net.sf.latexdraw.instruments
Class PreferencesSetter

java.lang.Object
  extended by org.malai.instrument.Instrument
      extended by net.sf.latexdraw.instruments.PreferencesSetter
All Implemented Interfaces:
ActionHandler, Preferenciable, Modifiable, Reinitialisable, UndoHandler

public class PreferencesSetter
extends Instrument

This instrument modifies the preferences.

This file is part of LaTeXDraw
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

01/18/11

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  MCheckBox alpaInterCheckBox
          This check-box allows to set if alpha-interpolation must be used.
protected  MCheckBox antialiasingCheckBox
          This check-box allows to set if antialiasing must be used.
protected  MCheckBox checkNewVersion
          Allows the set if the program must check new version on start up.
protected  MRadioButton classicGridRB
          The widget used to display the standard grid.
protected  MCheckBox colorRenderCheckBox
          This check-box allows to set if colour rendering quality must be used.
protected  MCheckBox displayBordersCB
          This check-box allows to set if the user wants to the borders of the drawing.
protected  MCheckBox displayGridCB
          This check-box allows to set if the user wants to display the grid.
protected  MCheckBox displayXScaleCB
          This check-box allows to set if the user wants to display the X-scale.
protected  MCheckBox displayYScaleCB
          This check-box allows to set if the user wants to display the Y-scale.
protected  javax.swing.JFileChooser fileChooser
          The file chooser of paths selection.
protected  LFrame frame
          The main frame.
protected  IPoint framePosition
          Defines the position of the main frame.
protected  java.awt.Dimension frameSize
          Defines the size of the main frame.
protected  boolean isFrameMaximized
          Defines if the main frame is maximised or not.
protected  MComboBox langList
          The list that contains the supported languages.
protected  MTextArea latexIncludes
          The text field used to defines the latex packages to use.
protected  MCheckBox magneticGridCB
          The widget that defines if the grid is magnetic.
protected  MSpinner nbRecentFilesField
          The widget used to defines the number of recent file to keep in memory.
protected  MTextField pathExportField
          This textField allows to set the default directories for exporting actions.
protected  MTextField pathOpenField
          This textField allows to set the default directories for open/save actions.
protected  MTextField pathTexEditorField
          The field used to modifies the path of the selected latex editor.
protected  MSpinner persoGridGapField
          The field used to modifies the gap of the customised grid.
protected  MRadioButton persoGridRB
          The widget used to display a customised grid.
protected  java.util.List<java.lang.String> recentFilesName
          The recent files.
protected  MCheckBox renderingCheckBox
          This check-box allows to set if rendering quality must be used.
protected  MComboBox themeList
          The list that contains the supported theme.
protected  MComboBox unitChoice
          Allows to set the unit of length by default.
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
PreferencesSetter(LFrame frame)
          Creates the instrument.
 
Method Summary
 void addRecentFile(java.lang.String absolutePath)
          Adds a recent file.
private  void applyValues()
          Applies the values of the preferences setter to the concerned elements.
 MCheckBox getAlpaInterCheckBox()
           
 MCheckBox getAntialiasingCheckBox()
           
 MCheckBox getCheckNewVersion()
           
 MRadioButton getClassicGridRB()
           
 MCheckBox getColorRenderCheckBox()
           
 MCheckBox getDisplayBordersCB()
           
 MCheckBox getDisplayGridCB()
           
 MCheckBox getDisplayXScaleCB()
           
 MCheckBox getDisplayYScaleCB()
           
 javax.swing.JFileChooser getFileChooser()
           
 MComboBox getLangList()
           
 MTextArea getLatexIncludes()
           
 MCheckBox getMagneticGridCB()
           
 MSpinner getNbRecentFilesField()
           
 MTextField getPathExportField()
           
 MTextField getPathOpenField()
           
 MTextField getPathTexEditorField()
           
 MSpinner getPersoGridGapField()
           
 MRadioButton getPersoGridRB()
           
 MCheckBox getRenderingCheckBox()
           
 MComboBox getThemeList()
           
 MComboBox getUnitChoice()
           
