$darkmode
DENOPTIM
denoptim.gui.GraphViewerPanel Class Reference

A Panel that holds the JUNG representation of a graph. More...

Inheritance diagram for denoptim.gui.GraphViewerPanel:
[legend]
Collaboration diagram for denoptim.gui.GraphViewerPanel:
[legend]

Classes

class  EdgeDrawPaintTransformer
 
class  EdgeLabelTransformer
 
class  EdgeStrokeTransformer
 
class  GraphOptsPopup
 
class  JEdge
 An edge in the JUNG Graph. More...
 
class  JVertex
 a vertex in the JUNG Graph. More...
 
enum  JVertexType
 
enum  LabelType
 
class  PopupGraphMousePlugin
 
class  VertexFillPaintTransformer
 
class  VertexLabelTransformer
 
class  VertexShapePaintTransformer
 

Public Member Functions

 GraphViewerPanel ()
 Constructor. More...
 
void cleanup ()
 Removes the currently loaded graph viewer. More...
 
void loadGraphToViewer (DGraph dnGraph)
 Load the given DGraph to this graph viewer. More...
 
void loadGraphToViewer (Template tmpl)
 Load the DGraph contained in a Template into the graph viewer. More...
 
void loadGraphToViewer (DGraph dnGraph, JUNGGraphSnapshot prevStatus)
 Load the given DGraph to the graph viewer. More...
 
edu.uci.ics.jung.graph.Graph< JVertex, JEdgeconvertDnGraphToGSGraph (DGraph dnG)
 Created a JUNG graph object that represents a DGraph, and allows to load a graphical representation into the viewer. More...
 
edu.uci.ics.jung.graph.Graph< JVertex, JEdgeconvertDnGraphToGSGraph (DGraph dnpGraph, Template tmpl)
 Created a JUNG graph object that represents a DGraph, and allows to load a graphical representation into the viewer. More...
 
void loadGraphToViewer (edu.uci.ics.jung.graph.Graph< JVertex, JEdge > g)
 Load the given graph to the graph viewer. More...
 
void loadGraphToViewer (edu.uci.ics.jung.graph.Graph< JVertex, JEdge > g, JUNGGraphSnapshot prevStatus)
 Load the given graph to the graph viewer. More...
 
void loadGraphToViewer (edu.uci.ics.jung.graph.Graph< JVertex, JEdge > g, JUNGGraphSnapshot prevStatus, boolean lock)
 Load the given graph to the graph viewer. More...
 
void loadGraphToViewer (edu.uci.ics.jung.graph.Graph< JVertex, JEdge > g, JUNGGraphSnapshot prevStatus, boolean lock, double reScaling)
 Load the given graph to the graph viewer. More...
 
void fireMouseModePropertyChange (int i)
 Files a property change relative to the mode of mouse transformation. More...
 
void centerGraphLayout ()
 
void setMouseMode (ModalGraphMouse.Mode mode)
 
void alterLabels (LabelType labelType, boolean show)
 Adds or removes labels from the elements selected in the graph view. More...
 
Set< JEdgegetSelectedEdges ()
 Finds of selected edges from the viewer. More...
 
Set< JVertexgetSelectedNodes ()
 Finds selected nodes from the viewer. More...
 
boolean hasSelected ()
 Check is there is any node selected in the viewer. More...
 
JUNGGraphSnapshot getGraphStatusSnapshot ()
 Returns a copy of the graph loaded into the viewer. More...
 
void dispose ()
 

Static Public Attributes

static final String PROPERTYNODECLICKED = "NODECLICKED"
 
static final String PROPERTYMOUSEMODE = "SETMOUSEMODE"
 

Package Attributes

edu.uci.ics.jung.graph.Graph< JVertex, JEdgeloadedGraph
 
DNPSpringLayout< JVertex, JEdgelayout
 
VisualizationViewer< JVertex, JEdgeviewer
 

Private Member Functions

void initialize ()
 Builds the initialized component. More...
 
Point2D getLayoutCenter ()
 
void inheritFeatures (JUNGGraphSnapshot prevStatus, boolean lock)
 

Static Private Member Functions

static void renumberAPs (Template tmpl, edu.uci.ics.jung.graph.Graph< JVertex, JEdge > graph)
 

Private Attributes

double scaling = 1.0
 
DefaultModalGraphMouse< JVertex, JEdgegm
 

