summaryrefslogtreecommitdiff
path: root/sources/prefs/editors
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-25 08:10:13 +0000
committerPaul Buetow <paul@buetow.org>2008-05-25 08:10:13 +0000
commitc015d586d22b69078b6da61858e5675793856b0b (patch)
treeefbc9881cf59363abef52a0beb5eedf9e81a224a /sources/prefs/editors
parent62fe28f0b0b0c9ebde18a6dc33907889ff3aa21b (diff)
JAutoDoc :)
Diffstat (limited to 'sources/prefs/editors')
-rw-r--r--sources/prefs/editors/VSBetterEditor.java55
-rw-r--r--sources/prefs/editors/VSColorChooser.java25
-rw-r--r--sources/prefs/editors/VSEditor.java253
-rw-r--r--sources/prefs/editors/VSEditorFrame.java30
-rw-r--r--sources/prefs/editors/VSEditorTable.java110
-rw-r--r--sources/prefs/editors/VSProcessEditor.java28
-rw-r--r--sources/prefs/editors/VSSimulatorEditor.java35
7 files changed, 536 insertions, 0 deletions
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<String> booleanKeys;
+
+ /** The color keys. */
private ArrayList<String> colorKeys;
+
+ /** The float keys. */
private ArrayList<String> floatKeys;
+
+ /** The integer keys. */
private ArrayList<String> integerKeys;
+
+ /** The long keys. */
private ArrayList<String> longKeys;
+
+ /** The string keys. */
private ArrayList<String> stringKeys;
+
+ /** The boolean fields. */
private HashMap<String,JCheckBox> booleanFields;
+
+ /** The integer fields. */
private HashMap<String,JComboBox> integerFields;
+
+ /** The color fields. */
private HashMap<String,JTextField> colorFields;
+
+ /** The float fields. */
private HashMap<String,JTextField> floatFields;
+
+ /** The long fields. */
private HashMap<String,JTextField> longFields;
+
+ /** The string fields. */
private HashMap<String,JTextField> stringFields;
+
+ /** The prefs to edit map. */
private HashMap<String,VSPrefs> 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<String> filterKeys(Set<String> set) {
ArrayList<String> filtered = new ArrayList<String>();
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<String,Component,JComboBox> 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<String,Component,JComboBox>(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<String,Component,JCheckBox> 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<String,Component,JCheckBox>(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<String,Component,JTextField> 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<String,Component,JTextField>(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<String,Component,JTextField> 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<String,Component,JTextField>(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<String,Component,JTextField> 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<String,Component,JTextField>(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<String,Component,JTextField> 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<String,Component,JTextField>(label, createUnitPanel(valField, fullKey), valField);
}
+ /**
+ * Fill edit panel.
+ *
+ * @param prefsToEdit the prefs to edit
+ */
private void fillEditPanel(VSPrefs prefsToEdit) {
HashMap<String,Component> components = new HashMap<String,Component>();
HashMap<String,String> labels = new HashMap<String,String>();
@@ -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<VSNode> 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<VSNode>();
@@ -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<String> 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 {
}