|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjsky.science.AbstractScienceObject
public abstract class AbstractScienceObject
Basic implementation of the ScienceObjectModel interface.
This code was originally developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).
| Nested Class Summary | |
|---|---|
static interface |
AbstractScienceObject.EventMonitor
|
| Field Summary |
|---|
| Fields inherited from interface jsky.science.ScienceObjectModel |
|---|
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractScienceObject()
|
|
AbstractScienceObject(java.lang.String inName)
|
|
| Method Summary | |
|---|---|
static void |
addEventMonitor(AbstractScienceObject.EventMonitor listener)
add an event monitor, each monitor will be notified of of all PropertyChangeEvents fired by this object. |
void |
addPropertyChangeListener(ReplaceablePropertyChangeListener listener)
add a listener |
protected boolean |
areNamesEqual(ScienceObjectModel target)
checks equality of the Name property. |
void |
clearAllListeners()
Convenience method for cloning. |
java.lang.Object |
clone()
default implementation: fires superclass (Object)'s clone and suppresses the CloneNotSupportedException, returning null if super.clone() fails |
int |
compareTo(java.lang.Object o)
Default implementation: compares the Names of the objects if they are ScienceObjectModels. |
protected java.lang.String |
createDefaultName()
Creates and returns a default name for an object. |
boolean |
equals(java.lang.Object obj)
Default implementation: checks for same name only |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Report a bound property update to any registered listeners. |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue,
boolean trace)
Report a bound property update to any registered listeners. |
void |
fireReplaceObject(java.lang.Object oldObject,
java.lang.Object newObject)
Report a replaceObject event to any registered ReplaceablePropertyChangeListeners that are also ReplaceablePropertyChangeListeners No events are sent if the old and new objects are '=='. |
void |
fireReplaceObject(java.lang.Object oldObject,
java.lang.Object newObject,
boolean trace)
Report a replaceObject event to any registered ReplaceablePropertyChangeListeners that are also ReplaceablePropertyChangeListeners No events are sent if the old and new objects are '=='. |
void |
fireReplaceObject(ReplaceablePropertyChangeListener newObject)
Report a replaceObject event to any registered propertyChangelisteners that are also ReplaceablePropertyChangeListeners No events are sent if the old and new objects are '=='. |
void |
fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Report a bound property update to any registered listeners. |
void |
fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue,
boolean trace)
Report a bound property update to any registered fListeners. |
java.lang.Exception |
getException()
returns the local exception (if any). |
java.lang.String |
getLabel()
Convenience method for storing a "user friendly" name for an object. |
java.lang.String |
getName()
returns the Name property. |
java.lang.String |
getObjectIdString()
Useful for debugging output, returns a String containing the class and hashcode of the specified object. |
static java.lang.String |
getObjectIdString(java.lang.Object obj)
Useful for debugging output, returns a String containing the class and hashcode of the specified object. |
ScienceObjectNodeModel |
getParent()
Returns the parent object in a hierarchy of objects. |
boolean |
isHolding()
default implementation: always returns false, should be overridden by subclasses that want to implement a delayed updating capability |
boolean |
isPending()
default implement: always returns false. |
boolean |
isTracing()
Returns the current tracing mode, @see setTracing() |
boolean |
isValid()
default implementation: the object is valid if and only if there is no specified local exception |
void |
notifyEventMonitors(java.lang.Object target,
java.util.EventObject event)
|
void |
propertyChange(java.beans.PropertyChangeEvent ev)
default implementation. |
static void |
removeEventMonitor(AbstractScienceObject.EventMonitor listener)
Remove a listener |
void |
removePropertyChangeListener(ReplaceablePropertyChangeListener listener)
Remove a listener |
void |
replaceObject(ReplacementEvent ev)
Default implementation. |
static void |
replaceObjectNYI(java.lang.Object source,
ReplacementEvent event)
Convenience debugging method for classes that do not support replaceObject() but find it has been called anyway. |
void |
setException(java.lang.Exception e)
sets an exception. |
void |
setHolding(boolean hold)
default implementation: does nothing |
void |
setName(java.lang.String inName)
Sets the Name property. |
void |
setParent(ScienceObjectNodeModel model)
Sets the parent in the hierarchy. |
static void |
setTraceAll(boolean t)
Sets a global tracing flag to turn tracing on for all AbstractScienceObjects. |
void |
setTracing(boolean onOff)
Sets debugging tracing on or off. |
java.lang.String |
toString()
local implementation: returns the name of the object, unless thats null in which case it returns call the superclass (Object)'s toString() |
protected void |
writeDebug(java.lang.Object source,
java.lang.Object message)
default implementation. |
protected void |
writeError(java.lang.Object source,
java.lang.Object message)
default implementation. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractScienceObject()
public AbstractScienceObject(java.lang.String inName)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic ScienceObjectNodeModel getParent()
getParent in interface ScienceObjectModelpublic void setParent(ScienceObjectNodeModel model)
setParent in interface ScienceObjectModelpublic boolean isPending()
public java.lang.Exception getException()
getException in interface ScienceObjectModelpublic void setException(java.lang.Exception e)
setException in interface ScienceObjectModelpublic boolean isValid()
isValid in interface ScienceObjectModelpublic boolean isHolding()
isHolding in interface ScienceObjectModelpublic void setHolding(boolean hold)
setHolding in interface ScienceObjectModelpublic java.lang.Object clone()
clone in interface ScienceObjectModelclone in class java.lang.Objectpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getName()
getName in interface ScienceObjectModelprotected boolean areNamesEqual(ScienceObjectModel target)
protected java.lang.String createDefaultName()
public void setName(java.lang.String inName)
setName in interface ScienceObjectModelpublic java.lang.String getLabel()
getLabel in interface ScienceObjectModelpublic boolean isTracing()
isTracing in interface ScienceObjectModelpublic static void setTraceAll(boolean t)
setTracing(boolean)public void setTracing(boolean onOff)
This is particularly useful for tracking down problems in clone() or replaceObject().
setTracing in interface ScienceObjectModelScienceObjectModel.isTracing()public void clearAllListeners()
clearAllListeners in interface ScienceObjectModelpublic void addPropertyChangeListener(ReplaceablePropertyChangeListener listener)
addPropertyChangeListener in interface ScienceObjectModellistener - The ReplaceablePropertyChangeListener to be addedpublic void removePropertyChangeListener(ReplaceablePropertyChangeListener listener)
removePropertyChangeListener in interface ScienceObjectModellistener - The ReplaceablePropertyChangeListener to be removedpublic static void addEventMonitor(AbstractScienceObject.EventMonitor listener)
listener - An event monitor to be addedpublic static void removeEventMonitor(AbstractScienceObject.EventMonitor listener)
listener - The ReplaceablePropertyChangeListener to be removed
public void notifyEventMonitors(java.lang.Object target,
java.util.EventObject event)
public void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange in interface java.beans.PropertyChangeListener
public static void replaceObjectNYI(java.lang.Object source,
ReplacementEvent event)
public void replaceObject(ReplacementEvent ev)
throws ReplacementVetoException
replaceObject in interface ReplaceablePropertyChangeListenerev - the event that contains details about replacement
ReplacementVetoException
public void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
firePropertyChange in interface ScienceObjectModelpropertyName - The programmatic name of the property
that was changed.oldValue - The old value of the property.newValue - The new value of the property.
public void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue,
boolean trace)
propertyName - The programmatic name of the property
that was changed.oldValue - The old value of the property.newValue - The new value of the property.
public void fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
throws ReplaceablePropertyVetoException
propertyName - The programmatic name of the property
that was changed.oldValue - The old value of the property.newValue - The new value of the property.
ReplaceablePropertyVetoException
public void fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue,
boolean trace)
throws ReplaceablePropertyVetoException
propertyName - The programmatic name of the property
that was changed.oldValue - The old value of the property.newValue - The new value of the property.
ReplaceablePropertyVetoException - passed on if received from a listener
public void fireReplaceObject(java.lang.Object oldObject,
java.lang.Object newObject)
throws ReplacementVetoException
oldObject - The object to be replaced by a new objectnewObject - The new object to replace the current object
ReplacementVetoException
public void fireReplaceObject(ReplaceablePropertyChangeListener newObject)
throws ReplacementVetoException
newObject - The new object to replace the current object
ReplacementVetoException
public void fireReplaceObject(java.lang.Object oldObject,
java.lang.Object newObject,
boolean trace)
throws ReplacementVetoException
newObject - The new object to replace the current object
ReplacementVetoException
protected void writeDebug(java.lang.Object source,
java.lang.Object message)
protected void writeError(java.lang.Object source,
java.lang.Object message)
public java.lang.String getObjectIdString()
public static java.lang.String getObjectIdString(java.lang.Object obj)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||