diff options
| author | Paul Buetow <paul@buetow.org> | 2008-08-13 01:21:52 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-08-13 01:21:52 +0000 |
| commit | 7c8f393e11142fd5894668905c7b3f091a5bd4be (patch) | |
| tree | 8faa8934ee1d7cffd5331bd476df48700b408243 /sources/simulator | |
| parent | f54ba6c064b3a3d78360ef448786f7c0b2d601fd (diff) | |
typos
Diffstat (limited to 'sources/simulator')
| -rw-r--r-- | sources/simulator/VSLogging.java | 88 | ||||
| -rw-r--r-- | sources/simulator/VSSimulator.java | 70 | ||||
| -rw-r--r-- | sources/simulator/VSSimulatorVisualization.java | 32 |
3 files changed, 95 insertions, 95 deletions
diff --git a/sources/simulator/VSLogging.java b/sources/simulator/VSLogging.java index e867c6b..2eb9ae7 100644 --- a/sources/simulator/VSLogging.java +++ b/sources/simulator/VSLogging.java @@ -30,8 +30,8 @@ import javax.swing.*; import utils.*; /** - * The class VSLogging, an object of this class is responsible for the logging - * of text messages into the simulator's logging window. + * The class VSLogging, an object of this class is responsible for the loging + * of text messages into the simulator's loging window. * * @author Paul C. Buetow */ @@ -39,27 +39,27 @@ public class VSLogging { /** The serial version uid */ private static final long serialVersionUID = 1L; - /** The logging area. */ - private JTextArea loggingArea; + /** The loging area. */ + private JTextArea logingArea; /** The filter text. */ private String filterText; - /** The pause lines. Used for cacheing the logging if the logging is + /** The pause lines. Used for cacheing the loging if the loging is * deactivated for a while */ private ArrayList<StringBuffer> pauseLines; - /** The logging lines. */ - private ArrayList<StringBuffer> loggingLines; + /** The loging lines. */ + private ArrayList<StringBuffer> logingLines; /** The simulator canvas. */ private VSSimulatorVisualization simulatorVisualization; - /** The logging messages are filtered. */ + /** The loging messages are filtered. */ private boolean isFiltered; - /** The logging is paused. */ + /** The loging is paused. */ private boolean isPaused; /** The filter pattern. */ @@ -69,11 +69,11 @@ public class VSLogging { * Instantiates a new VSLogging object. */ public VSLogging() { - loggingArea = new JTextArea(0, 0); - loggingArea.setEditable(false); - loggingArea.setLineWrap(true); - loggingArea.setWrapStyleWord(true); - loggingLines = new ArrayList<StringBuffer>(); + logingArea = new JTextArea(0, 0); + logingArea.setEditable(false); + logingArea.setLineWrap(true); + logingArea.setWrapStyleWord(true); + logingLines = new ArrayList<StringBuffer>(); pauseLines = new ArrayList<StringBuffer>(); filterText = ""; } @@ -88,12 +88,12 @@ public class VSLogging { } /** - * Gets the logging area. + * Gets the loging area. * - * @return the logging area + * @return the loging area */ public JTextArea getLoggingArea() { - return loggingArea; + return logingArea; } /** @@ -101,11 +101,11 @@ public class VSLogging { * * @param message the message */ - public void logg(String message) { + public void log(String message) { if (simulatorVisualization == null) - logg(message, 0); + log(message, 0); else - logg(message, simulatorVisualization.getTime()); + log(message, simulatorVisualization.getTime()); } /** @@ -114,7 +114,7 @@ public class VSLogging { * @param message the message * @param time the time */ - public synchronized void logg(String message, long time) { + public synchronized void log(String message, long time) { StringBuffer buffer = new StringBuffer(); buffer.append(VSTools.getTimeString(time)); buffer.append(": "); @@ -123,49 +123,49 @@ public class VSLogging { if (isPaused) pauseLines.add(buffer); else - loggFiltered(buffer); + logFiltered(buffer); } /** - * Sets if the logging is paused. + * Sets if the loging is paused. * - * @param isPaused true, if the logging is paused + * @param isPaused true, if the loging is paused */ public synchronized void isPaused(boolean isPaused) { this.isPaused = isPaused; if (!isPaused) { for (StringBuffer buffer : pauseLines) - loggFiltered(buffer); + logFiltered(buffer); pauseLines.clear(); } } /** - * If the logging is filtered, it's using the pattern matching. + * If the loging is filtered, it's using the pattern matching. * - * @param buffer the logging buffer to filter + * @param buffer the loging buffer to filter */ - private void loggFiltered(StringBuffer buffer) { - loggingLines.add(buffer); + private void logFiltered(StringBuffer buffer) { + logingLines.add(buffer); if (!isFiltered) { - loggingArea.append(buffer.toString()+"\n"); - loggingArea.setCaretPosition( - loggingArea.getDocument().getLength()); + logingArea.append(buffer.toString()+"\n"); + logingArea.setCaretPosition( + logingArea.getDocument().getLength()); } else if (filterPattern != null && filterPattern.matcher(buffer).find()) { - loggingArea.append(buffer.toString()+"\n"); - loggingArea.setCaretPosition( - loggingArea.getDocument().getLength()); + logingArea.append(buffer.toString()+"\n"); + logingArea.setCaretPosition( + logingArea.getDocument().getLength()); } } /** - * Checks if the logging is filtered. + * Checks if the loging is filtered. * - * @param isFiltered true, if the logging is filtered + * @param isFiltered true, if the loging is filtered */ public synchronized void isFiltered(boolean isFiltered) { this.isFiltered = isFiltered; @@ -187,23 +187,23 @@ public class VSLogging { } /** - * Clears the logging. + * Clears the loging. */ public synchronized void clear() { - loggingLines.clear(); + logingLines.clear(); pauseLines.clear(); - loggingArea.setText(""); + logingArea.setText(""); } /** - * Filters the logging. + * Filters the loging. */ private void filter() { try { filterPattern = Pattern.compile(filterText); StringBuffer buffer = new StringBuffer(); - for (StringBuffer line : loggingLines) { + for (StringBuffer line : logingLines) { if (isFiltered) { Matcher matcher = filterPattern.matcher(line); if (matcher.find()) { @@ -215,11 +215,11 @@ public class VSLogging { buffer.append("\n"); } } - loggingArea.setText(buffer.toString()); + logingArea.setText(buffer.toString()); } catch (Exception e) { filterPattern = null; - loggingArea.setText(""); + logingArea.setText(""); } } } diff --git a/sources/simulator/VSSimulator.java b/sources/simulator/VSSimulator.java index 51236f4..d1603ff 100644 --- a/sources/simulator/VSSimulator.java +++ b/sources/simulator/VSSimulator.java @@ -87,8 +87,8 @@ public class VSSimulator extends JPanel implements VSSerializable { /** The local panel. */ private JPanel localPanel; - /** The logging panel. */ - private JPanel loggingPanel; + /** The loging panel. */ + private JPanel logingPanel; /** The tools panel. */ private JPanel toolsPanel; @@ -105,8 +105,8 @@ public class VSSimulator extends JPanel implements VSSerializable { /** The tabbed pane. */ private JTabbedPane tabbedPane; - /** The logging area. */ - private JTextArea loggingArea; + /** The loging area. */ + private JTextArea logingArea; /** The filter text field. */ private JTextField filterTextField; @@ -120,8 +120,8 @@ public class VSSimulator extends JPanel implements VSSerializable { /** The thread. */ private Thread thread; - /** The logging. */ - private VSLogging logging; + /** The loging. */ + private VSLogging loging; /** The menu item states. */ private VSMenuItemStates menuItemStates; @@ -612,10 +612,10 @@ public class VSSimulator extends JPanel implements VSSerializable { this.globalTextFields = new ArrayList<String>(); /* Not null if init has been called from the deserialization */ - if (this.logging == null) - this.logging = new VSLogging(); + if (this.loging == null) + this.loging = new VSLogging(); - logging.logg(prefs.getString("lang.simulator.new")); + loging.log(prefs.getString("lang.simulator.new")); fillContentPane(); updateFromPrefs(); @@ -625,7 +625,7 @@ public class VSSimulator extends JPanel implements VSSerializable { splitPaneV.setDividerLocation( prefs.getInteger("div.window.ysize") - - prefs.getInteger("div.window.loggsize")); + - prefs.getInteger("div.window.logsize")); splitPane1.setDividerLocation((int) (getPaintSize()/2) - 20); @@ -647,17 +647,17 @@ public class VSSimulator extends JPanel implements VSSerializable { * Fills the content pane. */ private void fillContentPane() { - loggingArea = logging.getLoggingArea(); + logingArea = loging.getLoggingArea(); splitPaneH = new JSplitPane(); splitPaneV = new JSplitPane(); /* Not null if init has been called from the deserialization */ if (this.simulatorVisualization == null) - simulatorVisualization = new VSSimulatorVisualization(prefs, this, logging); + simulatorVisualization = new VSSimulatorVisualization(prefs, this, loging); taskManager = simulatorVisualization.getTaskManager(); - logging.setSimulatorCanvas(simulatorVisualization); + loging.setSimulatorCanvas(simulatorVisualization); JPanel canvasPanel = new JPanel(); canvasPanel.setLayout(new GridLayout(1, 1, 3, 3)); @@ -665,10 +665,10 @@ public class VSSimulator extends JPanel implements VSSerializable { canvasPanel.setMinimumSize(new Dimension(0, 0)); canvasPanel.setMaximumSize(new Dimension(0, 0)); - loggingPanel = new JPanel(new BorderLayout()); - loggingPanel.add(new JScrollPane(loggingArea), BorderLayout.CENTER); - loggingPanel.add(createToolsPanel(), BorderLayout.SOUTH); - loggingPanel.setPreferredSize(new Dimension(200, 1)); + logingPanel = new JPanel(new BorderLayout()); + logingPanel.add(new JScrollPane(logingArea), BorderLayout.CENTER); + logingPanel.add(createToolsPanel(), BorderLayout.SOUTH); + logingPanel.setPreferredSize(new Dimension(200, 1)); splitPaneH.setOrientation(JSplitPane.HORIZONTAL_SPLIT); splitPaneH.setLeftComponent(createProcessPanel()); @@ -678,7 +678,7 @@ public class VSSimulator extends JPanel implements VSSerializable { splitPaneV.setOrientation(JSplitPane.VERTICAL_SPLIT); splitPaneV.setTopComponent(splitPaneH); - splitPaneV.setBottomComponent(loggingPanel); + splitPaneV.setBottomComponent(logingPanel); splitPaneV.setContinuousLayout(true); this.add(splitPaneV); @@ -758,18 +758,18 @@ public class VSSimulator extends JPanel implements VSSerializable { toolsPanel.add(antiAliasing); } - JCheckBox loggingActiveCheckBox = new JCheckBox( - prefs.getString("lang.logging.active")); - loggingActiveCheckBox.setSelected(true); - loggingActiveCheckBox.addChangeListener(new ChangeListener() { + JCheckBox logingActiveCheckBox = new JCheckBox( + prefs.getString("lang.loging.active")); + logingActiveCheckBox.setSelected(true); + logingActiveCheckBox.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent ce) { AbstractButton abstractButton = (AbstractButton) ce.getSource(); ButtonModel buttonModel = abstractButton.getModel(); - logging.isPaused(!buttonModel.isSelected()); + loging.isPaused(!buttonModel.isSelected()); } }); - toolsPanel.add(loggingActiveCheckBox); + toolsPanel.add(logingActiveCheckBox); if (expertMode) { filterActiveCheckBox = new JCheckBox( @@ -780,9 +780,9 @@ public class VSSimulator extends JPanel implements VSSerializable { AbstractButton abstractButton = (AbstractButton) ce.getSource(); ButtonModel buttonModel = abstractButton.getModel(); - logging.isFiltered(buttonModel.isSelected()); + loging.isFiltered(buttonModel.isSelected()); if (buttonModel.isSelected()) - logging.setFilterText(filterTextField.getText()); + loging.setFilterText(filterTextField.getText()); } }); toolsPanel.add(filterActiveCheckBox); @@ -791,25 +791,25 @@ public class VSSimulator extends JPanel implements VSSerializable { filterTextField.getDocument().addDocumentListener( new DocumentListener() { public void insertUpdate(DocumentEvent de) { - logging.setFilterText(filterTextField.getText()); + loging.setFilterText(filterTextField.getText()); } public void removeUpdate(DocumentEvent de) { - logging.setFilterText(filterTextField.getText()); + loging.setFilterText(filterTextField.getText()); } public void changedUpdate(DocumentEvent de) { - logging.setFilterText(filterTextField.getText()); + loging.setFilterText(filterTextField.getText()); } }); toolsPanel.add(filterTextField); JButton clearButton = new JButton( - prefs.getString("lang.logging.clear")); + prefs.getString("lang.loging.clear")); clearButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { String command = ae.getActionCommand(); if (command.equals( - prefs.getString("lang.logging.clear"))) { - logging.clear(); + prefs.getString("lang.loging.clear"))) { + loging.clear(); } } }); @@ -1468,8 +1468,8 @@ public class VSSimulator extends JPanel implements VSSerializable { } /* Update the tools panel */ - loggingPanel.remove(1); - loggingPanel.add(createToolsPanel(), BorderLayout.SOUTH); + logingPanel.remove(1); + logingPanel.add(createToolsPanel(), BorderLayout.SOUTH); updateUI(); } @@ -1522,7 +1522,7 @@ public class VSSimulator extends JPanel implements VSSerializable { System.out.println("Deserializing: VSSimulator"); serialize.setObject("simulator", this); - serialize.setObject("logging", logging); + serialize.setObject("loging", loging); /** For later backwards compatibility, to add more stuff */ objectInputStream.readObject(); diff --git a/sources/simulator/VSSimulatorVisualization.java b/sources/simulator/VSSimulatorVisualization.java index b1f7e45..aa92c00 100644 --- a/sources/simulator/VSSimulatorVisualization.java +++ b/sources/simulator/VSSimulatorVisualization.java @@ -64,8 +64,8 @@ public class VSSimulatorVisualization extends Canvas /** The prefs. */ private VSPrefs prefs; - /** The logging. */ - private VSLogging logging; + /** The loging. */ + private VSLogging loging; /** The num processes. */ private volatile int numProcesses; @@ -472,11 +472,11 @@ public class VSSimulatorVisualization extends Canvas * * @param prefs the prefs * @param simulator the simulator - * @param logging the logging + * @param loging the loging */ public VSSimulatorVisualization(VSPrefs prefs, VSSimulator simulator, - VSLogging logging) { - init(prefs, simulator, logging); + VSLogging loging) { + init(prefs, simulator, loging); } /** @@ -484,13 +484,13 @@ public class VSSimulatorVisualization extends Canvas * * @param prefs the prefs * @param simulator the simulator - * @param logging the logging + * @param loging the loging */ private void init(VSPrefs prefs, VSSimulator simulator, - VSLogging logging) { + VSLogging loging) { this.prefs = prefs; this.simulator = simulator; - this.logging = logging; + this.loging = loging; this.messageLines = new LinkedList<VSMessageLine>(); this.messageLinesToRemove = new LinkedList<VSMessageLine>(); @@ -1300,7 +1300,7 @@ public class VSSimulatorVisualization extends Canvas * Starts/plays the simulator. */ public void play() { - logging.logg(prefs.getString("lang.simulator.started")); + loging.log(prefs.getString("lang.simulator.started")); final long currentTime = System.currentTimeMillis(); synchronized (processes) { @@ -1338,7 +1338,7 @@ public class VSSimulatorVisualization extends Canvas simulator.finish(); hasFinished = true; - logging.logg(prefs.getString("lang.simulator.finished")); + loging.log(prefs.getString("lang.simulator.finished")); paint(); if (prefs.getBoolean("sim.periodic")) { @@ -1359,7 +1359,7 @@ public class VSSimulatorVisualization extends Canvas } pauseTime = System.currentTimeMillis(); - logging.logg(prefs.getString("lang.simulator.paused")); + loging.log(prefs.getString("lang.simulator.paused")); paint(); } @@ -1368,7 +1368,7 @@ public class VSSimulatorVisualization extends Canvas */ public void reset() { if (!isResetted) { - logging.logg(prefs.getString("lang.simulator.resetted")); + loging.log(prefs.getString("lang.simulator.resetted")); isResetted = true; isPaused = false; @@ -1402,7 +1402,7 @@ public class VSSimulatorVisualization extends Canvas } paint(); - logging.clear(); + loging.clear(); } } @@ -1677,8 +1677,8 @@ public class VSSimulatorVisualization extends Canvas */ private VSInternalProcess createProcess(int processNum) { VSInternalProcess process = - new VSInternalProcess(prefs, processNum, this, logging); - logging.logg(prefs.getString("lang.process.new") + "; " + process); + new VSInternalProcess(prefs, processNum, this, loging); + loging.log(prefs.getString("lang.process.new") + "; " + process); return process; } @@ -1799,7 +1799,7 @@ public class VSSimulatorVisualization extends Canvas processCounter = ((Integer) objectInputStream.readObject()).intValue(); int num = ((Integer) objectInputStream.readObject()).intValue(); - logging.clear(); + loging.clear(); if (num > numProcesses) { for (int i = numProcesses; i < num; ++i) |
