public class Box extends Container implements Connectible
Modifier and Type | Class and Description |
---|---|
static class |
Box.BoxSide
Stores the side of a box that a points lies on.
|
Modifier and Type | Method and Description |
---|---|
Line |
connectTo(Connectible element,
Line.LineType lineType,
double spacing)
Adds a line to this diagram.
|
Line |
connectTo(Connectible element,
Line.LineType lineType,
double spacing,
java.util.ArrayList<java.awt.geom.Point2D.Double> points)
Adds a line to this diagram going along the given points.
|
Line |
connectTo(Connectible element,
Line.LineType lineType,
double spacing,
java.util.ArrayList<java.awt.geom.Point2D.Double> points,
boolean cleanup)
Adds a line to this diagram going along the given points.
|
OutsideLabel.BoxOutsideLabel |
createOutsideLabel(double width,
double height,
Box.BoxSide side,
double position,
LayoutConstraints.ConstraintType constraintType,
double spacing)
Creates a new outside label for this box.
|
OutsideLabel.BoxOutsideLabel |
createOutsideLabel(double width,
double height,
java.awt.geom.Point2D.Double center,
LayoutConstraints.ConstraintType constraintType,
double spacing)
Creates a new outside label for this box.
|
java.util.ArrayList<Element> |
getChildren()
Returns the children of this element.
|
java.util.ArrayList<Line> |
getIncidentLines()
Returns a list of all lines incident to this element.
|
java.util.ArrayList<OutsideLabel.BoxOutsideLabel> |
getOutsideLabels()
Returns the outside labels that belong to this box.
|
java.awt.geom.Path2D.Double |
getShape()
Returns the bounding rectangle of the box.
|
void |
move(java.awt.geom.Point2D.Double moveVector,
Container newOwner)
Moves the box by the given vector, along with its children.
|
void |
move(java.awt.geom.Point2D.Double moveVector,
Container newOwner,
java.lang.Integer row,
java.lang.Integer column)
Moves the box by the given vector, along with its children.
|
void |
move(java.awt.geom.Point2D.Double newCenter,
Container newOwner,
java.awt.geom.Point2D.Double growPoint)
Moves the box, taking it from its current position and placing it at the given position,
along with its children.
|
void |
move(java.awt.geom.Point2D.Double newCenter,
Container newOwner,
java.awt.geom.Point2D.Double growPoint,
java.lang.Integer row,
java.lang.Integer column)
Moves the box, taking it from its current position and placing it at the given position,
along with its children.
|
void |
remove()
Removes the element and its descendant elements.
|
void |
resize(java.awt.geom.Rectangle2D.Double rectangle)
Resizes the box, moving it from its current position to the given rectangle, pushing aside
other elements as needed.
|
void |
setMinHeight(double minHeight)
Sets the minimum height.
|
void |
setMinSize(double width,
double height)
Sets the minimum size of the box.
|
void |
setMinWidth(double minWidth)
Sets the minimum width.
|
void |
setSpacing(double spacing)
Sets the spacing value of the box.
|
convertToBox, convertToBox, convertToContainer, convertToContainer, createBox, createBox, createBox, createContainer, createContainer, findChildContainerEnclosingRectangle, findDescendantEnclosingRectangle, getArrangeData, getArrangeStyle, getBoxes, getContainers, getDescendantBoxes, getDescendantBoxes, getDescendantBoxOutsideLabels, getDescendantContainers, getDescendantLines, getDescendantOutsideLabels, getLines, getOwner, getPureContainers, getUsedArrangeData, getUsedArrangeStyle, setArrangeStyle
contains, createInsideLabel, createInsideLabel, createInsideLabel, findNextRectangleEnclosingRectangle, getBottom, getBounds, getCenter, getCenterX, getCenterY, getHeight, getInsideLabels, getLayoutConstraints, getLeft, getMinHeight, getMinWidth, getRight, getTop, getWidth, setConstraintType
getDiagram, getSpacing, remove
public void setSpacing(double spacing)
setSpacing
in class Container
spacing
- the new spacing valuepublic void setMinHeight(double minHeight)
minHeight
- the new minimum heightpublic void setMinWidth(double minWidth)
minWidth
- the new minimum widthpublic void setMinSize(double width, double height)
width
- the new minimum widthheight
- the new minimum heightpublic java.util.ArrayList<Element> getChildren()
Element
getChildren
in class Container
public java.util.ArrayList<Line> getIncidentLines()
Connectible
getIncidentLines
in interface Connectible
public java.util.ArrayList<OutsideLabel.BoxOutsideLabel> getOutsideLabels()
public void resize(java.awt.geom.Rectangle2D.Double rectangle)
rectangle
- the new position of the box to resize it topublic void move(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 desired 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 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 void move(java.awt.geom.Point2D.Double newCenter, Container newOwner, java.awt.geom.Point2D.Double growPoint)
newCenter
- the new desired 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 resize(java.awt.geom.Rectangle2D.Double)
public void move(java.awt.geom.Point2D.Double moveVector, Container newOwner, java.lang.Integer row, java.lang.Integer column)
public void move(java.awt.geom.Point2D.Double moveVector, Container newOwner)
public java.awt.geom.Path2D.Double getShape()
public OutsideLabel.BoxOutsideLabel createOutsideLabel(double width, double height, java.awt.geom.Point2D.Double center, LayoutConstraints.ConstraintType constraintType, double spacing)
width
- the width for the new labelheight
- the height for the new labelcenter
- the point from which to determine the position of the label relative to some
box side; the center of the new label will try to be as close to this point as possibleconstraintType
- the type of the layout constraints for the new labelspacing
- the spacing value for the new labelpublic OutsideLabel.BoxOutsideLabel createOutsideLabel(double width, double height, Box.BoxSide side, double position, LayoutConstraints.ConstraintType constraintType, double spacing)
width
- the width for the new labelheight
- the height for the new labelside
- the box side for the new labelposition
- the relative position on the box side for the new labelconstraintType
- the type of the layout constraints for the new labelspacing
- the spacing value for the new labelpublic Line connectTo(Connectible element, Line.LineType lineType, double spacing)
Connectible
connectTo
in interface Connectible
element
- the element to connect to this ConnectiblelineType
- the type of the new linespacing
- the width of the empty buffer around the linepublic Line connectTo(Connectible element, Line.LineType lineType, double spacing, java.util.ArrayList<java.awt.geom.Point2D.Double> points)
Connectible
connectTo
in interface Connectible
element
- the element to connect to this ConnectiblelineType
- the type of the new linespacing
- the width of the empty buffer around the linepoints
- the desired vertices of the new linepublic Line connectTo(Connectible element, Line.LineType lineType, double spacing, java.util.ArrayList<java.awt.geom.Point2D.Double> points, boolean cleanup)
Connectible
connectTo
in interface Connectible
element
- the element to connect to this ConnectiblelineType
- the type of the new linespacing
- the width of the empty buffer around the linepoints
- the desired vertices of the new linecleanup
- whether to clean up the given line, removing unnecessary cornerspublic void remove()
Element
remove
in class AbstractContainer