Interface VisualizationModel

All Superinterfaces:
org.gephi.project.spi.Model

public interface VisualizationModel extends org.gephi.project.spi.Model
Entry point to access and configure visualization settings.

It also includes selection-related methods like getSelectedNodes().

One model exists for each workspace.

Author:
Mathieu Bastian
  • 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:
      true if auto-select neighbors is enabled, false otherwise
    • getBackgroundColor

      Color getBackgroundColor()
      Returns the background color of the visualization canvas.

      Default value is Color.WHITE for light themes and Color.DARK_GRAY for dark themes.

      Returns:
      the background color
    • isBackgroundColorDark

      boolean isBackgroundColorDark()
      Returns whether the background color is dark.

      Default value is false for light themes and true for dark themes.

      The value is determined based on the luminance of the background color.

      Returns:
      true if background is dark, false otherwise
    • isLightenNonSelectedAuto

      boolean isLightenNonSelectedAuto()
      Returns whether non-selected elements are automatically lightened.

      Default value is true.

      Returns:
      true if lightening is enabled, false otherwise
    • 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:
      true if edges are shown, false otherwise
    • 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:
      true if non-selected edges are hidden, false otherwise
    • isEdgeSelectionColor

      boolean isEdgeSelectionColor()
      Returns whether selected edges use custom selection colors.

      Default value is false.

      Returns:
      true if selection colors are enabled, false otherwise
    • 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:
      true if edge weight is used, false otherwise
    • isRescaleEdgeWeight

      boolean isRescaleEdgeWeight()
      Returns whether edge weight rescaling is enabled.

      Default value is true.

      Returns:
      true if edge weight rescaling is enabled, false otherwise
    • getEdgeWeightEstimator

      org.gephi.graph.api.Estimator getEdgeWeightEstimator()
      Returns the estimator used for dynamic edge weights.
      Returns:
      the edge weight estimator or null if 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:
      true if zoom proportional, false otherwise
    • isRectangleSelection

      boolean isRectangleSelection()
      Returns whether rectangle selection mode is active.
      Returns:
      true if rectangle selection is active, false otherwise
    • isDirectMouseSelection

      boolean isDirectMouseSelection()
      Returns whether direct mouse selection mode is active.
      Returns:
      true if direct mouse selection is active, false otherwise
    • isCustomSelection

      boolean isCustomSelection()
      Returns whether custom selection mode is active.
      Returns:
      true if custom selection is active, false otherwise
    • isSelectionEnabled

      boolean isSelectionEnabled()
      Returns whether any selection mode is enabled.
      Returns:
      true if selection is enabled, false otherwise
    • isNodeSelection

      boolean isNodeSelection()
      Returns whether node selection mode is active.
      Returns:
      true if node selection is active, false otherwise
    • isSingleNodeSelection

      boolean isSingleNodeSelection()
      Returns whether single node selection mode is active.
      Returns:
      true if single node selection is active, false otherwise
    • isShowNodeLabels

      boolean isShowNodeLabels()
      Returns whether node labels are visible.

      Default value is false.

      Returns:
      true if node labels are shown, false otherwise
    • 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:
      true if fit to node size is enabled, false otherwise
    • 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:
      true if non-selected labels are hidden, false otherwise
    • isAvoidNodeLabelOverlap

      boolean isAvoidNodeLabelOverlap()
      Returns whether node label overlap avoidance is enabled.

      Default value is true.

      Returns:
      true if overlap avoidance is enabled, false otherwise
    • 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

      String getNodeLabel(org.gephi.graph.api.Node node, org.gephi.graph.api.GraphView view)
      Returns the label for the given node, based on getNodeLabelColumns().
      Parameters:
      node - the node
      view - the graph view
      Returns:
      the node label
    • getEdgeLabel

      String getEdgeLabel(org.gephi.graph.api.Edge edge, org.gephi.graph.api.GraphView view)
      Returns the label for the given edge, based on getEdgeLabelColumns().
      Parameters:
      edge - the edge
      view - the graph view
      Returns:
      the edge label
    • isShowEdgeLabels

      boolean isShowEdgeLabels()
      Returns whether edge labels are visible.

      Default value is false.

      Returns:
      true if edge labels are shown, false otherwise
    • 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:
      true if non-selected labels are hidden, false otherwise
    • 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