Main Page | Compound List | File List | Compound Members

dndtester::SSPanel Class Reference

SSPanel is the class the shows the result and debugging information. More...

List of all members.

Public Member Functions

void setScroller (JScrollBar scroll)
 Allows to change the scrollbar.

void paintComponent (Graphics graphics)
 Method that displays the results or debugging information.

void setTopIndexByPixelValue (int pixelValue)
 Calculates were the display of the results will start.

int incrementTopIndex ()
 Increments the topIndex by 1.

int decrementTopIndex ()
 Decrements the topIndex by 1.

Dimension getPreferredSize ()
 Calculates the size it will take to display all Strings in data.

int getUnitHeight ()
 Use to see how much to increment the scroller.

void reset ()
 Clears the data stored in both debug and nonDebug Vectors.

void logCommand (String[] data)
 logCommand adds the string to the nonDebug Vector.

int logString (String stri)
 Similar to logCommand but this only adds one String not an array.

int logDebugString (String str)
 Similar to logString.

void replaceLog (String str, int index)
 Replaces an entry in data.

void showDebugging ()
 Makes the #SSPanel show debugging information.

void hideDebugging ()
 Hides debugging information.


Static Public Attributes

boolean showDebug = false
 Should the debugging information be shown.

final int MAXLINE = 65
 How long a line of text display is.


Private Attributes

int topIndex = 0
 Stores where the display of the data or debugging info begins.

int fontHeight
 Font height.

JScrollBar scroller
 The scrollbar the SSPanel manipulates.

Vector data = new Vector()
 This is the active data to displayed, it might be with debugging or not.

Vector debug = new Vector()
 Where all the debuging information is stored.

Vector noDebug = data
 All the data without any debugging.

Hashtable pairs = new Hashtable()
 Since data is stored to places we need a way to pair up information.


Detailed Description

SSPanel is the class the shows the result and debugging information.

Has different methods to log either results or debugging information. The scroll bar it uses is set up so that it can be moved using the mouse the wheel mouse or the arrows on the keyboard. This class should be repainted everytime something is log-in.

Definition at line 24 of file SSPanel.java.


Member Function Documentation

int dndtester::SSPanel::decrementTopIndex  )  [inline]
 

Decrements the topIndex by 1.

This method is used to move the window display of the data up. It has boundary checks.

Definition at line 138 of file SSPanel.java.

References fontHeight, and topIndex.

Dimension dndtester::SSPanel::getPreferredSize  )  [inline]
 

Calculates the size it will take to display all Strings in data.

Returns:
Returns the dimensions it will take to display all the data.

Definition at line 150 of file SSPanel.java.

References data, and fontHeight.

Referenced by hideDebugging(), logCommand(), logDebugString(), logString(), dndtester::DaqPanel::paint(), and showDebugging().

int dndtester::SSPanel::getUnitHeight  )  [inline]
 

Use to see how much to increment the scroller.

Returns:
An int which is the font height

Definition at line 174 of file SSPanel.java.

References fontHeight.

Referenced by hideDebugging(), logCommand(), logDebugString(), logString(), dndtester::DaqPanel::paint(), paintComponent(), and showDebugging().

void dndtester::SSPanel::hideDebugging  )  [inline]
 

Hides debugging information.

If the rDPanel#showDebugInf is deselected this method is called. Makes data to point to noDebug. And sets showDebug to false. It recalculates the dimensions of the scroller.

Definition at line 370 of file SSPanel.java.

References data, fontHeight, getPreferredSize(), getUnitHeight(), noDebug, scroller, showDebug, and topIndex.

int dndtester::SSPanel::incrementTopIndex  )  [inline]
 

Increments the topIndex by 1.

This method is used to move the window display of the data down. It has boundary checks.

Definition at line 123 of file SSPanel.java.

References data, fontHeight, and topIndex.

void dndtester::SSPanel::logCommand String[]  data  )  [inline]
 

logCommand adds the string to the nonDebug Vector.

If the flag for log debugging information is set on then it also adds it to the debug Vector.

Parameters:
data is an array of strings that contains the data to be log.

Definition at line 197 of file SSPanel.java.

References debug, fontHeight, getPreferredSize(), getUnitHeight(), scroller, and topIndex.

int dndtester::SSPanel::logDebugString String  str  )  [inline]
 

Similar to logString.

The difference is that it only logs it in debug.

Parameters:
str the String to be log in debug.
Returns:
An int that has the index of where in the Vector str was logged in.

Definition at line 285 of file SSPanel.java.

References debug, fontHeight, getPreferredSize(), getUnitHeight(), MAXLINE, scroller, showDebug, and topIndex.

int dndtester::SSPanel::logString String  stri  )  [inline]
 

Similar to logCommand but this only adds one String not an array.

It make sures that the string is not bigger than MAXLINE otherwise it chops it in chunks of MAXLINE long and that is what logs in.

Parameters:
stri the String that is going to be logged in.
Returns:
An int that represents the index where the String was logged in.

Definition at line 229 of file SSPanel.java.

References data, debug, fontHeight, getPreferredSize(), getUnitHeight(), MAXLINE, noDebug, pairs, scroller, and topIndex.

void dndtester::SSPanel::paintComponent Graphics  graphics  )  [inline]
 

Method that displays the results or debugging information.

It begins drawing text where the topIndex is and continues until no more text fits in the panel.

Definition at line 66 of file SSPanel.java.

References data, fontHeight, getUnitHeight(), and topIndex.

void dndtester::SSPanel::replaceLog String  str,
int  index
[inline]
 

Replaces an entry in data.

Once the outcome of testing some command is known this command can be used to log in the outcome of that command. The index should be a number return by logString or logDebugString.

Parameters:
str the String that will replace some entry in data.
index the location of were in data the String should go.

Definition at line 331 of file SSPanel.java.

References debug, noDebug, and pairs.

void dndtester::SSPanel::setScroller JScrollBar  scroll  )  [inline]
 

Allows to change the scrollbar.

But the scrollbar should be added to the sspanel, this is not enforce but it should be followed for proper behavior

Definition at line 57 of file SSPanel.java.

References scroller.

Referenced by dndtester::DaqPanel::DaqPanel().

void dndtester::SSPanel::setTopIndexByPixelValue int  pixelValue  )  [inline]
 

Calculates were the display of the results will start.

Its given a pixel value and it divides this by the font height to find out where the data display should beging.

Definition at line 114 of file SSPanel.java.

References fontHeight, and topIndex.

Referenced by dndtester::DaqPanel::DaqPanel().

void dndtester::SSPanel::showDebugging  )  [inline]
 

Makes the #SSPanel show debugging information.

If the rDPanel#showDebugInf is selected this method is called. Makes data to point to debug. And sets showDebug to true. It recalculates the dimensions of the scroller.

Definition at line 346 of file SSPanel.java.

References data, debug, fontHeight, getPreferredSize(), getUnitHeight(), scroller, showDebug, and topIndex.


The documentation for this class was generated from the following file:
Generated on Mon Jul 28 13:59:25 2003 by doxygen 1.3.2