TV-Browser 2.7.5 API

util.ui
Class HelpDialog

java.lang.Object
  extended by util.ui.HelpDialog
All Implemented Interfaces:
ActionListener, EventListener, HyperlinkListener

public class HelpDialog
extends Object
implements ActionListener, HyperlinkListener

A help dialog which is able to show HTML pages that are located in a jar file.

Author:
Til Schneider, www.murfman.de

Nested Class Summary
protected static class HelpDialog.HistoryStackElement
           
protected  class HelpDialog.ScrollBarUpdater
           
 
Field Summary
static Dimension MAX_HELP_DIALOG_SIZE
          The maximum size of the help dialog.
static Dimension MIN_HELP_DIALOG_SIZE
          The minimum size of the help dialog.
 
Method Summary
 void actionPerformed(ActionEvent evt)
           
protected  void addThisSiteToHistory()
          Hilfsmethode für hyperlinkUpdate.
protected static String extractPath(String dateiname)
          Extrahiert aus einem gegebenen Dateinamen den Pfad.
 void hyperlinkUpdate(HyperlinkEvent evt)
           
protected  void openSite(String filename, Class clazz)
          Lädt eine HTML-Seite und gibt deren Inhalt als String zurück.
protected  void popFromHistory()
          Hilfsmethode für actionPerformed(ActionEvent).
protected  void setEditorText(String text, double updateScrollBarTo)
          Sets the text currently show.
 void show()
           
static void showHelpPage(Component parent, String filename, Class clazz)
          Shows the specified site in the help dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_HELP_DIALOG_SIZE

public static final Dimension MIN_HELP_DIALOG_SIZE
The minimum size of the help dialog.


MAX_HELP_DIALOG_SIZE

public static final Dimension MAX_HELP_DIALOG_SIZE
The maximum size of the help dialog.

Method Detail

showHelpPage

public static void showHelpPage(Component parent,
                                String filename,
                                Class clazz)
Shows the specified site in the help dialog. If there is currently no help dialog shown, one is created.

Parameters:
parent - If there is currently no help dialog shown, this parent is used for creating a new one.
filename - The name of the HTML file to show.
clazz - A class in the jar where the HTML file is in.

show

public void show()

setEditorText

protected void setEditorText(String text,
                             double updateScrollBarTo)
Sets the text currently show.

Parameters:
text - The HTML text.
updateScrollBarTo - The relative position to scroll to. (Between 0 and 1)

addThisSiteToHistory

protected void addThisSiteToHistory()
Hilfsmethode für hyperlinkUpdate.

Fügt die aktuelle Seite zum mHistoryStack hinzu.


popFromHistory

protected void popFromHistory()
Hilfsmethode für actionPerformed(ActionEvent).

Ruft die oberste Seite des mHistoryStack wieder auf.


openSite

protected void openSite(String filename,
                        Class clazz)
Lädt eine HTML-Seite und gibt deren Inhalt als String zurück.

Die Seite kann auch in der Jar-Datei sein, in dem diese Klasse ist.

Parameters:
clazz - A class in the jar where the HTML site is located.
filename - Der Dateiname der HTML-Seite.

extractPath

protected static String extractPath(String dateiname)
Extrahiert aus einem gegebenen Dateinamen den Pfad. Ist kein Pfad vorhanden, so wird null zurückgegeben.

Parameters:
dateiname - Der Dateiname.

actionPerformed

public void actionPerformed(ActionEvent evt)
Specified by:
actionPerformed in interface ActionListener

hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent evt)
Specified by:
hyperlinkUpdate in interface HyperlinkListener

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)