Static Private Attributes

static final long serialVersionUID = 2L
 Version UID. More...
 

Detailed Description

A Panel that holds the JUNG representation of a graph.

Author
Marco Foscato

Definition at line 77 of file GraphViewerPanel.java.

Constructor & Destructor Documentation

◆ GraphViewerPanel()

denoptim.gui.GraphViewerPanel.GraphViewerPanel ( )

Constructor.

Definition at line 319 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.initialize().

Here is the call graph for this function:

Member Function Documentation

◆ alterLabels()

void denoptim.gui.GraphViewerPanel.alterLabels ( LabelType  labelType,
boolean  show 
)

Adds or removes labels from the elements selected in the graph view.

The logics is a bit complex in that the behaviour is special in case one/more nodes are selected AND we want to alter the APClass labels: if there is only one selected node, then we display the APClasses on all incident vertexes, if there is more than one,

Parameters
labelTypethe type of label to act on.
showuse true to display labels, or false to hide labels of the given kind.

Definition at line 1136 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.getSelectedNodes(), denoptim.gui.GraphViewerPanel.loadedGraph, and denoptim.gui.GraphViewerPanel.viewer.

Referenced by denoptim.gui.GraphVertexMolViewerPanel.alterLabels(), and denoptim.gui.GraphViewerPanel.GraphOptsPopup.GraphOptsPopup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ centerGraphLayout()

void denoptim.gui.GraphViewerPanel.centerGraphLayout ( )

Definition at line 673 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.getLayoutCenter(), and denoptim.gui.GraphViewerPanel.viewer.

Referenced by denoptim.gui.GraphViewerPanel.GraphOptsPopup.GraphOptsPopup(), and denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanup()

void denoptim.gui.GraphViewerPanel.cleanup ( )

Removes the currently loaded graph viewer.

Definition at line 342 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.viewer.

Referenced by denoptim.gui.GraphVertexMolViewerPanel.clearCurrentSystem(), denoptim.gui.GraphViewerPanel.dispose(), denoptim.gui.GraphViewerPanel.GraphOptsPopup.GraphOptsPopup(), denoptim.gui.GraphVertexMolViewerPanel.loadDnGraphToViewer(), and denoptim.gui.VertexAsGraphViewPanel.loadVertexStructure().

Here is the caller graph for this function:

◆ convertDnGraphToGSGraph() [1/2]

edu.uci.ics.jung.graph.Graph< JVertex, JEdge > denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph ( DGraph  dnG)

Created a JUNG graph object that represents a DGraph, and allows to load a graphical representation into the viewer.

Parameters
dnGthe DGraph to be converted.
Returns
the JUNG object

Definition at line 404 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph().

Referenced by denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph(), and denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertDnGraphToGSGraph() [2/2]

edu.uci.ics.jung.graph.Graph< JVertex, JEdge > denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph ( DGraph  dnpGraph,
Template  tmpl 
)

Created a JUNG graph object that represents a DGraph, and allows to load a graphical representation into the viewer.

Parameters
dnGthe DGraph to be converted.
tmplnull, or the Template that contains the DGraph. If this is not null the numbering of the AP nodes will be based on the list of APs of the Template, otherwise (if tmpl is null) the numbering refers to the AP list of the vertex that is part of the dnG graph.
Returns
the JUNG object

Definition at line 424 of file GraphViewerPanel.java.

References denoptim.graph.DGraph.getEdgeList(), denoptim.graph.DGraph.getRings(), denoptim.graph.DGraph.getVertexList(), denoptim.gui.GraphViewerPanel.JVertexType.RCV, and denoptim.gui.GraphViewerPanel.renumberAPs().

Here is the call graph for this function:

◆ dispose()

void denoptim.gui.GraphViewerPanel.dispose ( )

Definition at line 1252 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.cleanup().

Referenced by denoptim.gui.GraphVertexMolViewerPanel.dispose(), and denoptim.gui.VertexAsGraphViewPanel.dispose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fireMouseModePropertyChange()

void denoptim.gui.GraphViewerPanel.fireMouseModePropertyChange ( int  i)

Files a property change relative to the mode of mouse transformation.

Parameters
iuse 0 for picking mode, 1 for move mode.

Definition at line 666 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.PROPERTYMOUSEMODE.

Referenced by denoptim.gui.GraphViewerPanel.GraphOptsPopup.GraphOptsPopup().

