|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Source
ptolemy.actor.lib.gui.SliderSource
public class SliderSource
The output of this actor is controlled by a slider in the run window. The range of the output is specified by two parameters, minimum and maximum. The type of these parameters and the output is integer.
Red (liuxj) |
Red (liuxj) |
Nested Class Summary | |
---|---|
static class |
SliderSource.SliderFrame
The frame for the slider. |
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private java.awt.Container |
_container
|
private javax.swing.JFrame |
_frame
|
private IntToken |
_outputVal
|
private javax.swing.JPanel |
_panel
The JPanel that contains the slider. |
Parameter |
majorTickSpacing
The major tick spacing of the slider. |
Parameter |
maximum
The maximum value of the slider. |
Parameter |
minimum
The minimum value of the slider. |
Parameter |
minorTickSpacing
The minor tick spacing of the slider. |
javax.swing.JSlider |
slider
The slider that controls the output of this actor. |
StringAttribute |
title
The title to put on top. |
Fields inherited from class ptolemy.actor.lib.Source |
---|
output, trigger |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
SliderSource(CompositeEntity container,
java.lang.String name)
Construct an actor with an input multiport of type GENERAL. |
Method Summary | |
---|---|
private void |
_remove()
Remove the display from the current container, if there is one. |
void |
attributeChanged(Attribute attribute)
If the specified attribute is minimum or maximum, then set the range of the slider. |
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace. |
void |
fire()
Output the value of the slider recorded when prefire() is last called. |
java.awt.Color |
getBackground()
Return the background. |
void |
initialize()
Create a slider on the screen, if necessary. |
void |
place(java.awt.Container container)
Specify the container in which the slider should be displayed. |
boolean |
prefire()
Record the current value of the slider. |
void |
setBackground(java.awt.Color background)
Set the background color of the panel that contains the slider. |
void |
setContainer(CompositeEntity container)
Override the base class to remove the display from its graphical container if the argument is null. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
The value of the slider changed, record the new value. |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Executable |
---|
isFireFunctional, isStrict, iterate, postfire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, preinitialize, removeInitializable, wrapup |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public javax.swing.JSlider slider
public Parameter minimum
public Parameter maximum
public Parameter majorTickSpacing
public Parameter minorTickSpacing
public StringAttribute title
private javax.swing.JPanel _panel
private java.awt.Container _container
private IntToken _outputVal
private javax.swing.JFrame _frame
Constructor Detail |
---|
public SliderSource(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
entity with this name.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that has changed.
IllegalActionException
- If the specified range for the
slider is invalid.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class AtomicActor
workspace
- The workspace for the new object.
java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class Source
IllegalActionException
- Not thrown in this base class.public java.awt.Color getBackground()
setBackground(Color)
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor
IllegalActionException
- If the parent class throws it.public void place(java.awt.Container container)
place
in interface Placeable
container
- The container into which to place the slider.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class Source
IllegalActionException
- If checking the trigger for
a token throws it or if the super class throws it.public void setBackground(java.awt.Color background)
background
- The background color.getBackground()
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
setContainer
in class AtomicActor
container
- The proposed container.
IllegalActionException
- If the base class throws it.
NameDuplicationException
- If the base class throws it.ComponentEntity.getContainer()
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
private void _remove()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |