net.sf.latexdraw.glib.models.impl
Class LAxes

java.lang.Object
  extended by net.sf.latexdraw.glib.models.impl.LShape
      extended by net.sf.latexdraw.glib.models.impl.LPositionShape
          extended by net.sf.latexdraw.glib.models.impl.LAbstractGrid
              extended by net.sf.latexdraw.glib.models.impl.LAxes
All Implemented Interfaces:
IArrowable, IAxes, IPositionShape, IShape, IStandardGrid, Modifiable

 class LAxes
extends LAbstractGrid
implements IAxes

Defines a model of axes.

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.

02/13/2008

Version:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.IAxes
IAxes.AxesStyle, IAxes.PlottingStyle, IAxes.TicksStyle
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
IShape.BorderPos, IShape.FillingStyle, IShape.LineStyle, IShape.Position
 
Field Summary
protected  IAxes.AxesStyle axesStyle
          The style of the axes.
protected  double distLabelsX
          The distance between each label of the X axe; if 0, the default value will be used (in cm).
protected  double distLabelsY
          The distance between each label of the Y axe; if 0, the default value will be used (in cm).
protected  double incrementX
          The increment of X axe (Dx in PST).
protected  double incrementY
          The increment of Y axe (Dy in PST).
protected  IAxes.PlottingStyle labelsDisplayed
          Define which labels must be displayed.
protected  boolean showOrigin
          Define the origin must be shown.
protected  IAxes.PlottingStyle ticksDisplayed
          Define how the ticks must be shown.
protected  double ticksSize
          The size of the ticks.
protected  IAxes.TicksStyle ticksStyle
          Define the style of the ticks.
 
Fields inherited from class net.sf.latexdraw.glib.models.impl.LAbstractGrid
gridEndx, gridEndy, gridStartx, gridStarty, labelSize, originx, originy, xLabelSouth, yLabelWest
 
Fields inherited from class net.sf.latexdraw.glib.models.impl.LShape
arrows, bordersPosition, dashSepBlack, dashSepWhite, dbleBordCol, dbleBordSep, dotSep, fillingCol, fillingStyle, gradAngle, gradColEnd, gradColStart, gradMidPt, hasDbleBord, hasShadow, hatchingsAngle, hatchingsCol, hatchingsSep, hatchingsWidth, id, lineColour, lineStyle, modified, opacity, points, rotationAngle, shadowAngle, shadowCol, shadowSize, showPts, thickness
 
Fields inherited from interface net.sf.latexdraw.glib.models.interfaces.IAxes
GAP_LABEL
 
Fields inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
GOLDEN_ANGLE, PPC
 
Constructor Summary
protected LAxes(boolean isUniqueID, IPoint pt)
          Creates axes with default values.
 
Method Summary
 void copy(IShape s)
          Copies a shape using another.
 IAxes duplicate()
          Creates a duplicate of the shape (however id are not the same).
 ILine getArrowLine(IArrow arrow)
           
private  ILine getArrowLineX(boolean leftX)
           