protected  void initialiseLinks()
          Initialises the links of the instrument.
protected  void initialiseWidgets()
          Initialises the widgets of the instrument.
 boolean isVersionCheckEnable()
           
private  void processXMLDataPreference(java.util.Map<java.lang.String,org.w3c.dom.Node> prefMap)
           
 void readXMLPreferences()
          Reads the preferences of latexdraw defined in XML.
private  void readXMLPreferencesFromFile(java.io.File xmlFile)
           
 void writeXMLPreferences()
          Writes the preferences of latexdraw in an XML document.
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, interimFeedback, isActivated, isModified, load, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, onUndoableRedo, onUndoableUndo, reinit, removeLink, save, setActivated, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileChooser

protected javax.swing.JFileChooser fileChooser
The file chooser of paths selection.


antialiasingCheckBox

protected MCheckBox antialiasingCheckBox
This check-box allows to set if antialiasing must be used.


renderingCheckBox

protected MCheckBox renderingCheckBox
This check-box allows to set if rendering quality must be used.


colorRenderCheckBox

protected MCheckBox colorRenderCheckBox
This check-box allows to set if colour rendering quality must be used.


displayGridCB

protected MCheckBox displayGridCB
This check-box allows to set if the user wants to display the grid.


magneticGridCB

protected MCheckBox magneticGridCB
The widget that defines if the grid is magnetic.


displayXScaleCB

protected MCheckBox displayXScaleCB
This check-box allows to set if the user wants to display the X-scale.


displayYScaleCB

protected MCheckBox displayYScaleCB
This check-box allows to set if the user wants to display the Y-scale.


checkNewVersion

protected MCheckBox checkNewVersion
Allows the set if the program must check new version on start up.


displayBordersCB

protected MCheckBox displayBordersCB
This check-box allows to set if the user wants to the borders of the drawing.


alpaInterCheckBox

protected MCheckBox alpaInterCheckBox
This check-box allows to set if alpha-interpolation must be used.


pathOpenField

protected MTextField pathOpenField
This textField allows to set the default directories for open/save actions.


pathExportField

protected MTextField pathExportField
This textField allows to set the default directories for exporting actions.


pathTexEditorField

protected MTextField pathTexEditorField
The field used to modifies the path of the selected latex editor.


latexIncludes

protected MTextArea latexIncludes
The text field used to defines the latex packages to use.


unitChoice

protected MComboBox unitChoice
Allows to set the unit of length by default.


themeList

protected MComboBox themeList
The list that contains the supported theme.


langList

protected MComboBox langList
The list that contains the supported languages.


classicGridRB

protected MRadioButton classicGridRB
The widget used to display the standard grid.


persoGridRB

protected MRadioButton persoGridRB
The widget used to display a customised grid.


persoGridGapField

protected MSpinner persoGridGapField
The field used to modifies the gap of the customised grid.


nbRecentFilesField

protected MSpinner nbRecentFilesField
The widget used to defines the number of recent file to keep in memory.


recentFilesName

protected java.util.List<java.lang.String> recentFilesName
The recent files.


isFrameMaximized

protected boolean isFrameMaximized
Defines if the main frame is maximised or not.


frameSize

protected java.awt.Dimension frameSize
Defines the size of the main frame.


framePosition

protected IPoint framePosition
Defines the position of the main frame.


frame

protected LFrame frame
The main frame.

Constructor Detail

PreferencesSetter

public PreferencesSetter(LFrame frame)
Creates the instrument.

Parameters:
frame - The frame that will be set while setting parameters.
Since:
3.0
Method Detail

initialiseWidgets

protected void initialiseWidgets()
Initialises the widgets of the instrument.

Since:
3.0

addRecentFile

