com.miginfocom.ashape.layout
Interface AShapeLayout

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractAShapeLayout, CutEdgeAShapeLayout, DefaultAShapeLayout, HitShapeAShapeLayout, RowAShapeLayout

public interface AShapeLayout
extends java.io.Serializable

The interface that defines how a layout manager that works to layout AShapes within other AShapes. Note that for a shape to have to possibility to be used as a 'stamp' (I.e. renderer, like TableCellRenderer) the layout that that shape uses must be stateless (I.e. reevaluate the layout everytime and not save/cache any information between the layout sessions).


Method Summary
 java.lang.Integer getLayoutSize(AShape shape, int type, int dim, java.lang.Integer otherDimSizeHint)
          Return a type of size (i.e.
 void layoutShapes(AShape parent)
          Layout the first level sub shapes of the parent and call AShape.layout() on them
 

Method Detail

layoutShapes

void layoutShapes(AShape parent)
Layout the first level sub shapes of the parent and call AShape.layout() on them

Parameters:
parent - The parent which sub shapes should be laid out.

getLayoutSize

java.lang.Integer getLayoutSize(AShape shape,
                                int type,
                                int dim,
                                java.lang.Integer otherDimSizeHint)
Return a type of size (i.e. min/preferred/max) for a dimension, if there is one.

Parameters:
shape - The shape to return the size for.
type - The type of size to return. E.g. Distributor.MIN.
dim - The dimension for which to return the size. E.g SwingConstants.HORIZONTAL
otherDimSizeHint - On optional size in the not-asked-for dimension. Useful for text shapes that wraps for instance.
Returns:
The size or null there are no answer that makes sense or it isn't set.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.