Package org.gephi.visualization.api
Interface VisualizationController
public interface VisualizationController
Main controller for visualization settings and operations.
Provides access to the visualization model and methods to modify visualization settings.
- Author:
- Mathieu Bastian
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(VisualizationEventListener listener) Adds a visualization event listener.voidAdds a property change listener.voidcenterOn(float x, float y, float width, float height) Centers the view on the specified rectangular area.voidcenterOnEdge(org.gephi.graph.api.Edge edge) Centers the view on the specified edge.voidCenters the view on the entire graph.voidcenterOnNode(org.gephi.graph.api.Node node) Centers the view on the specified node.voidCenters the view on the origin (0, 0) with default dimensions.voidDisables all selection modes.getModel()Returns the visualization model for the current workspace.getModel(org.gephi.project.api.Workspace workspace) Returns the visualization model for the specified workspace.Returns the screenshot controller.voidremoveListener(VisualizationEventListener listener) Removes a visualization event listener.voidRemoves a property change listener.voidResets the current selection.voidselectEdges(org.gephi.graph.api.Edge[] edges) Selects the specified edges.voidselectNodes(org.gephi.graph.api.Node[] nodes) Selects the specified nodes.voidsetAutoSelectNeighbors(boolean autoSelectNeighbors) Sets whether neighbors are automatically selected when a node is selected.voidsetAvoidNodeLabelOverlap(boolean avoidOverlap) Sets whether node label overlap avoidance is enabled.voidsetBackgroundColor(Color color) Sets the background color of the visualization canvas.voidEnables custom selection mode.voidEnables direct mouse selection mode.voidsetEdgeBothSelectionColor(Color edgeBothSelectionColor) Sets the color for selected bidirectional edges.voidSets the edge color mode.voidsetEdgeInSelectionColor(Color edgeInSelectionColor) Sets the color for selected incoming edges.voidSets the edge label color mode.voidsetEdgeLabelColumns(org.gephi.graph.api.Column[] columns) Sets the columns used to generate edge labels.voidsetEdgeLabelFont(Font font) Sets the font used for edge labels.voidsetEdgeLabelScale(float scale) Sets the edge label size scaling factor.voidSets the edge label size mode.voidsetEdgeOutSelectionColor(Color edgeOutSelectionColor) Sets the color for selected outgoing edges.voidsetEdgeScale(float edgeScale) Sets the edge thickness scaling factor.voidsetEdgeSelectionColor(boolean edgeSelectionColor) Sets whether selected edges use custom selection colors.voidsetEdgeWeightEstimator(org.gephi.graph.api.Estimator estimator) Sets the estimator used for dynamic edge weights.voidsetHideNonSelectedEdgeLabels(boolean hideNonSelected) Sets whether non-selected edge labels are hidden.voidsetHideNonSelectedEdges(boolean hideNonSelectedEdges) Sets whether non-selected edges are hidden.voidsetHideNonSelectedNodeLabels(boolean hideNonSelected) Sets whether non-selected node labels are hidden.voidsetLightenNonSelectedAuto(boolean lightenNonSelectedAuto) Sets whether non-selected elements are automatically lightened.voidsetMouseSelectionDiameter(int diameter) Sets the mouse selection diameter in pixels.voidsetMouseSelectionZoomProportional(boolean proportional) Sets whether the mouse selection diameter scales with zoom.voidSets the node label color mode.voidsetNodeLabelColumns(org.gephi.graph.api.Column[] columns) Sets the columns used to generate node labels.voidsetNodeLabelFitToNodeSize(boolean fitToNodeSize) Sets whether node labels are constrained to fit within node size.voidsetNodeLabelFont(Font font) Sets the font used for node labels.voidsetNodeLabelScale(float scale) Sets the node label size scaling factor.voidSets the node label size mode.voidsetNodeScale(float nodeScale) Sets the node size scaling factor.voidsetNodeSelection(boolean singleNode) Enables node selection mode.voidEnables rectangle selection mode.voidsetRescaleEdgeWeight(boolean rescaleEdgeWeight) Sets whether edge weights are rescaled to fit within the specified min and max thickness.voidsetShowEdgeLabels(boolean showEdgeLabels) Sets whether edge labels are visible.voidsetShowEdges(boolean showEdges) Sets whether edges are visible.voidsetShowNodeLabels(boolean showNodeLabels) Sets whether node labels are visible.voidsetUseEdgeWeight(boolean useEdgeWeight) Sets whether edge weights affect edge thickness.voidsetZoom(float zoom) Sets the zoom level.
-
Method Details
-
getModel
VisualizationModel getModel()Returns the visualization model for the current workspace.- Returns:
- the current visualization model
-
getModel
Returns the visualization model for the specified workspace.- Parameters:
workspace- the workspace- Returns:
- the visualization model for the workspace
-
getScreenshotController
ScreenshotController getScreenshotController()Returns the screenshot controller.- Returns:
- the screenshot controller
-
setZoom
void setZoom(float zoom) Sets the zoom level.- Parameters:
zoom- the zoom level
-
setAutoSelectNeighbors
void setAutoSelectNeighbors(boolean autoSelectNeighbors) Sets whether neighbors are automatically selected when a node is selected.- Parameters:
autoSelectNeighbors-trueto enable,falseto disable
-
setBackgroundColor
Sets the background color of the visualization canvas.- Parameters:
color- the background color
-
setNodeScale
void setNodeScale(float nodeScale) Sets the node size scaling factor.- Parameters:
nodeScale- the node scale
-
setShowEdges
void setShowEdges(boolean showEdges) Sets whether edges are visible.- Parameters:
showEdges-trueto show edges,falseto hide them
-
setEdgeColorMode
Sets the edge color mode.- Parameters:
mode- the edge color mode
-
setEdgeSelectionColor
void setEdgeSelectionColor(boolean edgeSelectionColor) Sets whether selected edges use custom selection colors.- Parameters:
edgeSelectionColor-trueto enable selection colors,falseto disable
-
setEdgeInSelectionColor
Sets the color for selected incoming edges.- Parameters:
edgeInSelectionColor- the incoming edge selection color
-
setEdgeOutSelectionColor
Sets the color for selected outgoing edges.- Parameters:
edgeOutSelectionColor- the outgoing edge selection color
-
setEdgeBothSelectionColor
Sets the color for selected bidirectional edges.- Parameters:
edgeBothSelectionColor- the bidirectional edge selection color
-
setEdgeScale
void setEdgeScale(float edgeScale) Sets the edge thickness scaling factor.- Parameters:
edgeScale- the edge scale
-
setUseEdgeWeight
void setUseEdgeWeight(boolean useEdgeWeight) Sets whether edge weights affect edge thickness.- Parameters:
useEdgeWeight-trueto enable,falseto disable
-
setRescaleEdgeWeight
void setRescaleEdgeWeight(boolean rescaleEdgeWeight) Sets whether edge weights are rescaled to fit within the specified min and max thickness.- Parameters:
rescaleEdgeWeight-trueto enable,falseto disable
-
setLightenNonSelectedAuto
void setLightenNonSelectedAuto(boolean lightenNonSelectedAuto) Sets whether non-selected elements are automatically lightened.- Parameters:
lightenNonSelectedAuto-trueto enable,falseto disable
-
setHideNonSelectedEdges
void setHideNonSelectedEdges(boolean hideNonSelectedEdges) Sets whether non-selected edges are hidden.- Parameters:
hideNonSelectedEdges-trueto hide,falseto show
-
setEdgeWeightEstimator
void setEdgeWeightEstimator(org.gephi.graph.api.Estimator estimator) Sets the estimator used for dynamic edge weights.- Parameters:
estimator- the edge weight estimator
-
centerOnGraph
void centerOnGraph()Centers the view on the entire graph. -
centerOnZero
void centerOnZero()Centers the view on the origin (0, 0) with default dimensions. -
centerOn
void centerOn(float x, float y, float width, float height) Centers the view on the specified rectangular area.- Parameters:
x- the x coordinatey- the y coordinatewidth- the widthheight- the height
-
centerOnNode
void centerOnNode(org.gephi.graph.api.Node node) Centers the view on the specified node.- Parameters:
node- the node to center on
-
centerOnEdge
void centerOnEdge(org.gephi.graph.api.Edge edge) Centers the view on the specified edge.- Parameters:
edge- the edge to center on
-
addPropertyChangeListener
Adds a property change listener.- Parameters:
listener- the listener to add
-
removePropertyChangeListener
Removes a property change listener.- Parameters:
listener- the listener to remove
-
addListener
Adds a visualization event listener.- Parameters:
listener- the listener to add
-
removeListener
Removes a visualization event listener.- Parameters:
listener- the listener to remove
-
disableSelection
void disableSelection()Disables all selection modes. -
setRectangleSelection
void setRectangleSelection()Enables rectangle selection mode. -
setDirectMouseSelection
void setDirectMouseSelection()Enables direct mouse selection mode. -
setCustomSelection
void setCustomSelection()Enables custom selection mode. -
setNodeSelection
void setNodeSelection(boolean singleNode) Enables node selection mode.- Parameters:
singleNode-truefor single node selection,falsefor multiple
-
setMouseSelectionDiameter
void setMouseSelectionDiameter(int diameter) Sets the mouse selection diameter in pixels.- Parameters:
diameter- the selection diameter
-
setMouseSelectionZoomProportional
void setMouseSelectionZoomProportional(boolean proportional) Sets whether the mouse selection diameter scales with zoom.- Parameters:
proportional-trueto enable zoom proportional,falseotherwise
-
resetSelection
void resetSelection()Resets the current selection. -
selectNodes
void selectNodes(org.gephi.graph.api.Node[] nodes) Selects the specified nodes.- Parameters:
nodes- the nodes to select ornullto clear node selection
-
selectEdges
void selectEdges(org.gephi.graph.api.Edge[] edges) Selects the specified edges.- Parameters:
edges- the edges to select ornullto clear edge selection
-
setShowNodeLabels
void setShowNodeLabels(boolean showNodeLabels) Sets whether node labels are visible.- Parameters:
showNodeLabels-trueto show node labels,falseto hide them
-
setNodeLabelFont
Sets the font used for node labels.- Parameters:
font- the node label font
-
setNodeLabelScale
void setNodeLabelScale(float scale) Sets the node label size scaling factor.- Parameters:
scale- the node label scale
-
setHideNonSelectedNodeLabels
void setHideNonSelectedNodeLabels(boolean hideNonSelected) Sets whether non-selected node labels are hidden.- Parameters:
hideNonSelected-trueto hide,falseto show
-
setNodeLabelColorMode
Sets the node label color mode.- Parameters:
mode- the node label color mode
-
setNodeLabelSizeMode
Sets the node label size mode.- Parameters:
mode- the node label size mode
-
setNodeLabelColumns
void setNodeLabelColumns(org.gephi.graph.api.Column[] columns) Sets the columns used to generate node labels.- Parameters:
columns- the node label columns
-
setNodeLabelFitToNodeSize
void setNodeLabelFitToNodeSize(boolean fitToNodeSize) Sets whether node labels are constrained to fit within node size.- Parameters:
fitToNodeSize-trueto enable,falseto disable
-
setAvoidNodeLabelOverlap
void setAvoidNodeLabelOverlap(boolean avoidOverlap) Sets whether node label overlap avoidance is enabled.- Parameters:
avoidOverlap-trueto enable,falseto disable
-
setShowEdgeLabels
void setShowEdgeLabels(boolean showEdgeLabels) Sets whether edge labels are visible.- Parameters:
showEdgeLabels-trueto show edge labels,falseto hide them
-
setEdgeLabelFont
Sets the font used for edge labels.- Parameters:
font- the edge label font
-
setEdgeLabelScale
void setEdgeLabelScale(float scale) Sets the edge label size scaling factor.- Parameters:
scale- the edge label scale
-
setEdgeLabelColorMode
Sets the edge label color mode.- Parameters:
mode- the edge label color mode
-
setEdgeLabelSizeMode
Sets the edge label size mode.- Parameters:
mode- the edge label size mode
-
setHideNonSelectedEdgeLabels
void setHideNonSelectedEdgeLabels(boolean hideNonSelected) Sets whether non-selected edge labels are hidden.- Parameters:
hideNonSelected-trueto hide,falseto show
-
setEdgeLabelColumns
void setEdgeLabelColumns(org.gephi.graph.api.Column[] columns) Sets the columns used to generate edge labels.- Parameters:
columns- the edge label columns
-