net.sf.latexdraw.instruments
Class ShapeBorderCustomiser

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.ShapeBorderCustomiser
All Implemented Interfaces:
ActionHandler, Preferenciable, Modifiable, Reinitialisable, UndoHandler

public class ShapeBorderCustomiser
extends ShapePropertyCustomiser

This instrument modifies border 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.

10/31/2010

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  MComboBox bordersPosCB
          Allows to select the position of the borders of the shape.
protected  MSpinner frameArcField
          Allows to change the angle of the round corner.
protected  MComboBox lineCB
          Allows to change the style of the borders
protected  MColorButton lineColButton
          Allows to set the colour of the borders of shapes.
protected  MSpinner thicknessField
          The field which allows to change shapes thickness.
 
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
ShapeBorderCustomiser(UIComposer<?> composer, Hand hand, Pencil pencil)
          Creates the instrument.
 
Method Summary
static MComboBox createBordersPositionChoice()
          Creates a list of the different positions of the borders.
static MComboBox createStyleLineChoice()
          Creates a list of the different styles of line.
 MComboBox getBordersPosCB()
           
 MSpinner getFrameArcField()
           
 MComboBox getLineCB()
           
 MColorButton getLineColButton()
           
 MSpinner getThicknessField()
           
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

thicknessField

protected MSpinner thicknessField
The field which allows to change shapes thickness.


lineColButton

protected MColorButton lineColButton
Allows to set the colour of the borders of shapes.


lineCB

protected MComboBox lineCB
Allows to change the style of the borders


bordersPosCB

protected MComboBox bordersPosCB
Allows to select the position of the borders of the shape.


frameArcField

protected MSpinner frameArcField
Allows to change the angle of the round corner.

Constructor Detail

ShapeBorderCustomiser

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

Parameters:
hand - The Hand instrument.
composer - The composer that manages the widgets of the instrument.
pencil - The Pencil instrument.
Throws:
java.lang.IllegalArgumentException - If one of the given argument is null or if the drawing cannot be accessed from the hand.
Since:
3.0
Method Detail

createBordersPositionChoice

public static MComboBox createBordersPositionChoice()
Creates a list of the different positions of the borders.

Returns:
The created list.

createStyleLineChoice

public static MComboBox createStyleLineChoice()
Creates a list of the different styles of line.

Returns:
The 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.

getLineCB

public MComboBox getLineCB()
Returns:
The line style combo box.
Since:
3.0

getBordersPosCB

public MComboBox getBordersPosCB()
Returns:
The border position combo box.
Since:
3.0

getLineColButton

public MColorButton getLineColButton()
Returns:
The line colour button.
Since:
3.0

getThicknessField

public MSpinner getThicknessField()
Returns:
The field that allows to modify the thickness of the pencil.
Since:
3.0

getFrameArcField

public MSpinner getFrameArcField()
Returns:
The field that defines the roundness of the corners.
Since:
3.0

initialiseLinks

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

Specified by:
initialiseLinks in class Instrument