Package hec.gfx2d

Class ViewportToolbar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ViewportToolbar extends JPanel
Toolbar containing buttons that select viewport mouse adapters.
See Also:
  • Constructor Details

    • ViewportToolbar

      public ViewportToolbar(G2dPanel p)
      Default Constructor to build a toolbar.
      Parameters:
      p - the reference to the parent panel that contains this toolbar
  • Method Details

    • configureToolbar

      public void configureToolbar(ViewportToolbarProp prop)
      Builds the toolbar based on the specified properties.
      Parameters:
      prop - the properties used to specify how to build the toolbar. If null the toolbar is cleared.
    • addViewport

      public void addViewport(Viewport view)
    • addToolButton

      public void addToolButton(JToggleButton button, ToolbarButtonProp bgstr)
      Adds a new toolbar button to the toolbar
      Parameters:
      button - the toogle button that is place in the toolbar
      bgstr - the properties used to configure the button such as image, listeners, etc.
    • addToolButton

      public void addToolButton(JToggleButton button, ToolbarButtonProp bgstr, GridBagConstraints gbc)
    • getSelectedButton

      public int getSelectedButton()
    • getButtonVector

      public Vector getButtonVector()
    • forceSelectButton

      public void forceSelectButton(int idx)
      Sets a toolbar button in the toolbar selected
      Parameters:
      idx - The index of the button to select
    • selectButton

      public void selectButton(int idx)
    • getProperties

      public ViewportToolbarProp getProperties()
    • addToolbarListener

      public void addToolbarListener(G2dToolbarListener l)
    • removeToolbarLisntener

      public void removeToolbarLisntener(G2dToolbarListener l)
    • notifyToolListeners

      protected void notifyToolListeners(String adpterClss)