ides.api.latex
Interface LatexPresentation

All Superinterfaces:
Presentation

public interface LatexPresentation
extends Presentation

A Presentation which contains elements to be rendered with LaTeX.

The use of this interface is optional, if one would like to take advantage of some automatic services offered by LatexManager.

The intention for this interface is to allow LatexManager to manage the prerendering of LaTeX labels when LaTeX rendering is turned on or when a new model is loaded into IDES. However, this management is only supplemental to that of the LaTeX on/off setting. Every presentation should respect the on/off setting by checking LatexManager.isLatexEnabled() before rendering LaTeX elements.

The intended procedure for newly opened models when LaTeX rendering is on is as follows:

  1. A LatexPresentation is instantiated by IDES to display a model. The presentation does not render its elements until setAllowedRendering(boolean) is called with a true argument (by default, newly instantiated LatexPresentations do not render their LaTeX elements).
  2. IDES requests a list of elements which need LaTeX rendering ( getUnrenderedLatexElements()).
  3. In a separate thread, IDES prerenders all elements from the list. In the meantime, the LatexPresentation may be already visible on the screen.
  4. If the user cancels the prerendering process, LaTeX rendering is turned off and the next step is skipped.
  5. When the prerendering is done, the LatexPresentation gets notified that it can now manage its own rendering ( setAllowedRendering(boolean) with a true argument). Allowing rendering does not override the LaTeX on/off setting.

The intended procedure when turning LaTeX rendering on is as follows:

  1. All LatexPresentations in the workspace are notified to stop rendering LaTeX elements (setAllowedRendering(boolean) with a false argument).
  2. The LaTeX setting is turned on.
  3. In a separate thread, IDES prerenders all LaTeX elements from all LatexPresentations in the workspace.
  4. If the user cancels the prerendering process, LaTeX rendering is turned off and the next step is skipped.
  5. When the prerendering is done, the LatexPresentations get notified that they can now manage their own rendering ( setAllowedRendering(boolean) with a true argument). Allowing rendering does not override the LaTeX on/off setting.

Author:
Lenko Grigorov
See Also:
LatexManager.isLatexEnabled()

Method Summary
 java.util.Collection<LatexElement> getUnrenderedLatexElements()
          Returns a list of all LatexElements in the presentation which need to be rendered.
 boolean isAllowedRendering()
          Returns what is the permission for rendering LaTeX elements by the presentation.
 void setAllowedRendering(boolean b)
          Allows or disallows rendering of LaTeX elements by the presentation.
 
Methods inherited from interface ides.api.plugin.presentation.Presentation
forceRepaint, getGUI, getModel, getName, release, setTrackModel
 

Method Detail

getUnrenderedLatexElements

java.util.Collection<LatexElement> getUnrenderedLatexElements()
Returns a list of all LatexElements in the presentation which need to be rendered. This list does not include elements whose rendered versions have been cached by the presentation.

Returns:
list of all LatexElements in the presentation which need to be rendered

setAllowedRendering

void setAllowedRendering(boolean b)
Allows or disallows rendering of LaTeX elements by the presentation. This control is supplemental to the LaTeX on/off setting ( LatexManager.isLatexEnabled()).

A LatexPresentation must not render LaTeX elements unless both LaTeX rendering is on and rendering is allowed via this method.

Parameters:
b - true to allow LaTeX rendering by the presentation, given that LaTeX rendering is on; false to disallow LaTeX rendering by the presentation, regardless of the LaTeX rendering setting
See Also:
LatexManager.isLatexEnabled()

isAllowedRendering

boolean isAllowedRendering()
Returns what is the permission for rendering LaTeX elements by the presentation.

Returns:
true if LaTeX rendering is allowed for this presentation; false if LaTeX rendering is disallowed for this presentation
See Also:
setAllowedRendering(boolean)