VertexType
- the vertex type of the graphEdgeType
- the edge type of the graphpublic class VertexVisualData<VertexType,EdgeType> extends java.lang.Object implements VertexArealData
Modifier and Type | Field and Description |
---|---|
static double |
NOTINITIALIZED |
Constructor and Description |
---|
VertexVisualData(VertexType vertex,
boolean directed)
Creates an instance with an uninitialized position
|
VertexVisualData(VertexType vertex,
double positionX,
double positionY,
boolean directed)
Creates an instance with the given data
|
Modifier and Type | Method and Description |
---|---|
void |
addIngoingEdge(EdgeVisualData<VertexType,EdgeType> edge)
Adds a visual edge to the list of ingoing edges.
|
void |
addOutgoingEdge(EdgeVisualData<VertexType,EdgeType> edge)
Adds a visual edge to the list of outgoing edges.
|
void |
addX(float x)
Adds the given value to the x position of the vertex
|
void |
addY(float y)
Adds the given value to the y position of the vertex
|
java.util.LinkedList<EdgeVisualData<VertexType,EdgeType>> |
getIngoingEdges()
Returns the list of the visual dates of all ingoing edges
|
java.util.LinkedList<EdgeVisualData<VertexType,EdgeType>> |
getOutgoingEdges()
Returns the list of the visual dates of all outgoing edges
|
DimensionD |
getScale()
Returns the dimensions of the visual vertex appearance
|
VertexType |
getVertex()
Returns the vertex associated with this visual data
|
double |
getX()
Returns the x position of the vertex
|
double |
getY()
Returns the y position of the vertex
|
boolean |
hasAutosizeData()
Tells whether or not this instance has data to automatically adjust the dimensions
|
boolean |
hasScale()
Tells whether or not the dimensions were set for this visual data
|
boolean |
isDirected()
Returns true, if and only if, the vertex is of a directed graph
|
boolean |
isPositionSet()
Returns true, if and only if, the position was initialized before
|
void |
resize(java.awt.Graphics gfx,
GraphLibrary<VertexType,EdgeType> graph,
ProjectionPlane projectionPlane)
Resizes the dimensions according to the content of the vertex
|
void |
setAutosizeData(java.awt.Graphics gfx,
java.awt.Font font,
java.lang.String caption)
Sets the data to automatically adjust the dimensions.
|
void |
setPosition(double x,
double y)
Sets the position of the vertex to the given x and y values
|
void |
setScale(DimensionD scale)
Sets the dimensions of the visual vertex appearance
|
void |
setScale(double scale)
Sets the x and y dimensions of the visual appearance both to the given value
|
void |
setScale(double scaleX,
double scaleY)
Sets the x and y dimensions of the visual appearance
|
void |
setX(double positionX)
Sets the x position of the vertex to the given value
|
void |
setY(double positionY)
Sets the y position of the vertex to the given value
|
void |
updateIncidentEdges(GraphLibrary<VertexType,EdgeType> graph)
Refreshes the visual positions and appearance of the incident visual edges of the vertex
|
public static final double NOTINITIALIZED
public VertexVisualData(VertexType vertex, double positionX, double positionY, boolean directed)
vertex
- the vertex to associate withpositionX
- the x position of the vertexpositionY
- the y position of the vertexdirected
- if true, ingoing as well as outgoing edges are storedpublic VertexVisualData(VertexType vertex, boolean directed)
vertex
- the vertex to associate withdirected
- if true, then ingoing as well as outgoing edges are storedpublic final boolean isDirected()
public final boolean isPositionSet()
public java.util.LinkedList<EdgeVisualData<VertexType,EdgeType>> getIngoingEdges()
public java.util.LinkedList<EdgeVisualData<VertexType,EdgeType>> getOutgoingEdges()
public void addIngoingEdge(EdgeVisualData<VertexType,EdgeType> edge)
public void addOutgoingEdge(EdgeVisualData<VertexType,EdgeType> edge)
public VertexType getVertex()
public DimensionD getScale()
getScale
in interface VertexArealData
public void setScale(DimensionD scale)
public void setScale(double scale)
public boolean hasScale()
public void setScale(double scaleX, double scaleY)
public double getX()
getX
in interface VertexArealData
public void setX(double positionX)
public double getY()
getY
in interface VertexArealData
public void setY(double positionY)
public void addX(float x)
public void addY(float y)
public void setPosition(double x, double y)
public boolean hasAutosizeData()
public void setAutosizeData(java.awt.Graphics gfx, java.awt.Font font, java.lang.String caption)
gfx
- the graphics surface on which the vertex is drawnfont
- the font which is used when drawing the vertexcaption
- the string which is output within the vertex when the vertex is drawnpublic void resize(java.awt.Graphics gfx, GraphLibrary<VertexType,EdgeType> graph, ProjectionPlane projectionPlane)
gfx
- the graphics surface on which the vertex is drawngraph
- the graph of the vertexprojectionPlane
- the plane which is used to calculate the visual propertiespublic void updateIncidentEdges(GraphLibrary<VertexType,EdgeType> graph)