net.sf.latexdraw.instruments
Class EditingSelector

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

public class EditingSelector
extends WidgetInstrument

This instrument selects the pencil or the hand.

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.

05/09/2010

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  MToggleButton arcB
          The button that allows to select the instrument Pencil to add arcs.
protected  MToggleButton axesB
          The button that allows to select the instrument Pencil to add axes.
protected  MToggleButton bezierB
          The button that allows to select the instrument Pencil to add bezier curves.
protected  MToggleButton bezierClosedB
          The button that allows to select the instrument Pencil to add closed bezier curves.
protected  Border border
          The instrument that manages selected shapes.
protected  java.util.Map<MToggleButton,EditionChoice> button2EditingChoiceMap
           
protected  MToggleButton circleB
          The button that allows to select the instrument Pencil to add circles.
protected  ShapeDeleter deleter
          The instrument used to delete shapes.
protected  MToggleButton dotB
          The button that allows to select the instrument Pencil to draw dots.
protected  MToggleButton ellipseB
          The button that allows to select the instrument Pencil to add ellipses.
protected  MToggleButton freeHandB
          The button that allows to select the instrument Pencil to draw free hand shapes.
protected  MToggleButton gridB
          The button that allows to select the instrument Pencil to add grids.
protected  Hand hand
          The instrument Hand.
protected  MToggleButton handB
          The button that allows to select the instrument Hand.
protected  MToggleButton linesB
          The button that allows to select the instrument Pencil to add lines.
protected  MetaShapeCustomiser metaShapeCustomiser
          The instrument that manages instruments that customise shapes and the pencil.
protected  Pencil pencil
          The instrument Pencil.
protected  MToggleButton picB
          The button that allows to select the instrument Pencil to add pictures.
protected  MToggleButton polygonB
          The button that allows to select the instrument Pencil to add polygons.
protected  MToggleButton recB
          The button that allows to select the instrument Pencil to add rectangles.
protected  MToggleButton rhombusB
          The button that allows to select the instrument Pencil to add rhombuses.
protected  MToggleButton squareB
          The button that allows to select the instrument Pencil to add squares.
protected  MToggleButton textB
          The button that allows to select the instrument Pencil to add texts.
protected  MToggleButton triangleB
          The button that allows to select the instrument Pencil to add triangles.
 
Fields inherited from class org.malai.instrument.WidgetInstrument
composer
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
EditingSelector(UIComposer<?> composer, Pencil pencil, Hand hand, MetaShapeCustomiser metaShapeCustomiser, Border border, ShapeDeleter deleter)
          Creates the instruments selector.
 
Method Summary
 MToggleButton getArcB()
           
 MToggleButton getAxesB()
           
 MToggleButton getBezierB()
           
 MToggleButton getBezierClosedB()
           
 MToggleButton getCircleB()
           
 MToggleButton getDotB()
           
 MToggleButton getEllipseB()
           
 MToggleButton getFreeHandB()
           
 MToggleButton getGridB()
           
 Hand getHand()
           
 MToggleButton getHandB()
           
 MToggleButton getLinesB()
           
 Pencil getPencil()
           
 MToggleButton getPicB()
           
 MToggleButton getPolygonB()
           
 MToggleButton getRecB()
           
 MToggleButton getRhombusB()
           
 MToggleButton getSquareB()
           
 MToggleButton getTextB()
           
 MToggleButton getTriangleB()
           
private  void initialiseEditingChoiceMap()
           
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.
 boolean isWidget(java.lang.Object ab)
           
 void onActionDone(Action action)
          Notifies the handler when the given action is done.
 void setActivated(boolean activated)
          Activates or deactivates the instrument.
 
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, onActionExecuted, onUndoableAdded, onUndoableRedo, onUndoableUndo, reinit, removeLink, save, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handB

protected MToggleButton handB
The button that allows to select the instrument Hand.


dotB

protected MToggleButton dotB
The button that allows to select the instrument Pencil to draw dots.


freeHandB

protected MToggleButton freeHandB
The button that allows to select the instrument Pencil to draw free hand shapes.


textB

protected MToggleButton textB
The button that allows to select the instrument Pencil to add texts.


recB

protected MToggleButton recB
The button that allows to select the instrument Pencil to add rectangles.


squareB

protected MToggleButton squareB
The button that allows to select the instrument Pencil to add squares.


ellipseB

protected MToggleButton ellipseB
The button that allows to select the instrument Pencil to add ellipses.


circleB

protected MToggleButton circleB
The button that allows to select the instrument Pencil to add circles.


linesB

protected MToggleButton linesB
The button that allows to select the instrument Pencil to add lines.


polygonB

protected MToggleButton polygonB
The button that allows to select the instrument Pencil to add polygons.


bezierB

protected MToggleButton bezierB
The button that allows to select the instrument Pencil to add bezier curves.


bezierClosedB

protected MToggleButton bezierClosedB
The button that allows to select the instrument Pencil to add closed bezier curves.


