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 class
class
protected class
protected class
class
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected Color
protected Color
protected MouseInputListener
protected Color
protected Color
protected PropertyChangeListener
protected ContainerListener
protected FocusListener
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMapTools
(MapToolSet set) void
addToolButton
(JToggleButton button, ButtonGifStrings bgstr) add the JToggleButton button with the adapter information specificed by bgstr as the next button in the MapToolPanelvoid
addToolButton
(JToggleButton button, ButtonGifStrings bgstr, GridBagConstraints gbc) boolean
protected MouseInputListener
protected MapToolPanel.DragWindow
protected MapToolPanel.DragWindow
createDragWindow
(MapToolPanel toolbar) protected RootPaneContainer
createFloatingWindow
(MapToolPanel toolbar) Creates a window which contains the toolbar after it has been dragged out from its containerprotected WindowListener
protected PropertyChangeListener
protected ContainerListener
protected FocusListener
protected void
findToolButtonFor
(String classname) find the button for with the MapMouseAdapter class name of classnameint
findToolButtonIndex
(String classname) find the index for the toolbutton with the MapMouseAdapter class name of classnameprotected void
void
forceSelectButton
(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.Handler
int
Returns the orientation of the toolbar window when the toolbar is floating.int
get the index of the current selected buttongetToolButton
(int idx) get the MapTool button at index idxint
get the number of Map Tool Buttonsboolean
protected void
miButton_Action
(ActionEvent event) Method Descriptionprotected void
Paints the contents of the window used for dragging.void
removeMapTools
(MapToolSet set) void
void
selectButton
(int idx) select the button at index idx.void
Sets the color displayed when over a docking areavoid
setEnabled
(boolean b) the the buttons on this MapToolPanel enabled or disabledprotected void
setFloating
(boolean b, Point p) void
setFloatingLocation
(int x, int y) void
setOrientation
(int orientation) void
setToolEnabled
(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, updateUI
Methods 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, update
Methods 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, validateTree
Methods 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:
setEnabled
in 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.HORIZONTAL
orJToolBar.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
RootPaneContainer
object, 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
- isg
is null- Since:
- 1.5
-
createFrameListener
-
floatAt
-
setFloatingLocation
public void setFloatingLocation(int x, int y) -
isFloating
public boolean isFloating() -
setFloating
-