summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/core/VSMessage.java4
-rw-r--r--sources/core/VSTask.java31
-rw-r--r--sources/core/VSTaskManager.java39
-rw-r--r--sources/core/time/VSLamportTime.java3
-rw-r--r--sources/core/time/VSVectorTime.java3
-rw-r--r--sources/events/internal/VSAbstractInternalEvent.java74
-rw-r--r--sources/events/internal/VSMessageReceiveEvent.java43
-rw-r--r--sources/events/internal/VSProtocolEvent.java4
-rw-r--r--sources/events/internal/VSProtocolScheduleEvent.java7
-rw-r--r--sources/prefs/2DOCUMENT0
-rw-r--r--sources/prefs/VSDefaultPrefs.java8
-rw-r--r--sources/prefs/VSPrefs.java78
-rw-r--r--sources/prefs/VSPrefsRestriction.java6
-rw-r--r--sources/prefs/editors/2DOCUMENT0
-rw-r--r--sources/prefs/editors/VSAbstractBetterEditor.java21
-rw-r--r--sources/prefs/editors/VSAbstractEditor.java227
-rw-r--r--sources/prefs/editors/VSColorChooser.java15
-rw-r--r--sources/prefs/editors/VSEditorFrame.java19
-rw-r--r--sources/prefs/editors/VSEditorTable.java76
-rw-r--r--sources/prefs/editors/VSProcessEditor.java37
-rw-r--r--sources/prefs/editors/VSSimulatorEditor.java21
-rw-r--r--sources/protocols/VSAbstractProtocol.java37
-rw-r--r--sources/serialize/VSNotSerializable.java34
-rw-r--r--sources/serialize/VSSerializable.java7
-rw-r--r--sources/serialize/VSSerialize.java5
-rw-r--r--sources/simulator/VSMain.java7
-rw-r--r--sources/simulator/VSSimulator.java2
-rw-r--r--sources/simulator/VSSimulatorCanvas.java42
-rw-r--r--sources/simulator/VSSimulatorFrame.java45
29 files changed, 582 insertions, 313 deletions
diff --git a/sources/core/VSMessage.java b/sources/core/VSMessage.java
index 99c5ce7..1f1ad5b 100644
--- a/sources/core/VSMessage.java
+++ b/sources/core/VSMessage.java
@@ -28,8 +28,8 @@ import events.*;
import prefs.VSPrefs;
/**
- * This class represents a message which is send from one process to another
- * process in the simulator.
+ * An object of this class represents a message which is sent from one process
+ * to another process in the simulator.
*
* @author Paul C. Buetow
*/
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java
index c1323e8..9ca04e6 100644
--- a/sources/core/VSTask.java
+++ b/sources/core/VSTask.java
@@ -99,7 +99,7 @@ public class VSTask implements Comparable, VSSerializable {
* Instantiates a new task during a deserialization.
*
* @param serialize the serialize object
- * @param process the object input stream
+ * @param objectInputStream The input stream
*/
public VSTask(VSSerialize serialize, ObjectInputStream objectInputStream)
throws IOException, ClassNotFoundException {
@@ -154,11 +154,29 @@ public class VSTask implements Comparable, VSSerializable {
}
/**
+ * Checks if the task is using an "internal event".
+ *
+ * @return true, if the task is using an internal event
+ */
+ public boolean hasInternalEvent() {
+ return event instanceof VSAbstractInternalEvent;
+ }
+
+ /**
+ * Checks if the task should not get serialized.
+ *
+ * @return true, if the task should not get serialized
+ */
+ public boolean hasNotSerializableEvent() {
+ return event instanceof VSNotSerializable;
+ }
+
+ /**
* Checks if the task is a message receive event.
*
* @return true, if it is a message receive event
*/
- public boolean isVSMessageReceiveEvent() {
+ public boolean hasMessageReceiveEvent() {
return event instanceof VSMessageReceiveEvent;
}
@@ -167,7 +185,7 @@ public class VSTask implements Comparable, VSSerializable {
*
* @return true, if it is a process recover event
*/
- public boolean isProcessRecoverEvent() {
+ public boolean hasProcessRecoverEvent() {
return event instanceof VSProcessRecoverEvent;
}
@@ -366,6 +384,13 @@ public class VSTask implements Comparable, VSSerializable {
objectOutputStream.writeObject(new Boolean(false));
objectOutputStream.writeObject(new Integer(process.getProcessNum()));
+
+ if (event.getClassname() == null)
+ event.init(process);
+
+ if (VSSerialize.DEBUG)
+ System.out.println("Serializing: " + event.getClassname());
+
objectOutputStream.writeObject(event.getClassname());
objectOutputStream.writeObject(new Integer(event.getID()));
event.serialize(serialize, objectOutputStream);
diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java
index d4ee83c..471b54f 100644
--- a/sources/core/VSTaskManager.java
+++ b/sources/core/VSTaskManager.java
@@ -32,10 +32,9 @@ import simulator.*;
import utils.*;
/**
- * The class VSTaskManager. The task manager is responsible that all tasks
- * will get fullfilled in the correct order. Please also read the javadoc
- * of the VSTask class. It describes the difference between local and global
- * timed tasks.
+ * The class VSTaskManager, it is responsible that all tasks will get
+ * fullfilled in the correct order. Please also read the javadoc of the VSTask
+ * class. It describes the difference between local and global timed tasks.
*
* @author Paul C. Buetow
*/
@@ -125,7 +124,7 @@ public class VSTaskManager implements VSSerializable {
globalTasks.poll();
redo = true;
- if (process.isCrashed() && !task.isProcessRecoverEvent()) {
+ if (process.isCrashed() && !task.hasProcessRecoverEvent()) {
if (task.isProgrammed())
fullfilledProgrammedTasks.add(task);
continue;
@@ -186,7 +185,7 @@ public class VSTaskManager implements VSSerializable {
redo = true;
if (process.isCrashed() &&
- !task.isProcessRecoverEvent()) {
+ !task.hasProcessRecoverEvent()) {
if (task.isProgrammed())
fullfilledProgrammedTasks.add(task);
continue;
@@ -506,28 +505,34 @@ public class VSTaskManager implements VSSerializable {
/** For later backwards compatibility, to add more stuff */
objectOutputStream.writeObject(new Boolean(false));
- ArrayList<VSTask> tasks = new ArrayList<VSTask>();
+ ArrayList<VSTask> serializeThoseTasks = new ArrayList<VSTask>();
- for (VSTask task : fullfilledProgrammedTasks)
- tasks.add(task);
+ for (VSTask task : fullfilledProgrammedTasks) {
+ if (!task.hasNotSerializableEvent())
+ serializeThoseTasks.add(task);
+ }
- for (VSTask task : this.globalTasks)
- tasks.add(task);
+ for (VSTask task : globalTasks) {
+ if (!task.hasNotSerializableEvent())
+ serializeThoseTasks.add(task);
+ }
ArrayList<VSProcess> processes = simulatorCanvas.getProcesses();
synchronized (processes) {
for (VSProcess process : processes) {
VSPriorityQueue<VSTask> localTasks = process.getTasks();
- ArrayList<VSTask> tasks_ = new ArrayList<VSTask>();
- for (VSTask task : localTasks)
- tasks.add(task);
+ for (VSTask task : localTasks) {
+ if (!task.hasNotSerializableEvent())
+ serializeThoseTasks.add(task);
+ }
}
}
- objectOutputStream.writeObject(new Integer(tasks.size()));
- for (VSTask task : tasks)
- task.serialize(serialize, objectOutputStream);
+ objectOutputStream.writeObject(
+ new Integer(serializeThoseTasks.size()));
+ for (VSTask task : serializeThoseTasks)
+ task.serialize(serialize, objectOutputStream);
/** For later backwards compatibility, to add more stuff */
objectOutputStream.writeObject(new Boolean(false));
diff --git a/sources/core/time/VSLamportTime.java b/sources/core/time/VSLamportTime.java
index aab598a..165adfc 100644
--- a/sources/core/time/VSLamportTime.java
+++ b/sources/core/time/VSLamportTime.java
@@ -24,8 +24,7 @@
package core.time;
/**
- * The class VSLamportTime. This class defined how the lamport
- * timestamps are represented.
+ * The class VSLamportTime, defines how the lamport timestamps are represented.
*
* @author Paul C. Buetow
*/
diff --git a/sources/core/time/VSVectorTime.java b/sources/core/time/VSVectorTime.java
index 1c30af6..ebd5438 100644
--- a/sources/core/time/VSVectorTime.java
+++ b/sources/core/time/VSVectorTime.java
@@ -26,8 +26,7 @@ package core.time;
import java.util.ArrayList;
/**
- * The class VSVectorTime. This class defined how the vector
- * timestamps are represented.
+ * The class VSVectorTime, defined how the vector timestamps are represented.
*
* @author Paul C. Buetow
*/
diff --git a/sources/events/internal/VSAbstractInternalEvent.java b/sources/events/internal/VSAbstractInternalEvent.java
new file mode 100644
index 0000000..10a23b7
--- /dev/null
+++ b/sources/events/internal/VSAbstractInternalEvent.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * All icons of the icons/ folder are under a Creative Commons
+ * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
+ *
+ * The icon's homepage is http://code.google.com/p/ultimate-gnome/
+ */
+
+package events.internal;
+
+import java.io.*;
+
+import events.VSAbstractEvent;
+import serialize.VSSerialize;
+
+/**
+ * The class VSAbstractInternalEvent, this class if for destinguishing between
+ * internal and non-internal events. Internal usage only.
+ *
+ * @author Paul C. Buetow
+ */
+abstract public class VSAbstractInternalEvent extends VSAbstractEvent {
+ /** The serial version uid */
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see serialize.VSSerializable#serialize(serialize.VSSerialize,
+ * java.io.ObjectOutputStream)
+ */
+ public synchronized void serialize(VSSerialize serialize,
+ ObjectOutputStream objectOutputStream)
+ throws IOException {
+ super.serialize(serialize, objectOutputStream);
+
+ /** For later backwards compatibility, to add more stuff */
+ objectOutputStream.writeObject(new Boolean(false));
+
+ /** For later backwards compatibility, to add more stuff */
+ objectOutputStream.writeObject(new Boolean(false));
+ }
+
+ /* (non-Javadoc)
+ * @see serialize.VSSerializable#deserialize(serialize.VSSerialize,
+ * java.io.ObjectInputStream)
+ */
+ @SuppressWarnings("unchecked")
+ public synchronized void deserialize(VSSerialize serialize,
+ ObjectInputStream objectInputStream)
+ throws IOException, ClassNotFoundException {
+ super.deserialize(serialize, objectInputStream);
+
+ if (VSSerialize.DEBUG)
+ System.out.println("Deserializing: VSAbstractInternalEvent");
+
+ /** For later backwards compatibility, to add more stuff */
+ objectInputStream.readObject();
+
+ }
+}
diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java
index 8972ce5..072c2d6 100644
--- a/sources/events/internal/VSMessageReceiveEvent.java
+++ b/sources/events/internal/VSMessageReceiveEvent.java
@@ -26,9 +26,8 @@ package events.internal;
import java.io.*;
import core.VSMessage;
-import events.VSAbstractEvent;
import protocols.VSAbstractProtocol;
-import serialize.VSSerialize;
+import serialize.VSNotSerializable;
/**
* The class VSMessageReceiveEvent. This event is used if a process receives
@@ -36,7 +35,8 @@ import serialize.VSSerialize;
*
* @author Paul C. Buetow
*/
-public class VSMessageReceiveEvent extends VSAbstractEvent {
+public class VSMessageReceiveEvent extends VSAbstractInternalEvent
+implements VSNotSerializable {
/** The serioal version uid */
private static final long serialVersionUID = 1L;
@@ -109,41 +109,4 @@ public class VSMessageReceiveEvent extends VSAbstractEvent {
return true;
}
-
- /* (non-Javadoc)
- * @see serialize.VSSerializable#serialize(serialize.VSSerialize,
- * java.io.ObjectOutputStream)
- */
- public synchronized void serialize(VSSerialize serialize,
- ObjectOutputStream objectOutputStream)
- throws IOException {
- super.serialize(serialize, objectOutputStream);
-
- /** For later backwards compatibility, to add more stuff */
- objectOutputStream.writeObject(new Boolean(false));
-
- /** For later backwards compatibility, to add more stuff */
- objectOutputStream.writeObject(new Boolean(false));
- }
-
- /* (non-Javadoc)
- * @see serialize.VSSerializable#deserialize(serialize.VSSerialize,
- * java.io.ObjectInputStream)
- */
- @SuppressWarnings("unchecked")
- public synchronized void deserialize(VSSerialize serialize,
- ObjectInputStream objectInputStream)
- throws IOException, ClassNotFoundException {
- super.deserialize(serialize, objectInputStream);
-
- if (VSSerialize.DEBUG)
- System.out.println("Deserializing: VSProtocolEvent");
-
- /** For later backwards compatibility, to add more stuff */
- objectInputStream.readObject();
-
- /** For later backwards compatibility, to add more stuff */
- objectInputStream.readObject();
-
- }
}
diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java
index 8d6b2dd..ba110c0 100644
--- a/sources/events/internal/VSProtocolEvent.java
+++ b/sources/events/internal/VSProtocolEvent.java
@@ -30,7 +30,7 @@ import protocols.VSAbstractProtocol;
import serialize.VSSerialize;
/**
- * The class VSProtocolEvent. This event is used if a protocol (server or
+ * The class VSProtocolEvent, this event is used if a protocol (server or
* client part) of a process gets enabled or disabled, an object of this class
* can be for 4 different purporses! Activation of the client protocol,
* deactivation of the client protocol, activation of the server protocol,
@@ -38,7 +38,7 @@ import serialize.VSSerialize;
*
* @author Paul C. Buetow
*/
-public class VSProtocolEvent extends VSAbstractEvent {
+public class VSProtocolEvent extends VSAbstractInternalEvent {
/** The serial version uid */
private static final long serialVersionUID = 1L;
diff --git a/sources/events/internal/VSProtocolScheduleEvent.java b/sources/events/internal/VSProtocolScheduleEvent.java
index 99ae020..3c334be 100644
--- a/sources/events/internal/VSProtocolScheduleEvent.java
+++ b/sources/events/internal/VSProtocolScheduleEvent.java
@@ -27,16 +27,17 @@ import java.io.*;
import events.*;
import protocols.VSAbstractProtocol;
-import serialize.VSSerialize;
+import serialize.*;
/**
- * The class VSProtocolScheduleEvent. This event is used if a protocol (which
+ * The class VSProtocolScheduleEvent, this event is used if a protocol (which
* is a subclass of VSAbstractProtocol) reschedules itself to run again on a
* specific time.
*
* @author Paul C. Buetow
*/
-public class VSProtocolScheduleEvent extends VSAbstractEvent {
+public class VSProtocolScheduleEvent extends VSAbstractInternalEvent
+implements VSNotSerializable {
/** The serial version uid */
private static final long serialVersionUID = 1L;
diff --git a/sources/prefs/2DOCUMENT b/sources/prefs/2DOCUMENT
deleted file mode 100644
index e69de29..0000000
--- a/sources/prefs/2DOCUMENT
+++ /dev/null
diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java
index bbf3c5f..e8ac8b5 100644
--- a/sources/prefs/VSDefaultPrefs.java
+++ b/sources/prefs/VSDefaultPrefs.java
@@ -27,9 +27,14 @@ import java.awt.Color;
import java.awt.event.KeyEvent;
/**
- * The class VSDefaultPrefs.
+ * The class VSDefaultPrefs, makes sure that the simulator has its default
+ * configuration values. (Btw: This is the only class which is allowed to have
+ * code lines which are longer than 80 chars!)
+ *
+ * @author Paul C. Buetow
*/
public class VSDefaultPrefs extends VSPrefs {
+ /** The serial version uid */
private static final long serialVersionUID = 1L;
/**
@@ -256,5 +261,6 @@ public class VSDefaultPrefs extends VSPrefs {
initBoolean("sim.message.own.recv", false, "Prozesse empfangen eigene Nachrichten");
initBoolean("sim.message.prob.mean", true, "Mittelwerte der Nachrichtausfallw'k. bilden");
initBoolean("sim.messages.relevant", true, "Nur alle relevanten Nachrichten ausliefern");
+ initBoolean("sim.periodic", false, "Simulation periodisch wiederholen");
}
}
diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java
index f17732c..e9ede88 100644
--- a/sources/prefs/VSPrefs.java
+++ b/sources/prefs/VSPrefs.java
@@ -30,7 +30,10 @@ import java.util.*;
import serialize.*;
/**
- * The class VSPrefs.
+ * The class VSPrefs, this class is for dynamic data storage. It can hold
+ * various different types such as Boolean, Floats, Integers, Strings, Colors.
+ *
+ * @author Paul C. Buetow
*/
public class VSPrefs implements VSSerializable {
/** The Constant BOOLEAN_PREFIX. */
@@ -90,9 +93,6 @@ public class VSPrefs implements VSSerializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 4L;
- /** The Constant PREFERENCES_FILENAME. */
- protected final static String PREFERENCES_FILENAME = "vs.dat";
-
/** The id counter. */
private static int idCounter;
@@ -201,7 +201,8 @@ public class VSPrefs implements VSSerializable {
* @param key the key
* @param settingRestriction the setting restriction
*/
- public synchronized void initRestriction(String key, VSPrefsRestriction settingRestriction) {
+ public synchronized void initRestriction(String key,
+ VSPrefsRestriction settingRestriction) {
restrictions.put(key, settingRestriction);
}
@@ -589,7 +590,8 @@ public class VSPrefs implements VSSerializable {
* @param descr the descr
* @param r the restriction
*/
- public void initInteger(String key, int val, String descr, VSPrefsRestriction.VSIntegerPrefRestriction r) {
+ public void initInteger(String key, int val, String descr,
+ VSPrefsRestriction.VSIntegerPrefsRestriction r) {
initInteger(key, val, descr);
initRestriction(INTEGER_PREFIX + key, r);
}
@@ -602,7 +604,9 @@ public class VSPrefs implements VSSerializable {
* @param descr the descr
* @param r the restriction
*/
- public void initInteger(String key, int val, String descr, VSPrefsRestriction.VSIntegerPrefRestriction r, String unit) {
+ public void initInteger(String key, int val, String descr,
+ VSPrefsRestriction.VSIntegerPrefsRestriction r,
+ String unit) {
initInteger(key, val, descr, r);
initUnit(INTEGER_PREFIX + key, unit);
}
@@ -616,9 +620,11 @@ public class VSPrefs implements VSSerializable {
* @param minValue the min value
* @param maxValue the max value
*/
- public void initInteger(String key, int val, String descr, int minValue, int maxValue) {
+ public void initInteger(String key, int val, String descr, int minValue,
+ int maxValue) {
initInteger(key, val, descr,
- new VSPrefsRestriction.VSIntegerPrefRestriction(minValue, maxValue));
+ new VSPrefsRestriction.VSIntegerPrefsRestriction(
+ minValue, maxValue));
}
/**
@@ -631,7 +637,8 @@ public class VSPrefs implements VSSerializable {
* @param maxValue the max value
* @param unit the unit
*/
- public void initInteger(String key, int val, String descr, int minValue, int maxValue, String unit) {
+ public void initInteger(String key, int val, String descr, int minValue,
+ int maxValue, String unit) {
initInteger(key, val, descr, minValue, maxValue);
initUnit(INTEGER_PREFIX + key, unit);
}
@@ -716,7 +723,8 @@ public class VSPrefs implements VSSerializable {
* @param val the val
* @param descr the descr
*/
- public void initVector(String key, Vector<Integer> val, String descr, String unit) {
+ public void initVector(String key, Vector<Integer> val, String descr,
+ String unit) {
initVector(key, val, descr);
initUnit(VECTOR_PREFIX + key, unit);
}
@@ -932,11 +940,6 @@ public class VSPrefs implements VSSerializable {
*/
public void fillWithDefaults() {}
- @SuppressWarnings("unchecked")
- public synchronized void readObject(ObjectInputStream objectInputStream)
- throws IOException, ClassNotFoundException {
- }
-
/* (non-Javadoc)
* @see serialize.VSSerializable#serialize(serialize.VSSerialize,
* java.io.ObjectOutputStream)
@@ -974,16 +977,23 @@ public class VSPrefs implements VSSerializable {
/** For later backwards compatibility, to add more stuff */
objectInputStream.readObject();
- booleanPrefs = (HashMap<String,Boolean>) objectInputStream.readObject();
- colorPrefs = (HashMap<String,Color>) objectInputStream.readObject();
+ booleanPrefs = (HashMap<String,Boolean>)
+ objectInputStream.readObject();
+ colorPrefs = (HashMap<String,Color>)
+ objectInputStream.readObject();
descriptionPrefs = (HashMap<String,String>)
objectInputStream.readObject();
- floatPrefs = (HashMap<String,Float>) objectInputStream.readObject();
- integerPrefs = (HashMap<String,Integer>) objectInputStream.readObject();
- longPrefs = (HashMap<String,Long>) objectInputStream.readObject();
+ floatPrefs = (HashMap<String,Float>)
+ objectInputStream.readObject();
+ integerPrefs = (HashMap<String,Integer>)
+ objectInputStream.readObject();
+ longPrefs = (HashMap<String,Long>)
+ objectInputStream.readObject();
restrictions = new HashMap<String,VSPrefsRestriction>();
- stringPrefs = (HashMap<String,String>) objectInputStream.readObject();
- units = (HashMap<String,String>) objectInputStream.readObject();
+ stringPrefs = (HashMap<String,String>)
+ objectInputStream.readObject();
+ units = (HashMap<String,String>)
+ objectInputStream.readObject();
vectorPrefs = (HashMap<String,Vector<Integer>>)
objectInputStream.readObject();
@@ -992,7 +1002,7 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Copy integers.
+ * Copies integers into another VSPrefs object.
*
* @param copyInto the copy into
* @param keys the keys
@@ -1002,13 +1012,13 @@ public class VSPrefs implements VSSerializable {
copyInto.initInteger(key,
getInteger(key),
getDescription(INTEGER_PREFIX + key),
- (VSPrefsRestriction.VSIntegerPrefRestriction)
+ (VSPrefsRestriction.VSIntegerPrefsRestriction)
getRestriction(INTEGER_PREFIX + key),
getUnit(INTEGER_PREFIX + key));
}
/**
- * Copy longs.
+ * Copies longs into another VSPrefs object.
*
* @param copyInto the copy into
* @param keys the keys
@@ -1021,7 +1031,7 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Copy floats.
+ * Copies floats into another VSPrefs object.
*
* @param copyInto the copy into
* @param keys the keys
@@ -1034,7 +1044,7 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Copy strings.
+ * Copies strings into another VSPrefs object.
*
* @param copyInto the copy into
* @param keys the keys
@@ -1046,7 +1056,7 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Copy colors.
+ * Copies color references into another VSPrefs object.
*
* @param copyInto the copy into
* @param keys the keys
@@ -1058,7 +1068,7 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Copy colors.
+ * Copies colors.
*
* @param copyInto the copy into
* @param keys the keys
@@ -1135,9 +1145,9 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Checks if is empty.
+ * Checks if the prefs are empty.
*
- * @return true, if is empty
+ * @return true, if empty
*/
public boolean isEmpty() {
if (!colorPrefs.isEmpty())
@@ -1165,9 +1175,9 @@ public class VSPrefs implements VSSerializable {
}
/**
- * Return all full keys
+ * Returns all full keys.
*
- * @return Allf ull keys
+ * @return All full keys
*/
public ArrayList<String> getAllFullKeys() {
ArrayList<String> allKeys = new ArrayList<String>();
diff --git a/sources/prefs/VSPrefsRestriction.java b/sources/prefs/VSPrefsRestriction.java
index 5a716bd..f66246c 100644
--- a/sources/prefs/VSPrefsRestriction.java
+++ b/sources/prefs/VSPrefsRestriction.java
@@ -33,9 +33,9 @@ public class VSPrefsRestriction implements Serializable {
private static final long serialVersionUID = 1L;
/**
- * The class VSIntegerPrefRestriction.
+ * The class VSIntegerPrefsRestriction.
*/
- public static class VSIntegerPrefRestriction extends VSPrefsRestriction {
+ public static class VSIntegerPrefsRestriction extends VSPrefsRestriction {
private static final long serialVersionUID = 1L;
/** The min value. */
private int minValue;
@@ -49,7 +49,7 @@ public class VSPrefsRestriction implements Serializable {
* @param minValue the min value
* @param maxValue the max value
*/
- public VSIntegerPrefRestriction(int minValue, int maxValue) {
+ public VSIntegerPrefsRestriction(int minValue, int maxValue) {
this.minValue = minValue;
this.maxValue = maxValue;
}
diff --git a/sources/prefs/editors/2DOCUMENT b/sources/prefs/editors/2DOCUMENT
deleted file mode 100644
index e69de29..0000000
--- a/sources/prefs/editors/2DOCUMENT
+++ /dev/null
diff --git a/sources/prefs/editors/VSAbstractBetterEditor.java b/sources/prefs/editors/VSAbstractBetterEditor.java
index 47ae1a7..8779e56 100644
--- a/sources/prefs/editors/VSAbstractBetterEditor.java
+++ b/sources/prefs/editors/VSAbstractBetterEditor.java
@@ -30,11 +30,13 @@ import javax.swing.*;
import prefs.*;
import utils.*;
-// TODO: Auto-generated Javadoc
/**
- * The class VSAbstractBetterEditor.
+ * The class VSAbstractBetterEditor, is an improved VSAbstractEditor.
+ *
+ * @author Paul C. Buetow
*/
public abstract class VSAbstractBetterEditor extends VSAbstractEditor {
+ /** The serial version uid */
private static final long serialVersionUID = 1L;
/** The content pane. */
@@ -47,13 +49,14 @@ public abstract class VSAbstractBetterEditor extends VSAbstractEditor {
private String title;
/**
- * Instantiates a new lang.process.removebetter editor.
+ * An simple constructor.
*
* @param prefs the prefs
* @param prefsToEdit the prefs to edit
* @param title the title
*/
- public VSAbstractBetterEditor(VSPrefs prefs, VSPrefs prefsToEdit, String title) {
+ public VSAbstractBetterEditor(VSPrefs prefs, VSPrefs prefsToEdit,
+ String title) {
super(prefs, prefsToEdit);
this.title = title;
this.contentPane = createContentPane();
@@ -100,12 +103,14 @@ public abstract class VSAbstractBetterEditor extends VSAbstractEditor {
}
/* (non-Javadoc)
- * @see prefs.editors.VSAbstractEditor#addToButtonPanelFront(javax.swing.JPanel)
+ * @see prefs.editors.VSAbstractEditor#addToButtonPanelFront(
+ * javax.swing.JPanel)
*/
protected void addToButtonPanelFront(JPanel buttonPanel) { }
/* (non-Javadoc)
- * @see prefs.editors.VSAbstractEditor#addToButtonPanelLast(javax.swing.JPanel)
+ * @see prefs.editors.VSAbstractEditor#addToButtonPanelLast(
+ * javax.swing.JPanel)
*/
protected void addToButtonPanelLast(JPanel buttonPanel) { }
@@ -115,11 +120,11 @@ public abstract class VSAbstractBetterEditor extends VSAbstractEditor {
protected void addToEditTableLast() { }
/* (non-Javadoc)
- * @see prefs.editors.VSAbstractEditor#actionPerformed(java.awt.event.ActionEvent)
+ * @see prefs.editors.VSAbstractEditor#actionPerformed(
+ * java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
//String actionCommand = e.getActionCommand();
-
/* More action in the super class!!! */
super.actionPerformed(e);
}
diff --git a/sources/prefs/editors/VSAbstractEditor.java b/sources/prefs/editors/VSAbstractEditor.java
index f4d913a..a3f5fe3 100644
--- a/sources/prefs/editors/VSAbstractEditor.java
+++ b/sources/prefs/editors/VSAbstractEditor.java
@@ -31,11 +31,14 @@ import java.util.*;
import utils.*;
import prefs.*;
-// TODO: Auto-generated Javadoc
/**
- * The class VSAbstractEditor.
+ * The class VSAbstractEditor, an object of this class is used in order to
+ * edit a VSPrefs object.
+ *
+ * @author Paul C. Buetow
*/
public abstract class VSAbstractEditor implements ActionListener {
+ /** The serial version uid */
private static final long serialVersionUID = 1L;
/** The boolean keys. */
@@ -117,7 +120,7 @@ public abstra