Class JaxoPreview
java.lang.Object
net.sf.jaxodraw.io.JaxoPreview
- All Implemented Interfaces:
Cloneable
Responsible for viewing, like the results of an export. In general, one has
to create temporary files that are opened with a default application and deleted
after the program terminates. For postscript preview, it is mandatory to
specify a default application in the preferences, the LaTeX preview may be
done with Java's internal JEditorPane.
- Since:
- 2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidShow a window displaying the given URL, allowing the user to browse.voidShow a window displaying the URL (typically HTML), allowing the user to browse.booleanIs it possible to show postscript files?copy()Returns a copy (clone) of this preview.final ComponentParent component to use for window owners.final StringgetTitle()Title to be used for internally opened Windows.voidsetParentComponent(Component value) Sets the parent component.voidSets the title of this dialog.voidShow a window displaying the component.voidshowComponent(Component c, JFrame frame) Display a component in a given frame.voidShow a message that the user cannot view postscript files.voidShow the postscript file 'f', or a message that it cannot be shown.voidShow a window displaying the text file.voidShow a window displaying the text file.voidshowTextInternally(String text) Show a window displaying the text file.voidshowTextInternally(String text, JFrame frame) Display a text file in a given frame.voidShow a window displaying the URL (typically HTML), not allowing the user to browse.
-
Field Details
-
USER_DIR
-
TMP_DIR
A directory for temporary files used for the preview.- Since:
- 2.0.2
-
-
Constructor Details
-
JaxoPreview
Constructor.- Parameters:
parentc- Component whose Window to use a parent for dialogs.
-
-
Method Details
-
getParentComponent
Parent component to use for window owners.- Returns:
- The parent component.
-
setParentComponent
Sets the parent component.- Parameters:
value- The parent component.
-
copy
-
getTitle
Title to be used for internally opened Windows. By default, JaxoInfo.VERSION.- Returns:
- The title of the dialog.
-
setTitle
-
showComponent
Show a window displaying the component.- Parameters:
c- The component to show.
-
showComponent
-
showText
Show a window displaying the text file. If there is an external editor, use that.- Parameters:
text- the text to show.fileName- The name of the temporary file that is created when the external editor is used. It is created in the user home dir.- Throws:
IOException- when there is a problem writing the temporary file when the external editor is used.
-
showText
Show a window displaying the text file. If there is an external editor, use that.- Parameters:
text- the text to show.fileName- The name of the temporary file that is created when the external editor is used. It is created in the user home dir.frame- the frame to show the component in.- Throws:
IOException- when there is a problem writing the temporary file when the external editor is used.
-
showTextInternally
Show a window displaying the text file. Always use the internal editor (JEditorPane).- Parameters:
text- The text.
-
showTextInternally
-
browseURL
Show a window displaying the given URL, allowing the user to browse. Use an external editor if available, otherwise the internal editor (JEditorPane).- Parameters:
u- The URL to display.
-
showURLInternally
Show a window displaying the URL (typically HTML), not allowing the user to browse.- Parameters:
u- The URL to display.
-
browseURLInternally
Show a window displaying the URL (typically HTML), allowing the user to browse.- Parameters:
u- The URL to display.
-
canShowPostscript
public boolean canShowPostscript()Is it possible to show postscript files?- Returns:
- True if a postscript viewer has been specified in the preferences.
-
showMessageForPostscriptViewer
public void showMessageForPostscriptViewer()Show a message that the user cannot view postscript files.- See Also:
-
showPostscript
Show the postscript file 'f', or a message that it cannot be shown.- Parameters:
f- The ps file to show.- See Also:
-
TMP_DIRfor temporary files.