base
Class LCDController

java.lang.Object
  extended by java.lang.Thread
      extended by base.LCDController
All Implemented Interfaces:
Runnable

public class LCDController
extends Thread

This class comtains the functionality to send data to an optionally connected LCD. This is done via lcdproc and the related classes of com.vwp.jLCD of the Java XTools. This class consisnts of several service methods and an onw thread. The thread displays some interesting statistic information after a timeout. This timeout elapses only when no other, usage-relevant data are displayed via the other service methods meanwhile.
Within the display two text lines are created, the first line is a scrolling widget that is able to hold texts that are larger than the display, the second one is a fixed widget where thexts should be set only that fit into the display, elsewhere the right part will be skipped.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LCDController(String title)
          The standard constructor for an object of type LCDController establishes the connection to the lcdproc server and starts the internal thread that checks for the user input timeout
 
Method Summary
 String getText(int num)
          Fetches a line of text that is currently set as standard text.
 void ping()
          This method has to be called for every user interaction that does not change the data displayed within the LCD so that it is able to restart the timeout counter without changing anything within the display or - when a timeout is active - to display the last data that have been active before the current timeout ocurred
 void resetErrorText()
          Removes the currently displayed error texts and switch back to the formerly shown standard information
 void resetMessageText()
          Removes the currently displayed message texts and switch back to the formerly shown standard information
 void resetSaverTexts()
          Removes the currently displayed saver texts and switch back to the formerly shown standard information
 void run()
           
 void setErrorText(String text)
          Sets two error texts to be displayed left-aligned and with a bigger priority than the standard texts; this method does not overwrite the standard texts, with a call to resetErrorText() the error text is removed and the previously used standard texts are displayed again
 void setMessageText(String text)
          Sets two message texts to be displayed left-aligned and with a bigger priority than the standard texts; this method does not overwrite the standard texts, with a call to resetMessageText() the message texts are removed and the previously used standard texts are displayed again
 void setTexts(String t1, String t2)
          Sets two standard texts to be displayed left-aligned
 void setTexts(String t1, String t2, boolean center)
          Sets two standard texts to be displayed
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LCDController

public LCDController(String title)
The standard constructor for an object of type LCDController establishes the connection to the lcdproc server and starts the internal thread that checks for the user input timeout

Parameters:
title - the name for the lcdproc scoller widget in first line of the LCD
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

ping

public void ping()
This method has to be called for every user interaction that does not change the data displayed within the LCD so that it is able to restart the timeout counter without changing anything within the display or - when a timeout is active - to display the last data that have been active before the current timeout ocurred


setTexts

public void setTexts(String t1,
                     String t2)
Sets two standard texts to be displayed left-aligned

Parameters:
t1 - the text for the first line within the display
t2 - the text for the second line within the display

setTexts

public void setTexts(String t1,
                     String t2,
                     boolean center)
Sets two standard texts to be displayed

Parameters:
t1 - the text for the first line within the display
t2 - the text for the second line within the display
center - when this value is set to false the texts are displayed left-aligned, when it is true they are centered

getText

public String getText(int num)
Fetches a line of text that is currently set as standard text. When a timeout is active and other information are displayed this method does NOT return these other information but the standard texts that would have been displayed withiut that timeout

Parameters:
num - the line for which the text has to be fetched
Returns:
the text stored at this line or null when an invalid line number was given

setErrorText

public void setErrorText(String text)
Sets two error texts to be displayed left-aligned and with a bigger priority than the standard texts; this method does not overwrite the standard texts, with a call to resetErrorText() the error text is removed and the previously used standard texts are displayed again

Parameters:
t1 - the error text for the first line within the display
t2 - the error text for the second line within the display

resetErrorText

public void resetErrorText()
Removes the currently displayed error texts and switch back to the formerly shown standard information


setMessageText

public void setMessageText(String text)
Sets two message texts to be displayed left-aligned and with a bigger priority than the standard texts; this method does not overwrite the standard texts, with a call to resetMessageText() the message texts are removed and the previously used standard texts are displayed again

Parameters:
t1 - the message text for the first line within the display
t2 - the message text for the second line within the display

resetMessageText

public void resetMessageText()
Removes the currently displayed message texts and switch back to the formerly shown standard information


resetSaverTexts

public void resetSaverTexts()
Removes the currently displayed saver texts and switch back to the formerly shown standard information