|
|||||||||
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.Sink
ptolemy.actor.lib.database.ArrayOfRecordsRecorder
ptolemy.domains.space.Occupants
public class Occupants
A Occupants display actor. This actor specializes its superclass for use with a space database. It provides a customized editor that supports modifying the space database in the following ways:
Red (cxh) |
Red (eal) |
Nested Class Summary | |
---|---|
class |
Occupants.OccupantsConfigureFactory
An interactive editor that configures the occupants. |
private class |
Occupants.RowListener
If a row is selected, then record which row is selected. |
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private static int |
_ADD_NEW
Indicator that a move to a new location should add a new space. |
private java.lang.String[] |
_classes
The set of values of the classcd field found in the database. |
private java.util.Set<java.lang.String> |
_occupantFields
A set of names of fields that remain with the occupant rather the space. |
private java.util.Set<java.lang.String> |
_occupantInSpaceFields
The fields that can be edited for a person in a space. |
private static int |
_REPLACE
Indicator that a move to a new location should add a new space. |
private int |
_selectedRow
The selected row. |
private java.util.Set<java.lang.String> |
_spaceFields
A set of names of fields that remain with the space rather the occupant. |
private static int |
_SWAP
Indicator that a move to a new location should add a new space. |
private javax.swing.JTable |
_table
The table. |
StringParameter |
databaseManager
Name of the DatabaseManager to use. |
StringParameter |
table
Table to use within the database. |
Fields inherited from class ptolemy.actor.lib.database.ArrayOfRecordsRecorder |
---|
colorKey, columns, iconColumns, records |
Fields inherited from class ptolemy.actor.lib.Sink |
---|
input |
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 | |
---|---|
Occupants(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary | |
---|---|
private void |
_addNewShared(DatabaseManager database,
java.lang.String sourceSpaceID,
RecordToken sourceRecord,
RecordToken destinationRecord)
Add a new occupant to share an existing space by creating a new space. |
private java.lang.String[] |
_classes(DatabaseManager database)
Return an array of the names of classes in the database. |
private RecordToken |
_editPersonQuery(RecordToken person,
java.lang.String room,
DatabaseManager database,
NamedObj object,
java.awt.Frame parent)
Construct a query for assigning an existing person to a space. |
private java.lang.String |
_getField(RecordToken record,
java.lang.String field)
Given a record and a string, return the entry in the record if there is one and it is a StringToken, and otherwise, return an empty string. |
private boolean |
_move(DatabaseManager database,
java.lang.String sourceSpaceID,
java.lang.String destinationSpaceID,
int mode)
Using the specified database, move the contents of sourceSpaceID to the destinationSpaceID, either adding to what is there, overwriting it, or swapping with it. |
private java.lang.String |
_occupants(ArrayToken records)
Return the name of the first found occupant in the specified records, or null if there is no such occupant. |
private ArrayToken |
_priorOccupants(DatabaseManager database,
java.lang.String building,
java.lang.String room,
java.lang.String deskno)
Return the prior occupants of the specified space. |
private java.lang.String |
_quotedString(java.lang.String string)
Return the specified string surrounded by single quotes with any internal single quotes escaped. |
private java.util.Map<java.lang.String,Token> |
_recordAsMap(RecordToken record)
Return a map representing the specified record token. |
private RecordToken |
_searchForPerson(java.lang.String lname,
java.lang.String fnames,
java.lang.String classcd,
java.lang.String email,
java.lang.String sponsorlname,
java.awt.Frame parent,
NamedObj object,
DatabaseManager database,
RecordToken sponsor,
java.lang.String message)
Open a dialog to search for a person. |
Methods inherited from class ptolemy.actor.lib.database.ArrayOfRecordsRecorder |
---|
clone, fire |
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, prefire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, initialize, 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 StringParameter databaseManager
public StringParameter table
private java.lang.String[] _classes
private java.util.Set<java.lang.String> _occupantInSpaceFields
private java.util.Set<java.lang.String> _occupantFields
private int _selectedRow
private java.util.Set<java.lang.String> _spaceFields
private javax.swing.JTable _table
private static int _ADD_NEW
private static int _REPLACE
private static int _SWAP
Constructor Detail |
---|
public Occupants(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the entity cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
private void _addNewShared(DatabaseManager database, java.lang.String sourceSpaceID, RecordToken sourceRecord, RecordToken destinationRecord) throws IllegalActionException
database
- The database manager.sourceSpaceID
- The space to be cleared, or null to not clear it.sourceRecord
- A record containing information about the space to be shared.destinationRecord
- A record containing information about the new occupant.
IllegalActionException
private java.lang.String[] _classes(DatabaseManager database) throws IllegalActionException, CancelException
database
- The database manager.
IllegalActionException
- If the table parameter is not valid.
CancelException
- If database access is canceled or denied.private RecordToken _editPersonQuery(RecordToken person, java.lang.String room, DatabaseManager database, NamedObj object, java.awt.Frame parent) throws CancelException, IllegalActionException
person
- A record with person information.room
- The room to assign the person to.database
- The database manager to use.object
- The Ptolemy II object for which this is an editor.parent
- The owning frame.
CancelException
IllegalActionException
private java.lang.String _getField(RecordToken record, java.lang.String field)
record
- The record.field
- The field name.private boolean _move(DatabaseManager database, java.lang.String sourceSpaceID, java.lang.String destinationSpaceID, int mode) throws KernelException
database
- The database manager.sourceSpaceID
- The spaceid of the source.destinationSpaceID
- The spaceid of the destination.mode
- One of _ADD_NEW, _REPLACE, or _SWAP.
KernelException
- If the table parameter can't
be evaluated or if executing the database query throws it,
or if re-executing the model throws it.private java.lang.String _occupants(ArrayToken records)
private ArrayToken _priorOccupants(DatabaseManager database, java.lang.String building, java.lang.String room, java.lang.String deskno) throws IllegalActionException
database
- The database manager.building
- The building name.room
- The room number.deskno
- The desk number.
IllegalActionException
private java.lang.String _quotedString(java.lang.String string)
string
- The string to quote.
private java.util.Map<java.lang.String,Token> _recordAsMap(RecordToken record)
record
- The record token.
private RecordToken _searchForPerson(java.lang.String lname, java.lang.String fnames, java.lang.String classcd, java.lang.String email, java.lang.String sponsorlname, java.awt.Frame parent, NamedObj object, DatabaseManager database, RecordToken sponsor, java.lang.String message) throws CancelException, IllegalActionException
lname
- Initial entry for the last name.fnames
- Initial entry for the first names.classcd
- Initial entry for the class.email
- Initial entry for the email.sponsorlname
- Initial entry for the sponsor last name.parent
- The parent frame for dialogs.object
- The Ptolemy object owning the dialog.database
- The database manager.sponsor
- If non-null, then a record specifying a sponsor. When this is
non-null, a match is not required. If it is null, and no match is found,
the user will be given the option of creating a new person.message
- A text message to include in the dialog, or null to not specify one.
CancelException
IllegalActionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |