Interface VisualizationModel
- All Superinterfaces:
org.gephi.project.spi.Model
It also includes selection-related methods like getSelectedNodes().
One model exists for each workspace.
- Author:
- Mathieu Bastian
-
Method Summary
Modifier and TypeMethodDescriptionReturns the background color of the visualization canvas.Returns the color for selected bidirectional edges.Returns the edge color mode.Returns the color for selected incoming edges.getEdgeLabel(org.gephi.graph.api.Edge edge, org.gephi.graph.api.GraphView view) Returns the label for the given edge, based ongetEdgeLabelColumns().Returns the edge label color mode.org.gephi.graph.api.Column[]Returns the columns used to generate edge labels.Returns the font used for edge labels.floatReturns the edge label size scaling factor.Returns the edge label size mode.Returns the color for selected outgoing edges.floatReturns the edge thickness scaling factor.org.gephi.graph.api.EstimatorReturns the estimator used for dynamic edge weights.intgetFps()Returns the current frames per second.intReturns the mouse selection diameter in pixels.getNodeLabel(org.gephi.graph.api.Node node, org.gephi.graph.api.GraphView view) Returns the label for the given node, based ongetNodeLabelColumns().Returns the node label color mode.org.gephi.graph.api.Column[]Returns the columns used to generate node labels.Returns the font used for node labels.floatReturns the node label size scaling factor.Returns the node label size mode.floatReturns the node size scaling factor.Returns the screenshot model.Collection<org.gephi.graph.api.Node>Returns the currently selected nodes.floatgetZoom()Returns the current zoom level.booleanReturns whether neighbors are automatically selected when a node is selected.booleanReturns whether node label overlap avoidance is enabled.booleanReturns whether the background color is dark.booleanReturns whether custom selection mode is active.booleanReturns whether direct mouse selection mode is active.booleanReturns whether selected edges use custom selection colors.booleanReturns whether non-selected edge labels are hidden.booleanReturns whether non-selected edges are hidden.booleanReturns whether non-selected node labels are hidden.booleanReturns whether non-selected elements are automatically lightened.booleanReturns whether the mouse selection diameter scales with zoom.booleanReturns whether node labels are constrained to fit within node size.booleanReturns whether node selection mode is active.booleanReturns whether rectangle selection mode is active.booleanReturns whether edge weight rescaling is enabled.booleanReturns whether any selection mode is enabled.booleanReturns whether edge labels are visible.booleanReturns whether edges are visible.booleanReturns whether node labels are visible.booleanReturns whether single node selection mode is active.booleanReturns whether edge weights affect edge thickness.Methods inherited from interface org.gephi.project.spi.Model
getWorkspace
-
Method Details
-
getScreenshotModel
ScreenshotModel getScreenshotModel()Returns the screenshot model.- Returns:
- the screenshot model
-
getZoom
float getZoom()Returns the current zoom level.Default value is
0.3.- Returns:
- the zoom level
-
getFps
int getFps()Returns the current frames per second.- Returns:
- the FPS
-
isAutoSelectNeighbors
boolean isAutoSelectNeighbors()Returns whether neighbors are automatically selected when a node is selected.Default value is
true.- Returns:
trueif auto-select neighbors is enabled,falseotherwise
-
getBackgroundColor
Color getBackgroundColor()Returns the background color of the visualization canvas.Default value is
Color.WHITEfor light themes andColor.DARK_GRAYfor dark themes.- Returns:
- the background color
-
isBackgroundColorDark
boolean isBackgroundColorDark()Returns whether the background color is dark.Default value is
falsefor light themes andtruefor dark themes.The value is determined based on the luminance of the background color.
- Returns:
trueif background is dark,falseotherwise
-
isLightenNonSelectedAuto
boolean isLightenNonSelectedAuto()Returns whether non-selected elements are automatically lightened.Default value is
true.- Returns:
trueif lightening is enabled,falseotherwise
-
getNodeScale
float getNodeScale()Returns the node size scaling factor.Default value is
1.0.- Returns:
- the node scale
-
isShowEdges
boolean isShowEdges()Returns whether edges are visible.Default value is
true.- Returns:
trueif edges are shown,falseotherwise
-
getEdgeColorMode
EdgeColorMode getEdgeColorMode()Returns the edge color mode.Default value is
EdgeColorMode.SOURCE.- Returns:
- the edge color mode
-
isHideNonSelectedEdges
boolean isHideNonSelectedEdges()Returns whether non-selected edges are hidden.Default value is
false.- Returns:
trueif non-selected edges are hidden,falseotherwise
-
isEdgeSelectionColor
boolean isEdgeSelectionColor()Returns whether selected edges use custom selection colors.Default value is
false.- Returns:
trueif selection colors are enabled,falseotherwise
-
getEdgeInSelectionColor
Color getEdgeInSelectionColor()Returns the color for selected incoming edges.Default value is
new Color(32, 95, 154, 255).- Returns:
- the incoming edge selection color
-
getEdgeOutSelectionColor
Color getEdgeOutSelectionColor()Returns the color for selected outgoing edges.Default value is
new Color(196, 66, 79, 255).- Returns:
- the outgoing edge selection color
-
getEdgeBothSelectionColor
Color getEdgeBothSelectionColor()Returns the color for selected bidirectional edges.Default value is
new Color(248, 215, 83, 255).- Returns:
- the bidirectional edge selection color
-
getEdgeScale
float getEdgeScale()Returns the edge thickness scaling factor.Default value is
2.0.- Returns:
- the edge scale
-
isUseEdgeWeight
boolean isUseEdgeWeight()Returns whether edge weights affect edge thickness.Default value is
true.- Returns:
trueif edge weight is used,falseotherwise
-
isRescaleEdgeWeight
boolean isRescaleEdgeWeight()Returns whether edge weight rescaling is enabled.Default value is
true.- Returns:
trueif edge weight rescaling is enabled,falseotherwise
-
getEdgeWeightEstimator
org.gephi.graph.api.Estimator getEdgeWeightEstimator()Returns the estimator used for dynamic edge weights.- Returns:
- the edge weight estimator or
nullif not applicable
-
getSelectedNodes
Collection<org.gephi.graph.api.Node> getSelectedNodes()Returns the currently selected nodes.- Returns:
- the selected nodes
-
getMouseSelectionDiameter
int getMouseSelectionDiameter()Returns the mouse selection diameter in pixels.Default value is
1.- Returns:
- the selection diameter
-
isMouseSelectionZoomProportional
boolean isMouseSelectionZoomProportional()Returns whether the mouse selection diameter scales with zoom.Default value is
false.- Returns:
trueif zoom proportional,falseotherwise
-
isRectangleSelection
boolean isRectangleSelection()Returns whether rectangle selection mode is active.- Returns:
trueif rectangle selection is active,falseotherwise
-
isDirectMouseSelection
boolean isDirectMouseSelection()Returns whether direct mouse selection mode is active.- Returns:
trueif direct mouse selection is active,falseotherwise
-
isCustomSelection
boolean isCustomSelection()Returns whether custom selection mode is active.- Returns:
trueif custom selection is active,falseotherwise
-
isSelectionEnabled
boolean isSelectionEnabled()Returns whether any selection mode is enabled.- Returns:
trueif selection is enabled,falseotherwise
-
isNodeSelection
boolean isNodeSelection()Returns whether node selection mode is active.- Returns:
trueif node selection is active,falseotherwise
-
isSingleNodeSelection
boolean isSingleNodeSelection()Returns whether single node selection mode is active.- Returns:
trueif single node selection is active,falseotherwise
-
isShowNodeLabels
boolean isShowNodeLabels()Returns whether node labels are visible.Default value is
false.- Returns:
trueif node labels are shown,falseotherwise
-
getNodeLabelColorMode
LabelColorMode getNodeLabelColorMode()Returns the node label color mode.Default value is
LabelColorMode.SELF.- Returns:
- the node label color mode
-
getNodeLabelSizeMode
LabelSizeMode getNodeLabelSizeMode()Returns the node label size mode.Default value is
LabelSizeMode.ZOOM.- Returns:
- the node label size mode
-
getNodeLabelFont
Font getNodeLabelFont()Returns the font used for node labels.Default value is Arial Bold 32.
- Returns:
- the node label font
-
isNodeLabelFitToNodeSize
boolean isNodeLabelFitToNodeSize()Returns whether node labels are constrained to fit within node size.Default value is
false.- Returns:
trueif fit to node size is enabled,falseotherwise
-
getNodeLabelScale
float getNodeLabelScale()Returns the node label size scaling factor.Default value is
0.5.- Returns:
- the node label scale
-
isHideNonSelectedNodeLabels
boolean isHideNonSelectedNodeLabels()Returns whether non-selected node labels are hidden.Default value is
false.- Returns:
trueif non-selected labels are hidden,falseotherwise
-
isAvoidNodeLabelOverlap
boolean isAvoidNodeLabelOverlap()Returns whether node label overlap avoidance is enabled.Default value is
true.- Returns:
trueif overlap avoidance is enabled,falseotherwise
-
getNodeLabelColumns
org.gephi.graph.api.Column[] getNodeLabelColumns()Returns the columns used to generate node labels.Default value is the node label column.
- Returns:
- the node label columns
-
getNodeLabel
Returns the label for the given node, based ongetNodeLabelColumns().- Parameters:
node- the nodeview- the graph view- Returns:
- the node label
-
getEdgeLabel
Returns the label for the given edge, based ongetEdgeLabelColumns().- Parameters:
edge- the edgeview- the graph view- Returns:
- the edge label
-
isShowEdgeLabels
boolean isShowEdgeLabels()Returns whether edge labels are visible.Default value is
false.- Returns:
trueif edge labels are shown,falseotherwise
-
getEdgeLabelColorMode
LabelColorMode getEdgeLabelColorMode()Returns the edge label color mode.Default value is
LabelColorMode.SELF.- Returns:
- the edge label color mode
-
getEdgeLabelSizeMode
LabelSizeMode getEdgeLabelSizeMode()Returns the edge label size mode.Default value is
LabelSizeMode.ZOOM.- Returns:
- the edge label size mode
-
getEdgeLabelFont
Font getEdgeLabelFont()Returns the font used for edge labels.Default value is Arial Bold 32.
- Returns:
- the edge label font
-
getEdgeLabelScale
float getEdgeLabelScale()Returns the edge label size scaling factor.Default value is
0.5.- Returns:
- the edge label scale
-
isHideNonSelectedEdgeLabels
boolean isHideNonSelectedEdgeLabels()Returns whether non-selected edge labels are hidden.Default value is
false.- Returns:
trueif non-selected labels are hidden,falseotherwise
-
getEdgeLabelColumns
org.gephi.graph.api.Column[] getEdgeLabelColumns()Returns the columns used to generate edge labels.Default value is the edge label column.
- Returns:
- the edge label columns
-