javax.help
Class Presentation

java.lang.Object
  |
  +--javax.help.Presentation
Direct Known Subclasses:
Popup, WindowPresentation

public abstract class Presentation
extends java.lang.Object

Presentation is an abstract class providing a generic interface for the development of alternative Presentations. Each implementation of Presentation will need to override the static method getPresentation according to it's own needs. For instance Popup creates a single object whereas SecondaryWindow looks for an existing secondary window that matches the parameters before creating a new SecondaryWindow and MainWindow will always create a new Presentation. Presentation implements several generic methods required in all presentations.

Since:
2.0
See Also:
HelpSet

Constructor Summary
Presentation()
           
 
Method Summary
 Map.ID getCurrentID()
          Determines which ID is displayed (if any).
 java.net.URL getCurrentURL()
          Determines which URL is displayed.
 java.awt.Font getFont()
          Gets the font for this Presentation.
 HelpSet getHelpSet()
          Returns the default HelpSet
 java.util.Locale getLocale()
          Gets the locale of this component.
static Presentation getPresentation(HelpSet hs, java.lang.String name)
          Get a "name" Presentation given the passed HelpSet.
 java.awt.Dimension getSize()
          Requests the size of the presentation.
abstract  boolean isDisplayed()
          Determines if the presentation is displayed.
 void setCurrentID(Map.ID id)
          Displays this ID--HelpVisitListeners are notified.
 void setCurrentID(java.lang.String id)
          Shows this ID as content relative to the (top) HelpSet for the Presentation instance--HelpVisitListeners are notified.
 void setCurrentURL(java.net.URL url)
          sets the current URL.
abstract  void setDisplayed(boolean b)
          Displays the presentation to the user.
 void setFont(java.awt.Font f)
          Sets the font for this this Presentation.
 void setHelpSet(HelpSet hs)
          Changes the HelpSet for this presentation.
 void setHelpSetPresentation(HelpSet.Presentation hsPres)
          Set the Presentation attributes from a named presentation in a HelpSet.
 void setLocale(java.util.Locale l)
          Sets the locale of this Presentation.
 void setSize(java.awt.Dimension d)
          Requests the presentation be set to a given size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Presentation

public Presentation()
Method Detail

getPresentation

public static Presentation getPresentation(HelpSet hs,
                                           java.lang.String name)
Get a "name" Presentation given the passed HelpSet. The presentation returned will vary depending on the implementing class. All classes will set the HelpSetPresentation based on the name if a HelpSet.Presentation matching that name exists in the HelpSet. If no named HelpSet.Presentation exits the default HelpSet.Presentation is used if present, otherwise the implementing class defaults will be used. Implementation of Presentation will override this implementation to return their own type. Implementation also have the descression to reuse "name"d presentations or create new Presentations. Presentation will return null unless otherwise overriden.

Parameters:
hs - The helpset used to get the Presentation
name - The name of the presentation.

setHelpSetPresentation

public void setHelpSetPresentation(HelpSet.Presentation hsPres)
Set the Presentation attributes from a named presentation in a HelpSet. Extension of this class should extend this class by adding additional attributes

See Also:
HelpSet.Presentation

getCurrentID

public Map.ID getCurrentID()
Determines which ID is displayed (if any).


setCurrentID

public void setCurrentID(java.lang.String id)
                  throws BadIDException
Shows this ID as content relative to the (top) HelpSet for the Presentation instance--HelpVisitListeners are notified.

Parameters:
id - A string that identifies the topic to show for the loaded (top) HelpSet
Throws:
BadIDException - The ID is not valid for the HelpSet

setCurrentID

public void setCurrentID(Map.ID id)
                  throws InvalidHelpSetContextException
Displays this ID--HelpVisitListeners are notified.

Parameters:
id - a Map.ID indicating the URL to display
Throws:
InvalidHelpSetContextException - if the current helpset does not contain id.helpset

getCurrentURL

public java.net.URL getCurrentURL()
Determines which URL is displayed.


setCurrentURL

public void setCurrentURL(java.net.URL url)
sets the current URL. HelpVisitListeners are notified. The currentID changes if there is a mathing ID for this URL

Parameters:
url - The url to display. A null URL is a valid url.

getHelpSet

public HelpSet getHelpSet()
Returns the default HelpSet


setHelpSet

public void setHelpSet(HelpSet hs)
Changes the HelpSet for this presentation.

Parameters:
hs - The HelpSet to set for this presentation. A null hs is valid parameter.

setDisplayed

public abstract void setDisplayed(boolean b)
Displays the presentation to the user.


isDisplayed

public abstract boolean isDisplayed()
Determines if the presentation is displayed.


getFont

public java.awt.Font getFont()
Gets the font for this Presentation.


setFont

public void setFont(java.awt.Font f)
Sets the font for this this Presentation. Concrete implementations must make sure that the font is properly set by extending this class.

Parameters:
f - The font.

getLocale

public java.util.Locale getLocale()
Gets the locale of this component.

Returns:
This component's locale. If this component does not have a locale, the defaultLocale is returned.
See Also:
setLocale(java.util.Locale)

setLocale

public void setLocale(java.util.Locale l)
Sets the locale of this Presentation. The locale is propagated to the presentation. Concrete implemenation must make sure they override this class to properly set the locale.

Parameters:
l - The locale to become this component's locale. A null locale is the same as the defaultLocale.
See Also:
getLocale()

getSize

public java.awt.Dimension getSize()
Requests the size of the presentation.


setSize

public void setSize(java.awt.Dimension d)
Requests the presentation be set to a given size. Concrete implementation must override this method to properly set the size.

Parameters:
d - - a Dimension to set the size to.