Package ghidra.service.graph
Class VertexShape
java.lang.Object
ghidra.service.graph.VertexShape
Class for defining shapes to use for rendering vertices in a graph
-
Field Summary
Modifier and TypeFieldDescriptionstatic VertexShape
static VertexShape
static VertexShape
static VertexShape
static VertexShape
static VertexShape
static VertexShape
static VertexShape
static VertexShape
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Shape
boolean
double
Gets the relative amount of margin space to allocate above the label.int
This is a factor to keep some shapes from being so distorted by very long labels that they effectively lose their shape when seen by the usergetName()
Returns the name of the shapegetShape()
Returns theShape
for thisVertexShape
instancestatic VertexShape
Returns theVertexShape
for the given shape nameReturns a list of names for all the supportedVertexShape
sdouble
Returns the size factor for a shape relative to its label.int
hashCode()
-
Field Details
-
RECTANGLE
-
ELLIPSE
-
TRIANGLE_UP
-
TRIANGLE_DOWN
-
STAR
-
DIAMOND
-
PENTAGON
-
HEXAGON
-
OCTAGON
-
-
Method Details
-
getName
Returns the name of the shape- Returns:
- the name of the shape
-
getShape
Returns theShape
for thisVertexShape
instance- Returns:
- the
Shape
for thisVertexShape
instance
-
getLabelPosition
public double getLabelPosition()Gets the relative amount of margin space to allocate above the label. The default is 0.5 which will center the label in the associated shape. A value closer to 0 will move the label closer to the top and a value closer to 1 will move the label closer to the bottom.- Returns:
- the relative amount of margin space to allocate obove the label.s
-
getShapeToLabelRatio
public double getShapeToLabelRatio()Returns the size factor for a shape relative to its label. Shapes are sized based on the label of a vertex so that the label can fit inside the shape (mostly). Some subclasses will need to override this value to some value > 1 to fit the label in the shape. For example, a rectangle shape does not need to be extended because text naturally fits. But for a shape like a triangle, its bounding box needs to be bigger so that text doesn't "stick out" in the narrow part of the triangle.- Returns:
- the size factor for a shape relatvie to its label
-
getMaxWidthToHeightRatio
public int getMaxWidthToHeightRatio()This is a factor to keep some shapes from being so distorted by very long labels that they effectively lose their shape when seen by the user- Returns:
- the max width to height ratio
-
createShape
-
getShape
Returns theVertexShape
for the given shape name- Parameters:
shapeName
- the name of the shape for which to get theVertexShape
- Returns:
- the
VertexShape
for the given shape name
-
getShapeNames
Returns a list of names for all the supportedVertexShape
s- Returns:
- a list of names for all the supported
VertexShape
s
-
hashCode
public int hashCode() -
equals
-