public class G9ToolBar extends JToolBar
Extends JToolBar with the capability of merging tool bars using the
mergeToolBars(G9DialogFrame). (The Java 5.0 swing framework does
not include support for multiple toolbars, as you find in e.g. MS Office. Due
to this fact, this implementations is not written to suppor multiple
toolbars.)
JToolBar.AccessibleJToolBar, JToolBar.SeparatorJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WESTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
G9ToolBar(G9DialogFrame parentFrame)
Default constructor.
|
G9ToolBar(G9DialogFrame parentFrame,
List<Component> myComponents)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Component |
add(Component c)
Adds the component argument to this tool bar.
|
Component[] |
getG9Components()
Returns an array containing all components added by using the
add(Component) method. |
boolean |
isModal()
Return
true if this menubar is modal otherwise
false. |
boolean |
isRemoveConsecutiveSeparators()
Return true if consecutive separators are to be reduced to one
|
static boolean |
isUseOldMerge() |
void |
mergeToolBars(G9DialogFrame activeDialog)
Merges the tool bar held by the argument dialog with the
applicaition tool bar.
|
void |
setEnabledWholeToolBar(boolean enable)
Enable or disable all toolbar items.
|
void |
setModal(boolean isModal)
Enable or disable the modal status of this tool bar.
|
void |
setRemoveConsecutiveSeparators(boolean removeConsecutiveSeparators)
If set to
true, consecutive separators are reduced to one |
static void |
setUseOldMerge(boolean useOldMerge) |
add, addImpl, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic G9ToolBar(G9DialogFrame parentFrame)
parentFrame - the owner of this tool bar.public G9ToolBar(G9DialogFrame parentFrame, List<Component> myComponents)
parentFrame - the owner of this tool barmyComponents - the components on this tool barpublic Component[] getG9Components()
add(Component) method.public void setRemoveConsecutiveSeparators(boolean removeConsecutiveSeparators)
true, consecutive separators are reduced to oneremoveConsecutiveSeparators - The flag to set.public boolean isRemoveConsecutiveSeparators()
public void setEnabledWholeToolBar(boolean enable)
enable - if true enable, else disable.public void setModal(boolean isModal)
isModal - Puts this menu bar into modal mode if true
otherwise the menu bar is put back to normal mode.public boolean isModal()
true if this menubar is modal otherwise
false.true if this menubar is modal otherwise
false.public void mergeToolBars(G9DialogFrame activeDialog)
Tool bars are merged using one of the following algoritms:
useOldMerge property is
false, the merge position is intially last in the
application tool bar. Then, the dialog's tool bar is scanned from
the beginnig. For each component the following algoritm is applied:
Eksample: The application tool bar has the following components
{A, B, C, D} and the dialog tool bar has
{X, A, Y, B, D , Z}, the result is:
{A, Y, B, C, D, Z, X}
useOldMerge property is true
the following algoritm is applied:
This algoritm will place un-merged application tool bar components first. Example:
Application tool bar: {A, B, C}
Dialog tool bar: {A, X, B, Y}
Merged tool bar: {C, A, X, B, Y}
activeDialog - the dialog that holds the tool bar to be merged.public Component add(Component c)
public static boolean isUseOldMerge()
mergeToolBars(G9DialogFrame)public static void setUseOldMerge(boolean useOldMerge)
useOldMerge - the useOldMerge to setmergeToolBars(G9DialogFrame)Copyright © 2006–2017 Esito AS. All rights reserved.