private  ILine getArrowLineY(boolean topY)
           
 IAxes.AxesStyle getAxesStyle()
           
 IPoint getDistLabels()
           
 double getDistLabelsX()
           
 double getDistLabelsY()
           
 IPoint getIncrement()
           
 double getIncrementX()
           
 double getIncrementY()
           
 IAxes.PlottingStyle getLabelsDisplayed()
           
 double getStep()
           
 IAxes.PlottingStyle getTicksDisplayed()
           
 double getTicksSize()
           
 IAxes.TicksStyle getTicksStyle()
           
 boolean isArrowable()
           
 boolean isLineStylable()
           
 boolean isParametersEquals(IShape s, boolean considerShadow)
          Checks if the parameters of the shapes are equals.
 boolean isShowOrigin()
           
 boolean isThicknessable()
           
 void setArrowStyle(IArrow.ArrowStyle style, int position)
          Sets the style of the arrow at the given position.
 void setAxesStyle(IAxes.AxesStyle axesStyle)
           
 void setDistLabels(IPoint distLabels)
           
 void setDistLabelsX(double distLabelsX)
           
 void setDistLabelsY(double distLabelsY)
           
 void setIncrement(IPoint increment)
           
 void setIncrementX(double increment)
           
 void setIncrementY(double increment)
           
 void setLabelsDisplayed(IAxes.PlottingStyle labelsDisplayed)
           
 void setShowOrigin(boolean showOrigin)
           
 void setTicksDisplayed(IAxes.PlottingStyle ticksDisplayed)
           
 void setTicksSize(double ticksSize)
           
 void setTicksStyle(IAxes.TicksStyle ticksStyle)
           
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LAbstractGrid
getBottomRightPoint, getGridEnd, getGridEndX, getGridEndY, getGridMaxX, getGridMaxY, getGridMinX, getGridMinY, getGridStart, getGridStartX, getGridStartY, getLabelsSize, getOriginX, getOriginY, getTopLeftPoint, getTopRightPoint, isXLabelSouth, isYLabelWest, mirrorHorizontal, mirrorVertical, setGridEnd, setGridEndX, setGridEndY, setGridStart, setGridStartX, setGridStartY, setLabelsSize, setOrigin, setOriginX, setOriginY, setXLabelSouth, setYLabelWest
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LPositionShape
getPosition, getX, getY, setPosition, setPosition, setX, setY
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LShape
addToRotationAngle, copyArrows, copyPoints, getArrowAt, getArrowInset, getArrowLength, getArrows, getArrowSizeDim, getArrowSizeNum, getArrowStyle, getBorderGap, getBordersPosition, getBottomLeftPoint, getBracketNum, getDashSepBlack, getDashSepWhite, getDbleBordCol, getDbleBordSep, getDotSep, getDotSizeDim, getDotSizeNum, getFillingCol, getFillingStyle, getFullBottomRightPoint, getFullTopLeftPoint, getGradAngle, getGradColEnd, getGradColStart, getGradMidPt, getGravityCentre, getHatchingsAngle, getHatchingsCol, getHatchingsSep, getHatchingsWidth, getId, getLineColour, getLineStyle, getNbPoints, getOpacity, getPoints, getPtAt, getRBracketNum, getRotationAngle, getShadowAngle, getShadowCol, getShadowGap, getShadowSize, getTBarSizeDim, getTBarSizeNum, getThickness, hasDbleBord, hasGradient, hasHatchings, hasShadow, isBordersMovable, isColourable, isDbleBorderable, isFillable, isFilled, isInteriorStylable, isModified, isShadowable, isShowPts, isShowPtsable, rotate, scale, scaleSetPoints, setArrowInset, setArrowLength, setArrowSizeDim, setArrowSizeNum, setBordersPosition, setBracketNum, setDashSepBlack, setDashSepWhite, setDbleBordCol, setDbleBordSep, setDotSep, setDotSizeDim, setDotSizeNum, setFilled, setFillingCol, setFillingStyle, setGradAngle, setGradColEnd, setGradColStart, setGradMidPt, setHasDbleBord, setHasShadow, setHatchingsAngle, setHatchingsCol, setHatchingsSep, setHatchingsWidth, setId, setLineColour, setLineStyle, setModified, setNewId, setOpacity, setRBracketNum, setRotationAngle, setShadowAngle, setShadowCol, setShadowSize, setShowPts, setTBarSizeDim, setTBarSizeNum, setThickness, shadowFillsShape, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IStandardGrid
getGridEnd, getGridEndX, getGridEndY, getGridMaxX, getGridMaxY, getGridMinX, getGridMinY, getGridStart, getGridStartX, getGridStartY, getLabelsSize, getOriginX, getOriginY, isXLabelSouth, isYLabelWest, setGridEnd, setGridEndX, setGridEndY, setGridStart, setGridStartX, setGridStartY, setLabelsSize, setOrigin, setOriginX, setOriginY, setXLabelSouth, setYLabelWest
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IPositionShape
getPosition, getX, getY, setPosition, setPosition, setX, setY
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
addToRotationAngle, getArrowAt, getArrows, getArrowStyle, getBorderGap, getBordersPosition, getBottomLeftPoint, getBottomRightPoint, getDashSepBlack, getDashSepWhite, getDbleBordCol, getDbleBordSep, getDotSep, getFillingCol, getFillingStyle, getFullBottomRightPoint, getFullTopLeftPoint, getGradAngle, getGradColEnd, getGradColStart, getGradMidPt, getGravityCentre, getHatchingsAngle, getHatchingsCol, getHatchingsSep, getHatchingsWidth, getId, getLineColour, getLineStyle, getNbPoints, getOpacity, getPoints, getPtAt, getRotationAngle, getShadowAngle, getShadowCol, getShadowGap, getShadowSize, getThickness, getTopLeftPoint, getTopRightPoint, hasDbleBord, hasGradient, hasHatchings, hasShadow, isBordersMovable, isColourable, isDbleBorderable, isFillable, isFilled, isInteriorStylable, isShadowable, isShowPts, isShowPtsable, mirrorHorizontal, mirrorVertical, rotate, scale, setBordersPosition, setDashSepBlack, setDashSepWhite, setDbleBordCol, setDbleBordSep, setDotSep, setFilled, setFillingCol, setFillingStyle, setGradAngle, setGradColEnd, setGradColStart, setGradMidPt, setHasDbleBord, setHasShadow, setHatchingsAngle, setHatchingsCol, setHatchingsSep, setHatchingsWidth, setId, setLineColour, setLineStyle, setNewId, setOpacity, setRotationAngle, setShadowAngle, setShadowCol, setShadowSize, setShowPts, setThickness, shadowFillsShape, translate
 
