Package com.j3d.gen.docs
Class DocsProvider
java.lang.Object
com.j3d.gen.docs.DocsProvider
Provides and manages documentation frames within the J3Engine.
This class acts as a central point for accessing and creating
DocsFrame instances,
ensuring that documentation files are loaded and displayed efficiently.
It maintains a cache of DocsFrame objects to prevent redundant loading.- Author:
- Lehlogonolo Poole
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides aDocsFramefor a given documentation ID.Provides the main documentation frame.voidshowAndScrollTo(Documentation doc, String header) Displays a specific documentation frame and scrolls to a designated header within it.
-
Field Details
-
frameHashMap
A map to storeDocsFrameinstances, keyed by their ID. This allows for efficient retrieval of existing documentation frames. -
main
The main documentation frame, which is always available.
-
-
Constructor Details
-
DocsProvider
public DocsProvider()Constructs a newDocsProvider.
-
-
Method Details
-
provideMain
Provides the main documentation frame. This frame is always available and serves as the primary documentation viewer.- Returns:
- The main
DocsFrameinstance.
-
provideDocFrame
Provides aDocsFramefor a given documentation ID. If a frame for the specified ID already exists in the cache, it is returned. Otherwise, a newDocsFrameis created, initialized with the given ID, added to the cache, and then returned. If the ID does not correspond to an existing documentation file, an error is handled.- Parameters:
id- The unique identifier for the documentation file.- Returns:
- The
DocsFrameassociated with the provided ID.
-
showAndScrollTo
Displays a specific documentation frame and scrolls to a designated header within it. This method first retrieves or creates aDocsFramefor the givenDocumentationobject using its file ID. It then makes the frame visible and instructs it to scroll to the specified header.- Parameters:
doc- TheDocumentationobject whose frame is to be shown and scrolled.header- The header string within the documentation to scroll to.
-