fedora.swing.jhelp
Class SimpleContentViewerUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.help.plaf.HelpContentViewerUI
          extended by fedora.swing.jhelp.SimpleContentViewerUI
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.help.event.HelpModelListener, javax.help.event.TextHelpModelListener, javax.swing.event.HyperlinkListener

public class SimpleContentViewerUI
extends javax.help.plaf.HelpContentViewerUI
implements javax.help.event.HelpModelListener, javax.help.event.TextHelpModelListener, javax.swing.event.HyperlinkListener, java.beans.PropertyChangeListener, java.io.Serializable

Title: SimpleContentViewerUI.java

Description: Based on SimpleContentViewerUI in javax.help.plaf.basic, which comes with JavaHelp, which comes with Java1.4, and is written by Sun Microsystems. More information on JavaHelp can be found at http://java.sun.com/products/javahelp/faq.html But this version doesn't call setBackingStoreEnable(true), which is a deprecated method (as of java1.4) anyway.

This simple modification has the net effect of allowing images displayed in help content windows to not be mangled (actually, they mysteriously disappear) when the scrollbar is first used.

----------------------------------------------------------------------------- Portions created by Sun Microsystems are Copyright © Sun Microsystems, originally made available at java.sun.com

-----------------------------------------------------------------------------

Version:
$Id: SimpleContentViewerUI.java 5162 2006-10-25 00:49:06Z eddie $
Author:
Sun Microsystems, cwilper@cs.cornell.edu
See Also:
Serialized Form

Nested Class Summary
 class SimpleContentViewerUI.JHEditorPane
          Subclass of JEditorPane that uses the JHelpContentViewer type registry.
 
Field Summary
protected  javax.help.JHelpContentViewer theViewer
           
 
Constructor Summary
SimpleContentViewerUI(javax.help.JHelpContentViewer b)
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
           
 java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
           
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
           
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
 void highlightsChanged(javax.help.event.TextHelpModelEvent e)
          Determines if highlights have changed.
 void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
          Notification of a change relative to a hyperlink.
 void idChanged(javax.help.event.HelpModelEvent e)
           
 void installUI(javax.swing.JComponent c)
           
protected  void linkActivated(java.net.URL u)
          Follows the reference in an link.
 void propertyChange(java.beans.PropertyChangeEvent event)
           
 void setEditorKit(java.lang.String type, javax.swing.text.EditorKit kit)
           
 void uninstallUI(javax.swing.JComponent c)
           
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theViewer

protected javax.help.JHelpContentViewer theViewer
Constructor Detail

SimpleContentViewerUI

public SimpleContentViewerUI(javax.help.JHelpContentViewer b)
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)

setEditorKit

public void setEditorKit(java.lang.String type,
                         javax.swing.text.EditorKit kit)

installUI

public void installUI(javax.swing.JComponent c)
Overrides:
installUI in class javax.swing.plaf.ComponentUI

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Overrides:
getPreferredSize in class javax.swing.plaf.ComponentUI

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Overrides:
getMinimumSize in class javax.swing.plaf.ComponentUI

getMaximumSize

public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
Overrides:
getMaximumSize in class javax.swing.plaf.ComponentUI

idChanged

public void idChanged(javax.help.event.HelpModelEvent e)
Specified by:
idChanged in interface javax.help.event.HelpModelListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

hyperlinkUpdate

public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
Notification of a change relative to a hyperlink.

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

linkActivated

protected void linkActivated(java.net.URL u)
Follows the reference in an link. The given url is the requested reference. By default this calls setPage, and if an exception is thrown the original previous document is restored and a beep sounded. If an attempt was made to follow a link, but it represented a malformed url, this method will be called with a null argument.

Parameters:
u - the URL to follow

highlightsChanged

public void highlightsChanged(javax.help.event.TextHelpModelEvent e)
Determines if highlights have changed. Collects all the highlights and marks the presentation.

Specified by:
highlightsChanged in interface javax.help.event.TextHelpModelListener
Parameters:
e - The TextHelpModelEvent.