Eren Yilmaz 6 years ago
parent
commit
6d74b52538
2 changed files with 7 additions and 15 deletions
  1. 2 0
      src/bk/BKNodePlacement.java
  2. 5 15
      src/graph/LayeredNode.java

+ 2 - 0
src/bk/BKNodePlacement.java

@@ -65,11 +65,13 @@ public class BKNodePlacement extends AnimatedAlgorithm {
 
     @Override
     public StageStatus forwardStep() {
+        graph.unselectGraph();
         return forward( "forwardStep" );
     }
 
     @Override
     public StageStatus backwardStep() {
+        graph.unselectGraph();
         return backward( "backwardStep" );
     }
 

+ 5 - 15
src/graph/LayeredNode.java

@@ -330,29 +330,19 @@ public class LayeredNode implements LayeredGraphNode {
     @Override
     public boolean isSelected(LayoutType layout) {
         if (layout == LayoutType.TOP_BOTTOM_LEFT) {
-            boolean tmp = layouts[0].selected;
-            layouts[0].selected = false;
-            return tmp;
+            return layouts[0].selected;
         }
         if (layout == LayoutType.TOP_BOTTOM_RIGHT) {
-            boolean tmp = layouts[1].selected;
-            layouts[1].selected = false;
-            return tmp;
+            return layouts[1].selected;
         }
         if (layout == LayoutType.BOTTOM_TOP_LEFT) {
-            boolean tmp = layouts[2].selected;
-            layouts[2].selected = false;
-            return tmp;
+            return layouts[2].selected;
         }
         if (layout == LayoutType.BOTTOM_TOP_RIGHT) {
-            boolean tmp = layouts[3].selected;
-            layouts[3].selected = false;
-            return tmp;
+            return layouts[3].selected;
         }
         if (layout == LayoutType.COMBINED) {
-            boolean tmp = combined.selected;
-            combined.selected = false;
-            return tmp;
+            return combined.selected;
         }
         return false;
     }