summaryrefslogtreecommitdiff
path: root/sources/prefs/editors/VSProcessEditor.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-21 11:25:06 +0000
committerPaul Buetow <paul@buetow.org>2008-05-21 11:25:06 +0000
commit47f50635ca3fa3665f2b0bfb3cc29b2e9b88e88e (patch)
tree8539c14942ff620b0ee11d861b90e8026445577b /sources/prefs/editors/VSProcessEditor.java
parent986ba9e27e6a3f6bced32d675246c85448b83f4f (diff)
Initial JTable editor.
Diffstat (limited to 'sources/prefs/editors/VSProcessEditor.java')
-rw-r--r--sources/prefs/editors/VSProcessEditor.java66
1 files changed, 0 insertions, 66 deletions
diff --git a/sources/prefs/editors/VSProcessEditor.java b/sources/prefs/editors/VSProcessEditor.java
index 0d55e86..1632ff1 100644
--- a/sources/prefs/editors/VSProcessEditor.java
+++ b/sources/prefs/editors/VSProcessEditor.java
@@ -52,72 +52,6 @@ public class VSProcessEditor extends VSBetterEditor {
if (prefsCategory != SIMULATION_PREFERENCES)
return;
- editPanelConstraints.gridy = editPanelRow++;
- editPanel.add(new JLabel(prefs.getString("lang.protocol.editor")), editPanelConstraints);
-
- editPanelConstraints.insets = insets;
- editPanelConstraints.gridy = editPanelRow++;
- JPanel protocolSelectorPanel = createProtocolSelector();
- editPanel.add(protocolSelectorPanel, editPanelConstraints);
-
- editPanelConstraints.insets = insetsTopSpaceing;
- editPanelConstraints.gridy = editPanelRow++;
- }
-
- private JPanel createProtocolSelector() {
- JPanel panel = new JPanel(new GridBagLayout());
- panel.setBorder(BorderFactory.createLineBorder(Color.black));
-
- Vector<String> registeredProtocolsNames = VSRegisteredEvents.getProtocolNames();
- Vector<String> registeredProtocolsShortnames = new Vector<String>();
- final HashMap<String,String> eventNames = new HashMap<String,String>();
-
- for (String protocolName : registeredProtocolsNames) {
- String protocolClassname = VSRegisteredEvents.getClassname(protocolName);
- String protocolShortname = VSRegisteredEvents.getShortname(protocolClassname);
- registeredProtocolsShortnames.add(protocolShortname);
- eventNames.put(protocolShortname, protocolName);
- }
-
- GridBagConstraints constraints = new GridBagConstraints();
- constraints.fill = GridBagConstraints.HORIZONTAL;
- constraints.gridx = 0;
- constraints.gridy = 0;
- constraints.insets = new Insets(5, 0, 5, 0);
- constraints.ipadx = 10;
- constraints.ipady = 10;
-
- final JComboBox comboBox = new JComboBox(registeredProtocolsShortnames);
- comboBox.setBackground(Color.WHITE);
- panel.add(comboBox, constraints);
- constraints.gridy = 1;
- JButton button = new JButton(prefs.getString("lang.edit"));
- button.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
- if (ae.getActionCommand().equals(prefs.getString("lang.edit"))) {
- String eventShortname = (String) comboBox.getSelectedItem();
- String eventName = eventNames.get(eventShortname);
- String eventClassname = VSRegisteredEvents.getClassname(eventName);
- VSProtocol protocol = null;
- if (process.objectExists(eventClassname)) {
- Object object = process.getObject(eventClassname);
- if (object instanceof VSProtocol)
- protocol = (VSProtocol) process.getObject(eventClassname);
- else
- return;
- } else {
- protocol = (VSProtocol) VSRegisteredEvents.createEventInstanceByName(eventName, process);
- process.setObject(eventClassname, protocol);
- }
-
- //new VSProtocolEditor(prefs, frame, protocol);
- }
- }
- });
-
- panel.add(button, constraints);
-
- return panel;
}
protected void resetEditPanel() {