|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.usc.cse.desi.viewers.AbstractCalculator
This is an abstract class for properties such as availability or overall latency. It is a framework for listening to the model and then updating a label to reflect your newly calculated value.
| Field Summary | |
protected org.eclipse.swt.widgets.Label |
myLabel
|
protected DESIViewModel |
myModel
|
| Constructor Summary | |
private |
AbstractCalculator()
|
|
AbstractCalculator(DESIViewModel model,
org.eclipse.swt.widgets.Label label)
When the calculator is first created, set the model and the label. |
| Method Summary | |
protected abstract void |
addThisAsAListenerToModel()
This method should be overriden by all subclasses. |
protected abstract void |
calculate()
In this method, do your calculation and then return the calculated value. |
protected void |
finalize()
I overrode this method: |
void |
modelChanged(DESIViewModel new_model)
If the model changes, you can call this method and the calculator will recalculate. |
protected abstract void |
removeThisAsAListenerFromModel()
This method can be called to remove this as a listner. |
void |
setMyLabelText(java.lang.String arg0)
This is a delegate method for the label that will set the text of the label to whatever is passed to it. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.beans.PropertyChangeListener |
propertyChange |
| Field Detail |
protected org.eclipse.swt.widgets.Label myLabel
protected DESIViewModel myModel
| Constructor Detail |
private AbstractCalculator()
public AbstractCalculator(DESIViewModel model,
org.eclipse.swt.widgets.Label label)
| Method Detail |
public void modelChanged(DESIViewModel new_model)
new_model - protected abstract void addThisAsAListenerToModel()
protected abstract void removeThisAsAListenerFromModel()
protected abstract void calculate()
protected void finalize()
throws java.lang.Throwable
java.lang.ThrowableObject.finalize()public void setMyLabelText(java.lang.String arg0)
arg0 - String - The text that you want to set the label to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||