# Class: com.pnfsoftware.jeb.client.api.GraphDialogExtensions

Optional extension used to customize and provide action handlers for [graph dialogs](IGraphicalClientContext#displayGraph(String, Digraph, GraphDialogExtensions)). Custom implementations should override the methods they need.

## Constructor: GraphDialogExtensions


## Method: displayEdgesOrientation
- return type: `java.lang.Integer`

Description: Specify how edge orientations should be rendered \(as arrows\), as well as their position on the edge. 

 The default implementation returns null \(i.e., use the defaults, currently set to 50: an arrow will be positioned right in the middle of its edge\).
return: null to use the defaults; \-1 to disable orientation rendering; else, a value between         0 and 100 indicating how close to the destination vertex the arrow should be         positioned \(the 50\-80 range generates pleasant rendering\)

## Method: getCanvasNodeDensity
- return type: `int`

Description: Provide a custom maximum node density \(per pixels\) used by the high\-score\-only rendering mode\(s\). 

 The default implementation returns \-1.
return: a density, strictly greater than 0; any other value will mean to use the default         density

## Method: getDescription
- parameter: `vertexId`, type: `int`
- return type: `java.lang.String`

Description: This method is called when additional information for a node \(not held in the graph definition\) is requested by the client. E.g. the GUI client displays that information in tooltip widgets displayed when hovering over a node. 

 The default implementation returns null.
parameter: vertexId: node id
return: a description

## Method: getEdgeColor
- parameter: `vertexId0`, type: `int`
- parameter: `vertexId1`, type: `int`
- return type: `int`

Description: Determine the color of a directed edge for rendering. 

 The default implementation returns \-1.
parameter: vertexId0: source node
parameter: vertexId1: destination node
return: \-1 to use defaults; else, an RGB value specifying the edge color, e.g. 0xFF0000 for         red

## Method: getEdgeStyle
- parameter: `vertexId0`, type: `int`
- parameter: `vertexId1`, type: `int`
- return type: `com.pnfsoftware.jeb.client.api.GraphDialogExtensions.EdgeStyle`

Description: Determine the style of an edge for rendering. 

 The default implementation returns null.
parameter: vertexId0: source node
parameter: vertexId1: destination node
return: null to use defaults; else, an edge style

## Method: getLayoutMode
- return type: `com.pnfsoftware.jeb.client.api.GraphDialogExtensions.LayoutMode`

Description: Provide the layout mode. 

 The default implementation returns null.
return: a mode; null to indicate a default mode

## Method: getShowVertex
- parameter: `vertexId`, type: `int`
- return type: `boolean`

Description: When in a filtered mode, this method is called to determine whether a vertex should be shown. \(This method is only called in a filtered mode.\) 

 The default implementation returns true.
parameter: vertexId: node id
return: determine whether the vertex should be shown \(in any of the filtered modes\)

## Method: getUnitAddress
- parameter: `vertexId`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.UnitAddress<?>`

Description: This method is called when client code requests a navigation action on a node. The implementation can return a unit\+address couple that clients will then attempt to navigate to. 

 The default implementation returns null.
parameter: vertexId: node id
return: a unit address

## Method: getVertexColor
- parameter: `vertexId`, type: `int`
- return type: `int`

Description: Determine the base color of a vertex for rendering. 

 The default implementation returns \-1.
parameter: vertexId: an optional vertex id; \-1 means any vertex
return: \-1 to use defaults; else, an RGB value specifying the node color, e.g. 0xFF0000 for         red

## Method: getVertexMark
- parameter: `vertexId`, type: `int`
- return type: `boolean`

Description: Determine if the provided vertex is marked. A 'mark' is a boolean flag which value can be toggled via the context menu on a node. Note that the mark is not be stored on the graph itself. It should be stored on the model. See [#processVertexMark(int, boolean)](#processVertexMark(int, boolean)). 

 The default implementation returns false.
parameter: vertexId: a vertex id
return: false if the mark is not set or if marks are not supported; true if the node is         marked

## Method: getVertexShape
- parameter: `vertexId`, type: `int`
- return type: `com.pnfsoftware.jeb.client.api.GraphDialogExtensions.VertexShape`

Description: Determine the shape of a vertex for rendering. 

 The default implementation returns null.
parameter: vertexId: an optional vertex id; \-1 means any vertex
return: null to use defaults; else, a shape enum

## Method: processNewVertexName
- parameter: `vertexId`, type: `int`
- parameter: `newName`, type: `java.lang.String`
- return type: `boolean`

Description: This method is called when a vertex is about to be renamed. The implementation can reject or accept the name, and act accordingly, e.g. by modifying underlying model data. 

 The default implementation returns true.
parameter: vertexId: node id
parameter: newName: new name
return: true to accept the new name; false to reject it

## Method: processVertexMark
- parameter: `vertexId`, type: `int`
- parameter: `marking`, type: `boolean`
- return type: `boolean`

Description: This method is called when the graph controller requests to mark or unmark a node. The implementation can reject or accept the mark, and should act accordingly, e.g. by modifying underlying model data. 

 The default implementation returns false.
parameter: vertexId: node id
parameter: marking: new mark value
return: true to accept the new mark value; false to reject it

