net.sf.latexdraw.instruments
Class ShapeAxesCustomiser

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

public class ShapeAxesCustomiser
extends ShapePropertyCustomiser

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

2012-04-05

Since:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
private static class ShapeAxesCustomiser.CheckBox2CustomAxes<A extends ShapePropertyAction>
          Maps a checkbox to an action that modifies several axes' parameters.
private static class ShapeAxesCustomiser.CheckBox2CustomPencilAxes
          Maps a spinner to an action that modifies the ticks size of the pencil.
private static class ShapeAxesCustomiser.CheckBox2CustomSelectedAxes
          Maps a spinner to an action that modifies the ticks size of the selected shapes.
private static class ShapeAxesCustomiser.Combobox2CustomAxes<A extends ShapePropertyAction>
          Maps a combobox to an action that modifies the axe's style.
private static class ShapeAxesCustomiser.Combobox2CustomPencilAxes
          Maps a combobox to an action that modifies the axe's style of the pencil.
private static class ShapeAxesCustomiser.Combobox2CustomSelectedAxes
          Maps a combobox to an action that modifies the axe's style of the selection.
private static class ShapeAxesCustomiser.Spinner2CustomAxes<A extends ShapePropertyAction>
          Maps a spinner to an action that modifies several axes' parameters.
private static class ShapeAxesCustomiser.Spinner2CustomPencilAxes
          Maps a spinner to an action that modifies the ticks size of the pencil.
private static class ShapeAxesCustomiser.Spinner2CustomSelectedAxes
          Maps a spinner to an action that modifies the ticks size of the selected shapes.
 
Field Summary
protected  MSpinner distLabelsX
          The distance between the X-labels.
protected  MSpinner distLabelsY
          The distance between the Y-labels.
protected  MSpinner incrLabelX
          The widget that permits to set the increment of X-labels.
protected  MSpinner incrLabelY
          The widget that permits to set the increment of Y-labels.
protected  MComboBox shapeAxes
          The widget that permits to select the style of the axes.
protected  MComboBox shapeTicks
          The widget that permits to select the style of the ticks.
protected  MComboBox showLabels
          The widget that permits to set the visibility of the labels.
protected  MCheckBox showOrigin
          The widget that permits to set the visibility of the origin point.
protected  MComboBox showTicks
          The widget that permits to show/hide the ticks of the axes.
protected  MSpinner ticksSizeS
          The widget that permits to set the size of the ticks.
 
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
ShapeAxesCustomiser(UIComposer<?> composer, Hand hand, Pencil pencil)
          Creates the instrument.
 
Method Summary
 MSpinner getDistLabelsX()
           
 MSpinner getDistLabelsY()
           
 MSpinner getIncrLabelX()
           
 MSpinner getIncrLabelY()
           
 MComboBox getShapeAxes()
           
 MComboBox getShapeTicks()
           
 MComboBox getShowLabels()
           
 MCheckBox getShowOrigin()
           
 MComboBox getShowTicks()
           
 MSpinner getTicksSizeS()
           
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

shapeAxes

protected MComboBox shapeAxes
The widget that permits to select the style of the axes.


shapeTicks

protected MComboBox shapeTicks
The widget that permits to select the style of the ticks.


ticksSizeS

protected MSpinner ticksSizeS
The widget that permits to set the size of the ticks.


showTicks

protected MComboBox showTicks
The widget that permits to show/hide the ticks of the axes.


incrLabelX

protected MSpinner incrLabelX
The widget that permits to set the increment of X-labels.


incrLabelY

protected MSpinner incrLabelY
The widget that permits to set the increment of Y-labels.


showLabels

protected MComboBox showLabels
The widget that permits to set the visibility of the labels.


showOrigin

protected MCheckBox showOrigin
The widget that permits to set the visibility of the origin point.


distLabelsX

protected MSpinner distLabelsX
The distance between the X-labels.


distLabelsY

protected MSpinner distLabelsY
The distance between the Y-labels.

Constructor Detail

ShapeAxesCustomiser

public ShapeAxesCustomiser(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

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.

initialiseWidgets

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

Specified by:
initialiseWidgets in class WidgetInstrument

initialiseLinks

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

Specified by:
initialiseLinks in class Instrument

getShapeAxes

public MComboBox getShapeAxes()
Returns:
The widget that permits to select the style of the axes.
Since:
3.0

getShapeTicks

public MComboBox getShapeTicks()
Returns:
The widget that permits to select the style of the ticks.
Since:
3.0

getTicksSizeS

public MSpinner getTicksSizeS()
Returns:
The widget that permits to set the size of the ticks.
Since:
3.0

getShowTicks

public MComboBox getShowTicks()
Returns:
The widget that permits to show/hide the ticks of the axes.
Since:
3.0

getShowLabels

public MComboBox getShowLabels()
Returns:
The widget that permits to show/hide the labels of the axes.
Since:
3.0

getIncrLabelX

public MSpinner getIncrLabelX()
Returns:
The widget that permits to set the increment of X-labels.
Since:
3.0

getIncrLabelY

public MSpinner getIncrLabelY()
Returns:
The widget that permits to set the increment of Y-labels.
Since:
3.0

getShowOrigin

public MCheckBox getShowOrigin()
Returns:
The widget that permits to set the visibility of the origin point.
Since:
3.0

getDistLabelsX

public MSpinner getDistLabelsX()
Returns:
The distance between the X-labels.
Since:
3.0

getDistLabelsY

public MSpinner getDistLabelsY()
Returns:
The distance between the Y-labels.
Since:
3.0