From c015d586d22b69078b6da61858e5675793856b0b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 25 May 2008 08:10:13 +0000 Subject: JAutoDoc :) --- sources/prefs/VSDefaultPrefs.java | 42 ++ sources/prefs/VSPrefs.java | 596 +++++++++++++++++++++++++++ sources/prefs/editors/VSBetterEditor.java | 55 +++ sources/prefs/editors/VSColorChooser.java | 25 ++ sources/prefs/editors/VSEditor.java | 253 ++++++++++++ sources/prefs/editors/VSEditorFrame.java | 30 ++ sources/prefs/editors/VSEditorTable.java | 110 +++++ sources/prefs/editors/VSProcessEditor.java | 28 ++ sources/prefs/editors/VSSimulatorEditor.java | 35 ++ 9 files changed, 1174 insertions(+) (limited to 'sources/prefs') diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java index f41692b..5363967 100644 --- a/sources/prefs/VSDefaultPrefs.java +++ b/sources/prefs/VSDefaultPrefs.java @@ -1,19 +1,43 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs; import java.awt.Color; import java.awt.event.KeyEvent; +// TODO: Auto-generated Javadoc +/** + * The Class VSDefaultPrefs. + */ public class VSDefaultPrefs extends VSPrefs { + + /** + * Inits the. + * + * @return the vS prefs + */ public static VSPrefs init() { return init(VSPrefs.PREFERENCES_FILENAME); } + /** + * Inits the. + * + * @param fileName the file name + * + * @return the vS prefs + */ public static VSPrefs init(String fileName) { VSPrefs prefs = new VSDefaultPrefs(); prefs.fillWithDefaults(); return prefs; } + /* (non-Javadoc) + * @see prefs.VSPrefs#fillWithDefaults() + */ public void fillWithDefaults() { super.clear(); fillDefaultBooleans(); @@ -24,6 +48,9 @@ public class VSDefaultPrefs extends VSPrefs { fillDefaultStrings(); } + /* (non-Javadoc) + * @see prefs.VSPrefs#fillDefaultStrings() + */ public void fillDefaultStrings() { initString("lang.about", "About"); initString("lang.about.info!", "Dieses Programm wurde von Paul Bütow im Rahmen der Diplomarbeit \"Objektorientierte Entwicklung eines GUI-basierten Tools für die ereignisbasierte Simulation verteilter Systeme\" bei Prof. Dr.-Ing. Oßmann erstellt. Dieses Programm stellt noch keinesfalls eine fertige Version dar, da es sich noch in Entwicklung befindet und die Diplomarbeit erst mitte August abgeschlossen sein wird! Bei Fehlern bitte eine kurze Mail mitsamt Fehlerbeschreibung an paul@buetow.org schicken! Dieser Simulator wird später außerdem unter einer open source Linzenz (wahrscheinlich der GNU General Public License) freigegeben!"); @@ -129,6 +156,9 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.window.new", "Neues Fenster"); } + /* (non-Javadoc) + * @see prefs.VSPrefs#fillDefaultIntegers() + */ public void fillDefaultIntegers() { /* Simulation prefs */ initInteger("sim.process.num", 3, "Anzahl der Prozesse", 1, 6); @@ -168,18 +198,27 @@ public class VSDefaultPrefs extends VSPrefs { initIntegerUnit("div.window.ysize", 768, "Hauptfenster Y-Achse", 600, 2400, "px"); } + /* (non-Javadoc) + * @see prefs.VSPrefs#fillDefaultFloats() + */ public void fillDefaultFloats() { /* Simulation prefs */ initFloat("process.clock.variance", 0, "Uhrabweichung"); initFloat("sim.clock.speed", 0.5f, "Simulationsgeschwindigkeit"); } + /** + * Fill default longs. + */ public void fillDefaultLongs() { /* Simulation prefs */ initLongUnit("message.sendingtime.min", 500, "Minimale Übertragungszeit", "ms"); initLongUnit("message.sendingtime.max", 2000, "Maximale Übertragungszeit", "ms"); } + /* (non-Javadoc) + * @see prefs.VSPrefs#fillDefaultColors() + */ public void fillDefaultColors() { /* Internal prefs */ initColor("col.background", new Color(0xFF, 0xFF, 0xFF)); @@ -196,6 +235,9 @@ public class VSDefaultPrefs extends VSPrefs { initColor("col.message.lost", new Color(0xFF, 0x00, 0x00)); } + /* (non-Javadoc) + * @see prefs.VSPrefs#fillDefaultBooleans() + */ public void fillDefaultBooleans() { //initBoolean("message.broadcast", false, "Nachrichten sind immer Broadcasts"); initBoolean("sim.mode.expert", false, "Expertenmodus aktivieren"); diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java index 7211219..65dfcde 100644 --- a/sources/prefs/VSPrefs.java +++ b/sources/prefs/VSPrefs.java @@ -1,55 +1,139 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs; import java.awt.Color; import java.io.*; import java.util.*; +// TODO: Auto-generated Javadoc +/** + * The Class VSPrefs. + */ public abstract class VSPrefs implements Serializable { + + /** The Constant BOOLEAN_PREFIX. */ public static final String BOOLEAN_PREFIX = "Boolean: "; + + /** The Constant COLOR_PREFIX. */ public static final String COLOR_PREFIX = "Color: "; + + /** The Constant FLOAT_PREFIX. */ public static final String FLOAT_PREFIX = "Float: "; + + /** The Constant INTEGER_PREFIX. */ public static final String INTEGER_PREFIX = "Integer: "; + + /** The Constant LONG_PREFIX. */ public static final String LONG_PREFIX = "Long: "; + + /** The Constant STRING_PREFIX. */ public static final String STRING_PREFIX = "String: "; + + /** The color prefs. */ private HashMap colorPrefs; + + /** The float prefs. */ private HashMap floatPrefs; + + /** The integer prefs. */ private HashMap integerPrefs; + + /** The long prefs. */ private HashMap longPrefs; + + /** The setting restriction prefs. */ private HashMap settingRestrictionPrefs; + + /** The description prefs. */ private HashMap descriptionPrefs; + + /** The string prefs. */ private HashMap stringPrefs; + + /** The boolean prefs. */ private HashMap booleanPrefs; + + /** The object prefs. */ private HashMap objectPrefs; + + /** The units. */ private HashMap units; + + /** 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 long idCounter; + + /** The id. */ protected long id; + /** + * The Class SettingRestriction. + */ public class SettingRestriction implements Serializable { } + /** + * The Class IntegerSettingRestriction. + */ public class IntegerSettingRestriction extends SettingRestriction { + + /** The min value. */ private int minValue; + + /** The max value. */ private int maxValue; + /** + * Instantiates a new integer setting restriction. + * + * @param minValue the min value + * @param maxValue the max value + */ public IntegerSettingRestriction(int minValue, int maxValue) { this.minValue = minValue; this.maxValue = maxValue; } + /** + * Gets the min value. + * + * @return the min value + */ public int getMinValue() { return minValue; } + /** + * Gets the max value. + * + * @return the max value + */ public int getMaxValue() { return maxValue; } } + /** + * The Class StringSettingRestriction. + */ public class StringSettingRestriction extends SettingRestriction { + + /** The possible selections. */ Vector possibleSelections; + /** + * Instantiates a new string setting restriction. + * + * @param possibleSelections the possible selections + */ public StringSettingRestriction(String [] possibleSelections) { this.possibleSelections = new Vector(); @@ -57,11 +141,19 @@ public abstract class VSPrefs implements Serializable { this.possibleSelections.add(elem); } + /** + * Gets the possible selections. + * + * @return the possible selections + */ public Vector getPossibleSelections() { return possibleSelections; } } + /** + * Instantiates a new vS prefs. + */ public VSPrefs() { colorPrefs = new HashMap(); descriptionPrefs = new HashMap(); @@ -76,6 +168,9 @@ public abstract class VSPrefs implements Serializable { id = ++idCounter; } + /** + * Clear. + */ protected synchronized void clear() { colorPrefs.clear(); floatPrefs.clear(); @@ -88,6 +183,13 @@ public abstract class VSPrefs implements Serializable { settingRestrictionPrefs.clear(); } + /** + * Gets the object. + * + * @param key the key + * + * @return the object + */ public synchronized Object getObject(String key) { Object val = objectPrefs.get(key); @@ -100,14 +202,33 @@ public abstract class VSPrefs implements Serializable { return val; } + /** + * Removes the object. + * + * @param key the key + */ public synchronized void removeObject(String key) { objectPrefs.remove(key); } + /** + * Object exists. + * + * @param key the key + * + * @return true, if successful + */ public synchronized boolean objectExists(String key) { return null != objectPrefs.get(key); } + /** + * Gets the string. + * + * @param key the key + * + * @return the string + */ public synchronized String getString(String key) { String val = stringPrefs.get(key); @@ -120,6 +241,13 @@ public abstract class VSPrefs implements Serializable { return val; } + /** + * Gets the integer obj. + * + * @param key the key + * + * @return the integer obj + */ public synchronized Integer getIntegerObj(String key) { Integer val = integerPrefs.get(key); @@ -132,10 +260,24 @@ public abstract class VSPrefs implements Serializable { return val; } + /** + * Gets the integer. + * + * @param key the key + * + * @return the integer + */ public int getInteger(String key) { return getIntegerObj(key).intValue(); } + /** + * Gets the float obj. + * + * @param key the key + * + * @return the float obj + */ public synchronized Float getFloatObj(String key) { Float val = floatPrefs.get(key); @@ -148,10 +290,24 @@ public abstract class VSPrefs implements Serializable { return val; } + /** + * Gets the float. + * + * @param key the key + * + * @return the float + */ public float getFloat(String key) { return getFloatObj(key).floatValue(); } + /** + * Gets the long obj. + * + * @param key the key + * + * @return the long obj + */ public synchronized Long getLongObj(String key) { Long val = longPrefs.get(key); @@ -164,10 +320,24 @@ public abstract class VSPrefs implements Serializable { return val; } + /** + * Gets the long. + * + * @param key the key + * + * @return the long + */ public long getLong(String key) { return getLongObj(key).longValue(); } + /** + * Gets the boolean obj. + * + * @param key the key + * + * @return the boolean obj + */ public synchronized Boolean getBooleanObj(String key) { Boolean val = booleanPrefs.get(key); @@ -177,10 +347,24 @@ public abstract class VSPrefs implements Serializable { return val; } + /** + * Gets the boolean. + * + * @param key the key + * + * @return the boolean + */ public boolean getBoolean(String key) { return getBooleanObj(key).booleanValue(); } + /** + * Gets the color. + * + * @param key the key + * + * @return the color + */ public synchronized Color getColor(String key) { Color color = colorPrefs.get(key); @@ -193,239 +377,600 @@ public abstract class VSPrefs implements Serializable { return color; } + /** + * Gets the description. + * + * @param key the key + * + * @return the description + */ public synchronized String getDescription(String key) { return descriptionPrefs.get(key); } + /** + * Gets the unit. + * + * @param key the key + * + * @return the unit + */ public synchronized String getUnit(String key) { return units.get(key); } + /** + * Gets the restriction. + * + * @param key the key + * + * @return the restriction + */ public synchronized SettingRestriction getRestriction(String key) { return settingRestrictionPrefs.get(key); } + /** + * Gets the string key set. + * + * @return the string key set + */ public synchronized Set getStringKeySet() { return stringPrefs.keySet(); } + /** + * Gets the integer key set. + * + * @return the integer key set + */ public synchronized Set getIntegerKeySet() { return integerPrefs.keySet(); } + /** + * Gets the float key set. + * + * @return the float key set + */ public synchronized Set getFloatKeySet() { return floatPrefs.keySet(); } + /** + * Gets the long key set. + * + * @return the long key set + */ public synchronized Set getLongKeySet() { return longPrefs.keySet(); } + /** + * Gets the boolean key set. + * + * @return the boolean key set + */ public synchronized Set getBooleanKeySet() { return booleanPrefs.keySet(); } + /** + * Gets the color key set. + * + * @return the color key set + */ public synchronized Set getColorKeySet() { return colorPrefs.keySet(); } + /** + * Sets the object. + * + * @param key the key + * @param val the val + */ public synchronized void setObject(String key, Object val) { objectPrefs.put(key, val); } + /** + * Sets the string. + * + * @param key the key + * @param val the val + */ public synchronized void setString(String key, String val) { stringPrefs.put(key, val); } + /** + * Sets the integer. + * + * @param key the key + * @param val the val + */ public synchronized void setInteger(String key, Integer val) { integerPrefs.put(key, val); } + /** + * Sets the color. + * + * @param key the key + * @param color the color + */ public synchronized void setColor(String key, Color color) { colorPrefs.put(key, color); } + /** + * Sets the int. + * + * @param key the key + * @param val the val + */ public synchronized void setInt(String key, int val) { integerPrefs.put(key, new Integer(val)); } + /** + * Sets the float. + * + * @param key the key + * @param val the val + */ public synchronized void setFloat(String key, float val) { floatPrefs.put(key, new Float(val)); } + /** + * Sets the float. + * + * @param key the key + * @param val the val + */ public synchronized void setFloat(String key, Float val) { floatPrefs.put(key, val); } + /** + * Sets the long. + * + * @param key the key + * @param val the val + */ public synchronized void setLong(String key, long val) { longPrefs.put(key, new Long(val)); } + /** + * Sets the long. + * + * @param key the key + * @param val the val + */ public synchronized void setLong(String key, Long val) { longPrefs.put(key, val); } + /** + * Sets the boolean. + * + * @param key the key + * @param val the val + */ public synchronized void setBoolean(String key, boolean val) { booleanPrefs.put(key, new Boolean(val)); } + /** + * Sets the boolean. + * + * @param key the key + * @param val the val + */ public synchronized void setBoolean(String key, Boolean val) { booleanPrefs.put(key, val); } + /** + * Inits the string. + * + * @param key the key + * @param val the val + */ public synchronized void initString(String key, String val) { if (!stringPrefs.containsKey(key)) stringPrefs.put(key, val); } + /** + * Inits the integer. + * + * @param key the key + * @param val the val + */ public synchronized void initInteger(String key, Integer val) { if (!integerPrefs.containsKey(key)) integerPrefs.put(key, val); } + /** + * Inits the integer. + * + * @param key the key + * @param val the val + */ public void initInteger(String key, int val) { initInteger(key, new Integer(val)); } + /** + * Inits the long. + * + * @param key the key + * @param val the val + */ public synchronized void initLong(String key, Long val) { if (!longPrefs.containsKey(key)) longPrefs.put(key, val); } + /** + * Inits the long. + * + * @param key the key + * @param val the val + */ public void initLong(String key, int val) { initLong(key, new Long(val)); } + /** + * Inits the float. + * + * @param key the key + * @param val the val + */ public synchronized void initFloat(String key, Float val) { if (!floatPrefs.containsKey(key)) floatPrefs.put(key, val); } + /** + * Inits the float. + * + * @param key the key + * @param val the val + */ public void initFloat(String key, float val) { initFloat(key, new Float(val)); } + /** + * Sets the long if unset. + * + * @param key the key + * @param val the val + */ public synchronized void setLongIfUnset(String key, Long val) { if (!longPrefs.containsKey(key)) longPrefs.put(key, val); } + /** + * Sets the long if unset. + * + * @param key the key + * @param val the val + */ public void setLongIfUnset(String key, long val) { setLongIfUnset(key, new Long(val)); } + /** + * Inits the boolean. + * + * @param key the key + * @param val the val + */ public synchronized void initBoolean(String key, Boolean val) { if (!booleanPrefs.containsKey(key)) booleanPrefs.put(key, val); } + /** + * Inits the boolean. + * + * @param key the key + * @param val the val + */ public void initBoolean(String key, boolean val) { initBoolean(key, new Boolean(val)); } + /** + * Inits the color. + * + * @param key the key + * @param color the color + */ public synchronized void initColor(String key, Color color) { if (!colorPrefs.containsKey(key)) colorPrefs.put(key, color); } + /** + * Sets the description if unset. + * + * @param key the key + * @param descr the descr + */ public synchronized void setDescriptionIfUnset(String key, String descr) { if (descr == null || descriptionPrefs.containsKey(key)) return; descriptionPrefs.put(key, descr); } + /** + * Sets the restriction. + * + * @param key the key + * @param settingRestriction the setting restriction + */ public synchronized void setRestriction(String key, SettingRestriction settingRestriction) { settingRestrictionPrefs.put(key, settingRestriction); } + /** + * Sets the unit. + * + * @param key the key + * @param unit the unit + */ public synchronized void setUnit(String key, String unit) { units.put(key, unit); } + /** + * Inits the string. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initString(String key, String val, String descr) { initString(key, val); setDescriptionIfUnset(STRING_PREFIX + key, descr); } + /** + * Sets the long if unset. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void setLongIfUnset(String key, long val, String descr) { setLongIfUnset(key, val); setDescriptionIfUnset(LONG_PREFIX + key, descr); } + /** + * Inits the boolean. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initBoolean(String key, boolean val, String descr) { initBoolean(key, val); setDescriptionIfUnset(BOOLEAN_PREFIX + key, descr); } + /** + * Inits the boolean unit. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param unit the unit + */ public void initBooleanUnit(String key, boolean val, String descr, String unit) { initBoolean(key, val, descr); setUnit(BOOLEAN_PREFIX + key, unit); } + /** + * Inits the integer. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param r the r + */ public void initInteger(String key, Integer val, String descr, IntegerSettingRestriction r) { initInteger(key, val); setDescriptionIfUnset(INTEGER_PREFIX + key, descr); setRestriction(INTEGER_PREFIX + key, r); } + /** + * Inits the integer. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param minValue the min value + * @param maxValue the max value + */ public void initInteger(String key, Integer val, String descr, int minValue, int maxValue) { initInteger(key, val, descr, new IntegerSettingRestriction(minValue, maxValue)); } + /** + * Inits the integer. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param r the r + */ public void initInteger(String key, int val, String descr, IntegerSettingRestriction r) { initInteger(key, new Integer(val), descr, r); } + /** + * Inits the integer. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param minValue the min value + * @param maxValue the max value + */ public void initInteger(String key, int val, String descr, int minValue, int maxValue) { initInteger(key, new Integer(val), descr, minValue, maxValue); } + /** + * Inits the integer unit. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param minValue the min value + * @param maxValue the max value + * @param unit the unit + */ public void initIntegerUnit(String key, int val, String descr, int minValue, int maxValue, String unit) { initInteger(key, new Integer(val), descr, minValue, maxValue); setUnit(INTEGER_PREFIX + key, unit); } + /** + * Inits the long. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initLong(String key, Long val, String descr) { initLong(key, val); setDescriptionIfUnset(LONG_PREFIX + key, descr); } + /** + * Inits the long. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initLong(String key, int val, String descr) { initLong(key, new Long(val), descr); } + /** + * Inits the long unit. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param unit the unit + */ public void initLongUnit(String key, int val, String descr, String unit) { initLong(key, new Long(val), descr); setUnit(LONG_PREFIX + key, unit); } + /** + * Inits the float. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initFloat(String key, Float val, String descr) { initFloat(key, val); setDescriptionIfUnset(FLOAT_PREFIX + key, descr); } + /** + * Inits the float. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initFloat(String key, float val, String descr) { initFloat(key, new Float(val), descr); } + /** + * Inits the float unit. + * + * @param key the key + * @param val the val + * @param descr the descr + * @param unit the unit + */ public void initFloatUnit(String key, float val, String descr, String unit) { initFloat(key, new Float(val), descr); setUnit(FLOAT_PREFIX + key, unit); } + /** + * Inits the color. + * + * @param key the key + * @param val the val + * @param descr the descr + */ public void initColor(String key, Color val, String descr) { initColor(key, val); setDescriptionIfUnset(COLOR_PREFIX + key, descr); } + /** + * Fill default strings. + */ public void fillDefaultStrings() {} + + /** + * Fill default integers. + */ public void fillDefaultIntegers() {} + + /** + * Fill default floats. + */ public void fillDefaultFloats() {} + + /** + * Fill default colors. + */ public void fillDefaultColors() {} + + /** + * Fill default booleans. + */ public void fillDefaultBooleans() {} + + /** + * Fill with defaults. + */ public void fillWithDefaults() {} + /** + * Write object. + * + * @param objectOutputStream the object output stream + * + * @throws IOException Signals that an I/O exception has occurred. + */ public synchronized void writeObject(ObjectOutputStream objectOutputStream) throws IOException { objectOutputStream.writeObject(booleanPrefs); @@ -437,6 +982,14 @@ public abstract class VSPrefs implements Serializable { objectOutputStream.writeObject(units); } + /** + * Read object. + * + * @param objectInputStream the object input stream + * + * @throws IOException Signals that an I/O exception has occurred. + * @throws ClassNotFoundException the class not found exception + */ @SuppressWarnings("unchecked") public synchronized void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { booleanPrefs = (HashMap) objectInputStream.readObject(); @@ -485,32 +1038,65 @@ public abstract class VSPrefs implements Serializable { } */ + /** + * Copy integers. + * + * @param copyInto the copy into + * @param keys the keys + */ public void copyIntegers(VSPrefs copyInto, String[] keys) { for (String key : keys) copyInto.initInteger(key, getInteger(key), getDescription(INTEGER_PREFIX + key), (IntegerSettingRestriction) getRestriction(INTEGER_PREFIX + key)); } + /** + * Copy longs. + * + * @param copyInto the copy into + * @param keys the keys + */ public void copyLongs(VSPrefs copyInto, String[] keys) { for (String key : keys) copyInto.initLong(key, getLong(key), getDescription(LONG_PREFIX + key)); } + /** + * Copy floats. + * + * @param copyInto the copy into + * @param keys the keys + */ public void copyFloats(VSPrefs copyInto, String[] keys) { for (String key : keys) copyInto.initFloat(key, getFloat(key), getDescription(FLOAT_PREFIX + key)); } + /** + * Copy strings. + * + * @param copyInto the copy into + * @param keys the keys + */ public void copyStrings(VSPrefs copyInto, String[] keys) { for (String key : keys) copyInto.initString(key, getString(key), getDescription(STRING_PREFIX + key)); } + /** + * Copy colors. + * + * @param copyInto the copy into + * @param keys the keys + */ public void copyColors(VSPrefs copyInto, String[] keys) { for (String key : keys) copyInto.initColor(key, getColor(key), getDescription(COLOR_PREFIX + key)); } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ public String toString() { String descr = ""; @@ -557,10 +1143,20 @@ public abstract class VSPrefs implements Serializable { return descr; } + /** + * Gets the iD. + * + * @return the iD + */ public long getID() { return id; } + /** + * Checks if is empty. + * + * @return true, if is empty + */ public boolean isEmpty() { if (!colorPrefs.isEmpty()) return false; diff --git a/sources/prefs/editors/VSBetterEditor.java b/sources/prefs/editors/VSBetterEditor.java index 289749d..211e8ed 100644 --- a/sources/prefs/editors/VSBetterEditor.java +++ b/sources/prefs/editors/VSBetterEditor.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.awt.*; @@ -7,26 +11,58 @@ import javax.swing.*; import prefs.*; import utils.*; +// TODO: Auto-generated Javadoc +/** + * The Class VSBetterEditor. + */ public abstract class VSBetterEditor extends VSEditor { + + /** The content pane. */ private Container contentPane; + + /** The info area. */ private VSInfoArea infoArea; + + /** The title. */ private String title; + /** + * Instantiates a new vS better editor. + * + * @param prefs the prefs + * @param prefsToEdit the prefs to edit + * @param title the title + */ public VSBetterEditor(VSPrefs prefs, VSPrefs prefsToEdit, String title) { super(prefs, prefsToEdit); this.title = title; this.contentPane = createContentPane(); } + /** + * Gets the title. + * + * @return the title + */ public String getTitle() { return title; } + /** + * Gets the content pane. + * + * @return the content pane + */ public Container getContentPane() { contentPane.setBackground(Color.WHITE); return contentPane; } + /** + * Creates the content pane. + * + * @return the j panel + */ private JPanel createContentPane() { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); @@ -43,10 +79,24 @@ public abstract class VSBetterEditor extends VSEditor { return panel; } + /* (non-Javadoc) + * @see prefs.editors.VSEditor#addToButtonPanelFront(javax.swing.JPanel) + */ protected void addToButtonPanelFront(JPanel buttonPanel) { } + + /* (non-Javadoc) + * @see prefs.editors.VSEditor#addToButtonPanelLast(javax.swing.JPanel) + */ protected void addToButtonPanelLast(JPanel buttonPanel) { } + + /* (non-Javadoc) + * @see prefs.editors.VSEditor#addToEditTableLast() + */ protected void addToEditTableLast() { } + /* (non-Javadoc) + * @see prefs.editors.VSEditor#actionPerformed(java.awt.event.ActionEvent) + */ public void actionPerformed(ActionEvent e) { //String actionCommand = e.getActionCommand(); @@ -54,6 +104,11 @@ public abstract class VSBetterEditor extends VSEditor { super.actionPerformed(e); } + /** + * Gets the info area. + * + * @return the info area + */ protected VSInfoArea getInfoArea() { return infoArea; } diff --git a/sources/prefs/editors/VSColorChooser.java b/sources/prefs/editors/VSColorChooser.java index 8d2009d..d7d5692 100644 --- a/sources/prefs/editors/VSColorChooser.java +++ b/sources/prefs/editors/VSColorChooser.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.awt.*; @@ -6,12 +10,30 @@ import javax.swing.event.*; import prefs.VSPrefs; +// TODO: Auto-generated Javadoc +/** + * The Class VSColorChooser. + */ public class VSColorChooser extends JPanel implements ChangeListener { + + /** The color chooser. */ protected JColorChooser colorChooser; + + /** The color. */ private Color color; + + /** The val field. */ private JTextField valField; + + /** The prefs. */ private VSPrefs prefs; + /** + * Instantiates a new vS color chooser. + * + * @param prefs the prefs + * @param valField the val field + */ public VSColorChooser(VSPrefs prefs, JTextField valField) { super(new BorderLayout()); this.prefs = prefs; @@ -26,6 +48,9 @@ public class VSColorChooser extends JPanel implements ChangeListener { add(colorChooser, BorderLayout.CENTER); } + /* (non-Javadoc) + * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent) + */ public void stateChanged(ChangeEvent e) { Color newColor = colorChooser.getColor(); valField.setBackground(newColor); diff --git a/sources/prefs/editors/VSEditor.java b/sources/prefs/editors/VSEditor.java index 32f2150..8eda1e0 100644 --- a/sources/prefs/editors/VSEditor.java +++ b/sources/prefs/editors/VSEditor.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.awt.*; @@ -8,66 +12,171 @@ import java.util.*; import utils.*; import prefs.VSPrefs; +// TODO: Auto-generated Javadoc +/** + * The Class VSEditor. + */ public abstract class VSEditor implements ActionListener { + + /** The boolean keys. */ private ArrayList booleanKeys; + + /** The color keys. */ private ArrayList colorKeys; + + /** The float keys. */ private ArrayList floatKeys; + + /** The integer keys. */ private ArrayList integerKeys; + + /** The long keys. */ private ArrayList longKeys; + + /** The string keys. */ private ArrayList stringKeys; + + /** The boolean fields. */ private HashMap booleanFields; + + /** The integer fields. */ private HashMap integerFields; + + /** The color fields. */ private HashMap colorFields; + + /** The float fields. */ private HashMap floatFields; + + /** The long fields. */ private HashMap longFields; + + /** The string fields. */ private HashMap stringFields; + + /** The prefs to edit map. */ private HashMap prefsToEditMap; + + /** The button panel. */ private JPanel buttonPanel; + + /** The edit panel. */ private JPanel editPanel; + + /** The edit table. */ private VSEditorTable editTable; + + /** The frame. */ private VSFrame frame; + + /** The expert mode changed. */ private boolean expertModeChanged; + + /** The prefs. */ protected VSPrefs prefs; + + /** The prefs to edit. */ protected VSPrefs prefsToEdit; + + /** The Constant MIN_UNIT_LENGTH. */ protected static final int MIN_UNIT_LENGTH = 5; + + /** The Constant VALUE_FIELD_COLS. */ protected static final int VALUE_FIELD_COLS = 9; + + /** The Constant ALL_PREFERENCES. */ public static final int ALL_PREFERENCES = 0; + + /** The Constant SIMULATION_PREFERENCES. */ public static final int SIMULATION_PREFERENCES = 1; + /** + * Instantiates a new vS editor. + * + * @param prefs the prefs + * @param prefsToEdit the prefs to edit + */ public VSEditor(VSPrefs prefs, VSPrefs prefsToEdit) { init(prefs, prefsToEdit); } + /** + * Adds the to button panel front. + * + * @param buttonPanel the button panel + */ abstract protected void addToButtonPanelFront(JPanel buttonPanel); + + /** + * Adds the to button panel last. + * + * @param buttonPanel the button panel + */ abstract protected void addToButtonPanelLast(JPanel buttonPanel); + + /** + * Adds the to edit table last. + */ abstract protected void addToEditTableLast(); + /** + * Sets the prefs. + * + * @param prefs the new prefs + */ public void setPrefs(VSPrefs prefs) { this.prefs = prefs; } + /** + * Sets the prefs to edit. + * + * @param prefsToEdit the new prefs to edit + */ public void setPrefsToEdit(VSPrefs prefsToEdit) { this.prefsToEdit = prefsToEdit; } + /** + * Sets the frame. + * + * @param frame the new frame + */ public void setFrame(VSFrame frame) { this.frame = frame; } + /** + * Gets the frame. + * + * @return the frame + */ public VSFrame getFrame() { return frame; } + /** + * Dispose frame if exists. + */ protected void disposeFrameIfExists() { if (frame != null) frame.dispose(); } + /** + * Dispose frame with parent if exists. + */ protected void disposeFrameWithParentIfExists() { if (frame != null) frame.disposeWithParent(); } + /** + * Inits the. + * + * @param prefs the prefs + * @param prefsToEdit the prefs to edit + */ private void init(VSPrefs prefs, VSPrefs prefsToEdit) { this.prefs = prefs; this.prefsToEdit = prefsToEdit; @@ -94,6 +203,13 @@ public abstract class VSEditor implements ActionListener { fillEditPanel(prefsToEdit); } + /** + * Filter keys. + * + * @param set the set + * + * @return the array list< string> + */ private ArrayList filterKeys(Set set) { ArrayList filtered = new ArrayList(); boolean expertMode = prefs.getBoolean("sim.mode.expert"); @@ -110,6 +226,11 @@ public abstract class VSEditor implements ActionListener { return filtered; } + /** + * Creates the button panel. + * + * @return the j panel + */ private JPanel createButtonPanel() { JPanel buttonPanel = new JPanel(); buttonPanel.setBackground(Color.WHITE); @@ -126,6 +247,14 @@ public abstract class VSEditor implements ActionListener { return buttonPanel; } + /** + * Creates the unit panel. + * + * @param comp the comp + * @param key the key + * + * @return the j panel + */ private JPanel createUnitPanel(Component comp, String key) { JPanel unitPanel = new JPanel(new GridBagLayout()); unitPanel.setBackground(Color.WHITE); @@ -147,6 +276,11 @@ public abstract class VSEditor implements ActionListener { return unitPanel; } + /** + * Creates the edit panel. + * + * @return the j panel + */ private JPanel createEditPanel() { JPanel editPanel = new JPanel(); editPanel.setLayout(new BoxLayout(editPanel, BoxLayout.Y_AXIS)); @@ -159,6 +293,15 @@ public abstract class VSEditor implements ActionListener { return editPanel; } + /** + * Creates the integer component. + * + * @param fullKey the full key + * @param key the key + * @param prefsToEdit the prefs to edit + * + * @return the vS tupel< string, component, j combo box> + */ protected VSTupel createIntegerComponent(String fullKey, String key, VSPrefs prefsToEdit) { String descr = prefsToEdit.getDescription(fullKey); String label = descr == null ? fullKey : descr; @@ -186,6 +329,15 @@ public abstract class VSEditor implements ActionListener { return new VSTupel(label, createUnitPanel(valComboBox, fullKey), valComboBox); } + /** + * Creates the boolean component. + * + * @param fullKey the full key + * @param key the key + * @param prefsToEdit the prefs to edit + * + * @return the vS tupel< string, component, j check box> + */ protected VSTupel createBooleanComponent(String fullKey, String key, VSPrefs prefsToEdit) { final String activated = prefs.getString("lang.activated"); String descr = prefsToEdit.getDescription(fullKey); @@ -196,6 +348,15 @@ public abstract class VSEditor implements ActionListener { return new VSTupel(label, createUnitPanel(valField, fullKey), valField); } + /** + * Creates the long component. + * + * @param fullKey the full key + * @param key the key + * @param prefsToEdit the prefs to edit + * + * @return the vS tupel< string, component, j text field> + */ protected VSTupel createLongComponent(String fullKey, String key, VSPrefs prefsToEdit) { String descr = prefsToEdit.getDescription(fullKey); String label = descr == null ? fullKey : descr; @@ -212,6 +373,15 @@ public abstract class VSEditor implements ActionListener { return new VSTupel(label, createUnitPanel(valField, fullKey), valField); } + /** + * Creates the float component. + * + * @param fullKey the full key + * @param key the key + * @param prefsToEdit the prefs to edit + * + * @return the vS tupel< string, component, j text field> + */ protected VSTupel createFloatComponent(String fullKey, String key, VSPrefs prefsToEdit) { String descr = prefsToEdit.getDescription(fullKey); String label = descr == null ? fullKey : descr; @@ -228,6 +398,15 @@ public abstract class VSEditor implements ActionListener { return new VSTupel(label, createUnitPanel(valField, fullKey), valField); } + /** + * Creates the color component. + * + * @param fullKey the full key + * @param key the key + * @param prefsToEdit the prefs to edit + * + * @return the vS tupel< string, component, j text field> + */ protected VSTupel createColorComponent(String fullKey, String key, final VSPrefs prefsToEdit) { String descr = prefsToEdit.getDescription(fullKey); String label = descr == null ? fullKey : descr; @@ -260,6 +439,15 @@ public abstract class VSEditor implements ActionListener { return new VSTupel(label, createUnitPanel(valField, fullKey), valField); } + /** + * Creates the string component. + * + * @param fullKey the full key + * @param key the key + * @param prefsToEdit the prefs to edit + * + * @return the vS tupel< string, component, j text field> + */ protected VSTupel createStringComponent(String fullKey, String key, VSPrefs prefsToEdit) { String descr = prefsToEdit.getDescription(fullKey); String label = descr == null ? fullKey : descr; @@ -276,6 +464,11 @@ public abstract class VSEditor implements ActionListener { return new VSTupel(label, createUnitPanel(valField, fullKey), valField); } + /** + * Fill edit panel. + * + * @param prefsToEdit the prefs to edit + */ private void fillEditPanel(VSPrefs prefsToEdit) { HashMap components = new HashMap(); HashMap labels = new HashMap(); @@ -398,6 +591,13 @@ public abstract class VSEditor implements ActionListener { editTable.fireTableDataChanged(); } + /** + * Adds the to editor. + * + * @param label the label + * @param prefsKey the prefs key + * @param prefsToAdd the prefs to add + */ protected void addToEditor(String label, String prefsKey, VSPrefs prefsToAdd) { addSeparator(label); prefsKey = "(" + prefsKey + ")"; @@ -459,19 +659,42 @@ public abstract class VSEditor implements ActionListener { } } + /** + * Adds the separator. + * + * @param label the label + */ private void addSeparator(String label) { editTable.addSeparator(label); } + /** + * Adds the variable. + * + * @param label the label + * @param component the component + * @param prefs the prefs + */ private void addVariable(String label, Component component, VSPrefs prefs) { addVariable("", label, component, prefs); } + /** + * Adds the variable. + * + * @param prefsKey the prefs key + * @param label the label + * @param component the component + * @param prefs the prefs + */ private void addVariable(String prefsKey, String label, Component component, VSPrefs prefs) { prefsToEditMap.put(prefsKey, prefs); editTable.addVariable(label, component); } + /** + * Reset edit panel. + */ protected void resetEditPanel() { for (String key : integerKeys) { JComboBox valComboBox = integerFields.get(key); @@ -510,6 +733,10 @@ public abstract class VSEditor implements ActionListener { } /** + * Gets the keys. + * + * @param key the key + * * @return [0] := key, [1] := prefsKey */ private String[] getKeys(String key) { @@ -523,6 +750,9 @@ public abstract class VSEditor implements ActionListener { return keys; } + /** + * Save prefs. + */ protected void savePrefs() { boolean expertMode = prefs.getBoolean("sim.mode.expert"); @@ -585,6 +815,11 @@ public abstract class VSEditor implements ActionListener { expertModeChanged = expertMode != prefs.getBoolean("sim.mode.expert"); } + /** + * Expert mode changed. + * + * @return true, if successful + */ public boolean expertModeChanged() { boolean ret = expertModeChanged; @@ -594,6 +829,9 @@ public abstract class VSEditor implements ActionListener { return ret; } + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ public void actionPerformed(ActionEvent e) { String actionCommand = e.getActionCommand(); @@ -605,14 +843,29 @@ public abstract class VSEditor implements ActionListener { } } + /** + * Gets the edits the panel. + * + * @return the edits the panel + */ public JPanel getEditPanel() { return editPanel; } + /** + * Gets the edits the table. + * + * @return the edits the table + */ public VSEditorTable getEditTable() { return editTable; } + /** + * Gets the button panel. + * + * @return the button panel + */ public JPanel getButtonPanel() { return buttonPanel; } diff --git a/sources/prefs/editors/VSEditorFrame.java b/sources/prefs/editors/VSEditorFrame.java index bd98938..18a5eb6 100644 --- a/sources/prefs/editors/VSEditorFrame.java +++ b/sources/prefs/editors/VSEditorFrame.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.awt.*; @@ -7,10 +11,25 @@ import javax.swing.*; import prefs.*; import utils.*; +// TODO: Auto-generated Javadoc +/** + * The Class VSEditorFrame. + */ public class VSEditorFrame extends VSFrame implements ActionListener { + + /** The editor. */ private VSBetterEditor editor; + + /** The prefs. */ private VSPrefs prefs; + /** + * Instantiates a new vS editor frame. + * + * @param prefs the prefs + * @param relativeTo the relative to + * @param editor the editor + */ public VSEditorFrame(VSPrefs prefs, Component relativeTo, VSBetterEditor editor) { super(editor.getTitle(), relativeTo); this.prefs = prefs; @@ -18,6 +37,9 @@ public class VSEditorFrame extends VSFrame implements ActionListener { init(); } + /** + * Inits the. + */ private void init() { editor.setFrame(this); fillButtonPanel(editor.getButtonPanel()); @@ -29,6 +51,11 @@ public class VSEditorFrame extends VSFrame implements ActionListener { setVisible(true); } + /** + * Fill button panel. + * + * @param buttonPanel the button panel + */ private void fillButtonPanel(JPanel buttonPanel) { JButton okButton = new JButton( prefs.getString("lang.ok")); @@ -44,6 +71,9 @@ public class VSEditorFrame extends VSFrame implements ActionListener { buttonPanel.repaint(); } + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ public void actionPerformed(ActionEvent e) { String actionCommand = e.getActionCommand(); diff --git a/sources/prefs/editors/VSEditorTable.java b/sources/prefs/editors/VSEditorTable.java index 27c422f..b641f33 100644 --- a/sources/prefs/editors/VSEditorTable.java +++ b/sources/prefs/editors/VSEditorTable.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.util.*; @@ -9,58 +13,127 @@ import javax.swing.text.*; import prefs.*; +// TODO: Auto-generated Javadoc +/** + * The Class VSEditorTable. + */ public class VSEditorTable extends JTable { + + /** The Constant MIN_ROWS. */ private static final int MIN_ROWS = 20; + + /** The prefs. */ private VSPrefs prefs; + + /** The nodes. */ private ArrayList nodes; + + /** The model. */ private VSEditorTableModel model; + /** + * The Class VSNode. + */ private class VSNode { + + /** The key. */ private String key; + + /** The comp. */ private Component comp; + /** + * Instantiates a new vS node. + * + * @param key the key + */ public VSNode(String key) { this.key = key; } + /** + * Instantiates a new vS node. + * + * @param key the key + * @param comp the comp + */ public VSNode(String key, Component comp) { this.key = key; this.comp = comp; } + /** + * Gets the key. + * + * @return the key + */ public String getKey() { return key; } + /** + * Gets the component. + * + * @return the component + */ public Component getComponent() { return comp; } + /** + * Gets the renderer component. + * + * @return the renderer component + */ public Component getRendererComponent() { return comp; } + /** + * Checks if is separator. + * + * @return true, if is separator + */ public boolean isSeparator() { return comp == null; } } + /** + * The Class VSEditorTableModel. + */ private class VSEditorTableModel extends AbstractTableModel implements TableCellRenderer { + + /** + * Instantiates a new vS editor table model. + */ public VSEditorTableModel() { } + /* (non-Javadoc) + * @see javax.swing.table.AbstractTableModel#getColumnName(int) + */ public String getColumnName(int col) { return ""; } + /* (non-Javadoc) + * @see javax.swing.table.TableModel#getRowCount() + */ public int getRowCount() { return nodes.size(); } + /* (non-Javadoc) + * @see javax.swing.table.TableModel#getColumnCount() + */ public int getColumnCount() { return 2; } + /* (non-Javadoc) + * @see javax.swing.table.TableModel#getValueAt(int, int) + */ public Object getValueAt(int row, int col) { VSNode node = nodes.get(row); @@ -77,6 +150,9 @@ public class VSEditorTable extends JTable { return node.getComponent(); } + /* (non-Javadoc) + * @see javax.swing.table.AbstractTableModel#isCellEditable(int, int) + */ public boolean isCellEditable(int row, int col) { if (col == 0) return false; @@ -87,9 +163,15 @@ public class VSEditorTable extends JTable { return true; } + /* (non-Javadoc) + * @see javax.swing.table.AbstractTableModel#setValueAt(java.lang.Object, int, int) + */ public void setValueAt(Object value, int row, int col) { } + /* (non-Javadoc) + * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int) + */ public Component getTableCellRendererComponent(JTable table, Object object, boolean isSelected, boolean hasFocus, int row, int col) { @@ -119,18 +201,32 @@ public class VSEditorTable extends JTable { } } + /** + * The Class VSTableCellEditor. + */ private class VSTableCellEditor extends AbstractCellEditor implements TableCellEditor { + /* (non-Javadoc) + * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int) + */ public Component getTableCellEditorComponent(JTable table, Object object, boolean isSelected, int row, int col) { return nodes.get(row).getComponent(); } + /* (non-Javadoc) + * @see javax.swing.CellEditor#getCellEditorValue() + */ public Object getCellEditorValue() { return new String(""); } } + /** + * Instantiates a new vS editor table. + * + * @param prefs the prefs + */ public VSEditorTable(VSPrefs prefs) { this.prefs = prefs; this.nodes = new ArrayList(); @@ -151,14 +247,28 @@ public class VSEditorTable extends JTable { col.sizeWidthToFit(); } + /** + * Adds the variable. + * + * @param key the key + * @param comp the comp + */ public void addVariable(String key, Component comp) { nodes.add(new VSNode(key, comp)); } + /** + * Adds the separator. + * + * @param text the text + */ public void addSeparator(String text) { nodes.add(new VSNode(text)); } + /** + * Fire table data changed. + */ public void fireTableDataChanged() { model.fireTableDataChanged(); } diff --git a/sources/prefs/editors/VSProcessEditor.java b/sources/prefs/editors/VSProcessEditor.java index bbd256f..e17f89a 100644 --- a/sources/prefs/editors/VSProcessEditor.java +++ b/sources/prefs/editors/VSProcessEditor.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.awt.event.*; @@ -9,9 +13,24 @@ import protocols.*; import events.*; import prefs.VSPrefs; +// TODO: Auto-generated Javadoc +/** + * The Class VSProcessEditor. + */ public class VSProcessEditor extends VSBetterEditor { + + /** The process. */ private VSProcess process; + + /** The TAKEOVE r_ button. */ public static boolean TAKEOVER_BUTTON; + + /** + * Instantiates a new vS process editor. + * + * @param prefs the prefs + * @param process the process + */ public VSProcessEditor(VSPrefs prefs, VSProcess process) { super(prefs, process, prefs.getString("lang.name") + " - " + prefs.getString("lang.prefs.process"));; this.process = process; @@ -19,6 +38,9 @@ public class VSProcessEditor extends VSBetterEditor { makeProtocolVariablesEditable(); } + /* (non-Javadoc) + * @see prefs.editors.VSBetterEditor#addToButtonPanelFront(javax.swing.JPanel) + */ protected void addToButtonPanelFront(JPanel buttonPanel) { JButton takeoverButton = new JButton( prefs.getString("lang.takeover")); @@ -27,6 +49,9 @@ public class VSProcessEditor extends VSBetterEditor { buttonPanel.add(takeoverButton); } + /** + * Make protocol variables editable. + */ protected void makeProtocolVariablesEditable() { ArrayList editableProtocolsClassnames = VSRegisteredEvents.getEditableProtocolsClassnames(); @@ -39,6 +64,9 @@ public class VSProcessEditor extends VSBetterEditor { } } + /* (non-Javadoc) + * @see prefs.editors.VSBetterEditor#actionPerformed(java.awt.event.ActionEvent) + */ public void actionPerformed(ActionEvent e) { String actionCommand = e.getActionCommand(); diff --git a/sources/prefs/editors/VSSimulatorEditor.java b/sources/prefs/editors/VSSimulatorEditor.java index 36593ac..1264377 100644 --- a/sources/prefs/editors/VSSimulatorEditor.java +++ b/sources/prefs/editors/VSSimulatorEditor.java @@ -1,3 +1,7 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package prefs.editors; import java.awt.event.*; @@ -6,12 +10,31 @@ import javax.swing.*; import simulator.*; import prefs.*; +// TODO: Auto-generated Javadoc +/** + * The Class VSSimulatorEditor. + */ public class VSSimulatorEditor extends VSBetterEditor { + + /** The simulator frame. */ private VSSimulatorFrame simulatorFrame; + + /** The simulation. */ private VSSimulator simulation; + + /** The TAKEOVE r_ button. */ public static boolean TAKEOVER_BUTTON; + + /** The dont start new simulation. */ private boolean dontStartNewSimulation; + /** + * Instantiates a new vS simulator editor. + * + * @param prefs the prefs + * @param simulatorFrame the simulator frame + * @param simulation the simulation + */ public VSSimulatorEditor(VSPrefs prefs, VSSimulatorFrame simulatorFrame, VSSimulator simulation) { super(prefs, prefs, prefs.getString("lang.name") + " - " + prefs.getString("lang.prefs")); @@ -20,12 +43,21 @@ public class VSSimulatorEditor extends VSBetterEditor { this.simulation = simulation; } + /** + * Instantiates a new vS simulator editor. + * + * @param prefs the prefs + * @param simulatorFrame the simulator frame + */ public VSSimulatorEditor(VSPrefs prefs, VSSimulatorFrame simulatorFrame) { super(prefs, prefs, prefs.getString("lang.name") + " - " + prefs.getString("lang.prefs")); this.simulatorFrame = simulatorFrame; } + /* (non-Javadoc) + * @see prefs.editors.VSBetterEditor#addToButtonPanelFront(javax.swing.JPanel) + */ protected void addToButtonPanelFront(JPanel buttonPanel) { if (TAKEOVER_BUTTON) { TAKEOVER_BUTTON = false; @@ -37,6 +69,9 @@ public class VSSimulatorEditor extends VSBetterEditor { } } + /* (non-Javadoc) + * @see prefs.editors.VSBetterEditor#actionPerformed(java.awt.event.ActionEvent) + */ public void actionPerformed(ActionEvent e) { String actionCommand = e.getActionCommand(); -- cgit v1.2.3