|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZGridLayoutManager
A simple grid layout. Lays out objects into equally sized cells. Allows for the specification of the number of rows or columns, the cell width and height, the vertical and horizontal spacing, and the upper left grid layout start point. This layout preserves object aspect ratios.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
ZNode
, ZLayout
Field Summary | |
static int |
COLUMN |
protected static double |
DEFAULT_CELL_HEIGHT |
protected static double |
DEFAULT_CELL_WIDTH |
protected static double |
DEFAULT_HORIZONTAL_SPACING |
protected static java.awt.geom.Point2D |
DEFAULT_START_POINT |
protected static double |
DEFAULT_VERTICAL_SPACING |
static int |
ROW |
Constructor Summary | |
ZGridLayoutManager() The default no arg constructor |
|
ZGridLayoutManager(int rowsOrColumns, int numCells) The default constructor |
|
ZGridLayoutManager(int rowsOrColumns, int numCells, double width, double height) Constructor that allows cell dimensions to be specified |
|
ZGridLayoutManager(int rowsOrColumns, int numCells, double width, double height, double horizontalSpacing, double verticalSpacing) Constructor that allows cell dimensions to be specified |
|
ZGridLayoutManager(int rowsOrColumns, int numCells, double width, double height, double horizontalSpacing, double verticalSpacing, double layoutStartX, double layoutStartY) Constructor that allows cell dimensions to be specified |
Method Summary | |
java.lang.Object |
clone() Layout manager objects must provide a public clone method |
void |
doLayout(ZGroup node) Apply this manager's layout algorithm to the specified node's children. |
void |
doLayout(ZGroup node, int millis) Apply this manager's layout algorithm to the specified node's children, and animate the changes over time. |
double |
getCellHeight() Gets the cell height |
double |
getCellWidth() Gets the cell width |
int |
getGridAxis() Gets whether this grid is specified by rows or columns Possible values are: 1 - COLUMN 2 - ROW |
double |
getHorizontalSpacing() Gets the current horizontal spacing |
boolean |
getInvertChildren() Gets whether this layout manager inverts its children before laying them out. |
java.awt.geom.Point2D |
getLayoutStartPoint() Gets the layout start point |
int |
getNumCells() Gets the number of cells on the grid axis |
double |
getVerticalSpacing() Gets the current vertical spacing |
void |
postLayout(ZGroup node) Notify the layout manager that the layout for this node has finished This is called after all children and the node itself are layed out. |
void |
preLayout(ZGroup node) Notify the layout manager that a potentially recursive layout is starting. |
void |
setCellHeight(double height) Sets the cell height |
void |
setCellWidth(double width) Sets the cell width |
void |
setGridAxis(int rowsOrColumns) Sets whether this grid is specified by rows or columns Possible values are: 1 - COLUMN 2 - ROW |
void |
setHorizontalSpacing(double horizontalSpacing) Sets the current horizontal spacing |
void |
setInvertChildren(boolean invertChildren) Sets whether this layout manager should invert its children before laying them out. |
void |
setLayoutStartPoint(double x, double y) Sets the layout start point |
void |
setLayoutStartPoint(java.awt.geom.Point2D startPoint) Sets the layout start point |
void |
setNumCells(int numCells) Sets the number of cells on the grid axis |
void |
setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue) Set some state of this object as it gets read back in. |
void |
setVerticalSpacing(double verticalSpacing) Sets the current vertical spacing |
void |
writeObject(ZObjectOutputStream out) Write out all of this object's state. |
void |
writeObjectRecurse(ZObjectOutputStream out) Specify which objects this object references in order to write out the scenegraph properly |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int COLUMN
public static final int ROW
protected static final java.awt.geom.Point2D DEFAULT_START_POINT
protected static final double DEFAULT_CELL_WIDTH
protected static final double DEFAULT_CELL_HEIGHT
protected static final double DEFAULT_HORIZONTAL_SPACING
protected static final double DEFAULT_VERTICAL_SPACING
Constructor Detail |
public ZGridLayoutManager()
public ZGridLayoutManager(int rowsOrColumns, int numCells)
rowsOrColumns
- Whether this manager should fix the number of rows or columnsnumCells
- The number of rows or columns to which this layout manager is fixedpublic ZGridLayoutManager(int rowsOrColumns, int numCells, double width, double height)
rowsOrColumns
- Whether this manager should fix the number of rows or columnsnumCells
- The number of rows or columns to which this layout manager is fixedwidth
- The row widthheight
- The row heightpublic ZGridLayoutManager(int rowsOrColumns, int numCells, double width, double height, double horizontalSpacing, double verticalSpacing)
rowsOrColumns
- Whether this manager should fix the number of rows or columnsnumCells
- The number of rows or columns to which this layout manager is fixedwidth
- The row widthheight
- The row heighthorizontalSpacing
- The horizontal spacing between columnsverticalSpacing
- The vertical spacing between rowspublic ZGridLayoutManager(int rowsOrColumns, int numCells, double width, double height, double horizontalSpacing, double verticalSpacing, double layoutStartX, double layoutStartY)
rowsOrColumns
- Whether this manager should fix the number of rows or columnsnumCells
- The number of rows or columns to which this layout manager is fixedwidth
- The row widthheight
- The row heighthorizontalSpacing
- The horizontal spacing between columnsverticalSpacing
- The vertical spacing between rowslayoutStartX
- The layout start x coordinate (in the coordinate system of the parent node being laid out)Method Detail |
public int getGridAxis()
public void setGridAxis(int rowsOrColumns)
rowsOrColumns
- Whether this rid is specified by rows or columnspublic void setInvertChildren(boolean invertChildren)
public boolean getInvertChildren()
public int getNumCells()
public void setNumCells(int numCells)
numCells
- The number of cells on the grid axispublic double getCellWidth()
public void setCellWidth(double width)
width
- The new cell widthpublic double getCellHeight()
public void setCellHeight(double height)
height
- The new cell heightpublic double getVerticalSpacing()
public void setVerticalSpacing(double verticalSpacing)
verticalSpacing
- The current vertical spacingpublic double getHorizontalSpacing()
public void setHorizontalSpacing(double horizontalSpacing)
horizontalSpacing
- The current horizontal spacingpublic java.awt.geom.Point2D getLayoutStartPoint()
public void setLayoutStartPoint(double x, double y)
public void setLayoutStartPoint(java.awt.geom.Point2D startPoint)
startPoint
- The new layout start pointpublic void doLayout(ZGroup node)
doLayout
in interface ZLayoutManager
node
- The node to apply this layout algorithm to.public void doLayout(ZGroup node, int millis)
doLayout
in interface ZLayoutManager
node
- The node to apply this layout algorithm to.millis
- The number of milliseconds over which to animate layout changes.public void preLayout(ZGroup node)
preLayout
in interface ZLayoutManager
node
- The node to apply this layout algorithm to.public void postLayout(ZGroup node)
postLayout
in interface ZLayoutManager
node
- The node to apply this layout algorithm to.public java.lang.Object clone()
clone
in interface ZLayoutManager
clone
in class java.lang.Object
public void writeObject(ZObjectOutputStream out) throws java.io.IOException
writeObject
in interface ZSerializable
out
- The stream that this object writes intojava.io.IOException
public void writeObjectRecurse(ZObjectOutputStream out) throws java.io.IOException
writeObjectRecurse
in interface ZSerializable
out
- The stream that this object writes intojava.io.IOException
public void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
setState
in interface ZSerializable
fieldType
- The fully qualified type of the fieldfieldName
- The name of the fieldfieldValue
- The value of the field
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |