Search this API

y.layout.organic
Class OutputRestriction

java.lang.Object
  extended by y.layout.organic.OutputRestriction

public abstract class OutputRestriction
extends Object

Implementations of this class can be set via a setOutputRestriction(OutputRestriction) method, e.g. SmartOrganicLayouter.setOutputRestriction(OutputRestriction) in SmartOrganicLayouter to restrict the output area and shape of the layout. Instances of this class can only be retrieved from the factory methods or from the static field.

See Also:
NONE, createAspectRatioRestriction(double), createCircularCageRestriction(double,double,double), createEllipticalCageRestriction(double,double,double,double), createRectangularCageRestriction(double,double,double,double)

Field Summary
static OutputRestriction NONE
          This restriction actually does not restrict the output.
 
Method Summary
static OutputRestriction createAspectRatioRestriction(double ratio)
          This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the bounding box roughly has the given aspect ratio.
static OutputRestriction createCircularCageRestriction(double x, double y, double radius)
          This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the nodes lie within a circle.
static OutputRestriction createEllipticalCageRestriction(double x, double y, double w, double h)
          This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the nodes lie within an ellipse whose main axes are parallel to the coordinate axes.
static OutputRestriction createRectangularCageRestriction(double x, double y, double w, double h)
          This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the nodes lie within the given rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final OutputRestriction NONE
This restriction actually does not restrict the output. It is a no-op. It can be used in for use in SmartOrganicLayouter.setOutputRestriction(OutputRestriction)

Method Detail

createRectangularCageRestriction

public static OutputRestriction createRectangularCageRestriction(double x,
                                                                 double y,
                                                                 double w,
                                                                 double h)
This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the nodes lie within the given rectangle.

Parameters:
x - x coordinate of the upper-left corner of the restriction rectangle
y - y coordinate of the upper-left corner of the restriction rectangle
w - width of the restriction rectangle
h - height of the restriction rectangle
Returns:
an instance for use in SmartOrganicLayouter.setOutputRestriction(OutputRestriction)

createCircularCageRestriction

public static OutputRestriction createCircularCageRestriction(double x,
                                                              double y,
                                                              double radius)
This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the nodes lie within a circle.

Parameters:
x - x coordinate of the center of the restriction circle
y - y coordinate of the center of the restriction circle
radius - the radius of the restriction circle
Returns:
an instance for use in SmartOrganicLayouter.setOutputRestriction(OutputRestriction)

createEllipticalCageRestriction

public static OutputRestriction createEllipticalCageRestriction(double x,
                                                                double y,
                                                                double w,
                                                                double h)
This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the nodes lie within an ellipse whose main axes are parallel to the coordinate axes.

Parameters:
x - x coordinate of the upper left corner
y - y coordinate of the upper left corner
w - width of the bounding box of the ellipse
h - the height of the bounding box of the ellipse
Returns:
an instance for use in SmartOrganicLayouter.setOutputRestriction(OutputRestriction)

createAspectRatioRestriction

public static OutputRestriction createAspectRatioRestriction(double ratio)
This factory method creates a restriction object that can be used to restrict the result of a layout run of SmartOrganicLayouter so that the bounding box roughly has the given aspect ratio.

Parameters:
ratio - the preferred aspect ratio (width/height) of the output
Returns:
an instance for use in SmartOrganicLayouter.setOutputRestriction(OutputRestriction)

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.