Package edu.cnu.mdi.graphics.toolbar
Class ToolBits
java.lang.Object
edu.cnu.mdi.graphics.toolbar.ToolBits
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longA set of tools suitable for the drawing view.static final longstatic final longA set with all bits on, for use in testing.static final longstatic final longstatic final longstatic final longProjection-aware map pan; intentionally shares thePANicon.static final longstatic final longA set of tools suitable for navigation panels.static final longstatic final longA set of tools suitable for picture view panels.static final longA set of tools suitable for plot panels.static final longBit flags for each standard toolbar button.static final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longA set of tools suitable for zooming and panning. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetIconRelativePath(long buttonBit) Get the icon path relative to the MDI resource root for a predefined button.static StringgetId(long buttonBit) Return a stable string id for a predefined toolbar bit.static StringgetResourcePath(long buttonBit) Get the full resource path for the icon corresponding to the given button bit.static StringgetToolTip(long buttonBit) Get the tooltip string for a predefined button bit.protected static booleanuseBoxZoomButton(long toolbarBits) protected static booleanuseCameraButton(long toolbarBits) protected static booleanuseCenterButton(long toolbarBits) protected static booleanuseConnectorButton(long toolbarBits) protected static booleanuseDeleteButton(long toolbarBits) protected static booleanuseEllipseButton(long toolbarBits) protected static booleanuseInfoButton(long toolbarBits) protected static booleanuseLineButton(long toolbarBits) protected static booleanuseMagnifyButton(long toolbarBits) protected static booleanuseMapPanButton(long toolbarBits) protected static booleanusePanButton(long toolbarBits) protected static booleanusePointerButton(long toolbarBits) protected static booleanusePolygonButton(long toolbarBits) protected static booleanusePolylineButton(long toolbarBits) protected static booleanusePrinterButton(long toolbarBits) protected static booleanuseRadArcButton(long toolbarBits) protected static booleanuseRectangleButton(long toolbarBits) protected static booleanuseResetZoomButton(long toolbarBits) protected static booleanuseStatusField(long toolbarBits) protected static booleanuseStyleButton(long toolbarBits) protected static booleanuseTextButton(long toolbarBits) protected static booleanuseUndoZoomButton(long toolbarBits) protected static booleanuseZoomInButton(long toolbarBits) protected static booleanuseZoomOutButton(long toolbarBits)
-
Field Details
-
POINTER
public static final long POINTERBit flags for each standard toolbar button.The status field is not a button; it is a small mouse-over feedback area on the toolbar.
- See Also:
-
ELLIPSE
public static final long ELLIPSE- See Also:
-
TEXT
public static final long TEXT- See Also:
-
RECTANGLE
public static final long RECTANGLE- See Also:
-
POLYGON
public static final long POLYGON- See Also:
-
LINE
public static final long LINE- See Also:
-
STYLEB
public static final long STYLEB- See Also:
-
DELETE
public static final long DELETE- See Also:
-
CENTER
public static final long CENTER- See Also:
-
UNDOZOOM
public static final long UNDOZOOM- See Also:
-
RADARC
public static final long RADARC- See Also:
-
POLYLINE
public static final long POLYLINE- See Also:
-
MAGNIFY
public static final long MAGNIFY- See Also:
-
BOXZOOM
public static final long BOXZOOM- See Also:
-
PAN
public static final long PAN- See Also:
-
CONNECTOR
public static final long CONNECTOR- See Also:
-
ZOOMIN
public static final long ZOOMIN- See Also:
-
ZOOMOUT
public static final long ZOOMOUT- See Also:
-
RESETZOOM
public static final long RESETZOOM- See Also:
-
CAMERA
public static final long CAMERA- See Also:
-
PRINTER
public static final long PRINTER- See Also:
-
STATUS
public static final long STATUS- See Also:
-
INFO
public static final long INFO- See Also:
-
MAPPAN
public static final long MAPPANProjection-aware map pan; intentionally shares thePANicon.- See Also:
-
ANNOTATIONTOOLS
public static final long ANNOTATIONTOOLS- See Also:
-
DRAWINGTOOLS
public static final long DRAWINGTOOLSA set of tools suitable for the drawing view.- See Also:
-
MAPTOOLS
public static final long MAPTOOLS- See Also:
-
ZOOMTOOLS
public static final long ZOOMTOOLSA set of tools suitable for zooming and panning.- See Also:
-
PICVIEWSTOOLS
public static final long PICVIEWSTOOLSA set of tools suitable for picture view panels.- See Also:
-
NAVIGATIONTOOLS
public static final long NAVIGATIONTOOLSA set of tools suitable for navigation panels.- See Also:
-
PLOTTOOLS
public static final long PLOTTOOLSA set of tools suitable for plot panels.- See Also:
-
EVERYTHING
public static final long EVERYTHINGA set with all bits on, for use in testing.- See Also:
-
-
Method Details
-
getId
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 asPOINTER.- Returns:
- a stable id string (never null). Unknown bits map to
"bit_<value>".
-
getIconRelativePath
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
nullif no icon is defined for this bit.
-
getResourcePath
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 returnsnull.- Parameters:
buttonBit- the button bit flag.- Returns:
- full resource path, or
nullif no icon is defined.
-
getToolTip
Get the tooltip string for a predefined button bit.- Parameters:
buttonBit- the button bit flag.- Returns:
- tooltip string, or
nullif 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)
-