Package hec.map
Class MapToolPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
hec.map.MapToolPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
Class that hold the MapToolButtons for the MapPanel
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classclassprotected classprotected classclassNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Colorprotected Colorprotected MouseInputListenerprotected Colorprotected Colorprotected PropertyChangeListenerprotected ContainerListenerprotected FocusListenerFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMapTools(MapToolSet set) voidaddToolButton(JToggleButton button, ButtonGifStrings bgstr) add the JToggleButton button with the adapter information specificed by bgstr as the next button in the MapToolPanelvoidaddToolButton(JToggleButton button, ButtonGifStrings bgstr, GridBagConstraints gbc) booleanprotected MouseInputListenerprotected MapToolPanel.DragWindowprotected MapToolPanel.DragWindowcreateDragWindow(MapToolPanel toolbar) protected RootPaneContainercreateFloatingWindow(MapToolPanel toolbar) Creates a window which contains the toolbar after it has been dragged out from its containerprotected WindowListenerprotected PropertyChangeListenerprotected ContainerListenerprotected FocusListenerprotected voidfindToolButtonFor(String classname) find the button for with the MapMouseAdapter class name of classnameintfindToolButtonIndex(String classname) find the index for the toolbutton with the MapMouseAdapter class name of classnameprotected voidvoidforceSelectButton(int idx) for the selection of the button at index idxgetButtonGifStrings(int idx) get the ButtonGifStrings at index idxGets the color displayed when over a docking areaprotected MapToolPanel.HandlerintReturns the orientation of the toolbar window when the toolbar is floating.intget the index of the current selected buttongetToolButton(int idx) get the MapTool button at index idxintget the number of Map Tool Buttonsbooleanprotected voidmiButton_Action(ActionEvent event) Method Descriptionprotected voidPaints the contents of the window used for dragging.voidremoveMapTools(MapToolSet set) voidvoidselectButton(int idx) select the button at index idx.voidSets the color displayed when over a docking areavoidsetEnabled(boolean b) the the buttons on this MapToolPanel enabled or disabledprotected voidsetFloating(boolean b, Point p) voidsetFloatingLocation(int x, int y) voidsetOrientation(int orientation) voidsetToolEnabled(Class buttonGifStringClass, boolean enabled) set the MapTool that is an instance of the buttonGifStringClass enabled state to enabledMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
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, validateTreeMethods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
dockingColor
-
floatingColor
-
dockingBorderColor
-
floatingBorderColor
-
dockingListener
-
propertyListener
-
toolBarContListener
-
toolBarFocusListener
-
constraintBeforeFloating
-
-
Constructor Details
-
MapToolPanel
Create a new MapToolPanel object- Parameters:
panel- Description
-
-
Method Details
-
removeMapTools
-
addMapTools
-
addToolButton
add the JToggleButton button with the adapter information specificed by bgstr as the next button in the MapToolPanel- Parameters:
button- the JToggleButton to add to the MapToolPanelbgstr- the button and adapter information
-
addToolButton
-
getSelectedButton
public int getSelectedButton()get the index of the current selected button- Returns:
- the currently selected button index
-
forceSelectButton
public void forceSelectButton(int idx) for the selection of the button at index idx- Parameters:
idx- the button index
-
selectButton
public void selectButton(int idx) select the button at index idx. If the selected button index already is set to idx then do nothing- Parameters:
idx- the button index
-
miButton_Action
Method Description- Parameters:
event- Description
-
setToolEnabled
set the MapTool that is an instance of the buttonGifStringClass enabled state to enabled- Parameters:
buttonGifStringClass- - the class of the MapTool's ButtonGifStrings to set enabledenabled- the new enabled state
-
setEnabled
public void setEnabled(boolean b) the the buttons on this MapToolPanel enabled or disabled- Overrides:
setEnabledin classJComponent- Parameters:
b- the new enabled state
-
removeToolButton
- Parameters:
tool-
-
findToolButtonFor
find the button for with the MapMouseAdapter class name of classname- Parameters:
classname- the classname of the MapMouseAdapter- Returns:
- the button or null
-
findToolButtonIndex
find the index for the toolbutton with the MapMouseAdapter class name of classname- Parameters:
classname- the name of the MapMouseAdapter- Returns:
- the index or -1 if the MapMouseAdapter wasn't found
-
getToolButtonCount
public int getToolButtonCount()get the number of Map Tool Buttons- Returns:
- the count of MapTool Buttons
-
getToolButton
get the MapTool button at index idx- Parameters:
idx- the index of the MapTool Button- Returns:
- the button or null if the idx is invalid
-
getButtonGifStrings
get the ButtonGifStrings at index idx- Parameters:
idx- the index of the MapTool Button- Returns:
- the ButtonGifStrings or null if the idx is invalid
-
getHandler
-
createToolBarContListener
-
createToolBarFocusListener
-
createDockingListener
-
createPropertyListener
-
getOrientation
public int getOrientation()Returns the orientation of the toolbar window when the toolbar is floating. The orientation is either one ofJToolBar.HORIZONTALorJToolBar.VERTICAL.- Returns:
- the orientation of the toolbar window
- Since:
- 1.6
-
setOrientation
public void setOrientation(int orientation) -
getDockingColor
Gets the color displayed when over a docking area -
setDockingColor
Sets the color displayed when over a docking area -
getFloatingColor
-
canDock
-
dragTo
-
createDragWindow
-
createFloatingWindow
Creates a window which contains the toolbar after it has been dragged out from its container- Returns:
- a
RootPaneContainerobject, containing the toolbar. - Since:
- 1.4
-
createDragWindow
-
paintDragWindow
Paints the contents of the window used for dragging.- Parameters:
g- Graphics to paint to.- Throws:
NullPointerException- isgis null- Since:
- 1.5
-
createFrameListener
-
floatAt
-
setFloatingLocation
public void setFloatingLocation(int x, int y) -
isFloating
public boolean isFloating() -
setFloating
-