Methods inherited from interface org.malai.properties.Modifiable
isModified, setModified
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IArrowable
getArrowInset, getArrowLength, getArrowSizeDim, getArrowSizeNum, getBracketNum, getDotSizeDim, getDotSizeNum, getRBracketNum, getTBarSizeDim, getTBarSizeNum, setArrowInset, setArrowLength, setArrowSizeDim, setArrowSizeNum, setBracketNum, setDotSizeDim, setDotSizeNum, setRBracketNum, setTBarSizeDim, setTBarSizeNum
 

Field Detail

incrementX

protected double incrementX
The increment of X axe (Dx in PST).


incrementY

protected double incrementY
The increment of Y axe (Dy in PST).


distLabelsX

protected double distLabelsX
The distance between each label of the X axe; if 0, the default value will be used (in cm).


distLabelsY

protected double distLabelsY
The distance between each label of the Y axe; if 0, the default value will be used (in cm).


labelsDisplayed

protected IAxes.PlottingStyle labelsDisplayed
Define which labels must be displayed.


showOrigin

protected boolean showOrigin
Define the origin must be shown.


ticksDisplayed

protected IAxes.PlottingStyle ticksDisplayed
Define how the ticks must be shown.


ticksStyle

protected IAxes.TicksStyle ticksStyle
Define the style of the ticks.


ticksSize

protected double ticksSize
The size of the ticks.


axesStyle

protected IAxes.AxesStyle axesStyle
The style of the axes.

Constructor Detail

LAxes

protected LAxes(boolean isUniqueID,
                IPoint pt)
Creates axes with default values.

Parameters:
pt - The bottom left position of the axes.
isUniqueID - True: the model will have a unique ID.
Method Detail

copy

public void copy(IShape s)
Description copied from interface: IShape
Copies a shape using another.

Specified by:
copy in interface IShape
Overrides:
copy in class LAbstractGrid
Parameters:
s - The shape to copy.

isParametersEquals

public boolean isParametersEquals(IShape s,
                                  boolean considerShadow)
Description copied from interface: IShape
Checks if the parameters of the shapes are equals.

Specified by:
isParametersEquals in interface IShape
Overrides:
isParametersEquals in class LAbstractGrid
Parameters:
s - The shape to compare.
considerShadow - True if the parameters of the shadows must be considered.
Returns:
True if the parameters are equals.

setArrowStyle

public void setArrowStyle(IArrow.ArrowStyle style,
                          int position)
Description copied from interface: IShape
Sets the style of the arrow at the given position.

Specified by:
setArrowStyle in interface IShape
Overrides:
setArrowStyle in class LShape
Parameters:
style - The style to set.
position - The position of the arrow to modify.

getArrowLine

public ILine getArrowLine(IArrow arrow)
Specified by:
getArrowLine in interface IShape
Overrides:
getArrowLine in class LShape
Parameters:
arrow - The arrow to analyse.
Returns:
The line that will be used to place the arrow.

getArrowLineY

private ILine getArrowLineY(boolean topY)
Returns:
The line of the Y-axis.

getArrowLineX

private ILine getArrowLineX(boolean leftX)
Returns:
The line of the X-axis.

duplicate

public IAxes duplicate()
Description copied from interface: IShape
Creates a duplicate of the shape (however id are not the same).

Specified by:
duplicate in interface IAxes
Specified by:
duplicate in interface IShape
Overrides:
duplicate in class LShape
Returns:
The duplicata.

getAxesStyle

public IAxes.AxesStyle getAxesStyle()
Specified by:
getAxesStyle in interface IAxes
Returns:
the axesStyle.

getDistLabelsX

public double getDistLabelsX()
Specified by:
getDistLabelsX in interface IAxes
Returns:
the distLabels.x.

