net.sf.latexdraw.instruments
Class ScaleRulersCustomiser

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

public class ScaleRulersCustomiser
extends Instrument

This instrument activates X and Y scale rulers.

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.

11/12/10

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
static java.lang.String LABEL_CM
          The label of the centimetre menu
static java.lang.String LABEL_INCH
          The label of the inch menu
protected  MCheckBoxMenuItem unitCmItem
          The menu for the centimetre unit.
protected  MCheckBoxMenuItem unitInchItem
          The menu for the inch unit.
protected  XScaleRuler xRuler
          The x ruler of the system.
protected  MCheckBoxMenuItem xRulerItem
          The menu item that (des-)activate the x-scale ruler.
protected  YScaleRuler yRuler
          The Y ruler of the system.
protected  MCheckBoxMenuItem yRulerItem
          The menu item that (des-)activate the y-scale ruler.
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
ScaleRulersCustomiser(XScaleRuler xRuler, YScaleRuler yRuler)
          Creates the instrument.
 
Method Summary
 MCheckBoxMenuItem getUnitCmItem()
           
 MCheckBoxMenuItem getUnitInchItem()
           
 MCheckBoxMenuItem getxRulerItem()
           
 MCheckBoxMenuItem getyRulerItem()
           
protected  void initialiseLinks()
          Initialises the links of the instrument.
 void interimFeedback()
          Reinitialises the interim feedback 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 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 update()
           
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, isActivated, isModified, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, reinit, removeLink, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LABEL_CM

public static final java.lang.String LABEL_CM
The label of the centimetre menu


LABEL_INCH

public static final java.lang.String LABEL_INCH
The label of the inch menu


xRuler

protected XScaleRuler xRuler
The x ruler of the system.


yRuler

protected YScaleRuler yRuler
The Y ruler of the system.


xRulerItem

protected MCheckBoxMenuItem xRulerItem
The menu item that (des-)activate the x-scale ruler.


yRulerItem

protected MCheckBoxMenuItem yRulerItem
The menu item that (des-)activate the y-scale ruler.


unitCmItem

protected MCheckBoxMenuItem unitCmItem
The menu for the centimetre unit.


unitInchItem

protected MCheckBoxMenuItem unitInchItem
The menu for the inch unit.

Constructor Detail

ScaleRulersCustomiser

public ScaleRulersCustomiser(XScaleRuler xRuler,
                             YScaleRuler yRuler)
Creates the instrument.

Parameters:
xRuler - The x ruler of the system.
yRuler - The Y ruler of the system.
Throws:
java.lang.IllegalArgumentException - If one of the given rulers is null.
Since:
3.0
Method Detail

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.

interimFeedback

public void interimFeedback()
Description copied from class: Instrument
Reinitialises the interim feedback of the instrument. Must be overridden.

Overrides:
interimFeedback in class Instrument

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.

update

protected void update()

initialiseLinks

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

Specified by:
initialiseLinks in class Instrument

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.

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.

getxRulerItem

public MCheckBoxMenuItem getxRulerItem()
Returns:
The menu item that (des-)activate the x-scale ruler.
Since:
3.0

getyRulerItem

public MCheckBoxMenuItem getyRulerItem()
Returns:
The menu item that (des-)activate the y-scale ruler.
Since:
3.0

getUnitCmItem

public MCheckBoxMenuItem getUnitCmItem()
Returns:
The menu for the centimetre unit.
Since:
3.0

getUnitInchItem

public MCheckBoxMenuItem getUnitInchItem()
Returns:
The menu for the inch unit.
Since:
3.0