Class ModeToolbar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, GraffitiComponent, GraffitiContainer

public class ModeToolbar
extends GraffitiToolbar
This toolbar is designed to be used as a representation of ogr.graffiti.plugin.mode.Mode. It handles toolbuttons in a special way.
Version:
$Revision: 1.7 $
See Also:
Mode, Serialized Form
  • Constructor Details

    • ModeToolbar

      public ModeToolbar​(Mode m)
      Constructor that sets the id of this toolbar. The id is set to the name of the mode. Tools can be added to the mode represented by this toolbar by adding their ToolButtons to this toolbar. The orientation is set to vertical by default.
      Parameters:
      m - the mode this toolbar represents.
    • ModeToolbar

      public ModeToolbar​(Mode m, int orientation)
      Constructor that sets the id of this toolbar to the name of the given mode and the orientation to the given value.
      Parameters:
      m - the mode this toolbar represents.
      orientation - the orientation of this toolbar.
  • Method Details

    • getActiveTool

      public Tool getActiveTool()
      Returns the tool that is selected in this ModeToolbar's button group.
      Returns:
      the tool that is selected in this ModeToolbar's button group.
    • getTools

      public Tool[] getTools()
      Returns the tools that are represented by buttons in this toolbar.
      Returns:
      the tools that are represented by buttons in this toolbar.
    • add

      public Component add​(Component comp)
      This function add the specified component to this toolbar. Additionaly, if the component is of type ToolButton it is also added to the button group this toolbar contains. If the component is no ToolButton it is added to the end, else it is added at the end of the ToolButtons already added.
      Overrides:
      add in class Container
      Parameters:
      comp - the component to be added.
      Returns:
      the component comp.
      See Also:
      Container.add(Component)