Here is the caller graph for this function:

◆ getGraphStatusSnapshot()

JUNGGraphSnapshot denoptim.gui.GraphViewerPanel.getGraphStatusSnapshot ( )

Returns a copy of the graph loaded into the viewer.

Definition at line 1240 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.layout, and denoptim.gui.GraphViewerPanel.loadedGraph.

Referenced by denoptim.gui.GraphViewerPanel.GraphOptsPopup.GraphOptsPopup(), and denoptim.gui.GraphVertexMolViewerPanel.loadDnGraphToViewer().

Here is the caller graph for this function:

◆ getLayoutCenter()

Point2D denoptim.gui.GraphViewerPanel.getLayoutCenter ( )
private

Definition at line 687 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.layout, and denoptim.gui.GraphViewerPanel.loadedGraph.

Referenced by denoptim.gui.GraphViewerPanel.centerGraphLayout().

Here is the caller graph for this function:

◆ getSelectedEdges()

Set< JEdge > denoptim.gui.GraphViewerPanel.getSelectedEdges ( )

Finds of selected edges from the viewer.

Returns
the set of edges

Definition at line 1186 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.loadedGraph, and denoptim.gui.GraphViewerPanel.viewer.

◆ getSelectedNodes()

Set< JVertex > denoptim.gui.GraphViewerPanel.getSelectedNodes ( )

Finds selected nodes from the viewer.

Returns
the set of nodes.

Definition at line 1219 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.viewer.

Referenced by denoptim.gui.GraphViewerPanel.alterLabels(), denoptim.gui.GraphVertexMolViewerPanel.getAPsSelectedInViewer(), and denoptim.gui.GraphVertexMolViewerPanel.getSelectedNodesInViewer().

Here is the caller graph for this function:

◆ hasSelected()

boolean denoptim.gui.GraphViewerPanel.hasSelected ( )

Check is there is any node selected in the viewer.

Returns
true if there is at least one node selected.

Definition at line 1230 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.viewer.

Referenced by denoptim.gui.GraphVertexMolViewerPanel.hasSelectedNodes().

Here is the caller graph for this function:

◆ inheritFeatures()

void denoptim.gui.GraphViewerPanel.inheritFeatures ( JUNGGraphSnapshot  prevStatus,
boolean  lock 
)
private

Definition at line 929 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.LabelType.APC, denoptim.gui.GraphViewerPanel.LabelType.APID, denoptim.gui.GraphViewerPanel.LabelType.BBID, denoptim.gui.GraphViewerPanel.LabelType.BT, denoptim.gui.JUNGGraphSnapshot.getEdgeIDsWithLabel(), denoptim.gui.JUNGGraphSnapshot.getVertexeIDsWithLabel(), denoptim.gui.GraphViewerPanel.layout, denoptim.gui.GraphViewerPanel.loadedGraph, and denoptim.gui.JUNGGraphSnapshot.vertexPosition.

Referenced by denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void denoptim.gui.GraphViewerPanel.initialize ( )
private

Builds the initialized component.

Definition at line 330 of file GraphViewerPanel.java.

Referenced by denoptim.gui.GraphViewerPanel.GraphViewerPanel().

Here is the caller graph for this function:

