From: <jom...@us...> - 2014-04-20 21:52:19
|
Revision: 1772 http://sourceforge.net/p/jason/svn/1772 Author: jomifred Date: 2014-04-20 21:52:15 +0000 (Sun, 20 Apr 2014) Log Message: ----------- fix problem in MASConsoleColorGUI Modified Paths: -------------- trunk/src/jason/architecture/AgArch.java trunk/src/jason/asSemantics/TransitionSystem.java trunk/src/jason/bb/JDBCPersistentBB.java trunk/src/jason/runtime/MASConsoleColorGUI.java Modified: trunk/src/jason/architecture/AgArch.java =================================================================== --- trunk/src/jason/architecture/AgArch.java 2014-03-31 17:43:53 UTC (rev 1771) +++ trunk/src/jason/architecture/AgArch.java 2014-04-20 21:52:15 UTC (rev 1772) @@ -201,7 +201,7 @@ * Executes the action <i>action</i> and, when finished, add it back in * <i>feedback</i> actions. */ - // TODO: remove feedback parameter and use getTS().addFeedbackAction + // TODO: remove feedback parameter and use getTS().addFeedbackAction in a new method of this class to be executed when the action is finished (as actionExecuted of centralised) // for jason 2.0 to avoid backward compatibility problems public void act(ActionExec action, List<ActionExec> feedback) { if (successor != null) Modified: trunk/src/jason/asSemantics/TransitionSystem.java =================================================================== --- trunk/src/jason/asSemantics/TransitionSystem.java 2014-03-31 17:43:53 UTC (rev 1771) +++ trunk/src/jason/asSemantics/TransitionSystem.java 2014-04-20 21:52:15 UTC (rev 1772) @@ -858,7 +858,11 @@ //System.out.println("adding "+t+"="+renamedVars.function.get(v)); if (adds == null) adds = new HashMap<VarTerm, Term>(); - adds.put((VarTerm)t,renamedVars.function.get(v)); + try { + adds.put((VarTerm)t,renamedVars.function.get(v)); + } catch (Exception e) { + logger.log(Level.SEVERE, "*** Error adding var into renamed vars. var="+v+", value="+t+".", e); + } } } if (adds != null) Modified: trunk/src/jason/bb/JDBCPersistentBB.java =================================================================== --- trunk/src/jason/bb/JDBCPersistentBB.java 2014-03-31 17:43:53 UTC (rev 1771) +++ trunk/src/jason/bb/JDBCPersistentBB.java 2014-04-20 21:52:15 UTC (rev 1772) @@ -371,8 +371,9 @@ return iterator(); } else { // get all rows of l's table + String q = null; try { - String q = getSelect(l); + q = getSelect(l); if (logger.isLoggable(Level.FINE)) logger.fine("getRelevant query for "+l+": "+q); final ResultSet rs = conn.createStatement().executeQuery(q); return new Iterator<Literal>() { @@ -409,7 +410,7 @@ } }; } catch (SQLException e) { - logger.log(Level.SEVERE, "SQL Error in getRelevant for "+l, e); + logger.log(Level.SEVERE, "SQL Error in getRelevant for "+l+" with query "+q, e); } } return null; Modified: trunk/src/jason/runtime/MASConsoleColorGUI.java =================================================================== --- trunk/src/jason/runtime/MASConsoleColorGUI.java 2014-03-31 17:43:53 UTC (rev 1771) +++ trunk/src/jason/runtime/MASConsoleColorGUI.java 2014-04-20 21:52:15 UTC (rev 1772) @@ -48,7 +48,7 @@ output.setEditable(false); ((DefaultCaret)output.getCaret()).setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); if (isTabbed()) { - tabPane.add("common", new JScrollPane(output)); + tabPane.add(" all", new JScrollPane(output)); } else { pcenter.add(BorderLayout.CENTER, new JScrollPane(output)); } @@ -75,10 +75,18 @@ if (isTabbed() && agName != null) { MASColorTextPane ta = agsTextArea.get(agName); if (ta == null) { - ta = new MASColorTextPane(c); - ta.setEditable(false); - agsTextArea.put(agName, ta); - tabPane.add(agName, new JScrollPane(ta)); + synchronized (this) { + ta = new MASColorTextPane(Color.black); + ta.setEditable(false); + agsTextArea.put(agName, ta); + int i = 0; + for (; i<tabPane.getTabCount(); i++) { + if (agName.toUpperCase().compareTo( tabPane.getTitleAt(i).toUpperCase()) < 0) + break; + } + tabPane.add(new JScrollPane(ta),i); + tabPane.setTitleAt(i, agName); + } } if (ta != null) { // no new TA was created // print out @@ -124,7 +132,7 @@ protected static int change = 0; protected static int lastColor = 0; - public static Color getNextAvailableColor() { + public synchronized static Color getNextAvailableColor() { if(change > 0) { seq[lastColor] = (change%2 == 1)?seq[lastColor].brighter():seq[lastColor].darker(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |