|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cs.piccolo.PNode
org.simbrain.network.nodes.ScreenElement
org.simbrain.network.nodes.SynapseNode
public final class SynapseNode
SynapseNode is a Piccolo PNode corresponding to a Neuron in the neural network model.
| Field Summary |
|---|
| Fields inherited from class edu.umd.cs.piccolo.PNode |
|---|
PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
|---|---|
SynapseNode()
Default constructor; used by Castor. |
|
SynapseNode(NetworkPanel net,
NeuronNode source,
NeuronNode target,
Synapse synapse)
Create a new synapse node connecting a source and target neuron. |
|
| Method Summary | |
|---|---|
Point2D |
calcCenter(Point2D src,
Point2D tar)
Calculates the position of the synapse circle based on the positions of the source and target NeuronNodes. |
protected JPopupMenu |
getContextMenu()
Return a context menu specific to this screen element. |
protected JDialog |
getPropertyDialog()
Return a property dialog for this screen element. |
NeuronNode |
getSource()
|
Synapse |
getSynapse()
|
NeuronNode |
getTarget()
|
protected String |
getToolTipText()
Return a String to use as tool tip text for this screen element. |
boolean |
hasContextMenu()
Return true if this screen element has a context menu. |
protected boolean |
hasPropertyDialog()
Return true if this screen element has a property dialog. |
protected boolean |
hasToolTipText()
Return true if this screen element has tool tip text. |
void |
initCastor(NetworkPanel net)
Initializes relevant data after a ScreenElement has been unmarshalled via Castor. |
boolean |
isDraggable()
Return true if this screen element is draggable. |
boolean |
isSelectable()
Return true if this screen element is selectable. |
void |
resetColors()
Reset colors when default colors have been changed in NetworkPreferences. |
void |
setSource(NeuronNode source)
|
void |
setSynapse(Synapse synapse)
|
void |
setTarget(NeuronNode target)
|
boolean |
showSelectionHandle()
Return true if this screen element should show a
selection handle. |
String |
toString()
Returns String representation of this NeuronNode. |
void |
updateColor()
Calculates the color for a weight, based on its current strength. |
void |
updateDiameter()
Update the diameter of the drawn weight based on the logical weight's strength. |
void |
updatePosition()
Update position of synapse. |
| Methods inherited from class org.simbrain.network.nodes.ScreenElement |
|---|
getNetworkPanel, setNetworkPanel |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SynapseNode()
public SynapseNode(NetworkPanel net,
NeuronNode source,
NeuronNode target,
Synapse synapse)
net - Reference to NetworkPanelsource - source neuronnodetarget - target neuronmodesynapse - the model synapse this PNode represents| Method Detail |
|---|
public void initCastor(NetworkPanel net)
ScreenElementScreenElement has been unmarshalled via Castor.
initCastor in class ScreenElementnet - network panelScreenElementpublic void updatePosition()
public void updateColor()
public void updateDiameter()
public Point2D calcCenter(Point2D src,
Point2D tar)
src - Source NeuronNodetar - Target NeuronNode
public boolean isSelectable()
ScreenElementtrue if this screen element is selectable.
Being selectable requires that this screen element is pickable
as far as the Piccolo API is concerned, so if this method returns
true, be sure that this class also returns true
for its getPickable() method.
isSelectable in class ScreenElementScreenElementpublic boolean showSelectionHandle()
ScreenElementtrue if this screen element should show a
selection handle.
Showing a selection handle requires that this screen element is pickable
as far as the Piccolo API is concerned, so if this method returns
true, be sure that this class also returns true
for its getPickable() method.
Showing a selection handle also requires that this screen element is selectable,
so if this method returns true, be sure that this class also
returns true for its isSelectable() method.
showSelectionHandle in class ScreenElementScreenElementpublic boolean isDraggable()
ScreenElementtrue if this screen element is draggable.
Being draggable requires that this screen element is pickable
as far as the Piccolo API is concerned, so if this method returns
true, be sure that this class also returns true
for its getPickable() method.
Being draggable also requires that this screen element is selectable,
so if this method returns true, be sure that this class also
returns true for its isSelectable() method.
isDraggable in class ScreenElementScreenElementprotected boolean hasToolTipText()
ScreenElementtrue if this screen element has tool tip text.
If this screen element does not have tool tip text, a tool tip
event handler will not be registered.
hasToolTipText in class ScreenElementScreenElementprotected String getToolTipText()
ScreenElementString to use as tool tip text for this screen element.
Return null if this screen element does not have tool tip text
or to temporarily prevent the tool tip from displaying.
getToolTipText in class ScreenElementString to use as tool tip text for this screen elementScreenElementpublic boolean hasContextMenu()
ScreenElementtrue if this screen element has a context menu.
If this screen element does not have a context menu, a context menu
event handler will not be registered.
hasContextMenu in class ScreenElementScreenElementprotected JPopupMenu getContextMenu()
ScreenElementnull if this screen element does not have a context
menu.
getContextMenu in class ScreenElementScreenElementprotected boolean hasPropertyDialog()
ScreenElementtrue if this screen element has a property dialog.
If this screen element does not have a property dialog, a property
dialog event handler will not be registered.
hasPropertyDialog in class ScreenElementScreenElementprotected JDialog getPropertyDialog()
ScreenElementnull if this screen element does not have a
property dialog.
getPropertyDialog in class ScreenElementScreenElementpublic String toString()
toString in class PNodepublic Synapse getSynapse()
public void setSynapse(Synapse synapse)
synapse - The synapse to set.public NeuronNode getSource()
public NeuronNode getTarget()
public void setSource(NeuronNode source)
source - The source to set.public void setTarget(NeuronNode target)
target - The target to set.public void resetColors()
ScreenElementNetworkPreferences.
resetColors in class ScreenElementScreenElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||