com.sibvisions.rad.ui.swing.impl.container
Class SwingToolBar

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<C>
      extended by com.sibvisions.rad.ui.awt.impl.AwtComponent<C>
          extended by com.sibvisions.rad.ui.awt.impl.AwtContainer<C>
              extended by com.sibvisions.rad.ui.swing.impl.SwingComponent<JVxToolBar>
                  extended by com.sibvisions.rad.ui.swing.impl.container.SwingToolBar
All Implemented Interfaces:
ComponentListener, KeyListener, MouseListener, EventListener, IToolBar, IAlignmentConstants, IComponent, IContainer, IResource, INamedObject

public class SwingToolBar
extends SwingComponent<JVxToolBar>
implements IToolBar

The SwingToolBar is the IToolBar implementation for swing.

See Also:
JToolBar, IToolBar

Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
eventComponentMoved, eventComponentResized, eventSource, factory, parent
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
Fields inherited from interface javax.rad.ui.container.IToolBar
HORIZONTAL, VERTICAL
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
SwingToolBar()
          Creates a new instance of SwingToolBar.
 
Method Summary
protected  void addIntern(Component pComponent, Object pConstraints, int pIndex)
          Internal function, for adding physical component and supporting layers.
 IInsets getMargins()
          Returns the margin between the tool bar's border and its buttons.
 int getOrientation()
          Returns the current orientation of the tool bar.
 boolean isMovable()
          Returns whether the toolbar is movable.
protected  void removeIntern(Component pComponent)
          Internal function, for adding physical component and supporting layers.
 void setMargins(IInsets pMargins)
          Sets the margin between the tool bar's border and its buttons.
 void setMovable(boolean pMovable)
          Sets whether the toolbar is movable.
 void setOrientation(int pOrientation)
          Sets the orientation of the tool bar.
 void setParent(IContainer pParent)
          Sets the parent of this component.
 
Methods inherited from class com.sibvisions.rad.ui.swing.impl.SwingComponent
capture, getToolTipText, setBackground, setToolTipText
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtContainer
add, add, add, add, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout, setLayoutIntern
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
componentHidden, componentMoved, componentResized, componentShown, createImage, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getVerticalAlignment, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, requestFocus, setBounds, setCursor, setEnabled, setEventSource, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setVerticalAlignment, setVisible, validate
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
equals, getResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

SwingToolBar

public SwingToolBar()
Creates a new instance of SwingToolBar.

Method Detail

getOrientation

public int getOrientation()
Returns the current orientation of the tool bar. The value is either HORIZONTAL or VERTICAL.

Specified by:
getOrientation in interface IToolBar
Returns:
an integer representing the current orientation -- either HORIZONTAL or VERTICAL
See Also:
IToolBar.setOrientation(int)

setOrientation

public void setOrientation(int pOrientation)
Sets the orientation of the tool bar. The orientation must have either the value HORIZONTAL or VERTICAL. If orientation is an invalid value, an exception will be thrown.

Specified by:
setOrientation in interface IToolBar
Parameters:
pOrientation - the new orientation -- either HORIZONTAL or VERTICAL
See Also:
IToolBar.getOrientation()

getMargins

public IInsets getMargins()
Returns the margin between the tool bar's border and its buttons.

Specified by:
getMargins in interface IToolBar
Returns:
an Insets object containing the margin values

setMargins

public void setMargins(IInsets pMargins)
Sets the margin between the tool bar's border and its buttons. Setting to null causes the tool bar to use the default margins. The tool bar's default Border object uses this value to create the proper margin. However, if a non-default border is set on the tool bar, it is that Border object's responsibility to create the appropriate margin space (otherwise this property will effectively be ignored).

Specified by:
setMargins in interface IToolBar
Parameters:
pMargins - an Insets object that defines the space between the border and the buttons

setMovable

public void setMovable(boolean pMovable)
Sets whether the toolbar is movable. Typically, a movable tool bar can be dragged into a different position within the same container or out into its own window.

Specified by:
setMovable in interface IToolBar
Parameters:
pMovable - true if the toolbar is movable, false otherwise

isMovable

public boolean isMovable()
Returns whether the toolbar is movable.

Specified by:
isMovable in interface IToolBar
Returns:
true if the toolbar is movable

setParent

public void setParent(IContainer pParent)
Sets the parent of this component.

Specified by:
setParent in interface IComponent
Overrides:
setParent in class AwtComponent<JVxToolBar>
Parameters:
pParent - the parent container of this component

addIntern

protected void addIntern(Component pComponent,
                         Object pConstraints,
                         int pIndex)
Internal function, for adding physical component and supporting layers.

Overrides:
addIntern in class AwtContainer<JVxToolBar>
Parameters:
pComponent - the Component to be added
pConstraints - an object expressing layout contraints for this
pIndex - the position in the container's list at which to insert the Component; -1 means insert at the end component
See Also:
AwtContainer.add(IComponent, Object, int)

removeIntern

protected void removeIntern(Component pComponent)
Internal function, for adding physical component and supporting layers.

Overrides:
removeIntern in class AwtContainer<JVxToolBar>
Parameters:
pComponent - the Component to be removed
See Also:
AwtContainer.remove(int)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.