public class LayoutProperties
extends java.lang.Object
LayoutProperties
contains all properties which can be accessed on
Graph
, Edge
, Node
, their default values, as well as
static accessor methods for those properties.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASPECT_RATIO_PROPERTY
Stores the preferred aspect ratio (width / height) for this EntityLayout.
|
static java.lang.String |
BOUNDS_PROPERTY
Stores the bounds in which the graph elements can be placed.
|
static java.lang.Double |
DEFAULT_ASPECT_RATIO
Defines the default value for the
ASPECT_RATIO_PROPERTY . |
static java.lang.Integer |
DEFAULT_DIRECTION
Defines the default value for the
DIRECTION_PROPERTY . |
static java.lang.Boolean |
DEFAULT_MOVABLE
Defines the default value for the
MOVABLE_PROPERTY . |
static java.lang.Boolean |
DEFAULT_RESIZABLE
Defines the default value for the
RESIZABLE_PROPERTY . |
static java.lang.Double |
DEFAULT_WEIGHT
Defines the default value for the
WEIGHT_PROPERTY . |
static int |
DIRECTION_BOTTOM_UP
Constant for bottom-up direction.
|
static int |
DIRECTION_LEFT_RIGHT
Constant for direction from left to right.
|
static java.lang.String |
DIRECTION_PROPERTY
Stores the direction of this subgraph.
|
static int |
DIRECTION_RIGHT_LEFT
Constant for direction from right to left.
|
static int |
DIRECTION_TOP_DOWN
Constant for top-down direction (default).
|
static java.lang.String |
LOCATION_PROPERTY
Stores the location of this EntityLayout.
|
static java.lang.String |
MOVABLE_PROPERTY
Stores the movable state of this EntityLayout.
|
static java.lang.String |
RESIZABLE_PROPERTY
Stores the resizable state of this EntityLayout.
|
static java.lang.String |
SIZE_PROPERTY
Stores the size of this EntityLayout.
|
static java.lang.String |
WEIGHT_PROPERTY
Stores a weight for this connection.
|
Constructor and Description |
---|
LayoutProperties() |
Modifier and Type | Method and Description |
---|---|
static Rectangle |
getBounds(org.eclipse.gef.graph.Graph graph)
Returns the value of the
BOUNDS_PROPERTY of the given
LayoutContext . |
static Point |
getLocation(org.eclipse.gef.graph.Node node)
Returns the value of the
LOCATION_PROPERTY of the given
Node . |
static java.lang.Double |
getPreferredAspectRatio(org.eclipse.gef.graph.Node node)
Returns the value of the
ASPECT_RATIO_PROPERTY of the given
Node . |
static Dimension |
getSize(org.eclipse.gef.graph.Node node)
Returns the value of the
SIZE_PROPERTY of the given Node
. |
static java.lang.Double |
getWeight(org.eclipse.gef.graph.Edge edge)
Returns the value of the
WEIGHT_PROPERTY of the given
Edge . |
static java.lang.Boolean |
isMovable(org.eclipse.gef.graph.Node node)
Returns the value of the
MOVABLE_PROPERTY of the given
Node . |
static java.lang.Boolean |
isResizable(org.eclipse.gef.graph.Node node)
Returns the value of the
RESIZABLE_PROPERTY of the given
Node . |
static void |
setBounds(org.eclipse.gef.graph.Graph graph,
Rectangle bounds)
Sets the value of the
BOUNDS_PROPERTY of the given
LayoutContext to the given value. |
static void |
setLocation(org.eclipse.gef.graph.Node node,
Point location)
Sets the value of the
LOCATION_PROPERTY of the given
Node to the given value. |
static void |
setResizable(org.eclipse.gef.graph.Node node,
boolean resizable)
Sets the value of the
RESIZABLE_PROPERTY of the given
Node to the given value. |
static void |
setSize(org.eclipse.gef.graph.Node node,
Dimension size)
Sets the value of the
SIZE_PROPERTY of the given Node to
the given value. |
static void |
setWeight(org.eclipse.gef.graph.Edge edge,
double weight)
Sets the value of the
WEIGHT_PROPERTY of the given Edge
to the given value. |
public static final java.lang.String BOUNDS_PROPERTY
public static final java.lang.String LOCATION_PROPERTY
public static final java.lang.String SIZE_PROPERTY
public static final java.lang.String MOVABLE_PROPERTY
public static final java.lang.Boolean DEFAULT_MOVABLE
MOVABLE_PROPERTY
.public static final java.lang.String RESIZABLE_PROPERTY
public static final java.lang.Boolean DEFAULT_RESIZABLE
RESIZABLE_PROPERTY
.public static final java.lang.String ASPECT_RATIO_PROPERTY
public static final java.lang.Double DEFAULT_ASPECT_RATIO
ASPECT_RATIO_PROPERTY
.public static final java.lang.String WEIGHT_PROPERTY
public static final java.lang.Double DEFAULT_WEIGHT
WEIGHT_PROPERTY
.public static final int DIRECTION_TOP_DOWN
public static final int DIRECTION_BOTTOM_UP
public static final int DIRECTION_LEFT_RIGHT
public static final int DIRECTION_RIGHT_LEFT
public static final java.lang.String DIRECTION_PROPERTY
public static final java.lang.Integer DEFAULT_DIRECTION
DIRECTION_PROPERTY
.public static Rectangle getBounds(org.eclipse.gef.graph.Graph graph)
BOUNDS_PROPERTY
of the given
LayoutContext
.graph
- The Graph
whose BOUNDS_PROPERTY
is read.BOUNDS_PROPERTY
of the given
Graph
.public static void setBounds(org.eclipse.gef.graph.Graph graph, Rectangle bounds)
BOUNDS_PROPERTY
of the given
LayoutContext
to the given value.graph
- The Graph
whose BOUNDS_PROPERTY
is changed.bounds
- The new value for the BOUNDS_PROPERTY
of the given
Graph
.public static Point getLocation(org.eclipse.gef.graph.Node node)
LOCATION_PROPERTY
of the given
Node
.node
- The Node
whose LOCATION_PROPERTY
is read.LOCATION_PROPERTY
of the given
Node
.public static Dimension getSize(org.eclipse.gef.graph.Node node)
SIZE_PROPERTY
of the given Node
.node
- The Node
whose SIZE_PROPERTY
is read.SIZE_PROPERTY
of the given Node
.public static java.lang.Double getPreferredAspectRatio(org.eclipse.gef.graph.Node node)
ASPECT_RATIO_PROPERTY
of the given
Node
.node
- The Node
whose ASPECT_RATIO_PROPERTY
is read.ASPECT_RATIO_PROPERTY
of the given
Node
.public static java.lang.Boolean isResizable(org.eclipse.gef.graph.Node node)
RESIZABLE_PROPERTY
of the given
Node
.node
- The Node
whose RESIZABLE_PROPERTY
is read.RESIZABLE_PROPERTY
of the given
Node
.public static java.lang.Boolean isMovable(org.eclipse.gef.graph.Node node)
MOVABLE_PROPERTY
of the given
Node
.node
- The Node
whose MOVABLE_PROPERTY
is read.MOVABLE_PROPERTY
of the given
Node
.public static void setLocation(org.eclipse.gef.graph.Node node, Point location)
LOCATION_PROPERTY
of the given
Node
to the given value.node
- The Node
whose LOCATION_PROPERTY
is changed.location
- The new location for the LOCATION_PROPERTY
of the
given Node
.public static void setSize(org.eclipse.gef.graph.Node node, Dimension size)
SIZE_PROPERTY
of the given Node
to
the given value.node
- The Node
whose SIZE_PROPERTY
is changed.size
- The new size for the SIZE_PROPERTY
of the given
Node
.public static void setResizable(org.eclipse.gef.graph.Node node, boolean resizable)
RESIZABLE_PROPERTY
of the given
Node
to the given value.node
- The Node
whose RESIZABLE_PROPERTY
is changed.resizable
- The new value for the RESIZABLE_PROPERTY
of the given
Node
.public static java.lang.Double getWeight(org.eclipse.gef.graph.Edge edge)
WEIGHT_PROPERTY
of the given
Edge
.edge
- The Edge
whose WEIGHT_PROPERTY
is read.WEIGHT_PROPERTY
of the given
Edge
.public static void setWeight(org.eclipse.gef.graph.Edge edge, double weight)
WEIGHT_PROPERTY
of the given Edge
to the given value.edge
- The Edge
whose WEIGHT_PROPERTY
is changed.weight
- The new value for the WEIGHT_PROPERTY
of the given
Edge
.Copyright (c) 2014 itemis AG and others. All rights reserved.