|
||||||||||
| 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.visionworld.VisionWorld
public class VisionWorld
< b>VisionWorld < /b> provides visual input to a neural network in the form of a grid of pixels that can be turned on or off by the user.
| Nested Class Summary |
|---|
| 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 | |
|---|---|
VisionWorld()
The default constructor, creates the world, and registers the necessary listeners. |
|
VisionWorld(int w,
int h)
A constructor for a height and width. |
|
VisionWorld(VisionWorldFrame pf)
A constructor for the default size, built on a parent frame. |
|
| Method Summary | |
|---|---|
void |
addCommandTarget(NetworkPanel net)
|
void |
completedInputRound()
Completed input round. |
ArrayList |
getAgentList()
Return the list of agents for this world. |
ArrayList |
getCommandTargets()
|
JMenu |
getMotorCommandMenu(ActionListener al)
Not yet implemented. |
int |
getNumPixelsColumn()
|
int |
getNumPixelsRow()
|
VisionWorldFrame |
getParentFrame()
|
World |
getParentWorld()
Return the parent world for this agent. |
Pixel |
getPixel(int x,
int y)
|
Pixel |
getSelectedPixel(MouseEvent e)
|
String |
getSelectedPixelToolTip(MouseEvent e)
|
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. |
double |
getStimulus(String[] sensorID)
Accepts a string in the form "x","y". |
String |
getType()
Return the type of this world. |
String |
getWorldName()
Return the name of this world. |
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
Drag-Flips a series of pixels. |
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
Sets the tooltip text of the mouse to the hovered-over pixel. |
void |
mousePressed(MouseEvent e)
Flips a pixel, or turns on pixel dragging. |
void |
mouseReleased(MouseEvent e)
|
void |
paint(Graphics g)
Overrides the paint method of the JPanel component, providing special qualifiers for pixels. |
void |
rebuild()
Rebuilds the world to an appropriate form. |
void |
redimension(int w,
int h)
Changes the dimensions of the world. |
void |
removeCommandTarget(NetworkPanel net)
|
void |
setMotorCommand(String[] commandList,
double value)
Not yet implemented. |
void |
setNumPixelsColumn(int numPixelsColumn)
|
void |
setNumPixelsRow(int numPixelsRow)
|
void |
setParentFrame(VisionWorldFrame parentFrame)
|
void |
setWorldName(String name)
|
| 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 |
| Methods inherited from interface org.simbrain.world.Agent |
|---|
getName |
| Constructor Detail |
|---|
public VisionWorld()
public VisionWorld(int w,
int h)
w - the width of the desired world (in pixels)h - the height of the desired world (in pixels)public VisionWorld(VisionWorldFrame pf)
pf - the parent frame calling the constructor| Method Detail |
|---|
public void redimension(int w,
int h)
h - numPixelsColumn in pixelsw - numPixelsRow in pixels
public Pixel getPixel(int x,
int y)
x - the x location of the pixel (in pixels)y - the y location of the pixel (in pixels)
public Pixel getSelectedPixel(MouseEvent e)
e - the event for which a pixel is needed
public String getSelectedPixelToolTip(MouseEvent e)
e - the mouseEvent for which the toolTip is needed
public void paint(Graphics g)
paint in class JComponentg - the Graphics object for this worldpublic void rebuild()
public World getParentWorld()
Agent
getParentWorld in interface Agentpublic double getStimulus(String[] sensorID)
getStimulus in interface AgentsensorID - is the sensor identification array
public void setMotorCommand(String[] commandList,
double value)
setMotorCommand in interface AgentcommandList - the list of command stringsvalue - the value to set on the given commanded itempublic String getType()
World
getType in class Worldpublic ArrayList getAgentList()
World
getAgentList in class Worldpublic JMenu getMotorCommandMenu(ActionListener al)
getMotorCommandMenu in class Worldal - the action listener to be attached to these menu items
public JMenu getSensorIdMenu(ActionListener al)
World
getSensorIdMenu in class Worldal - the action listener to attach to the menu items
public void addCommandTarget(NetworkPanel net)
net - the network to add as a command targetpublic void removeCommandTarget(NetworkPanel net)
net - the network to remove as a command targetpublic ArrayList getCommandTargets()
public VisionWorldFrame getParentFrame()
public void setParentFrame(VisionWorldFrame parentFrame)
parentFrame - the parent frame to be setpublic void setWorldName(String name)
name - the name to be set for this world, also, the title for the parent framepublic String getWorldName()
World
getWorldName in class Worldpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenere - the MouseEvent triggering the methodpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenere - the MouseEvent triggering the methodpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenere - the MouseEvent triggering the methodpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenere - the MouseEvent triggering the methodpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenere - the MouseEvent triggering the methodpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenere - the MouseEvent triggering the methodpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenere - the MouseEvent triggering the methodpublic int getNumPixelsColumn()
public void setNumPixelsColumn(int numPixelsColumn)
numPixelsColumn - the numPixelsColumn to setpublic int getNumPixelsRow()
public void setNumPixelsRow(int numPixelsRow)
numPixelsRow - the numPixelsRow to setpublic void completedInputRound()
completedInputRound in interface Agent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||