}
}
}
protected void createActions() {
aCut = new AbstractAction(resources.getStringValue("cutAction"), resources.getIcon("cutImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.executeSelectionCut();
}
}
};
aCopy = new AbstractAction(resources.getStringValue("copyAction"), resources.getIcon("copyImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.executeSelectionCopy();
}
}
};
aPaste = new AbstractAction(resources.getStringValue("pasteAction"), resources.getIcon("pasteImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.executeClipboardPaste();
}
}
};
aGroup = new AbstractAction(resources.getStringValue("groupAction"), resources.getIcon("groupImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if ((d != null) && (d instanceof ShapesComponent)) {
((ShapesComponent) d).group();
}
}
};
aUngroup = new AbstractAction(resources.getStringValue("ungroupAction"), resources.getIcon("ungroupImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if ((d != null) && (d instanceof ShapesComponent)) {
((ShapesComponent) d).unGroup();
}
}
};
aRegroup = new AbstractAction(resources.getStringValue("regroupAction"), resources.getIcon("regroupImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if ((d != null) && (d instanceof ShapesComponent)) {
((ShapesComponent) d).reGroup();
}
}
};
aRemove = new AbstractAction(resources.getStringValue("removeAction")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.executeSelectionDelete();
}
}
};
aSelectAll = new AbstractAction(resources.getStringValue("selectAllAction"), null) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.executeSelectAll();
}
}
};
aSelectAll.setEnabled(isEditable);
aFullScreen = new AbstractAction(resources.getStringValue("fullScreen")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
// Toggle full screen on / off
if (d.isFullScreen()) {
d.setFullScreen(false);
} else {
d.setFullScreen(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
}
}
};
aFullScreen.putValue(Action.ACCELERATOR_KEY, resources.getKeyStroke("fullScreenShortcut"));
aFront = new AbstractAction(resources.getStringValue("frontAction"), resources.getIcon("frontImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().bringSelectionToFront();
}
}
};
aForward = new AbstractAction(resources.getStringValue("forwardAction"), resources.getIcon("forwardImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().bringSelectionForward();
}
}
};
aBackward = new AbstractAction(resources.getStringValue("backwardAction"), resources.getIcon("backwardImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().sendSelectionBackward();
}
}
};
aBack = new AbstractAction(resources.getStringValue("backAction"), resources.getIcon("backImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().sendSelectionToBack();
}
}
};
aLeft = new AbstractAction(resources.getStringValue("leftAction"), resources.getIcon("leftImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().alignSelectionToLeft();
}
}
};
aRight = new AbstractAction(resources.getStringValue("rightAction"), resources.getIcon("rightImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().alignSelectionToRight();
}
}
};
aTop = new AbstractAction(resources.getStringValue("topAction"), resources.getIcon("topImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().alignSelectionToTop();
}
}
};
aBottom = new AbstractAction(resources.getStringValue("bottomAction"), resources.getIcon("bottomImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().alignSelectionToBottom();
}
}
};
aVCenter = new AbstractAction(resources.getStringValue("vCenterAction"), resources.getIcon("vCenterImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().alignSelectionVCenter();
}
}
};
aHCenter = new AbstractAction(resources.getStringValue("hCenterAction"), resources.getIcon("hCenterImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().alignSelectionHCenter();
}
}
};
dHorizontally = new AbstractAction(resources.getStringValue("dHorizontallyAction"), resources
.getIcon("dHorizontallyImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().distributeSelectionHorizontally();
}
}
};
dVertically = new AbstractAction(resources.getStringValue("dVerticallyAction"), resources
.getIcon("dVerticallyImage")) {
public void actionPerformed(ActionEvent e) {
DiagramComponent d = getActiveDiagram();
if (d != null) {
d.getDiagramSelection().distributeSelectionVertically();
}
}
};
aZoomIn = new AbstractAction(resources.getStringValue("zoomInAction"),
resources.getIcon("zoomInImage")) {
public void actionPerformed(ActionEvent e) {
zoomDiagram(true);
}
};
aZoomOut = new AbstractAction(resources.getStringValue("zoomOutAction"),
resources.getIcon("zoomOutImage")) {
public void actionPerformed(ActionEvent e) {
zoomDiagram(false);
}
};