net.sf.latexdraw.instruments
Class DrawingPropertiesCustomiser

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

public class DrawingPropertiesCustomiser
extends WidgetInstrument

This instrument modifies the properties of the drawing.

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.

2012-04-01

Since:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
private static class DrawingPropertiesCustomiser.CheckBox2CustDrawing
          The link that maps a check box to action that modifies the drawing's properties.
private static class DrawingPropertiesCustomiser.ComboBox2CustDrawing
          The link that maps a combo box to action that modifies the drawing's properties.
private static class DrawingPropertiesCustomiser.TextField2CustDrawing
          The link that maps text fields to action that modifies the drawing's properties.
 
Field Summary
protected  MTextField labelField
          The field that changes the label of the drawing.
protected  LaTeXGenerator latexGen
          The LaTeX code generator.
protected  MCheckBox middleHorizPosCB
          Defines if the horizontal position of the drawing must be centred.
protected  MComboBox positionCB
          Defines the position of the drawing.
protected  MTextField titleField
          The field that changes the title of the drawing.
 
Fields inherited from class org.malai.instrument.WidgetInstrument
composer
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
DrawingPropertiesCustomiser(UIComposer<?> composer, LaTeXGenerator latexGen)
          Creates the instrument.
 
Method Summary
 MTextField getLabelField()
           
 MCheckBox getMiddleHorizPosCB()
           
 MComboBox getPositionCB()
           
 MTextField getTitleField()
           
protected  void initialiseLinks()
          Initialises the links of the instrument.
protected  void initialiseWidgets()
          Initialises the widgets of the instrument.
 void load(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Element root)
          Loads data save in an XML document.
 void onUndoableRedo(Undoable undoable)
          Actions to do when an undoable object is redone.
 void onUndoableUndo(Undoable undoable)
          Actions to do when an undoable object is undone.
 void reinit()
          Reinitialises the object.
 void save(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Document document, org.w3c.dom.Element root)
          Saves the parameters of the instrument into an XML tag.
 void setActivated(boolean activated)
          Activates or deactivates the instrument.
protected  void updateWidgets()
           
 
Methods inherited from class org.malai.instrument.WidgetInstrument
getComposer, setActivated
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, interimFeedback, isActivated, isModified, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, removeLink, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

titleField

protected MTextField titleField
The field that changes the title of the drawing.


labelField

protected MTextField labelField
The field that changes the label of the drawing.


latexGen

protected LaTeXGenerator latexGen
The LaTeX code generator.


middleHorizPosCB

protected MCheckBox middleHorizPosCB
Defines if the horizontal position of the drawing must be centred.


positionCB

protected MComboBox positionCB
Defines the position of the drawing.

Constructor Detail

DrawingPropertiesCustomiser

public DrawingPropertiesCustomiser(UIComposer<?> composer,
                                   LaTeXGenerator latexGen)
Creates the instrument.

Parameters:
composer - The composer that manages the widgets of the instrument.
latexGen - The LaTeX code generator.
Since:
3.0
Method Detail

onUndoableUndo

public void onUndoableUndo(Undoable undoable)
Description copied from interface: UndoHandler
Actions to do when an undoable object is undone.

Specified by:
onUndoableUndo in interface UndoHandler
Overrides:
onUndoableUndo in class Instrument
Parameters:
undoable - The undone object.

onUndoableRedo

public void onUndoableRedo(Undoable undoable)
Description copied from interface: UndoHandler
Actions to do when an undoable object is redone.

Specified by:
onUndoableRedo in interface UndoHandler
Overrides:
onUndoableRedo in class Instrument
Parameters:
undoable - The redone object.

reinit

public void reinit()
Description copied from interface: Reinitialisable
Reinitialises the object.

Specified by:
reinit in interface Reinitialisable
Overrides:
reinit in class Instrument

save

public void save(boolean generalPreferences,
                 java.lang.String nsURI,
                 org.w3c.dom.Document document,
                 org.w3c.dom.Element root)
Description copied from interface: Preferenciable
Saves the parameters of the instrument into an XML tag.

Specified by:
save in interface Preferenciable
Overrides:
save in class Instrument
Parameters:
generalPreferences - True: this operation is called to save the general preferences of the interactive system. Otherwise, it is called to save a presentation in a document. This parameter is useful when different information must be saved during a presentation backup or a general preferences backup.
nsURI - The namespace that must be added to tags corresponding to the instrument's parameters.
document - The XML document.
root - The root element that will contains the instrument's parameters.

load

public void load(boolean generalPreferences,
                 java.lang.String nsURI,
                 org.w3c.dom.Element root)
Description copied from interface: Preferenciable
Loads data save in an XML document.

Specified by:
load in interface Preferenciable
Overrides:
load in class Instrument
Parameters:
generalPreferences - True: this operation is called to load the general preferences of the interactive system. Otherwise, it is called to load a presentation in a document. This parameter is useful when different information must be loaded during a presentation backup or a general preferences backup.
nsURI - The namespace that must be added to tags corresponding to the instrument's parameters.
root - The meta data element.

initialiseWidgets

protected void initialiseWidgets()
Description copied from class: WidgetInstrument
Initialises the widgets of the instrument.

Specified by:
initialiseWidgets in class WidgetInstrument

updateWidgets

protected void updateWidgets()

setActivated

public void setActivated(boolean activated)
Description copied from class: Instrument
Activates or deactivates the instrument.

Overrides:
setActivated in class Instrument
Parameters:
activated - True = activation.

getPositionCB

public final MComboBox getPositionCB()
Returns:
The combo-box that defines the position of the drawing.
Since:
3.0

getMiddleHorizPosCB

public final MCheckBox getMiddleHorizPosCB()
Returns:
The field that define if the horizontal position of the drawing must be centred.
Since:
3.0

getTitleField

public final MTextField getTitleField()
Returns:
The field that changes the title of the drawing.
Since:
3.0

getLabelField

public final MTextField getLabelField()
Returns:
The field that changes the label of the drawing.
Since:
3.0

initialiseLinks

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

Specified by:
initialiseLinks in class Instrument