issrg.utils.gui
Class HelpWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by issrg.utils.gui.HelpWindow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.HyperlinkListener, javax.swing.event.TreeSelectionListener, javax.swing.RootPaneContainer, javax.swing.tree.TreeCellRenderer, javax.swing.WindowConstants

public class HelpWindow
extends javax.swing.JFrame
implements javax.swing.event.TreeSelectionListener, javax.swing.event.HyperlinkListener, javax.swing.tree.TreeCellRenderer

This class represents a Help Window. It displays two panes, one of which contains the Table of Contents, and the other - the current topic.

When constructing the object, pass it the filename of the help descriptor and the anchor class in the package containing all the help resources (HTML files, pictures, etc).

Anchor class is an empty class that can be used solely to get the ClassLoader - and all the resources located in the same package (or JAR file directory).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.lang.Class clazz
           
protected  javax.swing.JLabel collapsed
           
protected  javax.swing.JEditorPane contentText
           
protected  javax.swing.JLabel expanded
           
protected  javax.swing.JLabel leafNode
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HelpWindow(java.awt.Frame parent, java.lang.String title, java.lang.Class anchorClass, java.lang.String rootTopic)
          This constructor builds one help window, given the anchor class and the filename of the root topic descriptor.
 
Method Summary
 java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          This method returns a TreeCellRendererComponent that has a icon corresponding to the type of node (open/closed topic with subtopics, or just a topic).
 boolean handleEvent(java.awt.Event evt)
           
 void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
          This is the method for HyperlinkListener.
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
          This is the method for TreeSelectionListener.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

contentText

protected javax.swing.JEditorPane contentText

clazz

protected java.lang.Class clazz

expanded

protected javax.swing.JLabel expanded

collapsed

protected javax.swing.JLabel collapsed

leafNode

protected javax.swing.JLabel leafNode
Constructor Detail

HelpWindow

public HelpWindow(java.awt.Frame parent,
                  java.lang.String title,
                  java.lang.Class anchorClass,
                  java.lang.String rootTopic)
This constructor builds one help window, given the anchor class and the filename of the root topic descriptor. The root topic descriptor is a text file that describes the contents of the help, as shown below.

<URL of a expanded node image>

<URL of a collapsed node image>

<URL of a help topic image>

<level number> [space] <URL of the topic HTML file> [space] <Topic name as it appears in the Table of Contents>

The level number is an integer. It should increase by one at most (to mark a sub-topic of the topic in the previous level), it can remain the same, or be less. E.g.

expanded.gif

collapsed.gif

help.gif

0 introduction.html Introduction

0 ac_contents.html AC Contents

1 attribute_type.html Attribute types

0 edit_menu.html Edit menu

1 preferences.html Preferences

2 holder_name.html Holder name

2 issuer_name.html Issuer name

3 attribute_window_new.html New

0 certificate_menu.html Certificate menu

This file represents the following Table of contents:

1. Introduction

2. Contents

2.1 Attribute types

3. Edit menu

3.1 Preferences

3.1.1 Holder name

3.1.2 Issuer name

3.1.2.1 New

4. Certificate menu

Parameters:
parent - - the parent window in relation to which the help window will be centered; if null, the window will be centered in relation to the screen
title - - the initial title of the help window
anchorClass - - the instance of the anchor class; its classloader will be used to located the help files in the resource bundle
rootTopic - - the contents descriptor file (relative URL pointing to the location of the contents descriptor in the resource bundle)
Method Detail

handleEvent

public boolean handleEvent(java.awt.Event evt)
Overrides:
handleEvent in class java.awt.Component

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent e)
This is the method for TreeSelectionListener. It opens the file associated with the selected topic and expands the topic, if there are any sub-topics.

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

hyperlinkUpdate

public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
This is the method for HyperlinkListener.

Specified by:
hyperlinkUpdate in interface javax.swing.event.HyperlinkListener

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                                       java.lang.Object value,
                                                       boolean selected,
                                                       boolean expanded,
                                                       boolean leaf,
                                                       int row,
                                                       boolean hasFocus)
This method returns a TreeCellRendererComponent that has a icon corresponding to the type of node (open/closed topic with subtopics, or just a topic).

Specified by:
getTreeCellRendererComponent in interface javax.swing.tree.TreeCellRenderer