public class Container extends AbstractContainer
Container
class specifies a group of diagram elements. The geometrical layout of the
elements is specified by its AbstractContainer.layoutConstraints
.Modifier and Type | Method and Description |
---|---|
Box |
convertToBox(java.awt.geom.Point2D.Double newCenter,
Container newOwner,
java.awt.geom.Point2D.Double growPoint)
Converts this container to a box, keeping all the common properties intact.
|
Box |
convertToBox(java.awt.geom.Point2D.Double newCenter,
Container newOwner,
java.awt.geom.Point2D.Double growPoint,
java.lang.Integer row,
java.lang.Integer column)
Converts this container to a box, keeping all the common properties intact.
|
Container |
convertToContainer(java.awt.geom.Point2D.Double moveVector,
Container newOwner)
Converts this box to a container, keeping all the common properties intact.
|
Container |
convertToContainer(java.awt.geom.Point2D.Double moveVector,
Container newOwner,
java.lang.Integer row,
java.lang.Integer column)
Converts this box to a container, keeping all the common properties intact.
|
Box |
createBox(java.awt.geom.Rectangle2D.Double rectangle,
ArrangeData.ArrangeStyle arrangeStyle,
LayoutConstraints.ConstraintType constraintType,
double spacing)
Creates a new box as a child of this container.
|
Box |
createBox(java.awt.geom.Rectangle2D.Double rectangle,
ArrangeData.ArrangeStyle arrangeStyle,
LayoutConstraints.ConstraintType constraintType,
double spacing,
java.lang.Integer row,
java.lang.Integer column)
Creates a new box as a child of this container.
|
Box |
createBox(java.awt.geom.Rectangle2D.Double rectangle,
double spacing)
Creates a new box as a child of this container.
|
Container |
createContainer()
Creates a new container as a child of this container.
|
Container |
createContainer(ArrangeData.ArrangeStyle arrangeStyle,
LayoutConstraints.ConstraintType constraintType)
Creates a new container as a child of this container.
|
java.awt.geom.Rectangle2D.Double |
findChildContainerEnclosingRectangle()
Finds the smallest rectangle containing all of the container's direct descendant child
containers, including the spacing of the container bounds.
|
java.awt.geom.Rectangle2D.Double |
findDescendantEnclosingRectangle()
Finds the smallest rectangle containing all of the container's children, including the
spacing of the children.
|
ArrangeData |
getArrangeData()
Returns the currently set arrange data for this container.
|
ArrangeData.ArrangeStyle |
getArrangeStyle()
Gets the style set for this container, including possibly
ArrangeData.ArrangeStyle.INHERITED . |
java.util.ArrayList<Box> |
getBoxes()
Returns all child boxes of this container.
|
java.util.ArrayList<Element> |
getChildren()
Returns the children of this element.
|
java.util.ArrayList<Container> |
getContainers()
Returns all containers that are children of this container.
|
java.util.ArrayList<Box> |
getDescendantBoxes()
Returns the set containing all descendant boxes of the container.
|
java.util.ArrayList<Box> |
getDescendantBoxes(boolean inclusive)
Returns the set containing all descendant boxes of the container.
|
java.util.ArrayList<OutsideLabel.BoxOutsideLabel> |
getDescendantBoxOutsideLabels()
Returns the set containing all descendant labels of the container.
|
java.util.ArrayList<Container> |
getDescendantContainers()
Returns the set containing all descendant containers of the container.
|
java.util.ArrayList<Line> |
getDescendantLines()
Returns the set containing all descendant lines of the container.
|
java.util.ArrayList<OutsideLabel> |
getDescendantOutsideLabels()
Returns the set containing all descendant labels of the container.
|
java.util.ArrayList<Line> |
getLines()
Returns all child lines of this container.
|
Container |
getOwner()
Each element can be owned by some other element.
|
java.util.ArrayList<Container> |
getPureContainers()
Returns all containers that are owned by this container.
|
java.awt.geom.Path2D.Double |
getShape()
Returns the approximate geometric shape of this container.
|
ArrangeData |
getUsedArrangeData()
Returns the currently used arrange data for this container.
|
ArrangeData.ArrangeStyle |
getUsedArrangeStyle()
Gets the style of the container according to which its elements will be arranged.
|
void |
move(java.awt.geom.Point2D.Double moveVector,
Container newOwner)
Moves the container (its grid and children) by the given vector.
|
void |
move(java.awt.geom.Point2D.Double moveVector,
Container newOwner,
java.lang.Integer row,
java.lang.Integer column)
Moves the container (its grid and children) by the given vector.
|
void |
setArrangeStyle(ArrangeData.ArrangeStyle arrangeStyle)
Sets the style for the container according to which to arrange its elements.
|
void |
setSpacing(double spacing)
Sets the spacing of the element.
|
contains, createInsideLabel, createInsideLabel, createInsideLabel, findNextRectangleEnclosingRectangle, getBottom, getBounds, getCenter, getCenterX, getCenterY, getHeight, getInsideLabels, getLayoutConstraints, getLeft, getMinHeight, getMinWidth, getRight, getTop, getWidth, remove, setConstraintType
getDiagram, getSpacing, remove
public void setSpacing(double spacing)
Element
setSpacing
in class Element
spacing
- the value to setpublic java.util.ArrayList<Element> getChildren()
Element
public java.util.ArrayList<Box> getBoxes()
public java.util.ArrayList<Box> getDescendantBoxes()
public java.util.ArrayList<Box> getDescendantBoxes(boolean inclusive)
inclusive
- whether to include this container in the result if it is a boxpublic java.util.ArrayList<Container> getDescendantContainers()
public java.util.ArrayList<OutsideLabel> getDescendantOutsideLabels()
public java.util.ArrayList<OutsideLabel.BoxOutsideLabel> getDescendantBoxOutsideLabels()
public java.util.ArrayList<Line> getDescendantLines()
public java.util.ArrayList<Container> getContainers()
Container
class. To get boxes and non-box containers separately, use the direct access
getBoxes()
and getPureContainers()
methods.public java.util.ArrayList<Container> getPureContainers()
Container
class (for that purpose use the getContainers()
method).public java.util.ArrayList<Line> getLines()
public Container getOwner()
Element
public ArrangeData getArrangeData()
INHERITED
,
use #getUsedArrangeData
to find the arrange data to be actually used.public ArrangeData getUsedArrangeData()
public final void setArrangeStyle(ArrangeData.ArrangeStyle arrangeStyle)
arrangeStyle
- the new arrange style for the containerpublic ArrangeData.ArrangeStyle getArrangeStyle()
ArrangeData.ArrangeStyle.INHERITED
. Use
getUsedArrangeStyle()
to get the style actually used.public ArrangeData.ArrangeStyle getUsedArrangeStyle()
getArrangeStyle()
unless that is ArrangeData.ArrangeStyle.INHERITED
, in which case goes
up the element hierarchy until the first element wit ha different style.public Box createBox(java.awt.geom.Rectangle2D.Double rectangle, double spacing)
rectangle
- the position of the new boxspacing
- the spacing value for the new boxpublic Box createBox(java.awt.geom.Rectangle2D.Double rectangle, ArrangeData.ArrangeStyle arrangeStyle, LayoutConstraints.ConstraintType constraintType, double spacing)
rectangle
- the position of the new boxarrangeStyle
- the style according to which to arrange the elements of the new boxconstraintType
- the type of the layout constraints for the new boxspacing
- the spacing value for the new boxpublic Box createBox(java.awt.geom.Rectangle2D.Double rectangle, ArrangeData.ArrangeStyle arrangeStyle, LayoutConstraints.ConstraintType constraintType, double spacing, java.lang.Integer row, java.lang.Integer column)
rectangle
- the position of the new boxarrangeStyle
- the style according to which to arrange the elements of the new boxconstraintType
- the type of the layout constraints for the new boxspacing
- the spacing value for the new boxrow
- the row of the new box in this container's gridcolumn
- the column of the new box in this container's gridpublic Container createContainer()
public Container createContainer(ArrangeData.ArrangeStyle arrangeStyle, LayoutConstraints.ConstraintType constraintType)
arrangeStyle
- the style according to which to arrange the elements of the new containerconstraintType
- the type of the layout constraints for the new containerpublic void move(java.awt.geom.Point2D.Double moveVector, Container newOwner, java.lang.Integer row, java.lang.Integer column)
moveVector
- the move vector for the container grid and childrennewOwner
- the new owner of the containerrow
- the row of the container in new owner's gridcolumn
- the column of the container in new owner's gridpublic void move(java.awt.geom.Point2D.Double moveVector, Container newOwner)
moveVector
- the move vector for the container grid and childrennewOwner
- the new owner of the containerpublic Box convertToBox(java.awt.geom.Point2D.Double newCenter, Container newOwner, java.awt.geom.Point2D.Double growPoint)
newCenter
- the new center of the boxnewOwner
- the new owner of the boxgrowPoint
- the exact point at which to insert the box, it will then be grow from that
point to its desired position as per Box.resize(java.awt.geom.Rectangle2D.Double)
public Box convertToBox(java.awt.geom.Point2D.Double newCenter, Container newOwner, java.awt.geom.Point2D.Double growPoint, java.lang.Integer row, java.lang.Integer column)
newCenter
- the new center of the boxnewOwner
- the new owner of the boxgrowPoint
- the exact point at which to insert the box, it will then be grow from that
point to its desired position as per Box.resize(java.awt.geom.Rectangle2D.Double)
row
- the row of the box in new owner's gridcolumn
- the column of the box in new owner's gridpublic Container convertToContainer(java.awt.geom.Point2D.Double moveVector, Container newOwner)
moveVector
- the move vector for the container grid and childrennewOwner
- the new owner of the containerpublic Container convertToContainer(java.awt.geom.Point2D.Double moveVector, Container newOwner, java.lang.Integer row, java.lang.Integer column)
moveVector
- the move vector for the container grid and childrennewOwner
- the new owner of the containerrow
- the row of the container in new owner's gridcolumn
- the column of the container in new owner's gridpublic java.awt.geom.Rectangle2D.Double findDescendantEnclosingRectangle()
findDescendantEnclosingRectangle
in class AbstractContainer
null
is the container has no
children with dimensionspublic java.awt.geom.Rectangle2D.Double findChildContainerEnclosingRectangle()
null
is the container
has no child containerspublic java.awt.geom.Path2D.Double getShape()
null
.