use of easik.ui.menu.popup.OpenSketchDataAction in project fql by CategoricalData.
the class ApplicationFrame method buildPopupMenu.
/**
* Creates the popup menu
*/
private void buildPopupMenu() {
_canvasPopupMenu.add(_AddSketchPopItem = new JMenuItem(new NewSketchAction(_popupPosition, _overview)));
_canvasPopupMenu.add(_ImportSketchPopItem = new JMenuItem(new ImportSketchAction(_popupPosition, _overview)));
_sketchPopupMenu.add(_OpenSketchPopDefItem = new JMenuItem(new OpenSketchAction(_overview, true)));
_sketchPopupMenu.add(_OpenSketchManipulatePopDefItem = new JMenuItem(new OpenSketchDataAction(_overview, true)));
_sketchPopupMenu.add(_OpenSketchPopItem = new JMenuItem(new OpenSketchAction(_overview)));
_sketchPopupMenu.add(_OpenSketchManipulatePopItem = new JMenuItem(new OpenSketchDataAction(_overview)));
_sketchPopupMenu.addSeparator();
_sketchPopupMenu.add(_NewViewPopItem = new JMenuItem(new NewViewAction(_overview)));
_sketchPopupMenu.addSeparator();
_sketchPopupMenu.add(_RenamePopItem = new JMenuItem(new RenameInOverviewAction(_overview)));
_sketchPopupMenu.add(_DeleteSketchPopItem = new JMenuItem(new DeleteFromOverviewAction(_overview)));
_sketchPopupMenu.addSeparator();
_sketchPopupMenu.add(_ExportSketchPopItem = new JMenuItem(new SketchExportAction(this)));
_sketchPopupMenu.add(_ExportSketchDatabasePopItem = new JMenuItem(new ExportDatabaseAction(this, null)));
// _sketchPopupMenu.add(_ExportSketchImage = new JMenuItem(new
// ExportImageAction<SketchFrame, SketchGraphModel, Sketch, EntityNode,
// SketchEdge>(null)));
_viewPopupMenu.add(_OpenViewPopItem = new JMenuItem(new OpenViewAction(_overview)));
_viewPopupMenu.add(_RenameViewPopItem = new JMenuItem(new RenameInOverviewAction(_overview)));
_viewPopupMenu.add(_DeleteViewPopItem = new JMenuItem(new DeleteFromOverviewAction(_overview)));
_viewPopupMenu.addSeparator();
// _viewPopupMenu.add(_ExportViewImage = new JMenuItem(new
// ExportImageAction<ViewFrame, ViewGraphModel, View, QueryNode,
// View_Edge>(null)));
_mixedPopupMenu.add(_DeleteMixedPopItem = new JMenuItem(new DeleteFromOverviewAction(_overview)));
_overview.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(final MouseEvent evt) {
mouseReleased(evt);
}
@Override
public void mouseReleased(final MouseEvent evt) {
if (evt.isPopupTrigger()) {
final Object rightClickedOn = _overview.getFirstCellForLocation(evt.getX(), evt.getY());
// the current selection
if (rightClickedOn != null) {
final Object[] selection = _overview.getSelectionCells();
if (!Arrays.asList(selection).contains(rightClickedOn)) {
_overview.setSelectionCell(_overview.getFirstCellForLocation(evt.getX(), evt.getY()));
}
} else {
_overview.setSelectionCells(new Object[0]);
}
_popupPosition.setLocation(evt.getX(), evt.getY());
final JPopupMenu menu = setPopMenu();
if (menu != null) {
menu.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
}
});
}
Aggregations