JMenuItem gui = new JMenuItem(i18n.get(OMDrawingTool.class,
"popupMenuChangeAppearance",
"Change Appearance"));
gui.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
EditableOMGraphic eomg = getCurrentEditable();
if (eomg != null) {
boolean previous = eomg.getShowGUI();
eomg.setShowGUI(true);
setVisible(true);
if (!getUseAsTool()) {
showInWindow();
}
eomg.setShowGUI(previous);
eomg.getStateMachine().setSelected();
}
}
});
if (isMask(SHOW_GUI_BEHAVIOR_MASK | GUI_VIA_POPUP_BEHAVIOR_MASK)
&& !getUseAsTool()) {
pum.add(gui);
} else {
Debug.output("Not adding Change Appearance to popup: guiViaPopup("
+ isMask(SHOW_GUI_BEHAVIOR_MASK)
+ ") isTool("
+ getUseAsTool() + ")");
}
}
if ((g.getAttribute(OMGraphicConstants.REMOVABLE)) == null
|| ((Boolean) g.getAttribute(OMGraphicConstants.REMOVABLE)).booleanValue()) {
JMenuItem delete = new JMenuItem(i18n.get(OMDrawingTool.class,
"popupMenuDelete",
"Delete"));
delete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
OMAction action = new OMAction();
action.setMask(OMGraphic.DELETE_GRAPHIC_MASK);
EditableOMGraphic eomg = getCurrentEditable();
if (eomg != null) {
OMGraphic g = eomg.getGraphic();
if (g != null) {
notifyListener(g, action);
}
}
setCurrentEditable(null);