summaryrefslogtreecommitdiff
path: root/sources/simulator/VSLogging.java
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/simulator/VSLogging.java
parent62fe28f0b0b0c9ebde18a6dc33907889ff3aa21b (diff)
JAutoDoc :)
Diffstat (limited to 'sources/simulator/VSLogging.java')
-rw-r--r--sources/simulator/VSLogging.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/sources/simulator/VSLogging.java b/sources/simulator/VSLogging.java
index c303bec..fe76abc 100644
--- a/sources/simulator/VSLogging.java
+++ b/sources/simulator/VSLogging.java
@@ -1,3 +1,7 @@
+/*
+ * VS is (c) 2008 by Paul C. Buetow
+ * vs@dev.buetow.org
+ */
package simulator;
import java.util.*;
@@ -6,16 +10,39 @@ import javax.swing.*;
import utils.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class VSLogging.
+ */
public class VSLogging {
+
+ /** The logging area. */
private JTextArea loggingArea;
+
+ /** The filter text. */
private String filterText;
+
+ /** The pause lines. */
private ArrayList<StringBuffer> pauseLines;
+
+ /** The logging lines. */
private ArrayList<StringBuffer> loggingLines;
+
+ /** The simulation canvas. */
private VSSimulatorCanvas simulationCanvas;
+
+ /** The is filtered. */
private boolean isFiltered;
+
+ /** The is paused. */
private boolean isPaused;
+
+ /** The filter pattern. */
private Pattern filterPattern;
+ /**
+ * Instantiates a new vS logging.
+ */
public VSLogging() {
loggingArea = new JTextArea(0, 0);
loggingArea.setEditable(false);
@@ -26,14 +53,29 @@ public class VSLogging {
filterText = "";
}
+ /**
+ * Sets the simulation canvas.
+ *
+ * @param simulationCanvas the new simulation canvas
+ */
public void setSimulationCanvas(VSSimulatorCanvas simulationCanvas) {
this.simulationCanvas = simulationCanvas;
}
+ /**
+ * Gets the logging area.
+ *
+ * @return the logging area
+ */
public JTextArea getLoggingArea() {
return loggingArea;
}
+ /**
+ * Logg.
+ *
+ * @param message the message
+ */
public void logg(String message) {
if (simulationCanvas == null)
logg(message, 0);
@@ -41,6 +83,12 @@ public class VSLogging {
logg(message, simulationCanvas.getTime());
}
+ /**
+ * Logg.
+ *
+ * @param message the message
+ * @param time the time
+ */
public synchronized void logg(String message, long time) {
StringBuffer buffer = new StringBuffer();
buffer.append(VSTools.getTimeString(time));
@@ -53,6 +101,11 @@ public class VSLogging {
loggFiltered(buffer);
}
+ /**
+ * Checks if is paused.
+ *
+ * @param isPaused the is paused
+ */
public synchronized void isPaused(boolean isPaused) {
this.isPaused = isPaused;
@@ -64,6 +117,11 @@ public class VSLogging {
}
}
+ /**
+ * Logg filtered.
+ *
+ * @param buffer the buffer
+ */
private void loggFiltered(StringBuffer buffer) {
loggingLines.add(buffer);
if (!isFiltered) {
@@ -76,6 +134,11 @@ public class VSLogging {
}
}
+ /**
+ * Checks if is filtered.
+ *
+ * @param isFiltered the is filtered
+ */
public synchronized void isFiltered(boolean isFiltered) {
this.isFiltered = isFiltered;
@@ -85,17 +148,28 @@ public class VSLogging {
filter();
}
+ /**
+ * Sets the filter text.
+ *
+ * @param filterText the new filter text
+ */
public synchronized void setFilterText(String filterText) {
this.filterText = filterText;
filter();
}
+ /**
+ * Clear.
+ */
public synchronized void clear() {
loggingLines.clear();
pauseLines.clear();
loggingArea.setText("");
}
+ /**
+ * Filter.
+ */
private void filter() {
try {
filterPattern = Pattern.compile(filterText);