gridB

protected MToggleButton gridB
The button that allows to select the instrument Pencil to add grids.


axesB

protected MToggleButton axesB
The button that allows to select the instrument Pencil to add axes.


rhombusB

protected MToggleButton rhombusB
The button that allows to select the instrument Pencil to add rhombuses.


triangleB

protected MToggleButton triangleB
The button that allows to select the instrument Pencil to add triangles.


arcB

protected MToggleButton arcB
The button that allows to select the instrument Pencil to add arcs.


picB

protected MToggleButton picB
The button that allows to select the instrument Pencil to add pictures.


hand

protected Hand hand
The instrument Hand.


pencil

protected Pencil pencil
The instrument Pencil.


metaShapeCustomiser

protected MetaShapeCustomiser metaShapeCustomiser
The instrument that manages instruments that customise shapes and the pencil.


border

protected Border border
The instrument that manages selected shapes.


deleter

protected ShapeDeleter deleter
The instrument used to delete shapes.


button2EditingChoiceMap

protected java.util.Map<MToggleButton,EditionChoice> button2EditingChoiceMap
Constructor Detail

EditingSelector

public EditingSelector(UIComposer<?> composer,
                       Pencil pencil,
                       Hand hand,
                       MetaShapeCustomiser metaShapeCustomiser,
                       Border border,
                       ShapeDeleter deleter)
Creates the instruments selector.

Parameters:
composer - The composer that manages the widgets of the instrument.
pencil - The pencil to select.
hand - The hand to select.
border - The instrument that manages selected shapes.
metaShapeCustomiser - The instrument that manages instruments that customise shapes and the pencil.
deleter - The instrument used to delete shapes.
Throws:
java.lang.IllegalArgumentException - If one of the given parameter is null.
Since:
3.0
Method Detail

initialiseEditingChoiceMap

private void initialiseEditingChoiceMap()

initialiseWidgets

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

Specified by:
initialiseWidgets in class WidgetInstrument

interimFeedback

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

Overrides:
interimFeedback in class Instrument

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.

isWidget

public boolean isWidget(java.lang.Object ab)
Parameters:
ab - The widget to test.
Returns:
True if the given widget is a widget of the instrument.
Since:
3.0

getHandB

public MToggleButton getHandB()
Returns:
The button that allows the select instrument Hand.
Since:
3.0

getFreeHandB

public MToggleButton getFreeHandB()
Returns:
The button that allows the select instrument Pencil to draw free hand shapes.
Since:
3.0

getTextB

public MToggleButton getTextB()
Returns:
The button that allows the select instrument Pencil to add texts.
Since:
3.0

getDotB

public MToggleButton getDotB()
Returns:
The button that allows the select instrument Pencil to draw dots.
Since:
3.0

getRecB

public MToggleButton getRecB()
Returns:
The button that allows the select instrument Pencil to draw rectangles.
Since:
3.0

getSquareB

public MToggleButton getSquareB()
Returns:
The button that allows the select instrument Pencil to draw squares.
Since:
3.0

getEllipseB

public MToggleButton getEllipseB()
Returns:
The button that allows the select instrument Pencil to draw ellipses.
Since:
3.0

getCircleB

public MToggleButton getCircleB()
Returns:
The button that allows the select instrument Pencil to draw circles.
Since:
3.0

getLinesB

public MToggleButton getLinesB()
Returns:
The button that allows the select instrument Pencil to draw lines.
Since:
3.0

getPolygonB

public MToggleButton getPolygonB()
Returns:
The button that allows the select instrument Pencil to draw polygons.
Since:
3.0

getBezierB

public MToggleButton getBezierB()
Returns:
The button that allows the select instrument Pencil to draw bezier curves.
Since:
3.0

getBezierClosedB

public MToggleButton getBezierClosedB()
Returns:
The button that allows the select instrument Pencil to draw closed bezier curves.
Since:
3.0

getGridB

public MToggleButton getGridB()
Returns:
The button that allows the select instrument Pencil to draw grids.
Since:
3.0

getAxesB

public MToggleButton getAxesB()
Returns:
The button that allows the select instrument Pencil to draw axes.
Since:
3.0

getRhombusB

public MToggleButton getRhombusB()
Returns:
The button that allows the select instrument Pencil to draw rhombuses.
Since:
3.0

getTriangleB

public MToggleButton getTriangleB()
Returns:
The button that allows the select instrument Pencil to draw triangles.
Since:
3.0

getArcB

public MToggleButton getArcB()
Returns:
The button that allows the select instrument Pencil to draw arcs.
Since:
3.0

getPicB

public MToggleButton getPicB()
Returns:
The button that allows the select instrument Pencil to add pictures.
Since:
3.0

getHand

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

getPencil

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

onActionDone

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

Specified by:
onActionDone in interface ActionHandler
Overrides:
onActionDone in class Instrument
Parameters:
action - The action that ends.