站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.0

Toolbar (NetBeans Loaders API) - NetBeans API Javadoc 5.5.0

org.openide.loaders 5.9.22

org.openide.awt
Class Toolbar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JToolBar
                  extended by org.openide.awt.Toolbar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public class Toolbar
extends JToolBar

Toolbar provides a component which is useful for displaying commonly used actions. It can be dragged inside its ToolbarPanel to customize its location.

See Also:
Serialized Form

Nested Class Summary
static class Toolbar.DnDEvent
          DnDEvent is Toolbar's drag and drop event.
static interface Toolbar.DnDListener
          DnDListener is Drag and Drop listener for Toolbar motion events.
 
Nested classes/interfaces inherited from class javax.swing.JToolBar
JToolBar.AccessibleJToolBar, JToolBar.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int BASIC_HEIGHT
          Deprecated. Use getBasicHeight instead.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
CENTER, EAST, HORIZONTAL, LEADING, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, SOUTH, SOUTH_EAST, SOUTH_WEST, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Toolbar()
          Create a new Toolbar with empty name.
Toolbar(String name)
          Create a new not floatable Toolbar with programmatic name.
Toolbar(String name, boolean f)
          Create a new Toolbar.
Toolbar(String name, String displayName)
          Create a new not floatable Toolbar with specified programmatic name and display name
Toolbar(String name, String displayName, boolean f)
          Create a new Toolbar.
 
Method Summary
protected  void addImpl(Component c, Object constraints, int idx)
          Overridden to set focusable to false for any AbstractButton subclasses which are added
 void addNotify()
           
protected  void fireDragToolbar(int dx, int dy, int type)
          Fire drag of Toolbar
protected  void fireDropToolbar(int dx, int dy, int type)
          Fire drop of Toolbar
static int getBasicHeight()
          Returns basic toolbar height according to preferred icons size.
 Component[] getComponents()
           
 String getDisplayName()
           
 Dimension getPreferredSize()
           
 String getUIClassID()
           
 void paint(Graphics g)
           
 void removeAll()
          Removes all ACTION components.
static int rowCount(int height)
          Compute with HEIGHT_TOLERANCE number of rows for specific toolbar height.
 void setDisplayName(String displayName)
          Sets new display name of this toolbar.
 void setDnDListener(Toolbar.DnDListener l)
          Set DnDListener to Toolbar.
 void setUI(ToolBarUI ui)
           
 void setVisible(boolean b)
           
 
Methods inherited from class javax.swing.JToolBar
add, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, 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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASIC_HEIGHT

public static final int BASIC_HEIGHT
Deprecated. Use getBasicHeight instead.
Basic toolbar height.

See Also:
Constant Field Values
Constructor Detail

Toolbar

public Toolbar()
Create a new Toolbar with empty name.


Toolbar

public Toolbar(String name)
Create a new not floatable Toolbar with programmatic name. Display name is set to be the same as name


Toolbar

public Toolbar(String name,
               String displayName)
Create a new not floatable Toolbar with specified programmatic name and display name


Toolbar

public Toolbar(String name,
               boolean f)
Create a new Toolbar.

Parameters:
name - a String containing the associated name
f - specified if Toolbar is floatable Display name of the toolbar is set equal to the name.

Toolbar

public Toolbar(String name,
               String displayName,
               boolean f)
Create a new Toolbar.

Parameters:
name - a String containing the associated name
f - specified if Toolbar is floatable
Method Detail

paint

public void paint(Graphics g)
Overrides:
paint in class JComponent

addNotify

public void addNotify()
Overrides:
addNotify in class JComponent

getComponents

public Component[] getComponents()
Overrides:
getComponents in class Container

setVisible

public void setVisible(boolean b)
Overrides:
setVisible in class JComponent

addImpl

protected void addImpl(Component c,
                       Object constraints,
                       int idx)
Overridden to set focusable to false for any AbstractButton subclasses which are added

Overrides:
addImpl in class JToolBar

getBasicHeight

public static int getBasicHeight()
Returns basic toolbar height according to preferred icons size. Used by toolbar layout manager.

Returns:
basic toolbar height
Since:
4.15

getUIClassID

public String getUIClassID()
Overrides:
getUIClassID in class JToolBar

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

removeAll

public void removeAll()
Removes all ACTION components.

Overrides:
removeAll in class Container

rowCount

public static int rowCount(int height)
Compute with HEIGHT_TOLERANCE number of rows for specific toolbar height.

Parameters:
height - of some toolbar
Returns:
number of rows

setDnDListener

public void setDnDListener(Toolbar.DnDListener l)
Set DnDListener to Toolbar.

Parameters:
l - DndListener for toolbar

getDisplayName

public String getDisplayName()
Returns:
Display name of this toolbar. Display name is localizable, on the contrary to the programmatic name

setDisplayName

public void setDisplayName(String displayName)
Sets new display name of this toolbar. Display name is localizable, on the contrary to the programmatic name


fireDragToolbar

protected void fireDragToolbar(int dx,
                               int dy,
                               int type)
Fire drag of Toolbar

Parameters:
dx - distance of horizontal dragging
dy - distance of vertical dragging
type - type of toolbar dragging

fireDropToolbar

protected void fireDropToolbar(int dx,
                               int dy,
                               int type)
Fire drop of Toolbar

Parameters:
dx - distance of horizontal dropping
dy - distance of vertical dropping
type - type of toolbar dropping

setUI

public void setUI(ToolBarUI ui)
Overrides:
setUI in class JToolBar

org.openide.loaders 5.9.22

Built on May 28 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.