public abstract class OutputRestriction extends Object
OutputRestriction
s restrict the output area and the shape of a layout in conjunction with organic layout
algorithms such as OrganicLayout
or InteractiveOrganicLayout
.
In consequence, all nodes need to be placed inside a specific restricted area.
Modifier and Type | Field and Description |
---|---|
static OutputRestriction |
NONE
This
OutputRestriction does not restrict the output by any means. |
Modifier and Type | Method and Description |
---|---|
static OutputRestriction |
createAspectRatioRestriction(double ratio)
Creates an
OutputRestriction that confines the layout result to a rectangular area which roughly complies with
the given aspect ratio. |
static OutputRestriction |
createCircularCageRestriction(double x,
double y,
double radius)
Creates an
OutputRestriction that confines the layout result to a circle. |
static OutputRestriction |
createEllipticalCageRestriction(double x,
double y,
double w,
double h)
Creates an
OutputRestriction that confines the layout result to an elliptical area. |
static OutputRestriction |
createRectangularCageRestriction(double x,
double y,
double w,
double h)
Creates an
OutputRestriction that confines the layout to a rectangular area. |
public static final OutputRestriction NONE
OutputRestriction
does not restrict the output by any means.
It is a no-op that can be used when the output area and shape of a layout should be unrestricted.
public static final OutputRestriction createAspectRatioRestriction(double ratio)
OutputRestriction
that confines the layout result to a rectangular area which roughly complies with
the given aspect ratio.
The aspect ratio is defined as the ratio between the width and the height of a layout.
The aspect ratio needs to be strictly positive.
IllegalArgumentException
- if the given aspect ratio is 0
or negativeratio
- the preferred aspect ratio of the outputOutputRestriction
imposing the given aspect ratio on the layoutOrganicLayout.setOutputRestriction(OutputRestriction)
,
InteractiveOrganicLayout.setOutputRestriction(OutputRestriction)
public static final OutputRestriction createCircularCageRestriction(double x, double y, double radius)
OutputRestriction
that confines the layout result to a circle.
The actual restriction circle is defined by the given coordinates and radius.
The radius of the restriction circle needs to be greater than zero.
IllegalArgumentException
- if the given radius is less than or equal to zerox
- the x-coordinate of the restriction circle's centery
- the y-coordinate of the restriction circle's centerradius
- the radius of the restriction circleOutputRestriction
confining the layout to a circular areaOrganicLayout.setOutputRestriction(OutputRestriction)
,
InteractiveOrganicLayout.setOutputRestriction(OutputRestriction)
public static final OutputRestriction createEllipticalCageRestriction(double x, double y, double w, double h)
OutputRestriction
that confines the layout result to an elliptical area.
The restriction ellipse is defined by its bounding box specified by the given coordinates and size values.
The main axes of the ellipse are parallel to the coordinate axes.
The values for height and width of the ellipse's bounding box need to be greater than zero.
IllegalArgumentException
- if the given width or height is 0
or negativex
- the x-coordinate of the bounding box's upper left cornery
- the y-coordinate of the bounding box's upper left cornerw
- the width of the bounding boxh
- the height of the bounding boxOutputRestriction
confining the layout to an elliptical areaOrganicLayout.setOutputRestriction(OutputRestriction)
,
InteractiveOrganicLayout.setOutputRestriction(OutputRestriction)
public static final OutputRestriction createRectangularCageRestriction(double x, double y, double w, double h)
OutputRestriction
that confines the layout to a rectangular area.
This restriction rectangle is defined by the given coordinates and size values.
The values for height and width of the rectangle need to be greater than zero.
IllegalArgumentException
- if the given width or height is less than or equal to zerox
- the x-coordinate of the restriction rectangle's upper-left cornery
- the y-coordinate of the restriction rectangle's upper-left cornerw
- width of the restriction rectangleh
- height of the restriction rectangleOutputRestriction
confining the layout to a rectangular areaOrganicLayout.setOutputRestriction(OutputRestriction)
,
InteractiveOrganicLayout.setOutputRestriction(OutputRestriction)