|
From: <jom...@us...> - 2015-06-15 12:45:29
|
Revision: 1841
http://sourceforge.net/p/jason/svn/1841
Author: jomifred
Date: 2015-06-15 12:45:27 +0000 (Mon, 15 Jun 2015)
Log Message:
-----------
try to fix some problems with mas console
Modified Paths:
--------------
trunk/src/jason/runtime/MASConsoleColorGUI.java
trunk/src/jason/runtime/MASConsoleGUI.java
trunk/src/jason/runtime/OutputStreamAdapter.java
trunk/src/jason/stdlib/term2string.java
trunk/src/templates/logging.properties
Modified: trunk/src/jason/runtime/MASConsoleColorGUI.java
===================================================================
--- trunk/src/jason/runtime/MASConsoleColorGUI.java 2015-05-25 12:41:56 UTC (rev 1840)
+++ trunk/src/jason/runtime/MASConsoleColorGUI.java 2015-06-15 12:45:27 UTC (rev 1841)
@@ -2,7 +2,6 @@
import java.awt.BorderLayout;
import java.awt.Color;
-import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
@@ -77,7 +76,8 @@
if (isTabbed() && agName != null) {
MASColorTextPane ta = agsTextArea.get(agName);
if (ta == null) {
- synchronized (this) {
+ // add new tab for the agent
+ synchronized (this) {
ta = new MASColorTextPane(Color.black);
ta.setEditable(false);
agsTextArea.put(agName, ta);
@@ -101,16 +101,17 @@
}
// print in output
- synchronized (this) {
+ synchronized (output) {
int l = output.getDocument().getLength();
if (l > 60000) {
cleanConsole();
- l = 0;
+ //l = 0;
}
- output.append(c, s);
try {
- output.setCaretPosition(l);
- } catch (IllegalArgumentException e) {}
+ output.append(c, s);
+ //output.setCaretPosition(l);
+ } catch (IllegalArgumentException e) {
+ }
}
} catch (Exception e) {
try {
@@ -169,9 +170,8 @@
AttributeSet as = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, c);
try {
getDocument().insertString(getDocument().getLength(), s, as);
- } catch (BadLocationException e) {
- e.printStackTrace();
- }
+ } catch (BadLocationException e) {
+ }
}
}
Modified: trunk/src/jason/runtime/MASConsoleGUI.java
===================================================================
--- trunk/src/jason/runtime/MASConsoleGUI.java 2015-05-25 12:41:56 UTC (rev 1840)
+++ trunk/src/jason/runtime/MASConsoleGUI.java 2015-06-15 12:45:27 UTC (rev 1841)
@@ -31,7 +31,6 @@
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
-import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
@@ -206,16 +205,17 @@
}
// print in output
- int l = output.getDocument().getLength();
- if (l > 60000) {
- cleanConsole();
- l = 0;
- }
- synchronized (this) {
- output.append(s);
+ synchronized (output) {
+ int l = output.getDocument().getLength();
+ if (l > 60000) {
+ cleanConsole();
+ //l = 0;
+ }
try {
- output.setCaretPosition(l);
- } catch (java.lang.IllegalArgumentException e) {}
+ output.append(s);
+ //output.setCaretPosition(l);
+ } catch (IllegalArgumentException e) {
+ }
}
} catch (Exception e) {
try {
Modified: trunk/src/jason/runtime/OutputStreamAdapter.java
===================================================================
--- trunk/src/jason/runtime/OutputStreamAdapter.java 2015-05-25 12:41:56 UTC (rev 1840)
+++ trunk/src/jason/runtime/OutputStreamAdapter.java 2015-06-15 12:45:27 UTC (rev 1841)
@@ -63,7 +63,8 @@
void append(String s) {
if (masConsole != null) {
masConsole.append(s);
- } if (ta != null) {
+ }
+ if (ta != null) {
ta.append(s);
ta.setCaretPosition(ta.getDocument().getLength());
}
Modified: trunk/src/jason/stdlib/term2string.java
===================================================================
--- trunk/src/jason/stdlib/term2string.java 2015-05-25 12:41:56 UTC (rev 1840)
+++ trunk/src/jason/stdlib/term2string.java 2015-06-15 12:45:27 UTC (rev 1841)
@@ -24,7 +24,8 @@
<p>Examples:<ul>
<li> <code>.term2string(b,"b")</code>: true.
<li> <code>.term2string(b,X)</code>: unifies X with "b".
- <li> <code>.term2string(X,"b")</code>: unified X with b.
+ <li> <code>.term2string(X,"b")</code>: unifies X with b.
+ <li> <code>.term2string(X,"10")</code>: unifies X with 10 (a number term).
</ul>
@see jason.stdlib.concat
Modified: trunk/src/templates/logging.properties
===================================================================
--- trunk/src/templates/logging.properties 2015-05-25 12:41:56 UTC (rev 1840)
+++ trunk/src/templates/logging.properties 2015-06-15 12:45:27 UTC (rev 1841)
@@ -29,7 +29,7 @@
jason.runtime.MASConsoleLogHandler.formatter = jason.runtime.MASConsoleLogFormatter
# set one text area for each agent
jason.runtime.MASConsoleLogHandler.tabbed = false
-jason.runtime.MASConsoleLogHandler.colors = true
+jason.runtime.MASConsoleLogHandler.colors = false
# default file output is in project's directory.
java.util.logging.FileHandler.pattern = mas.log
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|