net.sf.latexdraw.instruments
Class ShapeFillingCustomiser

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

public class ShapeFillingCustomiser
extends ShapePropertyCustomiser

This instrument modifies filling properties of shapes or the pencil.

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/11/2010

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  MColorButton fillColButton
          Sets the colour of the interior of a shape.
protected  MComboBox fillStyleCB
          Changes the style of filling.
protected  MSpinner gradAngleField
          Changes the angle of the gradient.
protected  MColorButton gradEndColButton
          Changes the second colour of a gradient.
protected  MSpinner gradMidPtField
          Changes the mid point of the gradient.
protected  MColorButton gradStartColButton
          Changes the first colour of a gradient.
protected  MSpinner hatchAngleField
          Changes the angle of the hatchings.
protected  MColorButton hatchColButton
          Sets the colour of the hatchings.
protected  MSpinner hatchSepField
          Changes the separation of the hatchings.
protected  MSpinner hatchWidthField
          Changes the width of the hatchings.
 
Fields inherited from class net.sf.latexdraw.instruments.ShapePropertyCustomiser
hand, pencil
 
Fields inherited from class org.malai.instrument.WidgetInstrument
composer
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
ShapeFillingCustomiser(UIComposer<?> composer, Hand hand, Pencil pencil)
          Creates the instrument.
 
Method Summary
static MComboBox createFillingChoice()
          Creates a list that contains all kinds of hatchings.
 MColorButton getFillColButton()
           
 MComboBox getFillStyleCB()
           
 MSpinner getGradAngleField()
           
 MColorButton getGradEndColButton()
           
 MSpinner getGradMidPtField()
           
 MColorButton getGradStartColButton()
           
 MSpinner getHatchAngleField()
           
 MColorButton getHatchColButton()
           
 MSpinner getHatchSepField()
           
 MSpinner getHatchWidthField()
           
protected  void initialiseLinks()
          Initialises the links of the instrument.
protected  void initialiseWidgets()
          Initialises the widgets of the instrument.
protected  void setWidgetsVisible(boolean visible)
          Sets the widgets of the instrument visible or not.
protected  void update(IShape shape)
          Updates the widgets using the given shape.
 
Methods inherited from class net.sf.latexdraw.instruments.ShapePropertyCustomiser
getHand, getPencil, onActionExecuted, onUndoableRedo, onUndoableUndo, setActivated, 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, 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

fillColButton

protected MColorButton fillColButton
Sets the colour of the interior of a shape.


hatchColButton

protected MColorButton hatchColButton
Sets the colour of the hatchings.


gradStartColButton

protected MColorButton gradStartColButton
Changes the first colour of a gradient.


gradEndColButton

protected MColorButton gradEndColButton
Changes the second colour of a gradient.


fillStyleCB

protected MComboBox fillStyleCB
Changes the style of filling.


gradMidPtField

protected MSpinner gradMidPtField
Changes the mid point of the gradient.


gradAngleField

protected MSpinner gradAngleField
Changes the angle of the gradient.


hatchSepField

protected MSpinner hatchSepField
Changes the separation of the hatchings.


hatchAngleField

protected MSpinner hatchAngleField
Changes the angle of the hatchings.


hatchWidthField

protected MSpinner hatchWidthField
Changes the width of the hatchings.

Constructor Detail

ShapeFillingCustomiser

public ShapeFillingCustomiser(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 argument is null.
Since:
3.0
Method Detail

createFillingChoice

public static MComboBox createFillingChoice()
Creates a list that contains all kinds of hatchings.

Returns:
A created list.

initialiseWidgets

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

Specified by:
initialiseWidgets in class WidgetInstrument

update

protected void update(IShape shape)
Description copied from class: ShapePropertyCustomiser
Updates the widgets using the given shape.

Specified by:
update in class ShapePropertyCustomiser
Parameters:
shape - The shape used to update the widgets. If null, nothing is performed.

setWidgetsVisible

protected void setWidgetsVisible(boolean visible)
Description copied from class: ShapePropertyCustomiser
Sets the widgets of the instrument visible or not.

Specified by:
setWidgetsVisible in class ShapePropertyCustomiser
Parameters:
visible - True: they are visible.

initialiseLinks

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

Specified by:
initialiseLinks in class Instrument

getFillColButton

public MColorButton getFillColButton()
Returns:
The widget that modifies the colour of the interior of a shape.
Since:
3.0

getHatchColButton

public MColorButton getHatchColButton()
Returns:
The widget that modifies the colour of the hatchings.
Since:
3.0

getGradStartColButton

public MColorButton getGradStartColButton()
Returns:
The widget that modifies the colour of the starting gradient.
Since:
3.0

getGradEndColButton

public MColorButton getGradEndColButton()
Returns:
The widget that modifies the colour of the ending gradient.
Since:
3.0

getFillStyleCB

public MComboBox getFillStyleCB()
Returns:
The widget that sets if the shape is filled.
Since:
3.0

getGradMidPtField

public MSpinner getGradMidPtField()
Returns:
The widget that modifies the middle point of the gradient.
Since:
3.0

getGradAngleField

public MSpinner getGradAngleField()
Returns:
The widget that modifies the angle of the gradient.
Since:
3.0

getHatchSepField

public MSpinner getHatchSepField()
Returns:
The widget that modifies the separation between hatchings.
Since:
3.0

getHatchAngleField

public MSpinner getHatchAngleField()
Returns:
The widget that modifies the angle of the hatchings.
Since:
3.0

getHatchWidthField

public MSpinner getHatchWidthField()
Returns:
The widget that modifies the width of the hatchings.
Since:
3.0