* http://java.sun.com/docs/books/tutorial/uiswing/components/list.html
* http://java.sun.com/docs/books/tutorial/ui/features/components.html
(visual gallery of Swing components)
Some of NARS output is sequential objects, so rather than appending
strings to a TextArea, appending a *message object* to a list. (This
could save memory if the message object's size is less than its expanded
string equivalent.)
ListCellRenderer can, depending on the content of a message object, can
adjust the font color, add an icon, or display multiple JLabel lines
(ex: title, sub-title). Buttons outside of the JList can adjust the
ListCellRenderer's parameters, like +/- sizing for more or less visible.
Some of these message objects might package the equivalent of several
TextArea "lines", such as a list of statements. Then these lists of
statements can be displayed / accessed by one GUI component. Certain
message objects could be tagged with a "reason" or "quality" of why they
were generated, affecting the color, font, icon, etc...
One disadvantage, though, is not being able to copy/paste like the
TextArea allows. Though you could generate the TextArea text from a
list of messages ex: concatenating their toString(), and the
concatenation could occur on a certain filtered subset of the messages.
These are all good ideas, though I probably won't have time for GUI
soon --- especially after the new semester starts at today. :-(
> One disadvantage, though, is not being able to copy/paste like the
> TextArea allows. Though you could generate the TextArea text from a
> list of messages ex: concatenating their toString(), and the
> concatenation could occur on a certain filtered subset of the messages.
Except the InputWindow, copy/paste is not absolutely necessary, though
it is desired, if not for the whole text, but for a single line or
term name.
Pei
S H, at the moment, the NARS interface does not depend on the Swing
library. Your suggestion is interesting, but introduces a new
dependency. Do you have an opinion about this issue?
Correct. The current GUI code was mostly written in 1999, with little
changes since then. AWT was used so that the demo can run in most
browsers in that time.
I think the GUI should be moved to Swing, though the priority of that
task hasn't been high enough in my long to-do list. :-(
> in terms of modularization (
> http://code.google.com/p/open-nars/wiki/GUIRequest and
> http://code.google.com/p/open-nars/wiki/Modules), maybe the NARS I/O and GUI
> systems could be organized into:
>
> nars.io.awt (the current contents of nars.gui)
> nars.io.swing (new GUI components)
> nars.io.swt (eclipse plugins?)
> nars.io.gwt (AJAX web interface?)
> nars.io..
>
> (replacing 'nars.gui' with 'nars.io' in consideration of how GUI's are
> essentially I/O channels for NARS existing at the same level as network,
> file, or database connections...)
>
> maybe this could be facilitated by refactoring the Memory, NARS, Parameters,
> and Center classes into:
>
> interface NAR - "non-axiomatic reasoner", a specific instance of a NARS
> implementation, with self-contained memory and executive control
> specific implementations of "NAR" would utilize specific memory and
> inference components, through a common access interface accessed by a
> separate GUI layer
I need to think more about this.
Pei
Correct. The current GUI code was mostly written in 1999, with little changes since then. AWT was used so that the demo can run in most browsers in that time. I think the GUI should be moved to Swing, though the priority of that task hasn't been high enough in my long to-do list. :-( in terms of modularization (
maybe this could be facilitated by refactoring the Memory, NARS, Parameters, and Center classes into: interface NAR - "non-axiomatic reasoner", a specific instance of a NARS implementation, with self-contained memory and executive control specific implementations of "NAR" would utilize specific memory and inference components, through a common access interface accessed by a separate GUI layer