public class NeuronNode extends ScreenElement implements java.beans.PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
static java.awt.Font |
IN_OUT_FONT
Font for input and output labels.
|
protected Neuron |
neuron
The logical neuron this screen element represents.
|
static java.awt.Font |
NEURON_FONT
Neuron Font.
|
static java.awt.Font |
NEURON_FONT_BOLD
Neuron font bold.
|
static java.awt.Font |
NEURON_FONT_SMALL
Neuron font small.
|
static java.awt.Font |
NEURON_FONT_VERYSMALL
Neuron font very small.
|
static java.awt.Font |
PRIORITY_FONT
Priority Font.
|
DEFAULT_PAINT, DEFAULT_STROKE, DEFAULT_STROKE_PAINT
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
Constructor and Description |
---|
NeuronNode(NetworkPanel net,
Neuron neuron)
Create a new neuron node.
|
Modifier and Type | Method and Description |
---|---|
protected javax.swing.JPopupMenu |
createContextMenu() |
java.awt.geom.Point2D |
getCenter()
Return the center of this node (the circle) in global coordinates.
|
java.util.Set<SynapseNode> |
getConnectedSynapses() |
protected javax.swing.JPopupMenu |
getContextMenu()
Return a context menu specific to this screen element.
|
static float |
getCoolColor() |
static int |
getDIAMETER() |
static float |
getHotColor() |
Neuron |
getNeuron()
Return the neuron for this neuron node.
|
protected javax.swing.JDialog |
getPropertyDialog()
Return a property dialog for this screen element.
|
static java.awt.Color |
getSpikingColor() |
protected java.lang.String |
getToolTipText()
Return a
String to use as tool tip text for this screen
element. |
double |
getXpos() |
double |
getYpos() |
protected 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. |
boolean |
isDraggable()
Return
true if this screen element is draggable. |
boolean |
isSelectable()
Return
true if this screen element is selectable. |
void |
offset(double dx,
double dy) |
void |
propertyChange(java.beans.PropertyChangeEvent event) |
void |
pullViewPositionFromModel()
Updates the position of the view neuron based on the position of the
model neuron.
|
void |
pushViewPositionToModel()
Update the position of the model neuron based on the global coordinates
of this pnode.
|
void |
resetColors()
Reset colors when default colors have been changed in
NetworkPreferences . |
static void |
setCoolColor(float coolColor) |
void |
setGrouped(boolean isGrouped) |
static void |
setHotColor(float hotColor) |
void |
setNeuron(Neuron neuron)
Set the neuron for this neuron node to
neuron . |
void |
setPriorityView(boolean makePriorityTextVisible)
Toggles the visibility of the priority view text label.
|
static void |
setSpikingColor(java.awt.Color spikingColor) |
void |
setXpos(double xpos) |
void |
setYpos(double ypos) |
boolean |
showSelectionHandle()
Return
true if this screen element should show a selection
handle. |
java.lang.String |
toString()
Returns String representation of this NeuronNode.
|
void |
update()
Update the neuron view based on the model neuron.
|
void |
updateSynapseNodePositions()
Update connected synapse node positions.
|
void |
updateTextLabel()
Update the text label.
|
void |
updateTextVisibility()
Update the visibility of all text nodes depending on view scale.
|
getNetworkPanel, isGrouped, setNetworkPanel, singleClickEvent
append, append, closePath, createArc, createArc, createCubicCurve, createCubicCurve, createEllipse, createEllipse, createLine, createLine, createQuadCurve, createQuadCurve, createRectangle, createRectangle, createRoundRectangle, createRoundRectangle, curveTo, getPath, getPathReference, getShape, lineTo, moveTo, quadTo, reset, transform
getBoundsWithStroke, getStroke, getStrokePaint, internalUpdateBounds, intersects, paint, setStroke, setStrokePaint, updateBoundsFromShape
addActivity, addAttribute, addChild, addChild, addChildren, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientPropertyKeysEnumeration, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, lower, lower, lowerBelow, lowerToBottom, lowerToBottom, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, print, print, raise, raise, raiseAbove, raiseToTop, raiseToTop, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
protected Neuron neuron
public static final java.awt.Font IN_OUT_FONT
public static final java.awt.Font NEURON_FONT
public static final java.awt.Font PRIORITY_FONT
public static final java.awt.Font NEURON_FONT_BOLD
public static final java.awt.Font NEURON_FONT_SMALL
public static final java.awt.Font NEURON_FONT_VERYSMALL
public NeuronNode(NetworkPanel net, Neuron neuron)
net
- Reference to NetworkPanelneuron
- reference to model neuronpublic void update()
public void updateTextVisibility()
public void updateTextLabel()
public void setPriorityView(boolean makePriorityTextVisible)
makePriorityTextVisible
- whether the priority text label should be
visible or notpublic boolean isSelectable()
ScreenElement
true
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 ScreenElement
ScreenElement
public boolean showSelectionHandle()
ScreenElement
true
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 ScreenElement
ScreenElement
public boolean isDraggable()
ScreenElement
true
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 ScreenElement
ScreenElement
protected boolean hasToolTipText()
ScreenElement
true
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 ScreenElement
ScreenElement
protected java.lang.String getToolTipText()
ScreenElement
String
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 ScreenElement
String
to use as tool tip text for this screen
elementScreenElement
protected boolean hasContextMenu()
ScreenElement
true
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 ScreenElement
ScreenElement
public java.awt.geom.Point2D getCenter()
protected javax.swing.JPopupMenu getContextMenu()
ScreenElement
null
if this screen element does not have a context menu.getContextMenu
in class ScreenElement
ScreenElement
protected boolean hasPropertyDialog()
ScreenElement
true
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 ScreenElement
ScreenElement
protected javax.swing.JDialog getPropertyDialog()
ScreenElement
null
if this screen element does not have a property dialog.getPropertyDialog
in class ScreenElement
ScreenElement
public java.lang.String toString()
toString
in class java.lang.Object
public Neuron getNeuron()
public void setNeuron(Neuron neuron)
neuron
.
This is a bound property.
neuron
- neuron for this neuron nodeprotected javax.swing.JPopupMenu createContextMenu()
ScreenElement
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
public void offset(double dx, double dy)
offset
in class org.piccolo2d.PNode
public void pushViewPositionToModel()
public void pullViewPositionFromModel()
public static int getDIAMETER()
public java.util.Set<SynapseNode> getConnectedSynapses()
public void updateSynapseNodePositions()
public double getXpos()
public void setXpos(double xpos)
xpos
- The xpos to set.public double getYpos()
public void setYpos(double ypos)
ypos
- The ypos to set.public void resetColors()
ScreenElement
NetworkPreferences
.resetColors
in class ScreenElement
ScreenElement
public void setGrouped(boolean isGrouped)
setGrouped
in class ScreenElement
isGrouped
- the isGrouped to setpublic static float getHotColor()
public static void setHotColor(float hotColor)
hotColor
- the hotColor to setpublic static float getCoolColor()
public static void setCoolColor(float coolColor)
coolColor
- the coolColor to setpublic static java.awt.Color getSpikingColor()
public static void setSpikingColor(java.awt.Color spikingColor)
spikingColor
- the spikingColor to set