javax.swing
Class JToolBar.DefaultToolBarLayout

java.lang.Object
  extended byjavax.swing.JToolBar.DefaultToolBarLayout
All Implemented Interfaces:
EventListener, LayoutManager, LayoutManager2, java.beans.PropertyChangeListener, Serializable, UIResource
Enclosing class:
JToolBar

private class JToolBar.DefaultToolBarLayout
extends Object
implements LayoutManager2, Serializable, java.beans.PropertyChangeListener, UIResource


Field Summary
(package private)  LayoutManager lm
           
 
Constructor Summary
(package private) JToolBar.DefaultToolBarLayout(int orientation)
           
 
Method Summary
 void addLayoutComponent(Component comp, Object constraints)
          Adds the specified component to the layout, using the specified constraint object.
 void addLayoutComponent(String name, Component comp)
          If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
 float getLayoutAlignmentX(Container target)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY(Container target)
          Returns the alignment along the y axis.
 void invalidateLayout(Container target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 void layoutContainer(Container target)
          Lays out the specified container.
 Dimension maximumLayoutSize(Container target)
          Calculates the maximum size dimensions for the specified container, given the components it contains.
 Dimension minimumLayoutSize(Container target)
          Calculates the minimum size dimensions for the specified container, given the components it contains.
 Dimension preferredLayoutSize(Container target)
          Calculates the preferred size dimensions for the specified container, given the components it contains.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void removeLayoutComponent(Component comp)
          Removes the specified component from the layout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lm

LayoutManager lm
Constructor Detail

JToolBar.DefaultToolBarLayout

JToolBar.DefaultToolBarLayout(int orientation)
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Description copied from interface: LayoutManager
If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name - the string to be associated with the component
comp - the component to be added

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
Description copied from interface: LayoutManager2
Adds the specified component to the layout, using the specified constraint object.

Specified by:
addLayoutComponent in interface LayoutManager2
Parameters:
comp - the component to be added
constraints - where/how the component is added to the layout.

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Description copied from interface: LayoutManager
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public Dimension preferredLayoutSize(Container target)
Description copied from interface: LayoutManager
Calculates the preferred size dimensions for the specified container, given the components it contains.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
target - the container to be laid out
See Also:
LayoutManager.minimumLayoutSize(java.awt.Container)

minimumLayoutSize

public Dimension minimumLayoutSize(Container target)
Description copied from interface: LayoutManager
Calculates the minimum size dimensions for the specified container, given the components it contains.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out
See Also:
LayoutManager.preferredLayoutSize(java.awt.Container)

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
Description copied from interface: LayoutManager2
Calculates the maximum size dimensions for the specified container, given the components it contains.

Specified by:
maximumLayoutSize in interface LayoutManager2
See Also:
Component.getMaximumSize(), LayoutManager

layoutContainer

public void layoutContainer(Container target)
Description copied from interface: LayoutManager
Lays out the specified container.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
target - the container to be laid out

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Description copied from interface: LayoutManager2
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Description copied from interface: LayoutManager2
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Specified by:
getLayoutAlignmentY in interface LayoutManager2

invalidateLayout

public void invalidateLayout(Container target)
Description copied from interface: LayoutManager2
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Specified by:
invalidateLayout in interface LayoutManager2

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener