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

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
All Implemented Interfaces:
IArrowable, IPositionShape, IShape, IStandardGrid, Modifiable
Direct Known Subclasses:
LAxes, LGrid

abstract class LAbstractGrid
extends LPositionShape
implements IStandardGrid

Defines a model of an abstract latex grid.

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.

07/05/2009

Since:
3.0
Version:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
IShape.BorderPos, IShape.FillingStyle, IShape.LineStyle, IShape.Position
 
Field Summary
protected  double gridEndx
          The x-maximum values of the axes
protected  double gridEndy
          The y-maximum values of the axes
protected  double gridStartx
          The x-minimum values of the axes
protected  double gridStarty
          The y-minimum values of the axes
protected  int labelSize
          The size of the labels.
protected  double originx
          The x-coordinate of the origin of the grid
protected  double originy
          The y-coordinate of the origin of the grid
protected  boolean xLabelSouth
          If true, the x label will be displayed at the south of the grid.
protected  boolean yLabelWest
          If true, the y label will be displayed at the west of the grid.
 
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.IShape
GOLDEN_ANGLE, PPC
 
Constructor Summary
protected LAbstractGrid(boolean isUniqueID, IPoint pt)
          Creates an abstract grid.
 
Method Summary
 void copy(IShape s)
          Copies a shape using another.
 IPoint getBottomRightPoint()
           
 IPoint getGridEnd()
           
 double getGridEndX()
           
 double getGridEndY()
           
 double getGridMaxX()
           
 double getGridMaxY()
           
 double getGridMinX()
           
 double getGridMinY()
           
 IPoint getGridStart()
           
 double getGridStartX()
           
 double getGridStartY()
           
 int getLabelsSize()
           
 double getOriginX()
           
 double getOriginY()
           
 IPoint getTopLeftPoint()
           
 IPoint getTopRightPoint()
           
 boolean isParametersEquals(IShape s, boolean considerShadow)
          Checks if the parameters of the shapes are equals.
 boolean isXLabelSouth()
           
 boolean isYLabelWest()
           
 void mirrorHorizontal(IPoint origin)
          Returns horizontally the shape.
 void mirrorVertical(IPoint origin)
          Returns vertically the shape.
 void setGridEnd(double x, double y)
           
 void setGridEndX(double x)
           
 void setGridEndY(double y)
           
 void setGridStart(double x, double y)
           
 void setGridStartX(double x)
           
 void setGridStartY(double y)
           
 void setLabelsSize(int labelsSize)
          Defines the size of the labels.
 void setOrigin(double x, double y)
           
 void setOriginX(double x)
           
 void setOriginY(double y)
           
 void setXLabelSouth(boolean isXLabelSouth)
           
 void setYLabelWest(boolean isYLabelWest)
           
 
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, duplicate, getArrowAt, getArrowInset, getArrowLength, getArrowLine, 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, isArrowable, isBordersMovable, isColourable, isDbleBorderable, isFillable, isFilled, isInteriorStylable, isLineStylable, isModified, isShadowable, isShowPts, isShowPtsable, isThicknessable, rotate, scale, scaleSetPoints, setArrowInset, setArrowLength, setArrowSizeDim, setArrowSizeNum, setArrowStyle, 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
getStep
 
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, duplicate, getArrowAt, getArrowLine, getArrows, getArrowStyle, getBorderGap, getBordersPosition, getBottomLeftPoint, 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, hasDbleBord, hasGradient, hasHatchings, hasShadow, isArrowable, isBordersMovable, isColourable, isDbleBorderable, isFillable, isFilled, isInteriorStylable, isLineStylable, isShadowable, isShowPts, isShowPtsable, isThicknessable, rotate, scale, setArrowStyle, 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

xLabelSouth

protected boolean xLabelSouth
If true, the x label will be displayed at the south of the grid. Else at the north


yLabelWest

protected boolean yLabelWest
If true, the y label will be displayed at the west of the grid. Else at the east


gridStartx

protected double gridStartx
The x-minimum values of the axes


gridStarty

protected double gridStarty
The y-minimum values of the axes


gridEndx

protected double gridEndx
The x-maximum values of the axes


gridEndy

protected double gridEndy
The y-maximum values of the axes


originx

protected double originx
The x-coordinate of the origin of the grid


originy

protected double originy
The y-coordinate of the origin of the grid


labelSize

protected int labelSize
The size of the labels.

Constructor Detail

LAbstractGrid

protected LAbstractGrid(boolean isUniqueID,
                        IPoint pt)
Creates an abstract grid.

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

getGridMinX

public double getGridMinX()
Specified by:
getGridMinX in interface IStandardGrid
Returns:
The minimal X-tick of the grid.

getGridMaxX

public double getGridMaxX()
Specified by:
getGridMaxX in interface IStandardGrid
Returns:
The maximal X-tick of the grid.

getGridMinY

public double getGridMinY()
Specified by:
getGridMinY in interface IStandardGrid
Returns:
The minimal Y-tick of the grid.

getGridMaxY

public double getGridMaxY()
Specified by:
getGridMaxY in interface IStandardGrid
Returns:
The maximal Y-tick of the grid.

getBottomRightPoint

public IPoint getBottomRightPoint()
Specified by:
getBottomRightPoint in interface IShape
Overrides:
getBottomRightPoint in class LShape
Returns:
The bottom right point of the shape. It does not take account of the thickness, the rotation angle, the double border, nor any parameters; only the points of the shape are used to compute the returned point.

getTopLeftPoint

public IPoint getTopLeftPoint()
Specified by:
getTopLeftPoint in interface IShape
Overrides:
getTopLeftPoint in class LShape
Returns:
The top left point of the shape. It does not take account of the thickness, the rotation angle, the double border, nor any parameters; only the points of the shape are used to compute the returned point.

getTopRightPoint

public IPoint getTopRightPoint()
Specified by:
getTopRightPoint in interface IShape
Overrides:
getTopRightPoint in class LShape
Returns:
The top right point of the shape. It does not take account of the thickness, the rotation angle, the double border, nor any parameters; only the points of the shape are used to compute the returned point.

mirrorHorizontal

public void mirrorHorizontal(IPoint origin)
Description copied from interface: IShape
Returns horizontally the shape.

Specified by:
mirrorHorizontal in interface IShape
Overrides:
mirrorHorizontal in class LShape
Parameters:
origin - The location of the horizontal axe.

mirrorVertical

public void mirrorVertical(IPoint origin)
Description copied from interface: IShape
Returns vertically the shape.

Specified by:
mirrorVertical in interface IShape
Overrides:
mirrorVertical in class LShape
Parameters:
origin - The location of the vertical axe.

setLabelsSize

public void setLabelsSize(int labelsSize)
Description copied from interface: IStandardGrid
Defines the size of the labels.

Specified by:
setLabelsSize in interface IStandardGrid
Parameters:
labelsSize - The new size of the labels.

getGridEndX

public double getGridEndX()
Specified by:
getGridEndX in interface IStandardGrid
Returns:
The x-coordinate of the ending point of the grid.

getGridEndY

public double getGridEndY()
Specified by:
getGridEndY in interface IStandardGrid
Returns:
The y-coordinate of the ending point of the grid.

getGridStartX

public double getGridStartX()
Specified by:
getGridStartX in interface IStandardGrid
Returns:
The x-coordinate of the starting point of the grid.

getGridStartY

public double getGridStartY()
Specified by:
getGridStartY in interface IStandardGrid
Returns:
The y-coordinate of the starting point of the grid.

getLabelsSize

public int getLabelsSize()
Specified by:
getLabelsSize in interface IStandardGrid
Returns:
The size of the labels.

getOriginX

public double getOriginX()
Specified by:
getOriginX in interface IStandardGrid
Returns:
The x-coordinate of the origin.

getOriginY

public double getOriginY()
Specified by:
getOriginY in interface IStandardGrid
Returns:
The y-coordinate of the origin.

isXLabelSouth

public boolean isXLabelSouth()
Specified by:
isXLabelSouth in interface IStandardGrid
Returns:
the isXLabelSouth.

isYLabelWest

public boolean isYLabelWest()
Specified by:
isYLabelWest in interface IStandardGrid
Returns:
the isYLabelWest.

setGridEnd

public void setGridEnd(double x,
                       double y)
Specified by:
setGridEnd in interface IStandardGrid
Parameters:
x - The x-coordinate of the ending point of the grid.
y - The y-coordinate of the ending point of the grid.

setGridEndX

public void setGridEndX(double x)
Specified by:
setGridEndX in interface IStandardGrid
Parameters:
x - The x-coordinate to set.

setGridEndY

public void setGridEndY(double y)
Specified by:
setGridEndY in interface IStandardGrid
Parameters:
y - The y-coordinate to set.

setGridStart

public void setGridStart(double x,
                         double y)
Specified by:
setGridStart in interface IStandardGrid
Parameters:
x - The x-coordinate of the starting point of the grid.
y - The y-coordinate of the starting point of the grid.

setGridStartX

public void setGridStartX(double x)
Specified by:
setGridStartX in interface IStandardGrid
Parameters:
x - The x-coordinate to set.

setGridStartY

public void setGridStartY(double y)
Specified by:
setGridStartY in interface IStandardGrid
Parameters:
y - The y-coordinate to set.

setOrigin

public void setOrigin(double x,
                      double y)
Specified by:
setOrigin in interface IStandardGrid
Parameters:
x - The x-coordinate of the origin of the grid.
y - The y-coordinate of the origin of the grid.

setOriginX

public void setOriginX(double x)
Specified by:
setOriginX in interface IStandardGrid
Parameters:
x - The X-coordinate to set.

setOriginY

public void setOriginY(double y)
Specified by:
setOriginY in interface IStandardGrid
Parameters:
y - The Y-coordinate to set.

setXLabelSouth

public void setXLabelSouth(boolean isXLabelSouth)
Specified by:
setXLabelSouth in interface IStandardGrid
Parameters:
isXLabelSouth - the isXLabelSouth to set.

setYLabelWest

public void setYLabelWest(boolean isYLabelWest)
Specified by:
setYLabelWest in interface IStandardGrid
Parameters:
isYLabelWest - the isYLabelWest to set.

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 LShape
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 LShape
Parameters:
s - The shape to compare.
considerShadow - True if the parameters of the shadows must be considered.
Returns:
True if the parameters are equals.

getGridStart

public IPoint getGridStart()
Specified by:
getGridStart in interface IStandardGrid
Returns:
The starting point of the grid.

getGridEnd

public IPoint getGridEnd()
Specified by:
getGridEnd in interface IStandardGrid
Returns:
The ending point of the grid.