|
||||||||||
| 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
edu.umd.cs.piccolo.PCanvas
org.simbrain.network.NetworkPanel
public final class NetworkPanel
Network panel.
| Nested Class Summary |
|---|
| 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 edu.umd.cs.piccolo.PCanvas |
|---|
CURRENT_ZCANVAS, INTERATING_CHANGED_NOTIFICATION |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, 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 | |
|---|---|
NetworkPanel()
Create a new network panel. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
|
void |
addGauge()
Add a gauge which by default gauges all neurons of current network. |
void |
addNeuron()
Add a new neural network. |
void |
addSelectionListener(NetworkSelectionListener l)
Add the specified network selection listener. |
void |
alignHorizontal()
Aligns neurons horizontally. |
void |
alignVertical()
Aligns neurons vertically. |
void |
centerCamera()
Centers the neural network in the middle of the PCanvas. |
void |
clampChanged()
Update clamp toolbar buttons and menu items. |
void |
clearSelection()
Clear the selection. |
void |
closeNetwork()
Close model network. |
void |
copy()
Copy to the clipboard. |
void |
couplingChanged(NetworkEvent e)
Notify this listener of a CouplingChanged event. |
JMenu |
createAlignMenu()
Return the align sub menu. |
protected JToolBar |
createClampToolBar()
Create the clamp tool bar. |
(package private) JMenu |
createEditMenu()
Create and return a new Edit menu for this network panel. |
protected JToolBar |
createEditToolBar()
Create the edit tool bar. |
(package private) JMenu |
createFileMenu()
Create and return a new File menu for this network panel. |
(package private) JMenu |
createGaugeMenu()
Create and return a new Gauge menu for this network panel. |
(package private) JMenu |
createHelpMenu()
Create and return a new Help menu for this network panel. |
(package private) JMenu |
createInsertMenu()
Create and return a new Insert menu for this network panel. |
protected JToolBar |
createMainToolBar()
Create the main tool bar. |
JMenu |
createSelectionMenu()
Create a selection JMenu. |
JMenu |
createSpacingMenu()
Return the space sub menu. |
(package private) JMenu |
createViewMenu()
Create and return a new View menu for this network panel. |
void |
cut()
Cut to the clipboard. |
void |
decrementSelectedObjects()
Decreases neuron and synapse activation levels. |
void |
deleteSelectedObjects()
Delete selected itemes. |
NeuronNode |
findNeuronNode(Neuron n)
Find the NeuronNode corresponding to a given model Neuron. |
SubnetworkNode |
findSubnetworkNode(Network net)
Find the SubnetworkNode corresponding to a given model subnetwork. |
SynapseNode |
findSynapseNode(Synapse s)
Find the SynapseNode corresponding to a given model Synapse. |
boolean |
getAutoZoomMode()
|
Color |
getBackgroundColor()
Get the background color. |
JToolBar |
getClampToolBar()
|
(package private) JPopupMenu |
getContextMenu()
Return the context menu for this network panel. |
float |
getCoolColor()
|
Collection |
getCoupledNodes()
Returns model network elements corresponding to selected screen elements. |
String |
getCurrentDirectory()
Returns a string representation of the current directory. |
EditMode |
getEditMode()
Return the current edit mode for this network panel. |
JToolBar |
getEditToolBar()
|
Color |
getExcitatoryColor()
|
float |
getHotColor()
|
Color |
getInhibitoryColor()
|
boolean |
getInOutMode()
|
Point2D |
getLastClickedPosition()
|
NeuronNode |
getLastSelectedNeuron()
|
Color |
getLineColor()
|
JToolBar |
getMainToolBar()
|
int |
getMaxDiameter()
|
int |
getMinDiameter()
|
StandardNetwork |
getNetwork()
|
NetworkFrame |
getNetworkFrame()
|
Collection |
getNeuronNodes()
Return a collection of all neuron nodes. |
ArrayList |
getNodeList()
Used by Castor. |
double |
getNudgeAmount()
|
double |
getNumberOfPastes()
|
Collection |
getPersistentNodes()
Return a collection of all persistent nodes, that is all neuron nodes and all synapse nodes. |
Collection |
getSelectedModelElements()
Returns model network elements corresponding to selected screen elements. |
Collection |
getSelectedModelNeurons()
Returns selected Neurons. |
ArrayList |
getSelectedNeurons()
Returns selected Neurons. |
ArrayList |
getSelectedSynapses()
Returns selected Synapses. |
Collection |
getSelection()
Return the selection as a collection of selected elements. |
boolean |
getShowSubnetOutline()
|
boolean |
getShowTime()
|
Color |
getSignalColor()
|
Color |
getSpikingColor()
|
Collection |
getSubnetNodes()
Return a collection of all subnet nodes. |
Collection |
getSynapseNodes()
Return a collection of all synapse nodes. |
boolean |
getUsingTabs()
|
Workspace |
getWorkspace()
Returns a reference to the workspace. |
Color |
getZeroWeightColor()
|
boolean |
hasChangedSinceLastSave()
|
void |
incrementSelectedObjects()
Increases neuron and synapse activation levels. |
boolean |
isSelected(Object element)
Return true if the specified element is selected. |
boolean |
isSelectionEmpty()
Return true if the selection is empty. |
void |
modelCleared(NetworkEvent e)
|
void |
networkChanged()
Update the network, gauges, and world. |
void |
neuronAdded(NetworkEvent e)
Notify this listener of a Neuron added event. |
void |
neuronChanged(NetworkEvent e)
Notify this listener of a NeuronChanged event. |
void |
neuronRemoved(NetworkEvent e)
Notify this listener of a Neuron removed event. |
protected void |
nudge(int offsetX,
int offsetY)
Nudge selected object. |
void |
openNetwork(File file)
Open the specified network. |
void |
paste()
Paste from the clipboard. |
void |
removeSelectionListener(NetworkSelectionListener l)
Remove the specified network selection listener. |
void |
repaint()
|
void |
resetColors()
Called by network preferences as preferences are changed. |
void |
resetSynapseDiameters()
Called by network preferences as preferences are changed. |
void |
saveCurrentNetwork()
Save the current network. |
void |
saveNetwork(File networkFile)
Save network to specified file. |
void |
selectAll()
Select all elements. |
void |
setAutoZoomMode(boolean autoZoomMode)
|
void |
setBackgroundColor(Color clr)
Set the background color, store it to user preferences, and repaint the panel. |
void |
setChangedSinceLastSave(boolean changedSinceLastSave)
Set to true if this network frame has changed since it was last saved. |
void |
setCoolColor(float coolColor)
|
void |
setEditMode(EditMode editMode)
Set the current edit mode for this network panel to editMode. |
void |
setExcitatoryColor(Color excitatoryColor)
|
void |
setHotColor(float hotColor)
|
void |
setInhibitoryColor(Color inhibitoryColor)
|
void |
setInOutMode(boolean inOutMode)
|
void |
setLastClickedPosition(Point2D lastLeftClicked)
Set the last position clicked on screen. |
void |
setLastSelectedNeuron(NeuronNode lastSelectedNeuron)
|
void |
setLineColor(Color lineColor)
|
void |
setMaxDiameter(int maxDiameter)
|
void |
setMinDiameter(int minDiameter)
|
void |
setNetwork(StandardNetwork network)
Used by Castor. |
void |
setNodeList(ArrayList list)
Used by Castor. |
void |
setNudgeAmount(double nudgeAmount)
|
void |
setNumberOfPastes(double numberOfPastes)
|
void |
setSelection(Collection elements)
Set the selection to the specified collection of elements. |
void |
setShowSubnetOutline(boolean showSubnetOutline)
|
void |
setShowTime(boolean showTime)
|
void |
setSignalColor(Color signalColor)
|
void |
setSpikingColor(Color spikingColor)
|
void |
setUsingTabs(boolean usingTabs)
|
void |
setZeroWeightColor(Color zeroWeightColor)
|
boolean |
showOpenFileDialog()
Show the dialog for opening a network. |
void |
showSaveFileDialog()
Show the dialog for saving a network. |
void |
showSelectedNeuronProperties()
Creates and displays the neuron properties dialog. |
void |
showSelectedSynapseProperties()
Creates and displays the synapse properties dialog. |
void |
spaceHorizontal()
Spaces neurons horizontally. |
void |
spaceVertical()
Spaces neurons vertically. |
void |
subnetAdded(NetworkEvent e)
Notify this listener of a subnetwork added event. |
void |
subnetRemoved(NetworkEvent e)
Notify this listener of a subnetwork removed event. |
void |
synapseAdded(NetworkEvent e)
Notify this listener of a Neuron removed event. |
void |
synapseChanged(NetworkEvent e)
Notify this listener of a Neuron removed event. |
void |
synapseRemoved(NetworkEvent e)
Notify this listener of a Neuron removed event. |
void |
toggleSelection(Object element)
Toggle the selected state of the specified element; if it is selected, remove it from the selection, if it is not selected, add it to the selection. |
String |
toString()
Returns information about the network in String form. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NetworkPanel()
| Method Detail |
|---|
JMenu createFileMenu()
JMenu createEditMenu()
JMenu createInsertMenu()
JMenu createViewMenu()
public JMenu createSelectionMenu()
JMenu createGaugeMenu()
JMenu createHelpMenu()
JPopupMenu getContextMenu()
This context menu should return actions that are appropriate for the network panel as a whole, e.g. actions that change modes, actions that operate on the selection, actions that add new components, etc. Actions specific to a node of interest should be built into a node-specific context menu.
protected JToolBar createMainToolBar()
protected JToolBar createEditToolBar()
protected JToolBar createClampToolBar()
public JMenu createAlignMenu()
public JMenu createSpacingMenu()
public EditMode getEditMode()
public void setEditMode(EditMode editMode)
editMode.
This is a bound property.
editMode - edit mode for this network panel, must not be nullpublic void deleteSelectedObjects()
public void copy()
public void cut()
public void paste()
public void alignHorizontal()
public void alignVertical()
public void spaceHorizontal()
public void spaceVertical()
public void showSelectedNeuronProperties()
public void showSelectedSynapseProperties()
public void clearSelection()
public void selectAll()
public boolean isSelectionEmpty()
public boolean isSelected(Object element)
element - element
public Collection getSelection()
public void setSelection(Collection elements)
elements - elementspublic void toggleSelection(Object element)
element - elementpublic void addSelectionListener(NetworkSelectionListener l)
l - network selection listener to addpublic void removeSelectionListener(NetworkSelectionListener l)
l - network selection listener to removepublic ArrayList getSelectedNeurons()
public ArrayList getSelectedSynapses()
public Collection getSelectedModelNeurons()
public Collection getSelectedModelElements()
public Collection getCoupledNodes()
public Collection getNeuronNodes()
public Collection getSynapseNodes()
public Collection getSubnetNodes()
public Collection getPersistentNodes()
public void resetColors()
public void resetSynapseDiameters()
public String toString()
toString in class Componentpublic StandardNetwork getNetwork()
public void setNetwork(StandardNetwork network)
network - The network to set.public Point2D getLastClickedPosition()
public void centerCamera()
public void setLastClickedPosition(Point2D lastLeftClicked)
lastLeftClicked - The lastClickedPosition to set.public Workspace getWorkspace()
public void modelCleared(NetworkEvent e)
NetworkListenerpublic void addNeuron()
public void neuronAdded(NetworkEvent e)
NetworkListener
neuronAdded in interface NetworkListenere - eventNetworkListenerpublic void neuronRemoved(NetworkEvent e)
NetworkListener
neuronRemoved in interface NetworkListenere - eventNetworkListenerpublic void neuronChanged(NetworkEvent e)
NetworkListener
neuronChanged in interface NetworkListenere - eventNetworkListenerpublic void synapseAdded(NetworkEvent e)
NetworkListener
synapseAdded in interface NetworkListenere - eventNetworkListenerpublic void synapseRemoved(NetworkEvent e)
NetworkListener
synapseRemoved in interface NetworkListenere - eventNetworkListenerpublic void subnetAdded(NetworkEvent e)
NetworkListener
subnetAdded in interface NetworkListenere - eventNetworkListenerpublic void subnetRemoved(NetworkEvent e)
NetworkListener
subnetRemoved in interface NetworkListenere - eventNetworkListenerpublic void couplingChanged(NetworkEvent e)
NetworkListener
couplingChanged in interface NetworkListenere - Network eventNetworkListenerpublic void synapseChanged(NetworkEvent e)
NetworkListener
synapseChanged in interface NetworkListenere - eventNetworkListenerpublic NeuronNode findNeuronNode(Neuron n)
n - the model neuron.
public SynapseNode findSynapseNode(Synapse s)
s - the model synapse.
public SubnetworkNode findSubnetworkNode(Network net)
net - the model subnetwork.
public void setLastSelectedNeuron(NeuronNode lastSelectedNeuron)
lastSelectedNeuron - The lastSelectedNeuron to set.public NeuronNode getLastSelectedNeuron()
public void setBackgroundColor(Color clr)
clr - new background color for network panelpublic Color getBackgroundColor()
public boolean showOpenFileDialog()
public void openNetwork(File file)
file - the file describing the network to openpublic void showSaveFileDialog()
public void saveCurrentNetwork()
public void saveNetwork(File networkFile)
networkFile - the file to save the network to.public void repaint()
repaint in class ComponentPCanvaspublic boolean getAutoZoomMode()
public void setAutoZoomMode(boolean autoZoomMode)
autoZoomMode - Auto zoom mode.public ArrayList getNodeList()
public void setNodeList(ArrayList list)
list - temporary list of persistable PNodespublic NetworkFrame getNetworkFrame()
public float getCoolColor()
public void setCoolColor(float coolColor)
coolColor - The coolColor to set.public Color getExcitatoryColor()
public void setExcitatoryColor(Color excitatoryColor)
excitatoryColor - The excitatoryColor to set.public float getHotColor()
public void setHotColor(float hotColor)
hotColor - The hotColor to set.public Color getInhibitoryColor()
public void setInhibitoryColor(Color inhibitoryColor)
inhibitoryColor - The inhibitoryColor to set.public void setInOutMode(boolean inOutMode)
inOutMode - The in out mode to set.public boolean getInOutMode()
public Color getLineColor()
public void setLineColor(Color lineColor)
lineColor - The lineColor to set.public double getNumberOfPastes()
public void setNumberOfPastes(double numberOfPastes)
numberOfPastes - The numberOfPastes to set.public boolean getShowSubnetOutline()
public void setShowSubnetOutline(boolean showSubnetOutline)
showSubnetOutline - Sets Show subnet outline.public boolean getShowTime()
public void setShowTime(boolean showTime)
showTime - Sets the show time.public Color getSpikingColor()
public void setSpikingColor(Color spikingColor)
spikingColor - Sets the spiking synapse color.public double getNudgeAmount()
public void setNudgeAmount(double nudgeAmount)
nudgeAmount - Sets the nudge amount.public boolean getUsingTabs()
public void setUsingTabs(boolean usingTabs)
usingTabs - The isUsingTabs to set.public int getMaxDiameter()
public void setMaxDiameter(int maxDiameter)
maxDiameter - Sets the maximum synapse diameter.public int getMinDiameter()
public void setMinDiameter(int minDiameter)
minDiameter - Sets the minimum synapse diameter.public void networkChanged()
networkChanged in interface NetworkListenerpublic void clampChanged()
clampChanged in interface NetworkListenerpublic String getCurrentDirectory()
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerActionListenerpublic void incrementSelectedObjects()
public void decrementSelectedObjects()
protected void nudge(int offsetX,
int offsetY)
offsetX - amount to nudge in the x direction (multipled by nudgeAmount)offsetY - amount to nudge in the y direction (multipled by nudgeAmount)public void closeNetwork()
public void addGauge()
public void setChangedSinceLastSave(boolean changedSinceLastSave)
changedSinceLastSave - true if this network frame has changed since
it was last savedpublic boolean hasChangedSinceLastSave()
public JToolBar getEditToolBar()
public JToolBar getMainToolBar()
public JToolBar getClampToolBar()
public Color getZeroWeightColor()
public void setZeroWeightColor(Color zeroWeightColor)
zeroWeightColor - Color of the zero weight.public Color getSignalColor()
public void setSignalColor(Color signalColor)
signalColor - Color of the signal synapse.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||