@@ -90,7 +90,7 @@ public class SmartGraphPanel<V, E> extends Pane {
9090 private final Graph <V , E > theGraph ;
9191 private final SmartPlacementStrategy placementStrategy ;
9292 private final Map <Vertex <V >, SmartGraphVertexNode <V >> vertexNodes ;
93- private final Map <Edge <E , V >, SmartGraphEdgeBase <E , V >> edgeNodes ;
93+ private final Map <Edge <E , V >, SmartGraphEdgeNode <E , V >> edgeNodes ;
9494 private final Map <Edge <E ,V >, Tuple <Vertex <V >>> connections ;
9595 private boolean initialized = false ;
9696 private final boolean edgesWithArrows ;
@@ -631,7 +631,7 @@ private void initNodes() {
631631 graphVertexIn .addAdjacentVertex (graphVertexOppositeOut );
632632 graphVertexOppositeOut .addAdjacentVertex (graphVertexIn );
633633
634- SmartGraphEdgeBase <E ,V > graphEdge = createEdge (edge , graphVertexIn , graphVertexOppositeOut );
634+ SmartGraphEdgeNode <E ,V > graphEdge = createEdge (edge , graphVertexIn , graphVertexOppositeOut );
635635
636636 /* Track Edges already placed */
637637 connections .put (edge , new Tuple <>(vertex , oppositeVertex ));
@@ -660,7 +660,7 @@ private SmartGraphVertexNode<V> createVertex(Vertex<V> v, double x, double y) {
660660 return new SmartGraphVertexNode <>(this , v , x , y , shapeRadius , shapeType , graphProperties .getVertexAllowUserMove ());
661661 }
662662
663- private SmartGraphEdgeBase <E ,V > createEdge (Edge <E , V > edge , SmartGraphVertexNode <V > graphVertexInbound , SmartGraphVertexNode <V > graphVertexOutbound ) {
663+ private SmartGraphEdgeNode <E ,V > createEdge (Edge <E , V > edge , SmartGraphVertexNode <V > graphVertexInbound , SmartGraphVertexNode <V > graphVertexOutbound ) {
664664 /*
665665 Edges will be placed with 'multiplicityIndex' starting at 0 for a single edge between a pair of vertices. This represents a straight edge.
666666 When more than an edge exists, the 'multiplicityIndex' will start at 1, forcing the edges to be curved.
@@ -695,16 +695,16 @@ private void addVertex(SmartGraphVertexNode<V> v) {
695695 }
696696 }
697697
698- private void addEdge (SmartGraphEdgeBase <E ,V > e , Edge <E , V > edge ) {
698+ private void addEdge (SmartGraphEdgeNode <E ,V > e , Edge <E , V > edge ) {
699699 // Edges to the back
700- this .getChildren ().add (0 , ( Node ) e );
700+ this .getChildren ().add (0 , e );
701701 edgeNodes .put (edge , e );
702702
703703 String labelText = getEdgeLabelFor (edge .element ());
704704
705705 if (graphProperties .getUseEdgeTooltip ()) {
706706 Tooltip t = new Tooltip (labelText );
707- Tooltip .install (( Node ) e , t );
707+ Tooltip .install (e , t );
708708 }
709709
710710 if (graphProperties .getUseEdgeLabel ()) {
@@ -804,7 +804,7 @@ The opposite vertex exists in the (di)graph, but we have not yet
804804 graphVertexOut .addAdjacentVertex (graphVertexIn );
805805 graphVertexIn .addAdjacentVertex (graphVertexOut );
806806
807- SmartGraphEdgeBase <E ,V > graphEdge = createEdge (edge , graphVertexIn , graphVertexOut );
807+ SmartGraphEdgeNode <E ,V > graphEdge = createEdge (edge , graphVertexIn , graphVertexOut );
808808
809809 /* Track edges */
810810 connections .put (edge , new Tuple <>(u , v ));
@@ -825,7 +825,7 @@ private void removeNodes() {
825825 //remove edges (graphical elements) that were removed from the underlying graph
826826 Collection <Edge <E , V >> removedEdges = removedEdges ();
827827 for (Edge <E , V > e : removedEdges ) {
828- SmartGraphEdgeBase <E ,V > edgeToRemove = edgeNodes .get (e );
828+ SmartGraphEdgeNode <E ,V > edgeToRemove = edgeNodes .get (e );
829829 edgeNodes .remove (e );
830830 removeEdge (edgeToRemove ); //remove from panel
831831
@@ -856,8 +856,8 @@ private void removeNodes() {
856856
857857 }
858858
859- private void removeEdge (SmartGraphEdgeBase <E ,V > e ) {
860- getChildren ().remove (( Node ) e );
859+ private void removeEdge (SmartGraphEdgeNode <E ,V > e ) {
860+ getChildren ().remove (e );
861861
862862 SmartArrow attachedArrow = e .getAttachedArrow ();
863863 if (attachedArrow != null ) {
@@ -878,13 +878,13 @@ private void removeEdge(SmartGraphEdgeBase<E,V> e) {
878878 *
879879 * This work
880880 */
881- private void updateParallelEdgesOf (SmartGraphEdgeBase <E ,V > e ) {
881+ private void updateParallelEdgesOf (SmartGraphEdgeNode <E ,V > e ) {
882882
883- SmartGraphVertexNode <V > v = e .getInbound ();
884- SmartGraphVertexNode <V > w = e .getOutbound ();
883+ SmartGraphVertexNode <V > v = ( SmartGraphVertexNode < V >) e .getInbound ();
884+ SmartGraphVertexNode <V > w = ( SmartGraphVertexNode < V >) e .getOutbound ();
885885
886886 // 'getEdgesBetween' returns a collection of ages, ordered by their "age".
887- List <SmartGraphEdgeBase <E , V >> parallelEdges = getEdgesBetween (v , w );
887+ List <SmartGraphEdgeNode <E , V >> parallelEdges = getEdgesBetween (v , w );
888888
889889 int numEdges = parallelEdges .size ();
890890 if (numEdges > 0 ) {
@@ -941,7 +941,7 @@ private void updateNodes() {
941941 });
942942
943943 theGraph .edges ().forEach ((e ) -> {
944- SmartGraphEdgeBase <E ,V > edgeNode = edgeNodes .get (e );
944+ SmartGraphEdgeNode <E ,V > edgeNode = edgeNodes .get (e );
945945 if (edgeNode != null ) {
946946 SmartLabel label = edgeNode .getAttachedLabel ();
947947 if (label != null ) {
@@ -1048,7 +1048,7 @@ protected final double getVertexShapeRadiusFor(V vertexElement) {
10481048 return graphProperties .getVertexRadius ();
10491049 }
10501050
1051- /*protected final List<SmartGraphEdgeBase > getConnectedEdgesFor(SmartGraphVertexNode<V> node) {
1051+ /*protected final List<SmartGraphEdgeNode > getConnectedEdgesFor(SmartGraphVertexNode<V> node) {
10521052 if(node == null) throw new IllegalArgumentException("node cannot be null."); // defensive
10531053
10541054 Vertex<V> underlyingVertex = node.getUnderlyingVertex();
@@ -1063,7 +1063,7 @@ protected final double getVertexShapeRadiusFor(V vertexElement) {
10631063 }
10641064
10651065 // Get the corresponding smart edges
1066- List<SmartGraphEdgeBase > connected = new ArrayList<>();
1066+ List<SmartGraphEdgeNode > connected = new ArrayList<>();
10671067
10681068 for (Edge<E, V> edge : edges) {
10691069 connected.add ( edgeNodes.get(edge) );
@@ -1135,11 +1135,11 @@ private int getTotalEdgesBetweenInModel(Vertex<V> v, Vertex<V> u) {
11351135 * @param u second vertex
11361136 * @return an ordered (by age) list of edges that exist between 'u' and 'v'
11371137 */
1138- private List <SmartGraphEdgeBase <E , V >> getEdgesBetween (SmartGraphVertexNode <V > v , SmartGraphVertexNode <V > u ) {
1138+ private List <SmartGraphEdgeNode <E , V >> getEdgesBetween (SmartGraphVertexNode <V > v , SmartGraphVertexNode <V > u ) {
11391139 Vertex <V > V = v .getUnderlyingVertex ();
11401140 Vertex <V > U = u .getUnderlyingVertex ();
11411141
1142- List <SmartGraphEdgeBase <E , V >> parallelEdges = new ArrayList <>();
1142+ List <SmartGraphEdgeNode <E , V >> parallelEdges = new ArrayList <>();
11431143
11441144 for (Map .Entry <Edge <E , V >, Tuple <Vertex <V >>> edgeTupleEntry : this .connections .entrySet ()) {
11451145 Edge <E , V > edge = edgeTupleEntry .getKey ();
@@ -1162,9 +1162,9 @@ private List<SmartGraphEdgeBase<E, V>> getEdgesBetween(SmartGraphVertexNode<V> v
11621162 */
11631163 private int getMaxMultiplicityIndexBetween (SmartGraphVertexNode <V > v , SmartGraphVertexNode <V > u ) {
11641164 int max = -1 ;
1165- for (SmartGraphEdgeBase <E , V > edge : edgeNodes .values ()) {
1166- SmartGraphVertexNode <V > in = edge .getInbound ();
1167- SmartGraphVertexNode <V > out = edge .getOutbound ();
1165+ for (SmartGraphEdgeNode <E , V > edge : edgeNodes .values ()) {
1166+ SmartGraphVertexNode <V > in = ( SmartGraphVertexNode < V >) edge .getInbound ();
1167+ SmartGraphVertexNode <V > out = ( SmartGraphVertexNode < V >) edge .getOutbound ();
11681168
11691169 if (in == v && out == u || in == u && out == v ) {
11701170 int cur = edge .getMultiplicityIndex ();
@@ -1233,9 +1233,9 @@ private Collection<Edge<E, V>> removedEdges() {
12331233 List <Edge <E , V >> removed = new LinkedList <>();
12341234
12351235 Collection <Edge <E , V >> graphEdges = theGraph .edges ();
1236- Collection <SmartGraphEdgeBase <E ,V >> plotted = edgeNodes .values ();
1236+ Collection <SmartGraphEdgeNode <E ,V >> plotted = edgeNodes .values ();
12371237
1238- for (SmartGraphEdgeBase <E ,V > e : plotted ) {
1238+ for (SmartGraphEdgeNode <E ,V > e : plotted ) {
12391239 if (!graphEdges .contains (e .getUnderlyingEdge ())) {
12401240 removed .add (e .getUnderlyingEdge ());
12411241 }
@@ -1376,7 +1376,7 @@ public SmartStylableNode getStylableLabel(Vertex<V> v) {
13761376 * @return stylable element (label)
13771377 */
13781378 public SmartStylableNode getStylableLabel (Edge <E ,V > e ) {
1379- SmartGraphEdgeBase <E ,V > edge = edgeNodes .get (e );
1379+ SmartGraphEdgeNode <E ,V > edge = edgeNodes .get (e );
13801380
13811381 return edge != null ? edge .getStylableLabel () : null ;
13821382 }
0 commit comments