use of edu.cmu.cs.hcii.cogtool.ui.ZoomableUI in project cogtool by cogtool.
the class ZoomableController method assignActions.
/**
* Registers the set of <code>IListenerAction</code> instances
* that implement the semantic actions that are possible.
* <p>
* For this class, this consists of the actions that all CogTool
* model editing windows support.
*
* @author mlh
*/
@Override
protected void assignActions() {
super.assignActions();
final ZoomableUI ui = getZoomableUI();
if (ui != null) {
ui.setAction(CogToolLID.SetZoom, new IListenerAction() {
public Class<?> getParameterClass() {
return Double.class;
}
public boolean performAction(Object prm) {
double zoom = ((Double) prm).doubleValue();
ui.setZoom(zoom);
return true;
}
});
ui.setAction(CogToolLID.ZoomToFit, new AListenerAction() {
public boolean performAction(Object prms) {
ui.zoomToFit();
return true;
}
});
ui.setAction(CogToolLID.ZoomNormal, new AListenerAction() {
public boolean performAction(Object prms) {
ui.zoomToActual();
return true;
}
});
ui.setAction(CogToolLID.ZoomIn, new AListenerAction() {
public boolean performAction(Object prms) {
ui.zoomIn();
return true;
}
});
ui.setAction(CogToolLID.ZoomOut, new AListenerAction() {
public boolean performAction(Object prms) {
ui.zoomOut();
return true;
}
});
}
}
Aggregations