net.sf.latexdraw.instruments
Class ShapePropertyCustomiser

java.lang.Object
  extended by org.malai.instrument.Instrument
      extended by org.malai.instrument.WidgetInstrument
          extended by net.sf.latexdraw.instruments.ShapePropertyCustomiser
All Implemented Interfaces:
ActionHandler, Preferenciable, Modifiable, Reinitialisable, UndoHandler
Direct Known Subclasses:
MetaShapeCustomiser, ShapeArcCustomiser, ShapeArrowCustomiser, ShapeAxesCustomiser, ShapeBorderCustomiser, ShapeCoordDimCustomiser, ShapeDotCustomiser, ShapeDoubleBorderCustomiser, ShapeFillingCustomiser, ShapeGridCustomiser, ShapeGrouper, ShapeRotationCustomiser, ShapeShadowCustomiser, TextCustomiser

public abstract class ShapePropertyCustomiser
extends WidgetInstrument

This abstract instrument defines the base definition of instruments that customise shape properties.

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.

10/31/10

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  Hand hand
          The Hand instrument.
protected  Pencil pencil
          The Pencil instrument.
 
Fields inherited from class org.malai.instrument.WidgetInstrument
composer
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
ShapePropertyCustomiser(UIComposer<?> composer, Hand hand, Pencil pencil)
          Creates the instrument.
 
Method Summary
 Hand getHand()
           
 Pencil getPencil()
           
 void onActionExecuted(Action action)
          Notifies the handler when the given action is executed.
 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 abstract  void setWidgetsVisible(boolean visible)
          Sets the widgets of the instrument visible or not.
 void update()
          Updates the instrument and its widgets
protected abstract  void update(IShape shape)
          Updates the widgets using the given shape.
 
Methods inherited from class org.malai.instrument.WidgetInstrument
getComposer, initialiseWidgets, setActivated
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, initialiseLinks, interimFeedback, isActivated, isModified, load, onActionAborted, onActionAdded, onActionCancelled, onActionDone, 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

hand

protected Hand hand
The Hand instrument.


pencil

protected Pencil pencil
The Pencil instrument.

Constructor Detail

ShapePropertyCustomiser

public ShapePropertyCustomiser(UIComposer<?> composer,
                               Hand hand,
                               Pencil pencil)
Creates the instrument.

Parameters:
composer - The composer that manages the widgets of the instrument.
hand - The Hand instrument.
pencil - The Pencil instrument.
Throws:
java.lang.IllegalArgumentException - If one of the given parameters is null.
Since:
3.0
Method Detail

onActionExecuted

public void onActionExecuted(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is executed.

Specified by:
onActionExecuted in interface ActionHandler
Overrides:
onActionExecuted in class Instrument
Parameters:
action - The executed action.

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

public void update()
Updates the instrument and its widgets

Since:
3.0

update

protected abstract void update(IShape shape)
Updates the widgets using the given shape.

Parameters:
shape - The shape used to update the widgets. If null, nothing is performed.
Since:
3.0

setWidgetsVisible

protected abstract void setWidgetsVisible(boolean visible)
Sets the widgets of the instrument visible or not.

Parameters:
visible - True: they are visible.
Since:
3.0

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.

getHand

public Hand getHand()
Returns:
The Hand instrument.
Since:
3.0

getPencil

public Pencil getPencil()
Returns:
The Pencil instrument.
Since:
3.0