Package ghidra.program.model.graph
Interface GraphDisplay
-
public interface GraphDisplay
Handle object to a graph display.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGN_CENTER
Aligns the graph text to the centerstatic int
ALIGN_LEFT
Aligns the graph text to the leftstatic int
ALIGN_RIGHT
Aligns the graph text to the right
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clear the graph data in the graph displayvoid
close()
Close the graph.void
defineEdgeAttribute(java.lang.String attributeName)
Define the name of an attribute on edges in the graph displayed.void
defineVertexAttribute(java.lang.String attributeName)
Define the name of an attribute on vertices in the graph displayed.boolean
isValid()
Check if the graph display is still valid.void
locate(java.lang.Object locationObject, boolean global)
Tell the display to set the location cursor on the graph based on some object that will be passed to the GraphSelectionHandler to map into and address string.void
popup()
Pop the graph display to the front.void
select(java.lang.Object selectionObject, boolean global)
Tell the display to set the selection set on the graph based on some object that will be passed to the GraphSelectionHandler to map into address strings.void
setGraphData(GraphData graph)
Set the graph data.void
setSelectionHandler(GraphSelectionHandler handler)
Set the handler that will map addresses strings on vertices and edges to/from objects that make sense to the generator of the graph.void
setVertexLabel(java.lang.String attributeName, int alignment, int size, boolean monospace, int maxLines)
Indicate that the specified vertex attribute should be displayed as the vertex label.
-
-
-
Field Detail
-
ALIGN_LEFT
static final int ALIGN_LEFT
Aligns the graph text to the left- See Also:
- Constant Field Values
-
ALIGN_CENTER
static final int ALIGN_CENTER
Aligns the graph text to the center- See Also:
- Constant Field Values
-
ALIGN_RIGHT
static final int ALIGN_RIGHT
Aligns the graph text to the right- See Also:
- Constant Field Values
-
-
Method Detail
-
popup
void popup() throws GraphException
Pop the graph display to the front.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
clear
void clear() throws GraphException
Clear the graph data in the graph display- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
close
void close()
Close the graph. This destroys the graph display.
-
isValid
boolean isValid()
Check if the graph display is still valid.
-
setGraphData
void setGraphData(GraphData graph) throws GraphException
Set the graph data. This will append the data to the graph. Call the clear method if this data is to replace the exising data on this display.- Parameters:
graph
- the graph data to apply to the graph display.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
defineEdgeAttribute
void defineEdgeAttribute(java.lang.String attributeName) throws GraphException
Define the name of an attribute on edges in the graph displayed.- Parameters:
attributeName
- the name of the attribute to define on an edge.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
defineVertexAttribute
void defineVertexAttribute(java.lang.String attributeName) throws GraphException
Define the name of an attribute on vertices in the graph displayed.- Parameters:
attributeName
- the name of the attribute to define on a vertex.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
setVertexLabel
void setVertexLabel(java.lang.String attributeName, int alignment, int size, boolean monospace, int maxLines) throws GraphException
Indicate that the specified vertex attribute should be displayed as the vertex label.- Parameters:
attributeName
- the name of the vertex attributealignment
- ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHTsize
- font size (8, 10, 12, etc.)monospace
- if true a monospace font will be used.maxLines
- indicate the maximum number of lines to be displayed for the label. A value <= 1 will result in a single line display and the preferred geometric shapes. A value >1 will force the use of rectangualr nodes.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
setSelectionHandler
void setSelectionHandler(GraphSelectionHandler handler)
Set the handler that will map addresses strings on vertices and edges to/from objects that make sense to the generator of the graph.- Parameters:
handler
- the GraphSelectionHandler to set on this GraphDisplay.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
select
void select(java.lang.Object selectionObject, boolean global)
Tell the display to set the selection set on the graph based on some object that will be passed to the GraphSelectionHandler to map into address strings.- Parameters:
selectionObject
- opaque object to be passed to the selection handler.global
- true if the selection is to be set on all known graph windows.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
locate
void locate(java.lang.Object locationObject, boolean global)
Tell the display to set the location cursor on the graph based on some object that will be passed to the GraphSelectionHandler to map into and address string.- Parameters:
locationObject
- opaque object to be passed to the selection handler.global
- true if the selection is to be set on all known graph windows.- Throws:
GraphException
- thrown if an error occurs while communicating with the graph service.
-
-