Horus Doc || Java GUI Reference || Doxygen's quick Index  

SimpleFrameNavigator Class Reference

Inheritance diagram for SimpleFrameNavigator::

FrameNavigator List of all members.

Public Methods

 SimpleFrameNavigator (FrameNavigatorUser u, int curFrame, int minFrame, int maxFrame, int scrollType)
 Construct a SimpleFrameNavigator. More...

 SimpleFrameNavigator (int scrollType)
 SimpleFrameNavigator ()
double getCurrentFrame ()
 Get the current frame. More...

void setUser (FrameNavigatorUser u)
void setCurrentFrame (int newFrame)
 Update the GUI to reflect the given status. More...

void setNumberOfFrames (int maxFrame)
void updateStatus (int curFrame, int minFrame, int maxFrame)
 Update the GUI to reflect the given status. More...

void actionPerformed (ActionEvent e)
 Implementation of ActionListener. More...

void adjustmentValueChanged (AdjustmentEvent e)
 Implementation of AdjustmentListener. More...

void stateChanged (ChangeEvent e)
 Implementation of ChangeListener. More...


Static Public Attributes

final int SCROLL_BAR = 1
final int SLIDER = 2

Constructor & Destructor Documentation

SimpleFrameNavigator::SimpleFrameNavigator FrameNavigatorUser    u,
int    curFrame,
int    minFrame,
int    maxFrame,
int    scrollType
[inline]
 

Construct a SimpleFrameNavigator.

scrollType indicates whether the GUI uses a ScrollBar (scrollType == 1) or a Slider (scrollType == 2).

00036 {
00037     doInit(u, curFrame, minFrame, maxFrame, scrollType);
00038 }

SimpleFrameNavigator::SimpleFrameNavigator int    scrollType [inline]
 

00041 {
00042     doInit(null, 0, 0, 0, scrollType);
00043 }

SimpleFrameNavigator::SimpleFrameNavigator   [inline]
 

00046 {
00047     doInit(null, 0, 0, 0, SCROLL_BAR);
00048 }


Member Function Documentation

double SimpleFrameNavigator::getCurrentFrame   [inline]
 

Get the current frame.

00053 {
00054     return _curFrame;
00055 }

void SimpleFrameNavigator::setUser FrameNavigatorUser    u [inline]
 

Reimplemented from FrameNavigator.

00058 {
00059     _user = u;
00060 }

void SimpleFrameNavigator::setCurrentFrame int    newFrame [inline]
 

Update the GUI to reflect the given status.

Will not call the _user (it is assumed that the _user does it).

Reimplemented from FrameNavigator.

00066 {
00067     if (newFrame == _curFrame)
00068         return;
00069     changeFrame(newFrame);
00070 }

void SimpleFrameNavigator::setNumberOfFrames int    maxFrame [inline]
 

Reimplemented from FrameNavigator.

00073 {
00074     updateStatus(0, 0, maxFrame);
00075 }

void SimpleFrameNavigator::updateStatus int    curFrame,
int    minFrame,
int    maxFrame
[inline]
 

Update the GUI to reflect the given status.

Will not call the _user (it is assumed that the _user does it).

00081 {
00082     _minFrame = minFrame;
00083     _maxFrame = maxFrame;
00084     if (_sb != null) {
00085         _sb.setMinimum(_minFrame);
00086         _sb.setMaximum(_maxFrame);
00087     }
00088     if (_slider != null) {
00089         _slider.setMinimum(_minFrame);
00090         _slider.setMaximum(_maxFrame);
00091     }
00092     changeFrame(curFrame);
00093 }

void SimpleFrameNavigator::actionPerformed ActionEvent    e [inline]
 

Implementation of ActionListener.

00099 {
00100     if (e.getSource() == _frameField) {
00101         if (_updatingFrame) // check whether we did this ourself
00102             return;
00103         String s = _frameField.getText();
00104         changeFrame(java.lang.Integer.valueOf(s).intValue());
00105         if(_user != null) _user.handleFrameChanged(_curFrame);
00106     }
00107 }

void SimpleFrameNavigator::adjustmentValueChanged AdjustmentEvent    e [inline]
 

Implementation of AdjustmentListener.

00113 {
00114     if (_updatingFrame) // check whether we did this ourself
00115         return;
00116     int value = _sb.getValue();
00117     changeFrame(value);
00118     if(_user != null) _user.handleFrameChanged(_curFrame);
00119 }

void SimpleFrameNavigator::stateChanged ChangeEvent    e [inline]
 

Implementation of ChangeListener.

00125 {
00126     if (_updatingFrame) // check whether we did this ourself
00127         return;
00128     int value = _slider.getValue();
00129     changeFrame(value);
00130     if(_user != null) _user.handleFrameChanged(_curFrame);
00131 }


Member Data Documentation

final int SimpleFrameNavigator::SCROLL_BAR = 1 [static]
 

final int SimpleFrameNavigator::SLIDER = 2 [static]
 


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:26 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001