Package javax.help
Class WindowPresentation
- java.lang.Object
-
- javax.help.Presentation
-
- javax.help.WindowPresentation
-
- Direct Known Subclasses:
MainWindow,SecondaryWindow
public abstract class WindowPresentation extends Presentation
Window Presentation is an abstract class providing a generic interface for the development of Window Presentations. Each implementation of Presentation will need to override the static method getPresentation according to it's own needs. WindowPresentation implements several generic methods required in all window presentations. Includes the ability to handle modal and non-modal activation of the help window.- Since:
- 2.0
- See Also:
HelpSet,JHelpNavigator,javax.help.HelpVisitListener
-
-
Constructor Summary
Constructors Constructor Description WindowPresentation(HelpSet hs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateHelpWindow()voiddestroy()Destroy this object.java.awt.WindowgetActivationWindow()Get the activation window.java.lang.StringgetCurrentView()Determines the current navigator.java.awt.FontgetFont()Gets the font for this WindowPresentationHelpSet.PresentationgetHelpSetPresentation()Return the HelpSet.Presentation if one was setjava.awt.WindowgetHelpWindow()Get the current window that help is displayed injava.awt.PointgetLocation()Requests the location of the presentation.intgetScreen()Requests the screen of the presentationjava.awt.DimensiongetSize()Requests the size of the presentation.java.lang.StringgetTitle()booleanisDestroyedOnExit()Determines if the presentation should be distroyed on exitbooleanisDisplayed()Determines if the presentation is displayed.booleanisTitleSetFromDocument()Is the title set from the Document.booleanisToolbarDisplayed()Determines if the toolbar is visible.booleanisViewDisplayed()Determines if the current view is visible.voidsetActivationObject(java.lang.Object comp)Set the activation window from given Component or MenuItem.voidsetActivationWindow(java.awt.Window window)Set the activation window.voidsetCurrentView(java.lang.String name)Set the currentView to the navigator with the same name as the name parameter.voidsetDestroyOnExit(boolean destroy)Destory the window on exitvoidsetDisplayed(boolean b)Displays the presentation to the user.voidsetFont(java.awt.Font f)Sets the font for this this WindowPresentation.voidsetHelpSet(HelpSet hs)Changes the HelpSet for this presentation.voidsetHelpSetPresentation(HelpSet.Presentation hsPres)Set the Presentation attributes specific to WindowPresentations from a named presentation in a HelpSet.voidsetLocale(java.util.Locale l)Sets the locale of this Presentation.voidsetLocation(java.awt.Point p)Requests the presentation be located at a given position.voidsetScreen(int screen)Sets the screen of the presentationvoidsetSize(java.awt.Dimension d)Requests the presentation be set to a given size.voidsetTitle(java.lang.String title)voidsetTitleFromDocument(boolean b)Set the title from the Document.voidsetToolbarDisplayed(boolean displayed)Hides/Shows ToolbarvoidsetViewDisplayed(boolean displayed)Hides/Shows view.-
Methods inherited from class javax.help.Presentation
getCurrentID, getCurrentURL, getHelpModel, getHelpSet, getLocale, getPresentation, setCurrentID, setCurrentID, setCurrentURL
-
-
-
-
Constructor Detail
-
WindowPresentation
public WindowPresentation(HelpSet hs)
-
-
Method Detail
-
setHelpSetPresentation
public void setHelpSetPresentation(HelpSet.Presentation hsPres)
Set the Presentation attributes specific to WindowPresentations from a named presentation in a HelpSet.- Overrides:
setHelpSetPresentationin classPresentation- See Also:
HelpSet.Presentation
-
getHelpSetPresentation
public HelpSet.Presentation getHelpSetPresentation()
Return the HelpSet.Presentation if one was set- See Also:
HelpSet.Presentation
-
getActivationWindow
public java.awt.Window getActivationWindow()
Get the activation window.
-
setActivationWindow
public void setActivationWindow(java.awt.Window window)
Set the activation window. If the window is an instance of a Dialog and the is modal, modallyActivated help is set to true and ownerDialog is set to the window. In all other instances modallyActivated is set to false and ownerDialog is set to null.- Parameters:
window- the activating window
-
setActivationObject
public void setActivationObject(java.lang.Object comp)
Set the activation window from given Component or MenuItem. It find Window component in the component tree from given Component or MenuItem end callsetActivationWindow
.- Since:
- 2.0
- See Also:
setActivationWindow(java.awt.Window)
-
getCurrentView
public java.lang.String getCurrentView()
Determines the current navigator.
-
setCurrentView
public void setCurrentView(java.lang.String name)
Set the currentView to the navigator with the same name as the name parameter.- Parameters:
name- The name of the navigator to set as the current view. If nav is null or not a valid Navigator in this WindowPresentation then an IllegalArgumentException is thrown.- Throws:
java.lang.IllegalArgumentException- if nav is null or not a valid Navigator.
-
isDestroyedOnExit
public boolean isDestroyedOnExit()
Determines if the presentation should be distroyed on exit
-
setDestroyOnExit
public void setDestroyOnExit(boolean destroy)
Destory the window on exit
-
destroy
public void destroy()
Destroy this object. Implementation of WindowPresentation that maintian a list of objects should override this method and call super.destroy to clear up the WindowPresentation internal fields.
-
setHelpSet
public void setHelpSet(HelpSet hs)
Changes the HelpSet for this presentation.- Overrides:
setHelpSetin classPresentation- Parameters:
hs- The HelpSet to set for this presentation. A null hs is valid parameter.
-
setDisplayed
public void setDisplayed(boolean b)
Displays the presentation to the user.- Specified by:
setDisplayedin classPresentation
-
isDisplayed
public boolean isDisplayed()
Determines if the presentation is displayed.- Specified by:
isDisplayedin classPresentation
-
setFont
public void setFont(java.awt.Font f)
Sets the font for this this WindowPresentation.- Overrides:
setFontin classPresentation- Parameters:
f- The font.
-
getFont
public java.awt.Font getFont()
Gets the font for this WindowPresentation- Overrides:
getFontin classPresentation
-
setLocale
public void setLocale(java.util.Locale l)
Sets the locale of this Presentation. The locale is propagated to the presentation.- Overrides:
setLocalein classPresentation- Parameters:
l- The locale to become this component's locale. A null locale is the same as the defaultLocale.- See Also:
Presentation.getLocale()
-
getLocation
public java.awt.Point getLocation()
Requests the location of the presentation.
-
setLocation
public void setLocation(java.awt.Point p)
Requests the presentation be located at a given position.
-
getScreen
public int getScreen()
Requests the screen of the presentation
-
setScreen
public void setScreen(int screen)
Sets the screen of the presentation- Parameters:
screen- the screen number- Throws:
java.lang.IllegalArgumentException- if the screen is invalid
-
getSize
public java.awt.Dimension getSize()
Requests the size of the presentation.- Overrides:
getSizein classPresentation
-
setSize
public void setSize(java.awt.Dimension d)
Requests the presentation be set to a given size. Updates the the presentation on the fly. This is an override of Presentation.SetSize.- Overrides:
setSizein classPresentation- Parameters:
d- - a Dimension to set the size to.
-
getTitle
public java.lang.String getTitle()
-
setTitle
public void setTitle(java.lang.String title)
-
isTitleSetFromDocument
public boolean isTitleSetFromDocument()
Is the title set from the Document. This is generally useful in SecondaryWindows.- Returns:
- boolean True if title is set from the Document, false otherwise.
-
setTitleFromDocument
public void setTitleFromDocument(boolean b)
Set the title from the Document.- Parameters:
b- if true will set the title form the document, otherwise will set the title from the HelpSet.
-
isViewDisplayed
public boolean isViewDisplayed()
Determines if the current view is visible.
-
setViewDisplayed
public void setViewDisplayed(boolean displayed)
Hides/Shows view.
-
isToolbarDisplayed
public boolean isToolbarDisplayed()
Determines if the toolbar is visible.
-
setToolbarDisplayed
public void setToolbarDisplayed(boolean displayed)
Hides/Shows Toolbar
-
createHelpWindow
public void createHelpWindow()
-
getHelpWindow
public java.awt.Window getHelpWindow()
Get the current window that help is displayed in
-
-