Interface EntityLayout
- All Known Subinterfaces:
NodeLayout
,SubgraphLayout
- All Known Implementing Classes:
DefaultSubgraph
,FigureSubgraph
,LabelSubgraph
,TriangleSubgraph
public interface EntityLayout
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionItem[]
getItems()
Returns all graph items that are represented using this single entity.Returns a point laying in the center of this entity.Returns all entities that are direct predecessors of this entity.double
Returns aspect ratio that is preferred for this entity.getSize()
Returns all entities that are direct successors of this entity.boolean
boolean
void
setLocation
(double x, double y) Sets the position of this entity.void
setSize
(double width, double height)
-
Method Details
-
getLocation
DisplayIndependentPoint getLocation()Returns a point laying in the center of this entity. Any subsequent changes to the returned point won't affect this node.- Returns:
- position of the center of this node
-
setLocation
void setLocation(double x, double y) Sets the position of this entity. The node will be moved so that it's center is located in the given point.- Parameters:
x
- the x-positiony
- the y-position
-
getSize
DisplayIndependentDimension getSize() -
setSize
void setSize(double width, double height) -
getPreferredAspectRatio
double getPreferredAspectRatio()Returns aspect ratio that is preferred for this entity. Can be 0 if this node can't be resized anyway or it doesn't care about about its ratio.- Returns:
- aspect ratio (width / height)
-
isResizable
boolean isResizable() -
isMovable
boolean isMovable() -
getSuccessingEntities
EntityLayout[] getSuccessingEntities()Returns all entities that are direct successors of this entity. Successor entities of an unpruned node N are:- all unpruned successor nodes of node N
- all subgraphs that are
GraphEntities
and contain at least one successor node of node N
GraphEntity
are:- all unpruned nodes that are successor of at least one node from subgraph S
- all subgraphs that are
GraphEntities
and contain at least one node that is a successor of at least one node from subgraph S
GraphEntities
an empty array will be returned.
Entities connected with this node by a bidirectional connection are considered both successors and predecessors. Any subsequent changes to the returned array do not affect this node.- Returns:
- array of successors of this node
-
getPredecessingEntities
EntityLayout[] getPredecessingEntities()Returns all entities that are direct predecessors of this entity. Predecessor entities of an unpruned node A are:- all unpruned predecessor nodes of node N
- all subgraphs that are
GraphEntities
and contain at least one predecessor node of node N
GraphEntity
are:- all unpruned nodes that are predecessor of at least one node from subgraph S
- all subgraphs that are
GraphEntities
and contain at least one node that is a predecessor of at least one node from subgraph S
GraphEntities
an empty array will be returned.
Entities connected with this node by a bidirectional connection are considered both successors and predecessors. Any subsequent changes to the returned array do not affect this node.- Returns:
- array of predecessors of this node
-
getItems
Item[] getItems()Returns all graph items that are represented using this single entity. They are useful when a layout would get information about the graph it draws.- Returns:
- an array of graph items
-