public class ToolBar extends KContainer implements java.awt.event.ActionListener
ToolBar object provides a component which is useful for
displaying commonly used Actions or controls. It can be showed or hidden
by the user.| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected static int |
BAR_SEPARATOR_SIZE |
protected java.awt.Component[][][] |
toolBarComponents |
protected Button[] |
toolBarHideButtons |
protected Button[] |
toolBarShowButtons |
protected boolean[] |
toolBarStates |
focusTraversable| コンストラクタと説明 |
|---|
ToolBar(java.awt.Component[][][] toolBarComponents)
Constructs a new tool bar with the specified components.
|
ToolBar(java.awt.Component[][][] toolBarComponents,
boolean showToolBar)
Constructs a new tool bar with the specified components and flag
that determins to be showd or hidden initially.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
|
protected java.awt.Component |
createBarPanel(java.awt.Component[] comps,
java.awt.Insets insets) |
protected java.awt.Component |
createPlainPanel(java.awt.Component[] comps) |
protected java.awt.Component |
createRightBarPanel(java.awt.Component[] comps) |
protected Button[] |
createToolBarButtons(int length,
int dir,
int align) |
protected Button[] |
createToolBarHideButtons(int length) |
protected java.awt.Component |
createToolBarPanel(Button b,
java.awt.Component[][] comps,
boolean top,
boolean bottom) |
protected Button[] |
createToolBarShowButtons(int length) |
protected int |
getPreferredWidth(java.awt.Component[][] comps) |
int |
getToolBarCount()
Returns the number of horizontal bars.
|
boolean |
getToolBarState(int index)
Returns the horizontal bar at the specified index is showed or hidden.
|
protected int |
indexOfButton(Button[] buttons,
Button b) |
protected void |
initToolBar()
Initializes the tool bar.
|
static void |
main(java.lang.String[] args)
Executes the examples.
|
void |
paint(java.awt.Graphics g)
Paints this component.
|
void |
setToolBarState(int index,
boolean state)
Sets the horizontal bar at the specified index to be showed or hidden.
|
addNotify, bounds, disable, doLayout, enable, enable, getBounds, getFrame, getInsets, getLocation, getMinimumSize, getPreferredSize, getSize, hide, insets, isDirectNotification, isFocusTraversable, layout, location, minimumSize, postOldEvent, preferredSize, repaintNow, requestFocus, reshape, setBounds, setEnabled, setFocusTraversable, setVisible, show, show, size, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMousePosition, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, list, list, locate, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected java.awt.Component[][][] toolBarComponents
protected boolean[] toolBarStates
protected Button[] toolBarShowButtons
protected Button[] toolBarHideButtons
protected static final int BAR_SEPARATOR_SIZE
public ToolBar(java.awt.Component[][][] toolBarComponents)
toolBarComponents - the components of the tool bar. the first
dimension classifies the horizontal bar;
the second dimension classifies the actions
with the vertical separator; and the third
dimension shows the actions.public ToolBar(java.awt.Component[][][] toolBarComponents,
boolean showToolBar)
toolBarComponents - the components of the tool bar. the first
dimension classifies the horizontal bar;
the second dimension classifies the actions
with the vertical separator; and the third
dimension shows the actions.showToolBar - If true, shows the actions initially;
otherwise hides.public void paint(java.awt.Graphics g)
paint クラス内 java.awt.Containerpublic int getToolBarCount()
public boolean getToolBarState(int index)
public void setToolBarState(int index,
boolean state)
getToolBarState(int)public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed インタフェース内 java.awt.event.ActionListenerActionListenerprotected void initToolBar()
protected Button[] createToolBarShowButtons(int length)
protected Button[] createToolBarHideButtons(int length)
protected Button[] createToolBarButtons(int length, int dir, int align)
protected java.awt.Component createPlainPanel(java.awt.Component[] comps)
protected java.awt.Component createRightBarPanel(java.awt.Component[] comps)
protected java.awt.Component createBarPanel(java.awt.Component[] comps,
java.awt.Insets insets)
protected java.awt.Component createToolBarPanel(Button b, java.awt.Component[][] comps, boolean top, boolean bottom)
protected int getPreferredWidth(java.awt.Component[][] comps)
public static void main(java.lang.String[] args)