summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/simulator/VSMenuItemStates.java110
-rw-r--r--sources/simulator/VSSimulator.java108
-rw-r--r--sources/simulator/VSSimulatorFrame.java10
3 files changed, 116 insertions, 112 deletions
diff --git a/sources/simulator/VSMenuItemStates.java b/sources/simulator/VSMenuItemStates.java
new file mode 100644
index 0000000..42edf96
--- /dev/null
+++ b/sources/simulator/VSMenuItemStates.java
@@ -0,0 +1,110 @@
+/*
+ * VS is (c) 2008 by Paul C. Buetow
+ * vs@dev.buetow.org
+ */
+package simulator;
+
+/**
+ * The Class VSMenuItemStates. Used by the VSSimulation to update the
+ * "simulation" bar of the VSSimulationFrame.
+ */
+public class VSMenuItemStates {
+ /** The pause. */
+ private volatile boolean pause;
+
+ /** The replay. */
+ private volatile boolean replay;
+
+ /** The reset. */
+ private volatile boolean reset;
+
+ /** The start. */
+ private volatile boolean start;
+
+ /**
+ * Instantiates a new lang.process.removemenu item states.
+ *
+ * @param pause the pause
+ * @param replay the replay
+ * @param reset the reset
+ * @param start the start
+ */
+ public VSMenuItemStates(boolean pause, boolean replay, boolean reset, boolean start) {
+ this.pause = pause;
+ this.replay = replay;
+ this.reset = reset;
+ this.start = start;
+ }
+
+ /**
+ * Sets the pause.
+ *
+ * @param pause the new pause
+ */
+ public void setPause(boolean pause) {
+ this.pause = pause;
+ }
+
+ /**
+ * Sets the replay.
+ *
+ * @param replay the new replay
+ */
+ public void setReplay(boolean replay) {
+ this.replay = replay;
+ }
+
+ /**
+ * Sets the reset.
+ *
+ * @param reset the new reset
+ */
+ public void setReset(boolean reset) {
+ this.reset = reset;
+ }
+
+ /**
+ * Sets the start.
+ *
+ * @param start the new start
+ */
+ public void setStart(boolean start) {
+ this.start = start;
+ }
+
+ /**
+ * Gets the pause.
+ *
+ * @return the pause
+ */
+ public boolean getPause() {
+ return pause;
+ }
+
+ /**
+ * Gets the replay.
+ *
+ * @return the replay
+ */
+ public boolean getReplay() {
+ return replay;
+ }
+
+ /**
+ * Gets the reset.
+ *
+ * @return the reset
+ */
+ public boolean getReset() {
+ return reset;
+ }
+
+ /**
+ * Gets the start.
+ *
+ * @return the start
+ */
+ public boolean getStart() {
+ return start;
+ }
+}
diff --git a/sources/simulator/VSSimulator.java b/sources/simulator/VSSimulator.java
index 66dbd77..8e5ccac 100644
--- a/sources/simulator/VSSimulator.java
+++ b/sources/simulator/VSSimulator.java
@@ -18,7 +18,6 @@ import prefs.*;
import prefs.editors.*;
import utils.*;
-// TODO: Auto-generated Javadoc
/**
* The Class VSSimulator.
*/
@@ -130,111 +129,6 @@ public class VSSimulator extends JPanel {
private static int simulationNum;
/**
- * The Class VSMenuItemStates.
- */
- public class VSMenuItemStates {
-
- /** The pause. */
- private volatile boolean pause;
-
- /** The replay. */
- private volatile boolean replay;
-
- /** The reset. */
- private volatile boolean reset;
-
- /** The start. */
- private volatile boolean start;
-
- /**
- * Instantiates a new lang.process.removemenu item states.
- *
- * @param pause the pause
- * @param replay the replay
- * @param reset the reset
- * @param start the start
- */
- public VSMenuItemStates(boolean pause, boolean replay, boolean reset, boolean start) {
- this.pause = pause;
- this.replay = replay;
- this.reset = reset;
- this.start = start;
- }
-
- /**
- * Sets the pause.
- *
- * @param pause the new pause
- */
- public void setPause(boolean pause) {
- this.pause = pause;
- }
-
- /**
- * Sets the replay.
- *
- * @param replay the new replay
- */
- public void setReplay(boolean replay) {
- this.replay = replay;
- }
-
- /**
- * Sets the reset.
- *
- * @param reset the new reset
- */
- public void setReset(boolean reset) {
- this.reset = reset;
- }
-
- /**
- * Sets the start.
- *
- * @param start the new start
- */
- public void setStart(boolean start) {
- this.start = start;
- }
-
- /**
- * Gets the pause.
- *
- * @return the pause
- */
- public boolean getPause() {
- return pause;
- }
-
- /**
- * Gets the replay.
- *
- * @return the replay
- */
- public boolean getReplay() {
- return replay;
- }
-
- /**
- * Gets the reset.
- *
- * @return the reset
- */
- public boolean getReset() {
- return reset;
- }
-
- /**
- * Gets the start.
- *
- * @return the start
- */
- public boolean getStart() {
- return start;
- }
- }
-
- /**
* Instantiates a new lang.process.removesimulator.
*
* @param prefs the prefs
@@ -1234,7 +1128,7 @@ public class VSSimulator extends JPanel {
*
* @return the menu item states
*/
- public VSSimulator.VSMenuItemStates getMenuItemStates() {
+ public VSMenuItemStates getMenuItemStates() {
return menuItemStates;
}
diff --git a/sources/simulator/VSSimulatorFrame.java b/sources/simulator/VSSimulatorFrame.java
index be06309..33d3074 100644
--- a/sources/simulator/VSSimulatorFrame.java
+++ b/sources/simulator/VSSimulatorFrame.java
@@ -284,7 +284,7 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener {
* Update simulation menu.
*/
public synchronized void updateSimulationMenu() {
- VSSimulator.VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
+ VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
pauseItem.setEnabled(menuItemState.getPause());
replayItem.setEnabled(menuItemState.getReplay());
@@ -340,7 +340,7 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener {
System.exit(0);
} else if (sourceText.equals(prefs.getString("lang.start"))) {
- VSSimulator.VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
+ VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
menuItemState.setStart(false);
menuItemState.setPause(true);
menuItemState.setReset(false);
@@ -349,7 +349,7 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener {
updateSimulationMenu();
} else if (sourceText.equals(prefs.getString("lang.pause"))) {
- VSSimulator.VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
+ VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
menuItemState.setStart(true);
menuItemState.setPause(false);
menuItemState.setReset(true);
@@ -358,7 +358,7 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener {
updateSimulationMenu();
} else if (sourceText.equals(prefs.getString("lang.reset"))) {
- VSSimulator.VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
+ VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
menuItemState.setStart(true);
menuItemState.setPause(false);
menuItemState.setReset(false);
@@ -367,7 +367,7 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener {
updateSimulationMenu();
} else if (sourceText.equals(prefs.getString("lang.replay"))) {
- VSSimulator.VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
+ VSMenuItemStates menuItemState = currentSimulation.getMenuItemStates();
menuItemState.setStart(false);
menuItemState.setPause(true);
menuItemState.setReset(false);