getDistLabelsY

public double getDistLabelsY()
Specified by:
getDistLabelsY in interface IAxes
Returns:
the distLabels.y.

getLabelsDisplayed

public IAxes.PlottingStyle getLabelsDisplayed()
Specified by:
getLabelsDisplayed in interface IAxes
Returns:
the labelsDisplayed.

getTicksDisplayed

public IAxes.PlottingStyle getTicksDisplayed()
Specified by:
getTicksDisplayed in interface IAxes
Returns:
the ticksDisplayed.

getTicksSize

public double getTicksSize()
Specified by:
getTicksSize in interface IAxes
Returns:
the ticksSize.

getTicksStyle

public IAxes.TicksStyle getTicksStyle()
Specified by:
getTicksStyle in interface IAxes
Returns:
the ticksStyle.

isShowOrigin

public boolean isShowOrigin()
Specified by:
isShowOrigin in interface IAxes
Returns:
the showOrigin.

setAxesStyle

public void setAxesStyle(IAxes.AxesStyle axesStyle)
Specified by:
setAxesStyle in interface IAxes
Parameters:
axesStyle - the axesStyle to set.

setDistLabelsX

public void setDistLabelsX(double distLabelsX)
Specified by:
setDistLabelsX in interface IAxes
Parameters:
distLabelsX - the distLabels.x to set.

setDistLabelsY

public void setDistLabelsY(double distLabelsY)
Specified by:
setDistLabelsY in interface IAxes
Parameters:
distLabelsY - the distLabels.y to set.

setIncrementX

public void setIncrementX(double increment)
Specified by:
setIncrementX in interface IAxes
Parameters:
increment - the X increment to set.

setIncrementY

public void setIncrementY(double increment)
Specified by:
setIncrementY in interface IAxes
Parameters:
increment - the Y increment to set.

setLabelsDisplayed

public void setLabelsDisplayed(IAxes.PlottingStyle labelsDisplayed)
Specified by:
setLabelsDisplayed in interface IAxes
Parameters:
labelsDisplayed - the labelsDisplayed to set.

setShowOrigin

public void setShowOrigin(boolean showOrigin)
Specified by:
setShowOrigin in interface IAxes
Parameters:
showOrigin - the showOrigin to set.

setTicksDisplayed

public void setTicksDisplayed(IAxes.PlottingStyle ticksDisplayed)
Specified by:
setTicksDisplayed in interface IAxes
Parameters:
ticksDisplayed - the ticksDisplayed to set.

setTicksSize

public void setTicksSize(double ticksSize)
Specified by:
setTicksSize in interface IAxes
Parameters:
ticksSize - the ticksSize to set.

setTicksStyle

public void setTicksStyle(IAxes.TicksStyle ticksStyle)
Specified by:
setTicksStyle in interface IAxes
Parameters:
ticksStyle - the ticksStyle to set.

getStep

public double getStep()
Specified by:
getStep in interface IStandardGrid
Returns:
The size of a step of the grid (can be LShape.PPC or LShape.PPC*unit for instance).

isArrowable

public boolean isArrowable()
Specified by:
isArrowable in interface IShape
Overrides:
isArrowable in class LShape
Returns:
True if the shape can have arrows.

isLineStylable

public boolean isLineStylable()
Specified by:
isLineStylable in interface IShape
Overrides:
isLineStylable in class LShape
Returns:
True if the line style of the shape can be changed.

isThicknessable

public boolean isThicknessable()
Specified by:
isThicknessable in interface IShape
Overrides:
isThicknessable in class LShape
Returns:
True if the thickness of the shape can be changed.

getIncrementX

public double getIncrementX()
Specified by:
getIncrementX in interface IAxes
Returns:
The X increment of the axes.

getIncrementY

public double getIncrementY()
Specified by:
getIncrementY in interface IAxes
Returns:
The Y increment of the axes.

getIncrement

public IPoint getIncrement()
Specified by:
getIncrement in interface IAxes
Returns:
The increments of the axes.

setIncrement

public void setIncrement(IPoint increment)
Specified by:
setIncrement in interface IAxes
Parameters:
increment - The axes' increment to set.

getDistLabels

public IPoint getDistLabels()
Specified by:
getDistLabels in interface IAxes
Returns:
The distance between the labels of the axes.

setDistLabels

public void setDistLabels(IPoint distLabels)
Specified by:
setDistLabels in interface IAxes
Parameters:
distLabels - The distance between the labels of the axes.