org.openscience.jmol.app

Class PovrayDialog

public class PovrayDialog extends JDialog

A dialog for controling the creation of a povray input file from a Chemframe and a display. The actual leg work of writing the file out is done by PovrayWriter.java.

Borrows code from org.openscience.jmol.Vibrate (Thanks!).

Author: Thomas James Grey (tjg1@ch.ic.ac.uk) Matthew A. Meineke (mmeineke@nd.edu)

Nested Class Summary
classPovrayDialog.PovrayWindowListener
Listener for responding to dialog window events.
Field Summary
protected JCheckBoxallFramesCheck
protected JCheckBoxantiAliasCheck
protected JCheckBoxdisplayWhileRenderingCheck
protected JButtongoButton
JLabelimageSizeHeight
JCheckBoximageSizeRatioBox
JComboBoximageSizeRatioCombo
JFormattedTextFieldimageSizeTextHeight
JFormattedTextFieldimageSizeTextWidth
JLabelimageSizeWidth
JCheckBoxmosaicPreviewCheck
JComboBoxmosaicPreviewComboEnd
JComboBoxmosaicPreviewComboStart
JLabelmosaicPreviewEnd
JLabelmosaicPreviewStart
JCheckBoxoutputAlphaCheck
StringoutputExtension
StringoutputFileType
JCheckBoxoutputFormatCheck
JComboBoxoutputFormatCombo
intoutputHeight
intoutputWidth
protected JButtonpovrayPathButton
protected JTextFieldpovrayPathLabel
protected JCheckBoxrunPovCheck
protected JTextFieldsaveField
protected JTextFieldsavePathLabel
JmolViewerviewer
Constructor Summary
PovrayDialog(JFrame f, JmolViewer viewer)
Creates a dialog for getting info related to output frames in povray format.
Method Summary
voidcancelPressed()
Responds to cancel being press- or equivalent eg window closed.
protected voidcenterDialog()
Centers the dialog on the screen.
StringdoubleQuoteIfContainsSpace(String str)
protected StringgetCommandLine()
Generates a commandline from the options set for povray path etc and sets in the textField.
StringgetINI()
Save INI file
voidgetPathHistory()
Just recovers the path settings from last session.
voidgoPressed()
Save or else launch povray- ie do our thang!
voidimageSizeChanged()
Called when the ImageSize check box is modified
voidmosaicPreviewChanged()
Called when the MosaicPreview check box is modified
voidoutputFormatChanged()
Called when the OutputFormat check box is modified
voidsaveHistory()
Just saves the path settings from this session.
voidsetImageDimensions(int imageWidth, int imageHeight)
Sets the output image dimensions.
voidshowPovrayPathDialog()
Show a file selector when the savePath button is pressed.
voidshowSavePathDialog()
Show a file selector when the savePath button is pressed.
StringsimpleQuoteIfContainsSpace(String str)
protected voidupdateCommandLine()
protected voidupdateScreen()
Update screen informations

Field Detail

allFramesCheck

protected JCheckBox allFramesCheck

antiAliasCheck

protected JCheckBox antiAliasCheck

displayWhileRenderingCheck

protected JCheckBox displayWhileRenderingCheck

goButton

protected JButton goButton

imageSizeHeight

private JLabel imageSizeHeight

imageSizeRatioBox

private JCheckBox imageSizeRatioBox

imageSizeRatioCombo

private JComboBox imageSizeRatioCombo

imageSizeTextHeight

private JFormattedTextField imageSizeTextHeight

imageSizeTextWidth

private JFormattedTextField imageSizeTextWidth

imageSizeWidth

private JLabel imageSizeWidth

mosaicPreviewCheck

private JCheckBox mosaicPreviewCheck

mosaicPreviewComboEnd

private JComboBox mosaicPreviewComboEnd

mosaicPreviewComboStart

private JComboBox mosaicPreviewComboStart

mosaicPreviewEnd

private JLabel mosaicPreviewEnd

mosaicPreviewStart

private JLabel mosaicPreviewStart

outputAlphaCheck

private JCheckBox outputAlphaCheck

outputExtension

private String outputExtension

outputFileType

private String outputFileType

outputFormatCheck

private JCheckBox outputFormatCheck

outputFormatCombo

private JComboBox outputFormatCombo

outputHeight

private int outputHeight

outputWidth

private int outputWidth

povrayPathButton

protected JButton povrayPathButton

povrayPathLabel

protected JTextField povrayPathLabel

runPovCheck

protected JCheckBox runPovCheck

saveField

protected JTextField saveField

savePathLabel

protected JTextField savePathLabel

viewer

private transient JmolViewer viewer

Constructor Detail

PovrayDialog

public PovrayDialog(JFrame f, JmolViewer viewer)
Creates a dialog for getting info related to output frames in povray format.

Parameters: f The frame assosiated with the dialog viewer The interacting display we are reproducing (source of view angle info etc)

Method Detail

cancelPressed

void cancelPressed()
Responds to cancel being press- or equivalent eg window closed.

centerDialog

protected void centerDialog()
Centers the dialog on the screen.

doubleQuoteIfContainsSpace

String doubleQuoteIfContainsSpace(String str)

getCommandLine

protected String getCommandLine()
Generates a commandline from the options set for povray path etc and sets in the textField.

Returns: command line

getINI

private String getINI()
Save INI file

Returns: INI data

getPathHistory

private void getPathHistory()
Just recovers the path settings from last session.

goPressed

void goPressed()
Save or else launch povray- ie do our thang!

imageSizeChanged

void imageSizeChanged()
Called when the ImageSize check box is modified

mosaicPreviewChanged

void mosaicPreviewChanged()
Called when the MosaicPreview check box is modified

outputFormatChanged

void outputFormatChanged()
Called when the OutputFormat check box is modified

saveHistory

private void saveHistory()
Just saves the path settings from this session.

setImageDimensions

public void setImageDimensions(int imageWidth, int imageHeight)
Sets the output image dimensions. Setting either to <= 0 will remove the height and width specification from the commandline- the resulting behaviour depends on povray!

Parameters: imageWidth The width of the image. imageHeight The height of the image.

showPovrayPathDialog

void showPovrayPathDialog()
Show a file selector when the savePath button is pressed.

showSavePathDialog

void showSavePathDialog()
Show a file selector when the savePath button is pressed.

simpleQuoteIfContainsSpace

String simpleQuoteIfContainsSpace(String str)

updateCommandLine

protected void updateCommandLine()

updateScreen

protected void updateScreen()
Update screen informations