Package hec.map

Class MapToolPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MapToolPanel extends JPanel
Class that hold the MapToolButtons for the MapPanel
See Also:
  • Field Details

    • dockingColor

      protected Color dockingColor
    • floatingColor

      protected Color floatingColor
    • dockingBorderColor

      protected Color dockingBorderColor
    • floatingBorderColor

      protected Color floatingBorderColor
    • dockingListener

      protected MouseInputListener dockingListener
    • propertyListener

      protected PropertyChangeListener propertyListener
    • toolBarContListener

      protected ContainerListener toolBarContListener
    • toolBarFocusListener

      protected FocusListener toolBarFocusListener
    • constraintBeforeFloating

      protected String constraintBeforeFloating
  • Constructor Details

    • MapToolPanel

      public MapToolPanel(MapPanel panel)
      Create a new MapToolPanel object
      Parameters:
      panel - Description
  • Method Details

    • removeMapTools

      public void removeMapTools(MapToolSet set)
    • addMapTools

      public void addMapTools(MapToolSet set)
    • addToolButton

      public void addToolButton(JToggleButton button, ButtonGifStrings bgstr)
      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 MapToolPanel
      bgstr - the button and adapter information
    • addToolButton

      public void addToolButton(JToggleButton button, ButtonGifStrings bgstr, GridBagConstraints gbc)
    • 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

      protected void miButton_Action(ActionEvent event)
      Method Description
      Parameters:
      event - Description
    • setToolEnabled

      public void setToolEnabled(Class buttonGifStringClass, boolean enabled)
      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 enabled
      enabled - the new enabled state
    • setEnabled

      public void setEnabled(boolean b)
      the the buttons on this MapToolPanel enabled or disabled
      Overrides:
      setEnabled in class JComponent
      Parameters:
      b - the new enabled state
    • removeToolButton

      public void removeToolButton(ButtonGifStrings tool)
      Parameters:
      tool -
    • findToolButtonFor

      public JToggleButton findToolButtonFor(String classname)
      find the button for with the MapMouseAdapter class name of classname
      Parameters:
      classname - the classname of the MapMouseAdapter
      Returns:
      the button or null
    • findToolButtonIndex

      public int findToolButtonIndex(String classname)
      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

      public JToggleButton getToolButton(int idx)
      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

      public ButtonGifStrings getButtonGifStrings(int idx)
      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

      protected MapToolPanel.Handler getHandler()
    • createToolBarContListener

      protected ContainerListener createToolBarContListener()
    • createToolBarFocusListener

      protected FocusListener createToolBarFocusListener()
    • createDockingListener

      protected MouseInputListener createDockingListener()
    • createPropertyListener

      protected PropertyChangeListener createPropertyListener()
    • getOrientation

      public int getOrientation()
      Returns the orientation of the toolbar window when the toolbar is floating. The orientation is either one of JToolBar.HORIZONTAL or JToolBar.VERTICAL.
      Returns:
      the orientation of the toolbar window
      Since:
      1.6
    • setOrientation

      public void setOrientation(int orientation)
    • getDockingColor

      public Color getDockingColor()
      Gets the color displayed when over a docking area
    • setDockingColor

      public void setDockingColor(Color c)
      Sets the color displayed when over a docking area
    • getFloatingColor

      public Color getFloatingColor()
    • canDock

      public boolean canDock(Component c, Point p)
    • dragTo

      protected void dragTo(Point position, Point origin)
    • createDragWindow

      protected MapToolPanel.DragWindow createDragWindow(MapToolPanel toolbar)
    • createFloatingWindow

      protected RootPaneContainer createFloatingWindow(MapToolPanel toolbar)
      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

      protected MapToolPanel.DragWindow createDragWindow()
    • paintDragWindow

      protected void paintDragWindow(Graphics g)
      Paints the contents of the window used for dragging.
      Parameters:
      g - Graphics to paint to.
      Throws:
      NullPointerException - is g is null
      Since:
      1.5
    • createFrameListener

      protected WindowListener createFrameListener()
    • floatAt

      protected void floatAt(Point position, Point origin)
    • setFloatingLocation

      public void setFloatingLocation(int x, int y)
    • isFloating

      public boolean isFloating()
    • setFloating

      protected void setFloating(boolean b, Point p)