Add new ArcInspector and correct naming in GUI.

This commit is contained in:
Mikael Capelle 2018-03-28 14:14:14 +02:00
parent a269d66470
commit 8ff1fb8c17
2 changed files with 29 additions and 1 deletions

View file

@ -79,6 +79,34 @@ public class ArcInspectorFactory {
});
// Only road allowed for cars and time:
filters.add(new ArcInspector() {
@Override
public boolean isAllowed(Arc arc) {
return true;
}
@Override
public double getCost(Arc arc) {
return arc.getMinimumTravelTime();
}
@Override
public int getMaximumSpeed() {
return GraphStatistics.NO_MAXIMUM_SPEED;
}
@Override
public Mode getMode() {
return Mode.TIME;
}
@Override
public String toString() {
return "Fastest path, all roads allowed";
}
});
filters.add(new ArcInspector() {
@Override
public boolean isAllowed(Arc arc) {

View file

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