Class SNTGraphAdapter<V,E extends org.jgrapht.graph.DefaultWeightedEdge>

java.lang.Object
com.mxgraph.util.mxEventSource
com.mxgraph.view.mxGraph
org.jgrapht.ext.JGraphXAdapter<V,E>
sc.fiji.snt.viewer.geditor.SNTGraphAdapter<V,E>
All Implemented Interfaces:
EventListener, org.jgrapht.event.GraphListener<V,E>, org.jgrapht.event.VertexSetListener<V>
Direct Known Subclasses:
AnnotationGraphAdapter, SNTPseudographAdapter, TreeGraphAdapter

public class SNTGraphAdapter<V,E extends org.jgrapht.graph.DefaultWeightedEdge> extends org.jgrapht.ext.JGraphXAdapter<V,E>
Base adapter that converts SNT graphs to JGraphX graph models for visualization. Handles vertex and edge styling, color management, and editing constraints for SNT graph displays.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.mxgraph.view.mxGraph

    com.mxgraph.view.mxGraph.mxICellVisitor

    Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource

    com.mxgraph.util.mxEventSource.mxIEventListener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final SNTGraph<V,E>
     

    Fields inherited from class com.mxgraph.view.mxGraph

    allowDanglingEdges, allowLoops, allowNegativeCoordinates, alternateEdgeStyle, autoOrigin, autoSizeCells, border, cellsBendable, cellsCloneable, cellsDeletable, cellsDisconnectable, cellsEditable, cellsLocked, cellsMovable, cellsResizable, cellsSelectable, changesRepaintThreshold, changeSupport, cloneInvalidEdges, collapseToPreferredSize, connectableEdges, constrainChildren, defaultLoopStyle, defaultOverlap, defaultParent, disconnectOnMove, dropEnabled, edgeLabelsMovable, enabled, extendParents, extendParentsOnAdd, fullRepaintHandler, graphModelChangeHandler, gridEnabled, gridSize, htmlLabels, imageBundles, keepEdgesInBackground, keepEdgesInForeground, labelsClipped, labelsVisible, maximumGraphBounds, minimumGraphSize, model, multigraph, multiplicities, origin, portsEnabled, resetEdgesOnConnect, resetEdgesOnMove, resetEdgesOnResize, resetViewOnRootChange, selectionModel, splitEnabled, stylesheet, swimlaneNesting, updateOriginHandler, VERSION, vertexLabelsMovable, view

    Fields inherited from class com.mxgraph.util.mxEventSource

    eventListeners, eventsEnabled, eventSource
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cellLabelChanged(Object cell, Object value, boolean autoSize)
     
    protected String
     
     
    protected boolean
     
    protected boolean
     
    void
    scaleEdgeWidths(double minWidth, double maxWidth, String scale)
     
    void
     
    void
    setEdgeColor(E edge, org.scijava.util.ColorRGB color)
     
    protected void
    setEnableEdgeLabels(boolean enable)
     
    protected void
    setEnableVertexLabels(boolean enable)
     
    void
    setVertexColor(V vertex, org.scijava.util.ColorRGB color)
     

    Methods inherited from class org.jgrapht.ext.JGraphXAdapter

    edgeAdded, edgeRemoved, getCellToEdgeMap, getCellToVertexMap, getEdgeToCellMap, getVertexToCellMap, vertexAdded, vertexRemoved

    Methods inherited from class com.mxgraph.view.mxGraph

    addAllEdges, addCell, addCell, addCell, addCells, addCells, addCells, addCells, addEdge, addImageBundle, addPropertyChangeListener, addPropertyChangeListener, addSelectionCell, addSelectionCells, addTopmostVerticesAndEdges, alignCells, alignCells, alignCells, cellConnected, cellDrawn, cellsAdded, cellsAdded, cellsFolded, cellsFolded, cellSizeUpdated, cellsMoved, cellsOrdered, cellsRemoved, cellsResized, cellsToggled, clearSelection, cloneCells, cloneCells, connectCell, connectCell, constrainChild, convertValueToString, createEdge, createGraphView, createGroupCell, createSelectionModel, createStylesheet, createVertex, createVertex, disconnectGraph, drawCell, drawGraph, drawState, enterGroup, enterGroup, exitGroup, extendParent, findTreeRoots, findTreeRoots, findTreeRoots, flipEdge, foldCells, foldCells, foldCells, foldCells, getAllConnectionConstraints, getAllEdges, getAlternateEdgeStyle, getBorder, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBoxFromGeometry, getBoundsForCells, getBoundsForGroup, getCellBounds, getCellBounds, getCellBounds, getCellBounds, getCellContainmentArea, getCellGeometry, getCellsBeyond, getCellsForGroup, getCellStyle, getCellValidationError, getChangesRepaintThreshold, getChildCells, getChildCells, getChildEdges, getChildOffsetForCell, getChildVertices, getCloneableCells, getConnectionConstraint, getConnectionPoint, getConnections, getConnections, getConnections, getCurrentRoot, getDefaultLoopStyle, getDefaultOverlap, getDefaultParent, getDeletableCells, getDropTarget, getEdges, getEdges, getEdges, getEdges, getEdgesBetween, getEdgesBetween, getEdgeValidationError, getFoldableCells, getGraphBounds, getGridSize, getImage, getImageBundles, getImageBundles, getImageFromBundles, getIncomingEdges, getIncomingEdges, getLabel, getLinkForCell, getMaximumGraphBounds, getMinimumGraphSize, getModel, getMovableCells, getMultiplicities, getOpposites, getOpposites, getOrigin, getOutgoingEdges, getOutgoingEdges, getOverlap, getPaintBounds, getPreferredSizeForCell, getSelectionCell, getSelectionCells, getSelectionCellsForChanges, getSelectionCount, getSelectionModel, getStartSize, getStylesheet, getTargetForCell, getTerminalForPort, getToolTipForCell, getTranslateForRoot, getView, graphModelChanged, groupCells, groupCells, groupCells, groupCells, home, insertEdge, insertEdge, insertVertex, insertVertex, insertVertex, isAllowDanglingEdges, isAllowLoops, isAllowNegativeCoordinates, isAllowOverlapParent, isAutoOrigin, isAutoSizeCell, isAutoSizeCells, isCellBendable, isCellCloneable, isCellCollapsed, isCellConnectable, isCellDeletable, isCellDisconnectable, isCellEditable, isCellFoldable, isCellLocked, isCellMovable, isCellResizable, isCellsBendable, isCellsCloneable, isCellsDeletable, isCellsDisconnectable, isCellsEditable, isCellSelectable, isCellSelected, isCellsLocked, isCellsMovable, isCellsResizable, isCellsSelectable, isCellVisible, isCloneInvalidEdges, isCollapseToPreferredSize, isConnectableEdges, isConstrainChild, isConstrainChildren, isDisconnectOnMove, isDropEnabled, isEdgeLabelsMovable, isEdgeValid, isEnabled, isExtendParent, isExtendParents, isExtendParentsOnAdd, isGridEnabled, isHtmlLabel, isHtmlLabels, isKeepEdgesInBackground, isKeepEdgesInForeground, isLabelClipped, isLabelMovable, isLabelsClipped, isLabelsVisible, isLoop, isMultigraph, isOrthogonal, isPort, isPortsEnabled, isResetEdgesOnConnect, isResetEdgesOnMove, isResetEdgesOnResize, isResetViewOnRootChange, isSelectionEmpty, isSplitEnabled, isSplitTarget, isSwimlane, isSwimlaneNesting, isTerminalPointMovable, isValidAncestor, isValidConnection, isValidDropTarget, isValidRoot, isValidSource, isValidTarget, isVertexLabelsMovable, main, moveCells, moveCells, moveCells, orderCells, orderCells, postProcessCellStyle, processChange, processChanges, refresh, removeCells, removeCells, removeCells, removeCellsFromParent, removeCellsFromParent, removeImageBundle, removePropertyChangeListener, removePropertyChangeListener, removeSelectionCell, removeSelectionCells, removeStateForCell, repaint, repaint, resetEdge, resetEdges, resizeCell, resizeCells, selectAll, selectAll, selectCell, selectCells, selectCells, selectChildCell, selectEdges, selectEdges, selectNextCell, selectParentCell, selectPreviousCell, selectVertices, selectVertices, setAllowDanglingEdges, setAllowLoops, setAllowNegativeCoordinates, setAlternateEdgeStyle, setAutoOrigin, setAutoSizeCells, setBorder, setCellsBendable, setCellsCloneable, setCellsDeletable, setCellsDisconnectable, setCellsEditable, setCellsLocked, setCellsMovable, setCellsResizable, setCellsSelectable, setCellStyle, setCellStyle, setCellStyleFlags, setCellStyleFlags, setCellStyles, setCellStyles, setChangesRepaintThreshold, setCloneInvalidEdges, setCollapseToPreferredSize, setConnectableEdges, setConnectionConstraint, setConstrainChildren, setDefaultLoopStyle, setDefaultOverlap, setDefaultParent, setDisconnectOnMove, setDropEnabled, setEdgeLabelsMovable, setEnabled, setExtendParents, setExtendParentsOnAdd, setGridEnabled, setGridSize, setHtmlLabels, setKeepEdgesInBackground, setKeepEdgesInForeground, setLabelsClipped, setLabelsVisible, setMaximumGraphBounds, setMinimumGraphSize, setModel, setMultigraph, setMultiplicities, setOrigin, setPortsEnabled, setResetEdgesOnConnect, setResetEdgesOnMove, setResetEdgesOnResize, setResetViewOnRootChange, setSelectionCell, setSelectionCells, setSelectionCells, setSplitEnabled, setStylesheet, setSwimlaneNesting, setVertexLabelsMovable, setView, snap, splitEdge, splitEdge, splitEdge, swapBounds, toggleCells, toggleCells, toggleCells, toggleCellStyle, toggleCellStyleFlags, toggleCellStyleFlags, toggleCellStyles, toggleCellStyles, toString, translateCell, traverse, traverse, ungroupCells, ungroupCells, updateAlternateBounds, updateCellSize, updateCellSize, updateGroupBounds, updateGroupBounds, updateGroupBounds, updateGroupBounds, updateOrigin, updateSelection, validateCell, validateEdge

    Methods inherited from class com.mxgraph.util.mxEventSource

    addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jgrapht.event.GraphListener

    edgeWeightUpdated
  • Field Details

    • cGraph

      protected final SNTGraph<V,E extends org.jgrapht.graph.DefaultWeightedEdge> cGraph
  • Constructor Details

    • SNTGraphAdapter

      public SNTGraphAdapter(SNTGraph<V,E> graph)
  • Method Details

    • cellLabelChanged

      public void cellLabelChanged(Object cell, Object value, boolean autoSize)
      Overrides:
      cellLabelChanged in class com.mxgraph.view.mxGraph
    • setVertexColor

      public void setVertexColor(V vertex, org.scijava.util.ColorRGB color)
    • setEdgeColor

      public void setEdgeColor(E edge, org.scijava.util.ColorRGB color)
    • setCellColorsFromGraph

      public void setCellColorsFromGraph()
    • getSourceGraph

      public SNTGraph<V,E> getSourceGraph()
    • isEdgeLabelsEnabled

      protected boolean isEdgeLabelsEnabled()
    • isVertexLabelsEnabled

      protected boolean isVertexLabelsEnabled()
    • setEnableEdgeLabels

      protected void setEnableEdgeLabels(boolean enable)
    • setEnableVertexLabels

      protected void setEnableVertexLabels(boolean enable)
    • getOriginalValueOfmxCell

      protected String getOriginalValueOfmxCell(String mxCellId)
    • scaleEdgeWidths

      public void scaleEdgeWidths(double minWidth, double maxWidth, String scale)