Search in sources :

Example 1 with RenameInOverviewFromTreeAction

use of easik.ui.tree.popup.RenameInOverviewFromTreeAction in project fql by CategoricalData.

the class OverviewInfoTreeUI method buildPopupMenu.

/**
 * Creates the popup menu
 */
private void buildPopupMenu() {
    _popupMenu.add(_addSketchItem = new JMenuItem(new NewSketchAction(_newPosition, _theFrame.getOverview())));
    _popupMenu.add(_addViewItem = new JMenuItem(new NewViewFromTreeAction(_theFrame.getOverview())));
    _popupMenu.add(_renameSketchItem = new JMenuItem(new RenameInOverviewFromTreeAction(_theFrame, "Rename Sketch")));
    _popupMenu.add(_deleteSketchItem = new JMenuItem(new DeleteFromOverviewFromTreeAction(_theFrame, "Delete Sketch")));
    _popupMenu.add(_renameViewItem = new JMenuItem(new RenameInOverviewFromTreeAction(_theFrame, "Rename View")));
    _popupMenu.add(_deleteViewItem = new JMenuItem(new DeleteFromOverviewFromTreeAction(_theFrame, "Delete View")));
    _infoTree.addMouseListener(new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent evt) {
            if (evt.isPopupTrigger()) {
                _infoTree.setSelectionRow(_infoTree.getClosestRowForLocation(evt.getX(), evt.getY()));
                _newPosition.setLocation(_theFrame.getOverview().getNewSketchPosition(10));
                if (setPopMenuItems()) {
                    _popupMenu.show(evt.getComponent(), evt.getX(), evt.getY());
                }
            }
        }

        @Override
        public void mouseReleased(MouseEvent evt) {
            mousePressed(evt);
        }
    });
}
Also used : DeleteFromOverviewFromTreeAction(easik.ui.tree.popup.DeleteFromOverviewFromTreeAction) MouseEvent(java.awt.event.MouseEvent) MouseAdapter(java.awt.event.MouseAdapter) RenameInOverviewFromTreeAction(easik.ui.tree.popup.RenameInOverviewFromTreeAction) NewViewFromTreeAction(easik.ui.tree.popup.NewViewFromTreeAction) JMenuItem(javax.swing.JMenuItem) NewSketchAction(easik.ui.menu.popup.NewSketchAction)

Aggregations

NewSketchAction (easik.ui.menu.popup.NewSketchAction)1 DeleteFromOverviewFromTreeAction (easik.ui.tree.popup.DeleteFromOverviewFromTreeAction)1 NewViewFromTreeAction (easik.ui.tree.popup.NewViewFromTreeAction)1 RenameInOverviewFromTreeAction (easik.ui.tree.popup.RenameInOverviewFromTreeAction)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 JMenuItem (javax.swing.JMenuItem)1