Package org.eclipse.gef.layout
Class LayoutProperties
java.lang.Object
org.eclipse.gef.layout.LayoutProperties
LayoutProperties
contains all properties which can be accessed on
Graph
, Edge
, Node
, their default values, as well as
static accessor methods for those properties.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Stores the preferred aspect ratio (width / height) for this EntityLayout.static final String
Stores the bounds in which the graph elements can be placed.static final Double
Defines the default value for theASPECT_RATIO_PROPERTY
.static final Integer
Defines the default value for theDIRECTION_PROPERTY
.static final Boolean
Defines the default value for theMOVABLE_PROPERTY
.static final Boolean
Defines the default value for theRESIZABLE_PROPERTY
.static final Double
Defines the default value for theWEIGHT_PROPERTY
.static final int
Constant for bottom-up direction.static final int
Constant for direction from left to right.static final String
Stores the direction of this subgraph.static final int
Constant for direction from right to left.static final int
Constant for top-down direction (default).static final String
Stores the location of this EntityLayout.static final String
Stores the movable state of this EntityLayout.static final String
Stores the resizable state of this EntityLayout.static final String
Stores the size of this EntityLayout.static final String
Stores a weight for this connection. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Rectangle
getBounds
(org.eclipse.gef.graph.Graph graph) Returns the value of theBOUNDS_PROPERTY
of the givenLayoutContext
.static Point
getLocation
(org.eclipse.gef.graph.Node node) Returns the value of theLOCATION_PROPERTY
of the givenNode
.static Double
getPreferredAspectRatio
(org.eclipse.gef.graph.Node node) Returns the value of theASPECT_RATIO_PROPERTY
of the givenNode
.static Dimension
getSize
(org.eclipse.gef.graph.Node node) Returns the value of theSIZE_PROPERTY
of the givenNode
.static Double
getWeight
(org.eclipse.gef.graph.Edge edge) Returns the value of theWEIGHT_PROPERTY
of the givenEdge
.static Boolean
isMovable
(org.eclipse.gef.graph.Node node) Returns the value of theMOVABLE_PROPERTY
of the givenNode
.static Boolean
isResizable
(org.eclipse.gef.graph.Node node) Returns the value of theRESIZABLE_PROPERTY
of the givenNode
.static void
Sets the value of theBOUNDS_PROPERTY
of the givenLayoutContext
to the given value.static void
setLocation
(org.eclipse.gef.graph.Node node, Point location) Sets the value of theLOCATION_PROPERTY
of the givenNode
to the given value.static void
setResizable
(org.eclipse.gef.graph.Node node, boolean resizable) Sets the value of theRESIZABLE_PROPERTY
of the givenNode
to the given value.static void
Sets the value of theSIZE_PROPERTY
of the givenNode
to the given value.static void
setWeight
(org.eclipse.gef.graph.Edge edge, double weight) Sets the value of theWEIGHT_PROPERTY
of the givenEdge
to the given value.
-
Field Details
-
BOUNDS_PROPERTY
Stores the bounds in which the graph elements can be placed.- See Also:
-
LOCATION_PROPERTY
Stores the location of this EntityLayout.- See Also:
-
SIZE_PROPERTY
Stores the size of this EntityLayout.- See Also:
-
MOVABLE_PROPERTY
Stores the movable state of this EntityLayout.- See Also:
-
DEFAULT_MOVABLE
Defines the default value for theMOVABLE_PROPERTY
. -
RESIZABLE_PROPERTY
Stores the resizable state of this EntityLayout. A resizable EntityLayout may be resized by a layout algorithm.- See Also:
-
DEFAULT_RESIZABLE
Defines the default value for theRESIZABLE_PROPERTY
. -
ASPECT_RATIO_PROPERTY
Stores the preferred aspect ratio (width / height) for this EntityLayout.- See Also:
-
DEFAULT_ASPECT_RATIO
Defines the default value for theASPECT_RATIO_PROPERTY
. -
WEIGHT_PROPERTY
Stores a weight for this connection.- See Also:
-
DEFAULT_WEIGHT
Defines the default value for theWEIGHT_PROPERTY
. -
DIRECTION_TOP_DOWN
public static final int DIRECTION_TOP_DOWNConstant for top-down direction (default).- See Also:
-
DIRECTION_BOTTOM_UP
public static final int DIRECTION_BOTTOM_UPConstant for bottom-up direction.- See Also:
-
DIRECTION_LEFT_RIGHT
public static final int DIRECTION_LEFT_RIGHTConstant for direction from left to right.- See Also:
-
DIRECTION_RIGHT_LEFT
public static final int DIRECTION_RIGHT_LEFTConstant for direction from right to left.- See Also:
-
DIRECTION_PROPERTY
Stores the direction of this subgraph.- See Also:
-
DEFAULT_DIRECTION
Defines the default value for theDIRECTION_PROPERTY
.
-
-
Constructor Details
-
LayoutProperties
public LayoutProperties()
-
-
Method Details
-
getBounds
Returns the value of theBOUNDS_PROPERTY
of the givenLayoutContext
.- Parameters:
graph
- TheGraph
whoseBOUNDS_PROPERTY
is read.- Returns:
- The value of the
BOUNDS_PROPERTY
of the givenGraph
.
-
setBounds
Sets the value of theBOUNDS_PROPERTY
of the givenLayoutContext
to the given value.- Parameters:
graph
- TheGraph
whoseBOUNDS_PROPERTY
is changed.bounds
- The new value for theBOUNDS_PROPERTY
of the givenGraph
.
-
getLocation
Returns the value of theLOCATION_PROPERTY
of the givenNode
.- Parameters:
node
- TheNode
whoseLOCATION_PROPERTY
is read.- Returns:
- The value of the
LOCATION_PROPERTY
of the givenNode
.
-
getSize
Returns the value of theSIZE_PROPERTY
of the givenNode
.- Parameters:
node
- TheNode
whoseSIZE_PROPERTY
is read.- Returns:
- The value of the
SIZE_PROPERTY
of the givenNode
.
-
getPreferredAspectRatio
Returns the value of theASPECT_RATIO_PROPERTY
of the givenNode
.- Parameters:
node
- TheNode
whoseASPECT_RATIO_PROPERTY
is read.- Returns:
- The value of the
ASPECT_RATIO_PROPERTY
of the givenNode
.
-
isResizable
Returns the value of theRESIZABLE_PROPERTY
of the givenNode
.- Parameters:
node
- TheNode
whoseRESIZABLE_PROPERTY
is read.- Returns:
- The value of the
RESIZABLE_PROPERTY
of the givenNode
.
-
isMovable
Returns the value of theMOVABLE_PROPERTY
of the givenNode
.- Parameters:
node
- TheNode
whoseMOVABLE_PROPERTY
is read.- Returns:
- The value of the
MOVABLE_PROPERTY
of the givenNode
.
-
setLocation
Sets the value of theLOCATION_PROPERTY
of the givenNode
to the given value.- Parameters:
node
- TheNode
whoseLOCATION_PROPERTY
is changed.location
- The new location for theLOCATION_PROPERTY
of the givenNode
.
-
setSize
Sets the value of theSIZE_PROPERTY
of the givenNode
to the given value.- Parameters:
node
- TheNode
whoseSIZE_PROPERTY
is changed.size
- The new size for theSIZE_PROPERTY
of the givenNode
.
-
setResizable
public static void setResizable(org.eclipse.gef.graph.Node node, boolean resizable) Sets the value of theRESIZABLE_PROPERTY
of the givenNode
to the given value.- Parameters:
node
- TheNode
whoseRESIZABLE_PROPERTY
is changed.resizable
- The new value for theRESIZABLE_PROPERTY
of the givenNode
.
-
getWeight
Returns the value of theWEIGHT_PROPERTY
of the givenEdge
.- Parameters:
edge
- TheEdge
whoseWEIGHT_PROPERTY
is read.- Returns:
- The value of the
WEIGHT_PROPERTY
of the givenEdge
.
-
setWeight
public static void setWeight(org.eclipse.gef.graph.Edge edge, double weight) Sets the value of theWEIGHT_PROPERTY
of the givenEdge
to the given value.- Parameters:
edge
- TheEdge
whoseWEIGHT_PROPERTY
is changed.weight
- The new value for theWEIGHT_PROPERTY
of the givenEdge
.
-