public void addRecentFile(java.lang.String absolutePath)
Adds a recent file.

Parameters:
absolutePath - The absolute path of the file to add.

initialiseLinks

protected void initialiseLinks()
Description copied from class: Instrument
Initialises the links of the instrument.

Specified by:
initialiseLinks in class Instrument

getFileChooser

public javax.swing.JFileChooser getFileChooser()
Returns:
The file chooser used to selected folders.
Since:
3.0

getAntialiasingCheckBox

public MCheckBox getAntialiasingCheckBox()
Returns:
The check-box that allows to set if antialiasing must be used.

getRenderingCheckBox

public MCheckBox getRenderingCheckBox()
Returns:
The check-box that allows to set if rendering quality must be used.

getColorRenderCheckBox

public MCheckBox getColorRenderCheckBox()
Returns:
The check-box that allows to set if colour rendering quality must be used.

getDisplayGridCB

public MCheckBox getDisplayGridCB()
Returns:
The check-box that allows to set if the user wants to display the grid.

getMagneticGridCB

public MCheckBox getMagneticGridCB()
Returns:
The widget that defines if the grid is magnetic.

getDisplayXScaleCB

public MCheckBox getDisplayXScaleCB()
Returns:
This check-box allows to set if the user wants to display the X-scale.

getDisplayYScaleCB

public MCheckBox getDisplayYScaleCB()
Returns:
This check-box allows to set if the user wants to display the Y-scale.

getCheckNewVersion

public MCheckBox getCheckNewVersion()
Returns:
The widget used to set if the program must check new version on start up.

getDisplayBordersCB

public MCheckBox getDisplayBordersCB()
Returns:
This check-box allows to set if the user wants to the borders of the drawing.

getAlpaInterCheckBox

public MCheckBox getAlpaInterCheckBox()
Returns:
This check-box allows to set if alpha-interpolation must be used.

getPathOpenField

public MTextField getPathOpenField()
Returns:
This textField allows to set the default directories for open/save actions.

getPathExportField

public MTextField getPathExportField()
Returns:
This textField allows to set the default directories for exporting actions.

getPathTexEditorField

public MTextField getPathTexEditorField()
Returns:
The field used to modifies the path of the selected latex editor.

getLatexIncludes

public MTextArea getLatexIncludes()
Returns:
The text field used to defines the latex packages to use.

getUnitChoice

public MComboBox getUnitChoice()
Returns:
Allows to set the unit of length by default.

getThemeList

public MComboBox getThemeList()
Returns:
The list that contains the supported theme.

getLangList

public MComboBox getLangList()
Returns:
The list that contains the supported languages.

getClassicGridRB

public MRadioButton getClassicGridRB()
Returns:
The widget used to display the standard grid.

getPersoGridRB

public MRadioButton getPersoGridRB()
Returns:
The widget used to display a customised grid.

getPersoGridGapField

public MSpinner getPersoGridGapField()
Returns:
The field used to modifies the gap of the customised grid.

getNbRecentFilesField

public MSpinner getNbRecentFilesField()
Returns:
The widget used to defines the number of recent file to keep in memory.

processXMLDataPreference

private void processXMLDataPreference(java.util.Map<java.lang.String,org.w3c.dom.Node> prefMap)

isVersionCheckEnable

public boolean isVersionCheckEnable()
Returns:
True if a new version must be checked.
Since:
3.0

applyValues

private void applyValues()
Applies the values of the preferences setter to the concerned elements.

Since:
3.0

writeXMLPreferences

public void writeXMLPreferences()
Writes the preferences of latexdraw in an XML document.

Since:
3.0

readXMLPreferences

public void readXMLPreferences()
Reads the preferences of latexdraw defined in XML.

Throws:
java.lang.IllegalArgumentException - If a problem occurs.
Since:
3.0

readXMLPreferencesFromFile

private void readXMLPreferencesFromFile(java.io.File xmlFile)