Class ToolBarToggleButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class ToolBarToggleButton extends JToggleButton
See Also:
  • Field Details

    • preferredSize

      protected Dimension preferredSize
      preferred size. Default, for whatever reason, will be 24x24.
    • customCursor

      protected Cursor customCursor
      Custom cursor.
    • customCursorImageFile

      protected String customCursorImageFile
      Optional file with a custom cursor.
    • triedOnce

      protected boolean triedOnce
      Used in conjunction with custom cursor.
    • xhot

      protected int xhot
      The x coordinate of hot spot of a custom cursor, if there is one. A negative value means it will use the center of the cursor.
    • yhot

      protected int yhot
      The y coordinate of hot spot of a custom cursor, if there is one. A negative value means it will use the center of the cursor.
    • ICONSIZE

      protected static int ICONSIZE
  • Constructor Details

    • ToolBarToggleButton

      public ToolBarToggleButton(String imageFileName, String toolTip, String actionCommand)
      Create a toolbar toggle button
      Parameters:
      container - the owner container.
      imageFileName - the name if the file holding the icon
      toolTip - a string for a tool tip
      actionCommand - theaction command.
    • ToolBarToggleButton

      public ToolBarToggleButton(String imageFileName, String toolTip, String actionCommand, int xh, int yh, String cursorImageFile)
      Create a toolbar toggle button
      Parameters:
      container - the owner container.
      imageFileName - the name if the file holding the icon
      toolTip - a string for a tool tip
      actionCommand - theaction command.
    • ToolBarToggleButton

      public ToolBarToggleButton(String imageFileName, String toolTip, String actionCommand, int xh, int yh, String cursorImageFile, int iw, int ih)
      Create a toolbar toggle button
      Parameters:
      container - the owner container.
      imageFileName - the name if the file holding the icon
      toolTip - a string for a tool tip
      actionCommand - theaction command.
  • Method Details

    • getPreferredSize

      public Dimension getPreferredSize()
      Get the preferred size.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      the preferred size for layout.
    • canvasCursor

      public Cursor canvasCursor()
      Get the appropriate cursor for this tool.
      Returns:
      The cursor appropriate when the mouse is in the container. The default will be a cross hair.