com.imagero.gui.flowin
Class ToolBarLayout

java.lang.Object
  extended bycom.imagero.gui.flowin.ToolBarLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2

public class ToolBarLayout
extends java.lang.Object
implements java.awt.LayoutManager2

ToolBarLayout.
LayoutManager which can lay out multiple tool bars in one Container.


Field Summary
static int FILL_ORDER_HORIZONTAL
           
static int FILL_ORDER_STDANDARD
           
static int X_AXIS
           
static int Y_AXIS
           
 
Constructor Summary
ToolBarLayout(java.awt.Container target)
          create new ToolBarLayout
ToolBarLayout(int axis, java.awt.Container target)
          create new ToolBarLayout
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
          Adds the specified component to the layout, using the specified constraint object.
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          not used
 void debug(java.lang.String s)
           
 void debugChildren()
          prints some infos about target's children.
 int getAxis()
           
 int getFillOrder()
           
 float getLayoutAlignmentX(java.awt.Container target)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY(java.awt.Container target)
          Returns the alignment along the y axis.
 java.lang.String getName()
           
 int getPreferredRowHeight()
          get preferred row height of this LayoutManager
protected  void insert(int row, com.imagero.gui.flowin.Entry newEntry)
          insert Component into row
 void invalidateLayout(java.awt.Container target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 boolean isAskParentForMaxWidth()
          if true then:
if target has horizontal orientation then preferred width of target is less or equal to width of target's parent
if target has vertical orientation then preferred height of target is less or equal to height of target's parent
 boolean isHorizontal()
          check if orientation is horizontal
 boolean isInsertBetweenRows()
          check if Component can be inserted between rows (e.g. in new row)
 boolean isKeepTogether()
          if true then Components placed without gap between them
 boolean isVertical()
          check if orientation is vertical
 boolean isWrap()
           
 void layoutContainer(java.awt.Container parent)
          Lays out the specified container.
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
          Calculates the maximum size dimensions for the specified container, given the components it contains.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Calculates the minimum size dimensions for the specified container, given the components it contains.
 int p2row(java.awt.Point pt)
          get row which contains given Point
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Calculates the preferred size dimensions for the specified container, given the components it contains.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component from the layout.
 void setAskParentForMaxWidth(boolean askParentForMaxWidth)
           
 void setAxis(int axis)
           
 void setFillOrder(int fillOrder)
           
 void setInsertBetweenRows(boolean insertBetweenRows)
           
 void setKeepTogether(boolean keepTogether)
           
 void setName(java.lang.String name)
           
 void setPreferredRowHeight(int preferredRowHeight)
          set preferred row height for this LayoutManager
 void setWrap(boolean wrap)
           
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILL_ORDER_HORIZONTAL

public static final int FILL_ORDER_HORIZONTAL
See Also:
Constant Field Values

FILL_ORDER_STDANDARD

public static final int FILL_ORDER_STDANDARD
See Also:
Constant Field Values

X_AXIS

public static final int X_AXIS
See Also:
Constant Field Values

Y_AXIS

public static final int Y_AXIS
See Also:
Constant Field Values
Constructor Detail

ToolBarLayout

public ToolBarLayout(java.awt.Container target)
create new ToolBarLayout

Parameters:
target - Container to lay out

ToolBarLayout

public ToolBarLayout(int axis,
                     java.awt.Container target)
create new ToolBarLayout

Parameters:
axis - orientation of target Container
target - Container to lay out
See Also:
Y_AXIS, X_AXIS
Method Detail

addLayoutComponent

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

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

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
not used

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

debug

public void debug(java.lang.String s)

debugChildren

public void debugChildren()
prints some infos about target's children.

See Also:
#isDebugComponent

getAxis

public int getAxis()

getFillOrder

public int getFillOrder()

getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container target)
Description copied from interface: java.awt.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 java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container target)
Description copied from interface: java.awt.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 java.awt.LayoutManager2

getName

public java.lang.String getName()

getPreferredRowHeight

public int getPreferredRowHeight()
get preferred row height of this LayoutManager

Returns:
preferred row height

insert

protected void insert(int row,
                      com.imagero.gui.flowin.Entry newEntry)
insert Component into row

Parameters:
row - row number
newEntry - Entry (contained Component)
See Also:
Entry

invalidateLayout

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

Specified by:
invalidateLayout in interface java.awt.LayoutManager2

isAskParentForMaxWidth

public boolean isAskParentForMaxWidth()
if true then:
if target has horizontal orientation then preferred width of target is less or equal to width of target's parent
if target has vertical orientation then preferred height of target is less or equal to height of target's parent

Returns:

isHorizontal

public boolean isHorizontal()
check if orientation is horizontal

Returns:
true if axis is set to Y_AXIS
See Also:
X_AXIS

isInsertBetweenRows

public boolean isInsertBetweenRows()
check if Component can be inserted between rows (e.g. in new row)

Returns:
true if Component can be inserted between rows

isKeepTogether

public boolean isKeepTogether()
if true then Components placed without gap between them

Returns:
true if Components should be keeped together

isVertical

public boolean isVertical()
check if orientation is vertical

Returns:
true if axis is set to Y_AXIS
See Also:
Y_AXIS

isWrap

public boolean isWrap()

layoutContainer

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

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - the container to be laid out

maximumLayoutSize

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

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

minimumLayoutSize

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

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

p2row

public int p2row(java.awt.Point pt)
get row which contains given Point

Parameters:
pt - Point
Returns:
row number

preferredLayoutSize

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

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

removeLayoutComponent

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

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

setAskParentForMaxWidth

public void setAskParentForMaxWidth(boolean askParentForMaxWidth)
Parameters:
askParentForMaxWidth - - if true then parent of target asked for width/height
See Also:
isAskParentForMaxWidth()

setAxis

public void setAxis(int axis)

setFillOrder

public void setFillOrder(int fillOrder)

setInsertBetweenRows

public void setInsertBetweenRows(boolean insertBetweenRows)
Parameters:
insertBetweenRows - if true then Component can be inserted between rows

setKeepTogether

public void setKeepTogether(boolean keepTogether)
Parameters:
keepTogether - if true then Components are keeped together

setName

public void setName(java.lang.String name)

setPreferredRowHeight

public void setPreferredRowHeight(int preferredRowHeight)
set preferred row height for this LayoutManager

Parameters:
preferredRowHeight - new preferred row height

setWrap

public void setWrap(boolean wrap)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns:
a string representation of the object.