|
|||||||||
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.util.Attribute
ptolemy.actor.gui.properties.GUIAction
public class GUIAction
A helper class to handle actions in GUI properties.
Red (tfeng) |
Red (tfeng) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
protected java.lang.String |
_momlSource
The input source that was specified the last time the configure method was called. |
protected java.lang.String |
_momlText
The text string that represents the current configuration of this object. |
protected NamedObj |
_parsedObject
The object obtained by parsing the moml text, or null. |
protected MoMLParser |
_parser
The parser used to parse the moml text. |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
GUIAction(NamedObj container,
java.lang.String name)
Construct an item with the given name contained by the specified entity. |
Method Summary | |
---|---|
protected void |
_parseSource()
Parse the configuration source if it has not been parsed, and store the result in protected field _parsedObject . |
void |
configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
Configure the object with data from the specified input source (a URL) and/or textual data. |
java.lang.String |
getConfigureSource()
Return the input source that was specified the last time the configure method was called. |
java.lang.String |
getConfigureText()
Return the text string that represents the current configuration of this object. |
javax.swing.JFrame |
getFrame()
Get the frame in which this item is selected. |
NamedObj |
getModel()
Get the model contained in the current frame. |
private static java.lang.String |
getMoml(NamedObj container,
NamedObj object)
Get the moml for the object to be added to the container. |
void |
perform(boolean parse)
React to this item being selected. |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String _momlSource
protected java.lang.String _momlText
protected NamedObj _parsedObject
protected MoMLParser _parser
Constructor Detail |
---|
public GUIAction(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this attribute.
IllegalActionException
- If the attribute is not of an
acceptable class for the container, or if the name contains a
period.
NameDuplicationException
- If the name coincides with
an attribute already in the container.Method Detail |
---|
public void configure(java.net.URL base, java.lang.String source, java.lang.String text) throws java.lang.Exception
This method is defined to throw a very general exception to allow classes that implement the interface to use whatever exceptions are appropriate.
base
- The base relative to which references within the input
are found, or null if this is not known, or there is none.source
- The input source, which specifies a URL, or null
if none.text
- Configuration information given as text, or null if
none.
java.lang.Exception
- If something goes wrong.public java.lang.String getConfigureSource()
public java.lang.String getConfigureText()
public javax.swing.JFrame getFrame()
public NamedObj getModel()
public void perform(boolean parse) throws java.lang.Exception
<configure source="some_file.xml"> </configure>then the source is read and its contents are used as the moml text. The moml text can also be given directly:
<configure> <entity name="C" class="ptolemy.actor.lib.Const"> </entity> </configure>Depending on whether the parse parameter is true or false, the moml text may be parsed first or not. If it is parsed, the returned NamedObj is used to generate a new moml string to be applied to the model in the current tableau (the nearest tableau that contains this GUI property). If it is not parsed, then the moml text is directly applied to the model.
parse
- Whether the configure text should be parsed before applying
to the current model.
java.lang.Exception
- If error occurs in performing the action.protected void _parseSource() throws java.lang.Exception
_parsedObject
.
java.lang.Exception
- If it occurs in the parsing.private static java.lang.String getMoml(NamedObj container, NamedObj object) throws java.lang.Exception
container
- The container.object
- The object whose moml is to be got.
java.lang.Exception
- If error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |