From c015d586d22b69078b6da61858e5675793856b0b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 25 May 2008 08:10:13 +0000 Subject: JAutoDoc :) --- sources/simulator/VSLogging.java | 74 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'sources/simulator/VSLogging.java') 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 pauseLines; + + /** The logging lines. */ private ArrayList 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); -- cgit v1.2.3