|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.simbrain.world.World
org.simbrain.world.textworld.TextWorld
public class TextWorld
TextWorld acts as a text interface to neural ntworks, for use in language parsing and other tasks. Users input text which parsed into vector form and sent to the network, and vectors from the network are converted into text and sent to this world.
| Nested Class Summary | |
|---|---|
(package private) class |
TextWorld.MyHighlightPainter
A private subclass of the default highlight painter. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TextWorld(TextWorldFrame ws)
Constructs an instance of TextWorld. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Responds to action events. |
void |
addCommandTarget(NetworkPanel net)
Adds command to agent selected. |
ArrayList |
getAgentList()
Return the list of agents for this world. |
ArrayList |
getCommandTargets()
Gets commands currently attached to agent. |
String |
getCurrentLine()
Returns the current line of text. |
Color |
getHilightColor()
|
JMenu |
getMotorCommandMenu(ActionListener al)
Return a menu of motor commands for this world and register the specified action listener as an action listener for the menu items in the returned menu. |
TextWorldFrame |
getParentFrame()
|
boolean |
getParseChar()
|
boolean |
getSendEnter()
|
JMenu |
getSensorIdMenu(ActionListener al)
Return a menu of sensor ids for this world and register the specified action listener as an action listener for the menu items in the returned menu. |
String |
getType()
Return the type of this world. |
String |
getWorldName()
Return the name of this world. |
void |
highlight(int begin,
int end)
Highlight word beginning at begin nd ending at end. |
void |
keyPressed(KeyEvent e)
Responds to key pressed events. |
void |
keyReleased(KeyEvent arg0)
Responds to key released events. |
void |
keyTyped(KeyEvent arg0)
Responds to the key typed. |
void |
mouseClicked(MouseEvent arg0)
Responds to mouse button click events. |
void |
mouseEntered(MouseEvent arg0)
Responds to events when mouse is in area. |
void |
mouseExited(MouseEvent arg0)
Responds to events when mouse is outside area. |
void |
mousePressed(MouseEvent arg0)
Responds to events when mouse button is pressed. |
void |
mouseReleased(MouseEvent arg0)
Responds to events when mouse button is released. |
void |
parseText(String text)
Parse a line of text. |
void |
parseWord(char[] text)
Break text into space-delimited words to send to network. |
void |
removeCommandTarget(NetworkPanel net)
Removes command from agent selected. |
void |
removeHighlights(JTextComponent textComp)
Removes highlights from specified component. |
void |
setHilightColor(Color hilightColor)
|
void |
setParentFrame(TextWorldFrame parentFrame)
|
void |
setParseChar(boolean parseChar)
Set whether to parse by character. |
void |
setSendEnter(boolean sendEnter)
|
void |
setWorldName(String worldName)
|
void |
showTextWorldDialog()
Displays a dialog for settable TextWorld preferences. |
| Methods inherited from class org.simbrain.world.World |
|---|
addWorldListener, fireWorldChanged, removeWorldListener |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextWorld(TextWorldFrame ws)
ws - Instance of TextWorldFrame| Method Detail |
|---|
public void showTextWorldDialog()
public String getType()
World
getType in class Worldpublic ArrayList getAgentList()
World
getAgentList in class Worldpublic JMenu getMotorCommandMenu(ActionListener al)
World
getMotorCommandMenu in class Worldal - ActionListener
public JMenu getSensorIdMenu(ActionListener al)
World
getSensorIdMenu in class Worldal - ActionListener
public void addCommandTarget(NetworkPanel net)
net - Network panelpublic void removeCommandTarget(NetworkPanel net)
net - Network Panelpublic ArrayList getCommandTargets()
public void keyPressed(KeyEvent e)
keyPressed in interface KeyListenere - KeyEventpublic void keyReleased(KeyEvent arg0)
keyReleased in interface KeyListenerarg0 - KeyEventpublic void keyTyped(KeyEvent arg0)
keyTyped in interface KeyListenerarg0 - KeyEventpublic void mouseClicked(MouseEvent arg0)
mouseClicked in interface MouseListenerarg0 - MouseEventpublic void mouseEntered(MouseEvent arg0)
mouseEntered in interface MouseListenerarg0 - MouseEventpublic void mouseExited(MouseEvent arg0)
mouseExited in interface MouseListenerarg0 - MouseEventpublic void mousePressed(MouseEvent arg0)
mousePressed in interface MouseListenerarg0 - MouseEventpublic void mouseReleased(MouseEvent arg0)
mouseReleased in interface MouseListenerarg0 - MouseEventpublic TextWorldFrame getParentFrame()
public void setParentFrame(TextWorldFrame parentFrame)
parentFrame - The parentFrame to set.public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - ActionEventpublic void parseText(String text)
text - text to parsepublic void parseWord(char[] text)
text - text to parse.public String getCurrentLine()
public boolean getParseChar()
public void setParseChar(boolean parseChar)
parseChar - boolean parse by character
public void highlight(int begin,
int end)
begin nd ending at end.
begin - offset of beginning of highlightend - offset of end of highlightpublic void removeHighlights(JTextComponent textComp)
textComp - text component to remove highlights from.public Color getHilightColor()
public void setHilightColor(Color hilightColor)
hilightColor - Color of highlighter.public boolean getSendEnter()
public void setSendEnter(boolean sendEnter)
sendEnter - Sets whether enter sends current line.public String getWorldName()
World
getWorldName in class Worldpublic void setWorldName(String worldName)
worldName - The worldName to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||