public class VisualVertex extends AbstractVisualGraphComponent
| Constructor and Description |
|---|
VisualVertex(Vertex vertex,
Font f,
VisualGraph vGraph)
Creates a new VisualVertex object that encapsulates the given Vertex object
using the Font specified to draw the string inside the VisualVertex.
|
VisualVertex(Vertex vertex,
Shape shape,
Color c,
Color bgcolor,
Font f,
VisualGraph vGraph)
Creates a new VisualVertex object that encapsulates the given Vertex object
with the given visual attributes.
|
VisualVertex(Vertex vertex,
VisualGraph vGraph)
Creates a new VisualVertex object that encapsulates the given Vertex object
This defaults the font to Lucida Sans, the outline color to black and the
fill or background colot to Color( 0, 255, 255 ).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double x,
double y)
Tests if the coordinate is inside the VisualVertex's shape.
|
Vertex |
getVertex()
Returns the Vertex that VisualVertex encapsulates.
|
void |
paint(Graphics2D g2d)
Draw the VisualVertex with the specified 2D graphics context.
|
void |
rescale()
Forces a rescale of the internal shape used to represent VisualVertex.
|
void |
setGeneralPath(GeneralPath path)
Sets geometry used to draw the VisualVertex.
|
void |
setLocation(double x,
double y) |
void |
setLocation(int x,
int y)
Moves the location of the VisualVertex to the new coordinate.
|
void |
setLocationDelta(double dx,
double dy) |
void |
setLocationDelta(int dx,
int dy)
Moves the location of the VisualVertex' shape by the specified delta values.
|
void |
setVertex(Vertex vertex)
Sets the vertex that the VisualVertex encapsulates.
|
String |
toString()
Wrapper method that simply returns this.displaytext.
|
addMouseListener, addMouseMotionListener, getBounds, getBounds2D, getFillcolor, getFont, getFontcolor, getFontMetrics, getGeneralPath, getLabel, getOutlinecolor, getPainter, getVisualGraph, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeMouseListener, removeMouseMotionListener, setFillcolor, setFont, setFontcolor, setGeneralPath, setLabel, setOutlinecolor, setPainterpublic VisualVertex(Vertex vertex, VisualGraph vGraph)
vertex - The Vertex object that the VisualVertex will encapsulate.public VisualVertex(Vertex vertex, Font f, VisualGraph vGraph)
vertex - The Vertex object that the VisualVertex will encapsulate.f - The font that will be used to draw the String representation of the vertexpublic VisualVertex(Vertex vertex, Shape shape, Color c, Color bgcolor, Font f, VisualGraph vGraph)
vertex - The Vertex object that the VisualVertex will encapsulate.shape - The shape used to render the VisualVertex.c - The color used to draw the outline of the VisualVertex's shape.bgcolor - The color used to fill the VisualVertex's shape.f - The font that will be used to draw the String representation of the vertexpublic Vertex getVertex()
public void setGeneralPath(GeneralPath path)
setGeneralPath in interface VisualGraphComponentsetGeneralPath in class AbstractVisualGraphComponentpath - A GeneralPath object used to draw the VisualVertex. If
the GeneralPath is not a closed polygon, this method will close the path.public void setVertex(Vertex vertex)
vertex - The new Vertex object that VisualVertex encapsulates.public boolean contains(double x,
double y)
x - x-coordinate of the point you want to testy - y-coordinate of the point you want to testpublic void setLocation(int x,
int y)
x - The new x-coordinate for the VisualVertexy - The new y-coordinate for the VisualVertexpublic void setLocation(double x,
double y)
public void setLocationDelta(int dx,
int dy)
x - The delta x-coordinate for the VisualVertexy - The delta y-coordinate for the VisualVertexpublic void setLocationDelta(double dx,
double dy)
public String toString()
toString in interface VisualGraphComponenttoString in class Objectpublic void paint(Graphics2D g2d)
g2d - The Graphics2D graphics context object used to draw
the VisualVertex.public void rescale()
Copyright © 2019 JULIE Lab, Germany. All rights reserved.