public class ContextPopupMenu extends JPopupMenu
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.SeparatorJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
private ActionListener |
actionListener
The action listener for the popup menu.
|
private JMenuItem |
menuItemDeleteAllROI
The menu item for deleting all ROIs on the currently selected layer.
|
private JMenuItem |
menuItemDeleteAllROIsAllLayers
The menu item for deleting all ROIs on any layer.
|
private JMenuItem |
menuItemDeleteCurrROI
The menu item for deleting the current ROI.
|
private JMenuItem |
menuItemImageHeader
The menu item for the image header.
|
private JMenuItem |
menuItemImageInfo
The menu item for the image information.
|
private static long |
serialVersionUID |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
ContextPopupMenu()
Default constructor.
|
ContextPopupMenu(ActionListener actionListener)
Custom constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createAndAssemble()
This method adds all menu items to the popup menu.
|
ActionListener |
getActionListener() |
JMenuItem |
getMenuItemDeleteAllROI()
This menu emits the default action command
deleteallrois, where the
ActionListener has to implement the corresponding action. |
JMenuItem |
getMenuItemDeleteCurrROI()
This menu emits the default action command
deletecurrroi, where the
ActionListener has to implement the corresponding action. |
JMenuItem |
getMenuItemDeleteROIAllLayers()
This menu emits the default action command
deleteallroisalllayers, where the
ActionListener has to implement the corresponding action. |
JMenuItem |
getMenuItemImageHeader()
This menu emits the default action command
imageheader, where the
ActionListener has to implement the corresponding action. |
JMenuItem |
getMenuItemImageInfo()
This menu emits the default action command
imageinfo, where the
ActionListener has to implement the corresponding action. |
void |
setActionListener(ActionListener actionListener) |
void |
setMenuItemDeleteAllROI(JMenuItem menuItemDeleteAllROI) |
void |
setMenuItemDeleteCurrROI(JMenuItem menuItemDeleteCurrROI) |
void |
setMenuItemDeleteROIAllLayers(JMenuItem menuItemDeleteAllROIsAllLayers) |
void |
setMenuItemImageHeader(JMenuItem menuItemImageHeader) |
void |
setMenuItemImageInfo(JMenuItem menuItemImageInfo) |
add, add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprivate static final long serialVersionUID
private ActionListener actionListener
private JMenuItem menuItemImageInfo
private JMenuItem menuItemImageHeader
private JMenuItem menuItemDeleteCurrROI
private JMenuItem menuItemDeleteAllROI
private JMenuItem menuItemDeleteAllROIsAllLayers
public ContextPopupMenu()
ActionListener has to be set
explicitly the corresponding commands for the ContextPopupMenu.
Also, the createAndAssemble() has to be called,
after all JMenuItems have been constructed.
For default behavior don't set custom JMenuItems to this instance.
public ContextPopupMenu(ActionListener actionListener)
ActionListener implements the
corresponding commands for the ContextPopupMenu.actionListener - public void createAndAssemble()
public ActionListener getActionListener()
public void setActionListener(ActionListener actionListener)
actionListener - the actionListener to setpublic JMenuItem getMenuItemImageInfo()
imageinfo, where the
ActionListener has to implement the corresponding action.public void setMenuItemImageInfo(JMenuItem menuItemImageInfo)
menuItemImageInfo - the menuItemImageInfo to setpublic JMenuItem getMenuItemImageHeader()
imageheader, where the
ActionListener has to implement the corresponding action.public void setMenuItemImageHeader(JMenuItem menuItemImageHeader)
menuItemImageHeader - the menuItemImageHeader to setpublic JMenuItem getMenuItemDeleteCurrROI()
deletecurrroi, where the
ActionListener has to implement the corresponding action.public void setMenuItemDeleteCurrROI(JMenuItem menuItemDeleteCurrROI)
menuItemDeleteCurrROI - the menuItemDeleteCurrROI to setpublic JMenuItem getMenuItemDeleteAllROI()
deleteallrois, where the
ActionListener has to implement the corresponding action.public void setMenuItemDeleteAllROI(JMenuItem menuItemDeleteAllROI)
menuItemDeleteAllROI - the menuItemDeleteAllROI to setpublic JMenuItem getMenuItemDeleteROIAllLayers()
deleteallroisalllayers, where the
ActionListener has to implement the corresponding action.public void setMenuItemDeleteROIAllLayers(JMenuItem menuItemDeleteAllROIsAllLayers)
menuItemDeleteAllROIsAllLayers - the menuItemDeleteAllROIsAllLayers to setCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.