Class ToolBits

java.lang.Object
edu.cnu.mdi.graphics.toolbar.ToolBits

public final class ToolBits extends Object
Bit flags controlling which pre-defined buttons appear on a BaseToolBar.

Values are written in octal.

Stable IDs

Each predefined bit maps to a stable string id via getId(long). These ids are intended for programmatic lookup through AToolBar.getButton(String) and related methods:


 toolbar.setButtonEnabled(ToolBits.getId(ToolBits.DELETEBUTTON), hasSelection);
 

Applications may add their own buttons with their own ids.

  • Field Details

  • Method Details

    • getId

      public static String getId(long buttonBit)
      Return a stable string id for a predefined toolbar bit.

      These ids are intended for programmatic lookup through AToolBar.getButton(String) and related methods.

      For application-defined buttons, choose your own ids (e.g., "myCustomTool").

      Parameters:
      buttonBit - a predefined bit constant such as POINTER.
      Returns:
      a stable id string (never null). Unknown bits map to "bit_<value>".
    • getIconRelativePath

      public static String getIconRelativePath(long buttonBit)
      Get the icon path relative to the MDI resource root for a predefined button.
      Parameters:
      buttonBit - the button bit flag.
      Returns:
      relative icon path, or null if no icon is defined for this bit.
    • getResourcePath

      public static String getResourcePath(long buttonBit)
      Get the full resource path for the icon corresponding to the given button bit.

      If the button has no icon (e.g. STATUS), this method returns null.

      Parameters:
      buttonBit - the button bit flag.
      Returns:
      full resource path, or null if no icon is defined.
    • getToolTip

      public static String getToolTip(long buttonBit)
      Get the tooltip string for a predefined button bit.
      Parameters:
      buttonBit - the button bit flag.
      Returns:
      tooltip string, or null if none is defined.
    • usePointerButton

      protected static boolean usePointerButton(long toolbarBits)
    • usePanButton

      protected static boolean usePanButton(long toolbarBits)
    • useMapPanButton

      protected static boolean useMapPanButton(long toolbarBits)
    • useResetZoomButton

      protected static boolean useResetZoomButton(long toolbarBits)
    • useUndoZoomButton

      protected static boolean useUndoZoomButton(long toolbarBits)
    • useCenterButton

      protected static boolean useCenterButton(long toolbarBits)
    • usePrinterButton

      protected static boolean usePrinterButton(long toolbarBits)
    • useCameraButton

      protected static boolean useCameraButton(long toolbarBits)
    • useDeleteButton

      protected static boolean useDeleteButton(long toolbarBits)
    • useStyleButton

      protected static boolean useStyleButton(long toolbarBits)
    • useEllipseButton

      protected static boolean useEllipseButton(long toolbarBits)
    • useTextButton

      protected static boolean useTextButton(long toolbarBits)
    • useRectangleButton

      protected static boolean useRectangleButton(long toolbarBits)
    • usePolygonButton

      protected static boolean usePolygonButton(long toolbarBits)
    • useLineButton

      protected static boolean useLineButton(long toolbarBits)
    • usePolylineButton

      protected static boolean usePolylineButton(long toolbarBits)
    • useRadArcButton

      protected static boolean useRadArcButton(long toolbarBits)
    • useMagnifyButton

      protected static boolean useMagnifyButton(long toolbarBits)
    • useConnectorButton

      protected static boolean useConnectorButton(long toolbarBits)
    • useStatusField

      protected static boolean useStatusField(long toolbarBits)
    • useZoomInButton

      protected static boolean useZoomInButton(long toolbarBits)
    • useZoomOutButton

      protected static boolean useZoomOutButton(long toolbarBits)
    • useInfoButton

      protected static boolean useInfoButton(long toolbarBits)
    • useBoxZoomButton

      protected static boolean useBoxZoomButton(long toolbarBits)