edu.luc.cs.trull.demo.counter
Class CounterComponent
java.lang.Object
edu.luc.cs.trull.EmptyComponent
edu.luc.cs.trull.TerminatingComponent
edu.luc.cs.trull.AbstractComponent
edu.luc.cs.trull.AbstractCombinator
edu.luc.cs.trull.Composite
edu.luc.cs.trull.demo.counter.CounterComponent
- All Implemented Interfaces:
- Combinator, Component, EventLabels, PropertyChangeSource, Startable, Suspendable, VisualComponent, Terminating, java.beans.PropertyChangeListener, java.util.EventListener
public class CounterComponent
- extends Composite
- implements VisualComponent, EventLabels
A bounded counter implemented fully in Trull as a complex component.
The current value of the counter is visualized as the position of a button
in a rectangle whose height is the maximum value times the
height of the button.
view Triveni source
|
Constructor Summary |
CounterComponent(java.lang.String buttonName,
int numSteps,
int width,
int height)
|
|
Method Summary |
javax.swing.JComponent |
getView()
Returns the Swing component associated with this Trull component. |
(package private) void |
lowerButton()
|
(package private) void |
placeButton()
|
(package private) void |
raiseButton()
|
(package private) void |
resetButton()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
b
private javax.swing.JButton b
buttonName
private java.lang.String buttonName
height
private int height
numSteps
private int numSteps
panel
private javax.swing.JPanel panel
position
private int position
width
private int width
CounterComponent
public CounterComponent(java.lang.String buttonName,
int numSteps,
int width,
int height)
getView
public javax.swing.JComponent getView()
- Description copied from interface:
VisualComponent
- Returns the Swing component associated with this Trull component.
- Specified by:
getView in interface VisualComponent
- Returns:
- the associated Swing component.
lowerButton
void lowerButton()
placeButton
void placeButton()
raiseButton
void raiseButton()
resetButton
void resetButton()
http://www.cs.luc.edu/trull/