Browse Source

Add new ArcInspector and correct naming in GUI.

Mikael Capelle 3 years ago
parent
commit
8ff1fb8c17

+ 28
- 0
src/main/org/insa/algo/ArcInspectorFactory.java View File

@@ -79,6 +79,34 @@ public class ArcInspectorFactory {
79 79
         });
80 80
 
81 81
         // Only road allowed for cars and time:
82
+
83
+        filters.add(new ArcInspector() {
84
+            @Override
85
+            public boolean isAllowed(Arc arc) {
86
+                return true;
87
+            }
88
+
89
+            @Override
90
+            public double getCost(Arc arc) {
91
+                return arc.getMinimumTravelTime();
92
+            }
93
+
94
+            @Override
95
+            public int getMaximumSpeed() {
96
+                return GraphStatistics.NO_MAXIMUM_SPEED;
97
+            }
98
+
99
+            @Override
100
+            public Mode getMode() {
101
+                return Mode.TIME;
102
+            }
103
+
104
+            @Override
105
+            public String toString() {
106
+                return "Fastest path, all roads allowed";
107
+            }
108
+        });
109
+
82 110
         filters.add(new ArcInspector() {
83 111
             @Override
84 112
             public boolean isAllowed(Arc arc) {

+ 1
- 1
src/main/org/insa/graphics/AlgorithmPanel.java View File

@@ -194,7 +194,7 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
194 194
             c.gridy = 1;
195 195
             c.gridx = 0;
196 196
             c.weightx = 0;
197
-            modeAndObserverPanel.add(new JLabel("Restrictions: "), c);
197
+            modeAndObserverPanel.add(new JLabel("Mode: "), c);
198 198
             c.gridx = 1;
199 199
             c.gridwidth = 2;
200 200
             c.weightx = 1;

Loading…
Cancel
Save