From 8939a75ff2997b110397e137c34cdec1383aed30 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 9 Oct 2016 18:26:45 +0200 Subject: [PATCH] [TASK] Remove autoscroll checkbox. --- .../gui/FancyTextObserverWindow.java | 3 ++- .../java/lu/jpt/csparqlproject/rentacar/Car.java | 15 ++++++++++++--- .../rentacar/RentACarSimulation.java | 9 ++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main/java/lu/jpt/csparqlproject/gui/FancyTextObserverWindow.java b/src/main/java/lu/jpt/csparqlproject/gui/FancyTextObserverWindow.java index 9252e0c..5183fc6 100644 --- a/src/main/java/lu/jpt/csparqlproject/gui/FancyTextObserverWindow.java +++ b/src/main/java/lu/jpt/csparqlproject/gui/FancyTextObserverWindow.java @@ -208,7 +208,8 @@ public class FancyTextObserverWindow extends JFrame implements Observer { textObserverWindow.setAutoScrollToBottom(checkBox.isSelected()); } }); - bottomPanel.add(autoscrollCheckbox); + // TODO: Fix the feature first! + //bottomPanel.add(autoscrollCheckbox); // Add a checkbox to toggle uri shortening using PrefixManager JCheckBox usePrefixManagerCheckbox = new JCheckBox(); diff --git a/src/main/java/lu/jpt/csparqlproject/rentacar/Car.java b/src/main/java/lu/jpt/csparqlproject/rentacar/Car.java index e803b0b..3cf7f6b 100644 --- a/src/main/java/lu/jpt/csparqlproject/rentacar/Car.java +++ b/src/main/java/lu/jpt/csparqlproject/rentacar/Car.java @@ -235,20 +235,29 @@ public class Car { if(this.isCurrentActionHard && this.currentActionTicksLeft == 3) rpmBonus = 200; this.motorRpm += RandomHelper.getRandomNumberWithin(100, 350 + rpmBonus); this.speed += RandomHelper.getRandomNumberWithin(5, 20); - if(this.isCurrentActionHard) this.speed += 30; + if(this.isCurrentActionHard) { + this.speed += 40; + this.motorRpm += RandomHelper.getRandomNumberWithin(100, 350 + rpmBonus); + } break; case BRAKING: if(this.isCurrentActionHard && this.currentActionTicksLeft == 3) rpmBonus = 200; this.motorRpm -= RandomHelper.getRandomNumberWithin(100, 350 + rpmBonus); this.speed -= RandomHelper.getRandomNumberWithin(5, 20); - if(this.isCurrentActionHard) this.speed -= 30; + if(this.isCurrentActionHard) { + this.speed -= 40; + this.motorRpm -= RandomHelper.getRandomNumberWithin(100, 350 + rpmBonus); + } if(this.speed < 0) this.speed = 0; if(this.motorRpm < 0) this.motorRpm = Car.MIN_RPM[this.CAR_TYPE]; break; case HALTING: this.motorRpm -= RandomHelper.getRandomNumberWithin(100, 350 + rpmBonus); this.speed -= RandomHelper.getRandomNumberWithin(5, 20); - if(this.isCurrentActionHard) this.speed -= 30; + if(this.isCurrentActionHard) { + this.speed -= 40; + this.motorRpm -= RandomHelper.getRandomNumberWithin(100, 350 + rpmBonus); + } if(this.speed < 0) this.speed = 0; if(this.motorRpm < 0) this.motorRpm = Car.MIN_RPM[this.CAR_TYPE]; // Halt on last tick of halting action diff --git a/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java b/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java index dc77c75..76449ff 100644 --- a/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java +++ b/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java @@ -505,11 +505,10 @@ public class RentACarSimulation implements Runnable { + "PREFIX xsd: " + "PREFIX car: <"+RentACarSimulation.BASE_ONTOLOGY_IRI+"> " + "SELECT ?e ?car ?types " - + "FROM STREAM <"+RentACarSimulation.CAR_STREAM_IRI+"> [RANGE 3s STEP 1s] " - + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getEngineWear> [RANGE 3s STEP 1s] " - + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getBrakeWear> [RANGE 3s STEP 1s] " - + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getHandbrakeWear> [RANGE 3s STEP 1s] " - + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getTireWear> [RANGE 3s STEP 1s] " + + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getEngineWear> [RANGE 5s STEP 1s] " + + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getBrakeWear> [RANGE 5s STEP 1s] " + + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getHandbrakeWear> [RANGE 5s STEP 1s] " + + "FROM STREAM <"+RentACarSimulation.BASE_STREAM_IRI+"/getTireWear> [RANGE 5s STEP 1s] " + "WHERE { " + " ?e rdf:type car:CarWearEvent . " + " ?e rdf:type ?types . "