public class EditToolbar
extends JPanel
Modifier and Type | Class and Description |
---|---|
static class |
EditToolbar.Command |
static class |
EditToolbar.Mode |
Modifier and Type | Field and Description |
---|---|
private JRadioButton |
actorTool |
private JRadioButton |
arrowTool |
private EnumMap<EditToolbar.Command,JCheckBoxMenuItem> |
commandMenuMap |
private JRadioButton |
conceptTool |
private JRadioButton |
corefTool |
private JRadioButton |
deleteTool |
private JMenu |
drawingMenu |
private EditFrame |
ef |
private JRadioButton |
genSpecLinkTool |
private JSeparator |
jSeparator1 |
private JPopupMenu.Separator |
jSeparator2 |
private JButton |
makeContextButton |
private JButton |
makeCutButton |
private JCheckBoxMenuItem |
menuItemActor |
private JCheckBoxMenuItem |
menuItemArrow |
private JCheckBoxMenuItem |
menuItemConcept |
private JCheckBoxMenuItem |
menuItemCoref |
private JCheckBoxMenuItem |
menuItemDelete |
private JCheckBoxMenuItem |
menuItemGenSpecLink |
private JCheckBoxMenuItem |
menuItemMakeContext |
private JCheckBoxMenuItem |
menuItemMakeCut |
private JCheckBoxMenuItem |
menuItemNote |
private JCheckBoxMenuItem |
menuItemRelation |
private JCheckBoxMenuItem |
menuItemRelType |
private JCheckBoxMenuItem |
menuItemSelect |
private JCheckBoxMenuItem |
menuItemType |
private JCheckBoxMenuItem |
menuItemUnmakeContext |
protected EditToolbar.Mode |
mode |
private EnumMap<EditToolbar.Mode,JRadioButton> |
modeMap |
private EnumMap<EditToolbar.Mode,JCheckBoxMenuItem> |
modeMenuMap |
private JRadioButton |
noteTool |
private JRadioButton |
relationTool |
private JRadioButton |
relTypeTool |
private JRadioButton |
selectionTool |
private ButtonGroup |
toolButtonGroup |
private JRadioButton |
typeTool |
private JButton |
unMakeContextButton |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
EditToolbar(EditFrame ef)
Creates new form EditToolbar
|
Modifier and Type | Method and Description |
---|---|
private void |
actorToolItemStateChanged(ItemEvent evt) |
private void |
arrowToolItemStateChanged(ItemEvent evt) |
void |
clearMenuCheckboxes() |
private void |
conceptToolItemStateChanged(ItemEvent evt) |
private void |
corefToolItemStateChanged(ItemEvent evt) |
private void |
deleteToolItemStateChanged(ItemEvent evt) |
private void |
genSpecLinkToolItemStateChanged(ItemEvent evt) |
EditFrame |
getEditFrame()
Return the owner edit frame.
|
JMenu |
getMenu() |
EditToolbar.Mode |
getMode()
What is the current tool mode?
|
EditToolbar.Mode |
getMode(JCheckBoxMenuItem item)
Get the mode associated with this menu item.
|
EditToolbar.Mode |
getMode(JRadioButton button)
Get the mode associated with this button.
|
private void |
initComponents()
This method is called from within the constructor to initialize the form.
|
void |
initMenuMaps() |
void |
initModeMap() |
boolean |
isEdgeInsertMode()
Determine whether the current tool mode is one for inserting edges
|
boolean |
isNodeInsertMode()
Determine whether the tool mode is one for inserting nodes
|
private void |
makeContextButtonActionPerformed(ActionEvent evt) |
private void |
makeCutButtonActionPerformed(ActionEvent evt) |
private void |
menuItemActorActionPerformed(ActionEvent evt) |
private void |
menuItemArrowActionPerformed(ActionEvent evt) |
private void |
menuItemConceptActionPerformed(ActionEvent evt) |
private void |
menuItemCorefActionPerformed(ActionEvent evt) |
private void |
menuItemDeleteActionPerformed(ActionEvent evt) |
private void |
menuItemGenSpecLinkActionPerformed(ActionEvent evt) |
private void |
menuItemMakeContextActionPerformed(ActionEvent evt) |
private void |
menuItemNoteActionPerformed(ActionEvent evt) |
private void |
menuItemRelationActionPerformed(ActionEvent evt) |
private void |
menuItemRelTypeActionPerformed(ActionEvent evt) |
private void |
menuItemSelectActionPerformed(ActionEvent evt) |
void |
menuItemSelected(ActionEvent evt) |
private void |
menuItemTypeActionPerformed(ActionEvent evt) |
private void |
menuItemUnmakeContextActionPerformed(ActionEvent evt) |
private void |
noteToolItemStateChanged(ItemEvent evt) |
void |
performCommand(EditToolbar.Command command) |
private void |
relationToolItemStateChanged(ItemEvent evt) |
private void |
relTypeToolItemStateChanged(ItemEvent evt) |
private void |
selectionToolItemStateChanged(ItemEvent evt) |
void |
setAvailableCommands(boolean somethingIsSelected)
If something is selected, then enable the commands, otherwise disable
them.
|
void |
setMode(EditToolbar.Mode m)
Sets the current mode of the toolbar.
|
void |
shortcutKeys(int key)
Set the mode based on a KeyEvent value
|
void |
toolStateChanged(ItemEvent ie)
Handles the check box group for the various tool modes, as well as the command buttons.
|
private void |
typeToolItemStateChanged(ItemEvent evt) |
private void |
unMakeContextButtonActionPerformed(ActionEvent evt) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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, setVisible, unregisterKeyboardAction, update
add, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, 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, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, 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, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private EditFrame ef
protected EditToolbar.Mode mode
private EnumMap<EditToolbar.Mode,JRadioButton> modeMap
private EnumMap<EditToolbar.Mode,JCheckBoxMenuItem> modeMenuMap
private EnumMap<EditToolbar.Command,JCheckBoxMenuItem> commandMenuMap
private JRadioButton actorTool
private JRadioButton arrowTool
private JRadioButton conceptTool
private JRadioButton corefTool
private JRadioButton deleteTool
private JMenu drawingMenu
private JRadioButton genSpecLinkTool
private JSeparator jSeparator1
private JPopupMenu.Separator jSeparator2
private JButton makeContextButton
private JButton makeCutButton
private JCheckBoxMenuItem menuItemActor
private JCheckBoxMenuItem menuItemArrow
private JCheckBoxMenuItem menuItemConcept
private JCheckBoxMenuItem menuItemCoref
private JCheckBoxMenuItem menuItemDelete
private JCheckBoxMenuItem menuItemGenSpecLink
private JCheckBoxMenuItem menuItemMakeContext
private JCheckBoxMenuItem menuItemMakeCut
private JCheckBoxMenuItem menuItemNote
private JCheckBoxMenuItem menuItemRelType
private JCheckBoxMenuItem menuItemRelation
private JCheckBoxMenuItem menuItemSelect
private JCheckBoxMenuItem menuItemType
private JCheckBoxMenuItem menuItemUnmakeContext
private JRadioButton noteTool
private JRadioButton relTypeTool
private JRadioButton relationTool
private JRadioButton selectionTool
private ButtonGroup toolButtonGroup
private JRadioButton typeTool
private JButton unMakeContextButton
public EditToolbar(EditFrame ef)
public EditFrame getEditFrame()
public void toolStateChanged(ItemEvent ie)
ie
- the item event (containing the source button) that changedpublic void initModeMap()
public void initMenuMaps()
public EditToolbar.Mode getMode()
public void setMode(EditToolbar.Mode m)
public EditToolbar.Mode getMode(JRadioButton button)
button
- public EditToolbar.Mode getMode(JCheckBoxMenuItem item)
item
- the item being checked.public boolean isNodeInsertMode()
public boolean isEdgeInsertMode()
public void shortcutKeys(int key)
key
- the KeyEvent value returned by mousePressedKeyEvent
public JMenu getMenu()
public void clearMenuCheckboxes()
public void menuItemSelected(ActionEvent evt)
public void setAvailableCommands(boolean somethingIsSelected)
somethingIsSelected
- public void performCommand(EditToolbar.Command command)
private void initComponents()
private void selectionToolItemStateChanged(ItemEvent evt)
private void conceptToolItemStateChanged(ItemEvent evt)
private void relationToolItemStateChanged(ItemEvent evt)
private void actorToolItemStateChanged(ItemEvent evt)
private void arrowToolItemStateChanged(ItemEvent evt)
private void corefToolItemStateChanged(ItemEvent evt)
private void typeToolItemStateChanged(ItemEvent evt)
private void relTypeToolItemStateChanged(ItemEvent evt)
private void genSpecLinkToolItemStateChanged(ItemEvent evt)
private void noteToolItemStateChanged(ItemEvent evt)
private void deleteToolItemStateChanged(ItemEvent evt)
private void makeContextButtonActionPerformed(ActionEvent evt)
private void makeCutButtonActionPerformed(ActionEvent evt)
private void unMakeContextButtonActionPerformed(ActionEvent evt)
private void menuItemSelectActionPerformed(ActionEvent evt)
private void menuItemConceptActionPerformed(ActionEvent evt)
private void menuItemRelationActionPerformed(ActionEvent evt)
private void menuItemActorActionPerformed(ActionEvent evt)
private void menuItemArrowActionPerformed(ActionEvent evt)
private void menuItemCorefActionPerformed(ActionEvent evt)
private void menuItemTypeActionPerformed(ActionEvent evt)
private void menuItemRelTypeActionPerformed(ActionEvent evt)
private void menuItemGenSpecLinkActionPerformed(ActionEvent evt)
private void menuItemNoteActionPerformed(ActionEvent evt)
private void menuItemDeleteActionPerformed(ActionEvent evt)
private void menuItemMakeContextActionPerformed(ActionEvent evt)
private void menuItemUnmakeContextActionPerformed(ActionEvent evt)