|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.simbrain.workspace.Workspace
public class Workspace
Workspace is the high-level container for all Simbrain windows--network, world, and gauge. These components are handled here, as are couplings and linkages between them.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| 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.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Workspace()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
React to menu selections. |
void |
addConsole()
Add a beanshell console. |
void |
addDataWorld(boolean makeVisible)
Add a new world to the workspace, to be initialized with default values. |
void |
addDataWorld(DataWorldFrame world,
boolean makeVisible)
Add a world to the workspace. |
void |
addGauge(boolean makeVisible)
Add a new gauge to the workspace, to be initialized with default values. |
void |
addGauge(GaugeFrame gauge,
boolean makeVisible)
Add a gauge to the workspace. |
void |
addNetwork(boolean makeVisible)
Add a network to the workspace, to be initialized with default values. |
void |
addNetwork(NetworkFrame network,
boolean makeVisible)
Add a network to the workspace. |
void |
addOdorWorld(boolean makeVisible)
Add a new world to the workspace, to be initialized with default values. |
void |
addOdorWorld(OdorWorldFrame world,
boolean makeVisible)
Add a world to the workspace. |
void |
addTextWorld(boolean makeVisible)
Adds a new text world to the workspace. |
void |
addTextWorld(TextWorldFrame world,
boolean makeVisible)
Adds a new text world to the workspace. |
void |
addVisionWorld(boolean makeVisible)
Add a new world to the workspace, to be initialized with default values. |
void |
addVisionWorld(VisionWorldFrame world,
boolean makeVisible)
Add a world to the workspace. |
void |
attachAgentsToCouplings()
When a new world is opened, see if any open networks have "null" couplings that that world's agents can attach to. |
void |
attachAgentsToCouplings(ArrayList couplings)
Look for "null" couplings (couplings with no agent field), and try to find suitable agents to attach them to. |
boolean |
changesExist()
Check whether there have been changes in the workspace or its components. |
void |
clearWorkspace()
Remove all items (networks, worlds, etc.) from this workspace. |
void |
componentHidden(ComponentEvent arg0)
Responds to component hidden events. |
void |
componentMoved(ComponentEvent arg0)
Responds to component moved events. |
void |
componentResized(ComponentEvent arg0)
Responds to component resized events. |
void |
componentShown(ComponentEvent arg0)
Responds to component shown events. |
protected JMenuBar |
createMenuBar()
Build the menu bar. |
void |
disposeAllFrames()
Disposes all frames. |
void |
exportWorkspace()
Export a workspace file: that is, save all workspace components and then a simple workspace file correpsonding to them. |
Agent |
findMatchingAgent(Coupling c)
Associates a coupling with a matching agent in the current workspace. |
ArrayList |
getAgentList()
Get a list of all agents in the workspace. |
ArrayList |
getCouplingList()
|
File |
getCurrentFile()
|
ArrayList |
getDataWorldChangeList()
|
ArrayList |
getDataWorldList()
|
GaugeFrame |
getGauge(String name)
Return a named gauge, null otherwise. |
GaugeFrame |
getGaugeAssociatedWithNetwork(String networkName)
Return the gauge associated with a network (by name), null otherwise. |
ArrayList |
getGaugeChangeList()
|
ArrayList |
getGaugeList()
|
JMenu |
getGaugeMenu(ActionListener al)
Returns a menu which shows what gauges are currently in the workspace Returns null if ther are no gauges. |
ArrayList |
getGauges(NetworkFrame net)
Get those gauges gauged by the given network. |
DataWorldFrame |
getLastDataWorld()
|
GaugeFrame |
getLastGauge()
|
NetworkFrame |
getLastNetwork()
|
OdorWorldFrame |
getLastOdorWorld()
|
JMenu |
getMotorCommandMenu(ActionListener al,
NeuronNode theNode)
Returns a menu which shows what possible sources there are for motor couplings in this workspace. |
NetworkFrame |
getNetwork(String name)
Return a named network, null otherwise. |
ArrayList |
getNetworkChangeList()
|
ArrayList |
getNetworkList()
|
ArrayList |
getOdorWorldChangeList()
|
ArrayList |
getOdorWorldList()
|
JMenu |
getSensorIdMenu(ActionListener al,
NeuronNode theNode)
Returns a menu which shows what possible sources there are for sensory couplings in this workspace. |
ArrayList |
getWorldFrameList()
|
ArrayList |
getWorldList()
|
boolean |
hasWorkspaceChanged()
|
void |
importWorkspace()
Import a workspace. |
static void |
main(String[] args)
Simbrain main method. |
void |
menuCanceled(MenuEvent arg0)
Responds to menu canceled events. |
void |
menuDeselected(MenuEvent arg0)
Responds to menu deslected events. |
void |
menuSelected(MenuEvent arg0)
Responds to menu selected events. |
protected void |
quit()
Quit application. |
void |
removeAgentsFromCouplings(ArrayList agents)
Remove all given agents from the couplng list, by setting the agent field on those couplings to null. |
void |
removeAgentsFromCouplings(World w)
Remove all given agents from the couplng list, by setting the agent field on those couplings to null. |
void |
repaintAllNetworks()
Repaint all open network panels. |
void |
saveFile()
Show the save dialog. |
void |
setCurrentFile(File currentFile)
|
void |
setDataWorldList(ArrayList dataWorldList)
|
void |
setGaugeList(ArrayList gaugeList)
|
void |
setNetworkList(ArrayList networkList)
|
void |
setOdorWorldList(ArrayList odorWorldList)
|
void |
setWorkspaceChanged(boolean workspaceChanged)
Sets whether the workspace has been changed. |
void |
showSaveFileAsDialog()
Shows the dialog for saving a workspace file. |
void |
windowActivated(WindowEvent arg0)
Responds to window activated events. |
void |
windowClosed(WindowEvent arg0)
Responds to window closed events. |
void |
windowClosing(WindowEvent arg0)
Responds to window closing events. |
void |
windowDeactivated(WindowEvent arg0)
Responds to window deactivated events. |
void |
windowDeiconified(WindowEvent arg0)
Responds to window deiconified events. |
void |
windowIconified(WindowEvent arg0)
Responds to window iconified events. |
void |
windowOpened(WindowEvent arg0)
Responds to window opened events. |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Constructor Detail |
|---|
public Workspace()
| Method Detail |
|---|
protected JMenuBar createMenuBar()
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - Action eventpublic void addNetwork(boolean makeVisible)
makeVisible - Determines whether or not frame is visible when a new on is createdpublic void addConsole()
public void addNetwork(NetworkFrame network,
boolean makeVisible)
network - the networkFrame to addmakeVisible - Determines whether or not frame is visible when a new on is createdpublic void addOdorWorld(boolean makeVisible)
makeVisible - Determines whether or not frame is visible when a new on is created
public void addOdorWorld(OdorWorldFrame world,
boolean makeVisible)
world - the worldFrame to addmakeVisible - Determines whether or not frame is visible when a new on is createdpublic void addDataWorld(boolean makeVisible)
makeVisible - Determines whether or not frame is visible when a new on is created
public void addDataWorld(DataWorldFrame world,
boolean makeVisible)
world - the worldFrame to addmakeVisible - make the world visible after creating it. Used for opening worlds.public void addVisionWorld(boolean makeVisible)
makeVisible - Determines whether or not frame is visible when a new on is created
public void addVisionWorld(VisionWorldFrame world,
boolean makeVisible)
world - the worldFrame to addmakeVisible - Determines whether or not frame is visible when a new on is createdpublic void addTextWorld(boolean makeVisible)
makeVisible - Determines whether or not frame is visible when a new on is created
public void addTextWorld(TextWorldFrame world,
boolean makeVisible)
world - Text world to addmakeVisible - Determines whether or not frame is visible when a new on is createdpublic void addGauge(boolean makeVisible)
makeVisible - Determines whether or not frame is visible when a new on is created
public void addGauge(GaugeFrame gauge,
boolean makeVisible)
gauge - the worldFrame to addmakeVisible - Determines whether or not frame is visible when a new on is createdpublic NetworkFrame getLastNetwork()
public OdorWorldFrame getLastOdorWorld()
public DataWorldFrame getLastDataWorld()
public GaugeFrame getLastGauge()
public GaugeFrame getGaugeAssociatedWithNetwork(String networkName)
networkName - Name of network to associate gauge
public GaugeFrame getGauge(String name)
name - Name of gauge
public ArrayList getGauges(NetworkFrame net)
net - Network frame
public NetworkFrame getNetwork(String name)
name - Name of network
public void clearWorkspace()
public void disposeAllFrames()
public void importWorkspace()
public void showSaveFileAsDialog()
public void exportWorkspace()
public void saveFile()
public void repaintAllNetworks()
public static void main(String[] args)
args - currently not usedpublic ArrayList getNetworkList()
public void setNetworkList(ArrayList networkList)
networkList - The networkList to set.public ArrayList getWorldFrameList()
public ArrayList getGaugeList()
public void setGaugeList(ArrayList gaugeList)
gaugeList - The gaugeList to set.public ArrayList getAgentList()
public JMenu getMotorCommandMenu(ActionListener al,
NeuronNode theNode)
al - Action listenertheNode - Neuron node
public JMenu getSensorIdMenu(ActionListener al,
NeuronNode theNode)
al - Action listenertheNode - Neuron node
public JMenu getGaugeMenu(ActionListener al)
al - Action listener
public Agent findMatchingAgent(Coupling c)
c - a temporary coupling which holds an agent-name, agent-type, and world-name
public void attachAgentsToCouplings(ArrayList couplings)
couplings - the set of couplings to checkpublic void attachAgentsToCouplings()
public void removeAgentsFromCouplings(World w)
w - the world whose agents should be removedpublic void removeAgentsFromCouplings(ArrayList agents)
agents - the list of agents to be removed.public ArrayList getCouplingList()
public ArrayList getWorldList()
public ArrayList getDataWorldList()
public void setDataWorldList(ArrayList dataWorldList)
dataWorldList - The dataWorldList to set.public ArrayList getOdorWorldList()
public void setOdorWorldList(ArrayList odorWorldList)
odorWorldList - The odorWorldList to set.public boolean changesExist()
public ArrayList getOdorWorldChangeList()
public ArrayList getNetworkChangeList()
public ArrayList getDataWorldChangeList()
public ArrayList getGaugeChangeList()
protected void quit()
public void windowOpened(WindowEvent arg0)
windowOpened in interface WindowListenerarg0 - Window eventpublic void windowClosing(WindowEvent arg0)
windowClosing in interface WindowListenerarg0 - Window eventpublic void windowClosed(WindowEvent arg0)
windowClosed in interface WindowListenerarg0 - Window eventpublic void windowIconified(WindowEvent arg0)
windowIconified in interface WindowListenerarg0 - Window eventpublic void windowDeiconified(WindowEvent arg0)
windowDeiconified in interface WindowListenerarg0 - Window eventpublic void windowActivated(WindowEvent arg0)
windowActivated in interface WindowListenerarg0 - Window eventpublic void windowDeactivated(WindowEvent arg0)
windowDeactivated in interface WindowListenerarg0 - Window eventpublic boolean hasWorkspaceChanged()
public void setWorkspaceChanged(boolean workspaceChanged)
workspaceChanged - Has workspace been changed valuepublic File getCurrentFile()
public void setCurrentFile(File currentFile)
currentFile - The current_file to set.public void componentHidden(ComponentEvent arg0)
componentHidden in interface ComponentListenerarg0 - Component eventpublic void componentMoved(ComponentEvent arg0)
componentMoved in interface ComponentListenerarg0 - Component eventpublic void componentResized(ComponentEvent arg0)
componentResized in interface ComponentListenerarg0 - Component eventpublic void componentShown(ComponentEvent arg0)
componentShown in interface ComponentListenerarg0 - Component eventpublic void menuSelected(MenuEvent arg0)
menuSelected in interface MenuListenerarg0 - Menu eventpublic void menuDeselected(MenuEvent arg0)
menuDeselected in interface MenuListenerarg0 - Menu eventpublic void menuCanceled(MenuEvent arg0)
menuCanceled in interface MenuListenerarg0 - Menu event
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||