◆ loadGraphToViewer() [1/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( DGraph  dnGraph)

Load the given DGraph to this graph viewer.

Parameters
dnGraphthe graph to load.

Definition at line 362 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph(), and denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Referenced by denoptim.gui.GraphViewerPanel.GraphOptsPopup.GraphOptsPopup(), denoptim.gui.GraphVertexMolViewerPanel.loadDnGraphToViewer(), denoptim.gui.GraphViewerPanel.loadGraphToViewer(), and denoptim.gui.VertexAsGraphViewPanel.loadVertexStructure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadGraphToViewer() [2/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( DGraph  dnGraph,
JUNGGraphSnapshot  prevStatus 
)

Load the given DGraph to the graph viewer.

Parameters
dnGraphthe graph to load.
prevStatusthe snapshot of the previous status. We use this to remember previously chosen settings, such as the labels to be displayed, or the position of nodes.

Definition at line 390 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph(), and denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:

◆ loadGraphToViewer() [3/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( edu.uci.ics.jung.graph.Graph< JVertex, JEdge g)

Load the given graph to the graph viewer.

Parameters
gthe graph to load

Definition at line 504 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:

◆ loadGraphToViewer() [4/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( edu.uci.ics.jung.graph.Graph< JVertex, JEdge g,
JUNGGraphSnapshot  prevStatus 
)

Load the given graph to the graph viewer.

Parameters
gthe graph to load
prevStatusthe snapshot of the previous status. We use this to remember previously chosen settings, such as the labels to be displayed, or the position of nodes.

Definition at line 518 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:

◆ loadGraphToViewer() [5/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( edu.uci.ics.jung.graph.Graph< JVertex, JEdge g,
JUNGGraphSnapshot  prevStatus,
boolean  lock 
)

Load the given graph to the graph viewer.

Parameters
gthe graph to load
prevStatusthe snapshot of the previous status. We use this to remember previously chosen settings, such as the labels to be displayed, or the position of nodes.
lockdecides whether we lock the initial position of nodes or not.

Definition at line 534 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:

◆ loadGraphToViewer() [6/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( edu.uci.ics.jung.graph.Graph< JVertex, JEdge g,
JUNGGraphSnapshot  prevStatus,
boolean  lock,
double  reScaling 
)

Load the given graph to the graph viewer.

Parameters
gthe graph to load
prevStatusthe snapshot of the previous status. We use this to remember previously chosen settings, such as the labels to be displayed, or the position of nodes.
lockdecides whether we lock the initial position of nodes or not.
reScalinga factor to be multiplied to the current scaling of the graph layout size. This allows to reduce/enlarge the space considered for plotting the graph.

Definition at line 552 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.centerGraphLayout(), denoptim.gui.GraphViewerPanel.JVertex.expandable, denoptim.gui.GraphViewerPanel.gm, denoptim.gui.GUIPreferences.graphLabelFontSize, denoptim.gui.GraphViewerPanel.inheritFeatures(), denoptim.gui.GraphViewerPanel.layout, denoptim.gui.GraphViewerPanel.loadedGraph, denoptim.gui.GraphViewerPanel.PROPERTYNODECLICKED, denoptim.gui.GraphViewerPanel.scaling, and denoptim.gui.GraphViewerPanel.viewer.

Here is the call graph for this function:

◆ loadGraphToViewer() [7/7]

void denoptim.gui.GraphViewerPanel.loadGraphToViewer ( Template  tmpl)

Load the DGraph contained in a Template into the graph viewer.

Parameters
tmplthe template containing the graph to visualise.

Definition at line 374 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph(), denoptim.graph.Template.getInnerGraph(), and denoptim.gui.GraphViewerPanel.loadGraphToViewer().

Here is the call graph for this function:

◆ renumberAPs()

static void denoptim.gui.GraphViewerPanel.renumberAPs ( Template  tmpl,
edu.uci.ics.jung.graph.Graph< JVertex, JEdge graph 
)
staticprivate

Definition at line 477 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.JVertexType.AP, denoptim.graph.Template.getAttachmentPoints(), denoptim.graph.Template.getInnerAPFromOuterAP(), and denoptim.graph.AttachmentPoint.toString().

Referenced by denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMouseMode()

void denoptim.gui.GraphViewerPanel.setMouseMode ( ModalGraphMouse.Mode  mode)

Definition at line 921 of file GraphViewerPanel.java.

References denoptim.gui.GraphViewerPanel.gm.

Referenced by denoptim.gui.GraphVertexMolViewerPanel.setMouseMode().

Here is the caller graph for this function:

Member Data Documentation

◆ gm

DefaultModalGraphMouse<JVertex, JEdge> denoptim.gui.GraphViewerPanel.gm
private

◆ layout

◆ loadedGraph

◆ PROPERTYMOUSEMODE

final String denoptim.gui.GraphViewerPanel.PROPERTYMOUSEMODE = "SETMOUSEMODE"
static

◆ PROPERTYNODECLICKED

final String denoptim.gui.GraphViewerPanel.PROPERTYNODECLICKED = "NODECLICKED"
static

◆ scaling

double denoptim.gui.GraphViewerPanel.scaling = 1.0
private

◆ serialVersionUID

final long denoptim.gui.GraphViewerPanel.serialVersionUID = 2L
staticprivate

Version UID.

Definition at line 82 of file GraphViewerPanel.java.

◆ viewer


The documentation for this class was generated from the following file: