net.sf.latexdraw.instruments
Class MagneticGridCustomiser

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

public class MagneticGridCustomiser
extends WidgetInstrument

This instrument customises the magnetic grid.

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/14/10

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  LMagneticGrid grid
          The grid to customise.
protected  MSpinner gridSpacing
          Defines the spacing of the personal grid.
protected  MCheckBox magneticCB
          Sets if the grid is magnetic.
protected  MComboBox styleList
          Contains the different possible kind of grids.
 
Fields inherited from class org.malai.instrument.WidgetInstrument
composer
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
MagneticGridCustomiser(UIComposer<?> composer, LMagneticGrid grid)
          Initialises the instrument.
 
Method Summary
static MComboBox createStyleList()
           
 MSpinner getGridSpacing()
           
 MCheckBox getMagneticCB()
           
 MComboBox getStyleList()
           
protected  void initialiseLinks()
          Initialises the links of the instrument.
protected  void initialiseWidgets()
          Initialises the widgets of the instrument.
 void interimFeedback()
          Reinitialises the interim feedback of the instrument.
 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 setActivated(boolean activated)
          Activates or deactivates the instrument.
protected  void update()
           
 
Methods inherited from class org.malai.instrument.WidgetInstrument
getComposer, setActivated
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, isActivated, isModified, load, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, reinit, removeLink, save, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid

protected LMagneticGrid grid
The grid to customise.


styleList

protected MComboBox styleList
Contains the different possible kind of grids.


magneticCB

protected MCheckBox magneticCB
Sets if the grid is magnetic.


gridSpacing

protected MSpinner gridSpacing
Defines the spacing of the personal grid.

Constructor Detail

MagneticGridCustomiser

public MagneticGridCustomiser(UIComposer<?> composer,
                              LMagneticGrid grid)
Initialises the instrument.

Parameters:
composer - The composer that manages the widgets of the instrument.
grid - The grid to customise.
Throws:
java.lang.IllegalArgumentException - If the given grid is null.
Since:
3.0
Method Detail

initialiseWidgets

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

Specified by:
initialiseWidgets in class WidgetInstrument

createStyleList

public static MComboBox createStyleList()
Returns:
The list widget that contains the different style of the magnetic grid.
Since:
3.0

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.

interimFeedback

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

Overrides:
interimFeedback in class Instrument

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

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.

getStyleList

public MComboBox getStyleList()
Returns:
The list that contains the different possible kind of grids.
Since:
3.0

getMagneticCB

public MCheckBox getMagneticCB()
Returns:
The check box that sets if the grid is magnetic.
Since:
3.0

getGridSpacing

public MSpinner getGridSpacing()
Returns:
The spinner that defines the spacing of the personal grid.
Since:
3.0