summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-18 02:32:36 +0000
committerPaul Buetow <paul@buetow.org>2008-05-18 02:32:36 +0000
commit7b3a0120581322678ddc0ed58f1a6a478899c217 (patch)
tree66f562c5e3ae484fbcf2aa4aedbc98b61d2c8f61 /sources
parentefe41ac4240c4e12a0cada829575b43378d22823 (diff)
layout done.
Diffstat (limited to 'sources')
-rw-r--r--sources/prefs/VSDefaultPrefs.java8
-rw-r--r--sources/simulator/VSSimulation.java65
2 files changed, 51 insertions, 22 deletions
diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java
index 325efef..98d8083 100644
--- a/sources/prefs/VSDefaultPrefs.java
+++ b/sources/prefs/VSDefaultPrefs.java
@@ -80,7 +80,7 @@ public class VSDefaultPrefs extends VSPrefs {
initString("lang.process.clock.variance", "Uhrabweichung");
initString("lang.process.id", "PID");
initString("lang.process.new", "Neuer Prozess");
- initString("lang.process.task", "Prozess-Task");
+ initString("lang.process.task", "Prozessereignis");
initString("lang.process.time.local", "Lokale Zeit");
initString("lang.protocol", "Protokoll");
initString("lang.protocol.client", "Clientseite");
@@ -107,11 +107,11 @@ public class VSDefaultPrefs extends VSPrefs {
initString("lang.start", "Starten");
initString("lang.stop", "Stoppen");
initString("lang.takeover", "Übernehmen");
- initString("lang.task", "Task");
initString("lang.taskmanager", "Taskmanager");
initString("lang.time.lamport", "Lamportzeit");
initString("lang.time.vector", "Vektorzeit");
initString("lang.time", "Zeit");
+ initString("lang.event", "Ereignis");
initString("lang.type", "Typ");
initString("name", "Verteilte Systeme v0.2-devel");
}
@@ -150,7 +150,7 @@ public class VSDefaultPrefs extends VSPrefs {
initIntegerUnit("window.prefs.xsize", 350, "X-Grösse des Einstellungsfensters", 550, 3200, "px");
initIntegerUnit("window.prefs.ysize", 600, "Y-Grösse des Einstellungsfensters", 640, 2400, "px");
initIntegerUnit("window.loggsize", 300, "Y-Grösse des Loggingfensters", 100, 1000, "px");
- initIntegerUnit("window.splitsize", 225, null, 100, 1000, "px");
+ initIntegerUnit("window.splitsize", 265, null, 100, 1000, "px");
initIntegerUnit("window.xsize", 1024, "X-Grösse des Hauptfensters", 800, 3200, "px");
initIntegerUnit("window.ysize", 768, "Y-Grösse des Hauptfensters", 600, 2400, "px");
}
@@ -168,7 +168,7 @@ public class VSDefaultPrefs extends VSPrefs {
public void fillDefaultColors() {
/* Internal prefs */
- initColor("paintarea.background", new Color(0xFF, 0xFB, 0xEF));
+ initColor("paintarea.background", new Color(0xFF, 0xFF, 0xFF));
initColor("process.default", new Color(0x00, 0x00, 0x00));
initColor("process.running", new Color(0x0D, 0xD8, 0x09));
initColor("process.crashed", new Color(0xff, 0x00, 0x00));
diff --git a/sources/simulator/VSSimulation.java b/sources/simulator/VSSimulation.java
index 56cfb25..12b154a 100644
--- a/sources/simulator/VSSimulation.java
+++ b/sources/simulator/VSSimulation.java
@@ -20,7 +20,6 @@ public class VSSimulation extends VSFrame implements ActionListener {
private JMenuItem replayItem;
private JMenuItem resetItem;
private JMenuItem startItem;
- private JPanel processPanel;
private JSplitPane splitPaneH;
private JSplitPane splitPaneV;
private Thread thread;
@@ -166,7 +165,6 @@ public class VSSimulation extends VSFrame implements ActionListener {
simulationPanel = new VSSimulationPanel(prefs, this, logging);
logging.setSimulationPanel(simulationPanel);
simulationPanel.setBackground(prefs.getColor("paintarea.background"));//new Color(0xFD, 0xFC, 0xF7));
- processPanel = createProcessPanel();
JScrollPane paintScrollPane = new JScrollPane(simulationPanel);
JScrollPane textScrollPane = new JScrollPane(loggingArea);
@@ -178,14 +176,13 @@ public class VSSimulation extends VSFrame implements ActionListener {
loggingPane.setPreferredSize(new Dimension(200, 1));
splitPaneH.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
- splitPaneH.setLeftComponent(processPanel);
+ splitPaneH.setLeftComponent(createProcessPane());
splitPaneH.setRightComponent(paintScrollPane);
splitPaneH.setContinuousLayout(true);
splitPaneH.setOneTouchExpandable(true);
splitPaneV.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPaneV.setTopComponent(splitPaneH);
- //splitPaneV.setTopComponent(paintScrollPane);
splitPaneV.setBottomComponent(loggingPane);
splitPaneV.setOneTouchExpandable(true);
splitPaneV.setContinuousLayout(true);
@@ -282,9 +279,8 @@ public class VSSimulation extends VSFrame implements ActionListener {
return toolsPanel;
}
- private JPanel createProcessPanel() {
+ private JSplitPane createProcessPane() {
JPanel editPanel = new JPanel(new GridBagLayout());
- editPanel.setBackground(Color.WHITE);
editPanel.setLayout(new BoxLayout(editPanel, BoxLayout.Y_AXIS));
JComboBox comboBox = new JComboBox();
@@ -301,22 +297,18 @@ public class VSSimulation extends VSFrame implements ActionListener {
splitPane1.setTopComponent(localPanel);
splitPane1.setBottomComponent(globalPanel);
splitPane1.setDividerLocation((int) (getPaintSize()/2) - 20);
+ splitPane1.setOneTouchExpandable(true);
JSplitPane splitPane2 = new JSplitPane();
splitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPane2.setTopComponent(comboBox);
splitPane2.setBottomComponent(splitPane1);
- editPanel.add(splitPane2);
- return editPanel;
+ return splitPane2;
}
private JPanel createLabelPanel(String text) {
JPanel panel = new JPanel();
- panel.setBorder(new CompoundBorder(
- new LineBorder(Color.BLACK),
- new EmptyBorder(0, 0, 0, 0)));
-
JLabel label = new JLabel(text);
panel.add(label);
@@ -334,17 +326,14 @@ public class VSSimulation extends VSFrame implements ActionListener {
JScrollPane scrollPane = new JScrollPane(createTaskTable(localTasks));
panel.add(scrollPane);
- /*
- JTextArea emptyArea = new JTextArea(0, 0);
- emptyArea.setEditable(false);
- panel.add(emptyArea);
- */
+
+ initAddPanel(panel);
return panel;
}
private JTable createTaskTable(boolean localTasks) {
- String[] columnNames = { prefs.getString("lang.time"), prefs.getString("lang.task") };
+ String[] columnNames = { prefs.getString("lang.time"), prefs.getString("lang.event") };
Object[][] data = {
{"foo", "bar" },
{"foo", "bar" },
@@ -356,10 +345,50 @@ public class VSSimulation extends VSFrame implements ActionListener {
JTable table = new JTable(data, columnNames);
table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
+ table.setBackground(Color.WHITE);
return table;
}
+ private void initAddPanel(JPanel panel) {
+ JPanel panel1 = new JPanel();
+ panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
+
+ panel1.add(new JTextField());
+ panel1.add(new JLabel(" ms "));
+ JButton takeoverButton = new JButton(prefs.getString("lang.takeover"));
+ panel1.add(takeoverButton);
+
+ JComboBox comboBox = new JComboBox();
+ comboBox.addItem("-- Prozessereignisse --");
+ comboBox.addItem("Prozessabsturz");
+ comboBox.addItem("Prozesswiederbelebung");
+ comboBox.addItem("-- Protokollereignisse --");
+ comboBox.addItem("BerkelyTime Client aktivieren");
+ comboBox.addItem("BerkelyTime Client deaktivieren");
+ comboBox.addItem("BerkelyTime Server aktivieren");
+ comboBox.addItem("BerkelyTime Server deaktivieren");
+ comboBox.addItem("ExternalTimeSync Client aktivieren");
+ comboBox.addItem("ExternalTimeSync Client deaktivieren");
+ comboBox.addItem("ExternalTimeSync Server aktivieren");
+ comboBox.addItem("ExternalTimeSync Server deaktivieren");
+ comboBox.addItem("InternalTimeSync Client aktivieren");
+ comboBox.addItem("InternalTimeSync Client deaktivieren");
+ comboBox.addItem("InternalTimeSync Server aktivieren");
+ comboBox.addItem("InternalTimeSync Server deaktivieren");
+ comboBox.addItem("PingPong Client aktivieren");
+ comboBox.addItem("PingPong Client deaktivieren");
+ comboBox.addItem("PingPong Server aktivieren");
+ comboBox.addItem("PingPong Server deaktivieren");
+ comboBox.addItem("-- Anfragen --");
+ comboBox.addItem("BerkelyTime Anfrage starten");
+ comboBox.addItem("ExternalTimeSync Anfrage starten");
+ comboBox.addItem("InternalTimeSync Anfrage starten");
+ comboBox.addItem("PingPong Anfrage starten");
+ panel.add(comboBox);
+ panel.add(panel1);
+ }
+
public int getSplitSize() {
return splitPaneH.getDividerLocation();
}