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

java.lang.Object
  extended by net.sf.latexdraw.glib.models.impl.LShape
All Implemented Interfaces:
IArrowable, IShape, Modifiable
Direct Known Subclasses:
LGroup, LModifiablePointsShape, LPositionShape

abstract class LShape
extends java.lang.Object
implements IShape

Defines a model of a shape.

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  java.util.List<IArrow> arrows
          The arrow of the shape, may be null.
protected  IShape.BorderPos bordersPosition
          The position of the border of the shape.
protected  double dashSepBlack
          The black dash separator for dashed lines in pixel.
protected  double dashSepWhite
          The white dash separator for dashed lines in pixel.
protected  java.awt.Color dbleBordCol
          The colour of the double borders.
protected  double dbleBordSep
          The separation size of the double borders in pixel.
protected  double dotSep
          The dot separator for dotted lines.
protected  java.awt.Color fillingCol
          The colour of the interior of the shape.
protected  IShape.FillingStyle fillingStyle
          The style of the interior of the shape.
protected  double gradAngle
          The angle of the gradient in radian.
protected  java.awt.Color gradColEnd
          The end colour of the gradient.
protected  java.awt.Color gradColStart
          The start colour of the gradient.
protected  double gradMidPt
          The middle point of the gradient.
protected  boolean hasDbleBord
          Defines if the shape has double borders.
protected  boolean hasShadow
          Defines if the shape has a shadow.
protected  double hatchingsAngle
          The angle of the hatchings in radian.
protected  java.awt.Color hatchingsCol
          The colour of the hatchings.
protected  double hatchingsSep
          The separation size between hatchings in pixel.
protected  double hatchingsWidth
          The thickness of the hatchings in pixel.
protected  int id
          The ID of the shape.
protected  java.awt.Color lineColour
          The colour of the lines.
protected  IShape.LineStyle lineStyle
          The style of the lines.
protected  boolean modified
          Defined if the shape has been modified.
private static int number
          The increment used to define the ID of the shapes.
protected  double opacity
          The opacity of the shape (in [0;1]).
protected  java.util.List<IPoint> points
          The points of the shape.
protected  double rotationAngle
          The rotation angle of the shape.
protected  double shadowAngle
          The angle of the shadow in radian.
protected  java.awt.Color shadowCol
          The colour of the shadow.
protected  double shadowSize
          The size of the shadow in pixel.
protected  boolean showPts
          Defines if the points of the shape must be considered.
protected  double thickness
          The thickness of the lines of the shape in pixels.
 
Fields inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
GOLDEN_ANGLE, PPC
 
Constructor Summary
protected LShape(boolean uniqueID)
          The second default constructor
 
Method Summary
 void addToRotationAngle(IPoint gravCentre, double angle)
          Adds the given angle to the current rotation angle.
 void copy(IShape s)
          Copies a shape using another.
protected  void copyArrows(IShape s)
           
protected  void copyPoints(IShape sh)
           
 IShape duplicate()
          Creates a duplicate of the shape (however id are not the same).
 IArrow getArrowAt(int position)
           
 double getArrowInset()
           
 double getArrowLength()
           
 ILine getArrowLine(IArrow arrow)
           
 java.util.List<IArrow> getArrows()
           
 double getArrowSizeDim()
           
 double getArrowSizeNum()
           
 IArrow.ArrowStyle getArrowStyle(int position)
           
 double getBorderGap()
          Computes the gap created by the thickness, the double borders and the position of the border.
 IShape.BorderPos getBordersPosition()
           
 IPoint getBottomLeftPoint()
           
 IPoint getBottomRightPoint()
           
 double getBracketNum()
           
 double getDashSepBlack()
           
 double getDashSepWhite()
           
 java.awt.Color getDbleBordCol()
           
 double getDbleBordSep()
           
 double getDotSep()
           
 double getDotSizeDim()
           
 double getDotSizeNum()
           
 java.awt.Color getFillingCol()
           
 IShape.FillingStyle getFillingStyle()
           
 IPoint getFullBottomRightPoint()
           
 IPoint getFullTopLeftPoint()
           
 double getGradAngle()
           
 java.awt.Color getGradColEnd()
           
 java.awt.Color getGradColStart()
           
 double getGradMidPt()
           
 IPoint getGravityCentre()
           
 double getHatchingsAngle()
           
 java.awt.Color getHatchingsCol()
           
 double getHatchingsSep()
           
 double getHatchingsWidth()
           
 int getId()
           
 java.awt.Color getLineColour()
           
 IShape.LineStyle getLineStyle()
           
 int getNbPoints()
           
 double getOpacity()
           
 java.util.List<IPoint> getPoints()
           
 IPoint getPtAt(int position)
           
 double getRBracketNum()
           
 double getRotationAngle()
           
 double getShadowAngle()
           
 java.awt.Color getShadowCol()
           
 IPoint getShadowGap()
          Computes the translation vector between the shape itself and its shadow.
 double getShadowSize()
           
 double getTBarSizeDim()
           
 double getTBarSizeNum()
           
 double getThickness()
           
 IPoint getTopLeftPoint()
           
 IPoint getTopRightPoint()
           
 boolean hasDbleBord()
           
 boolean hasGradient()
           
 boolean hasHatchings()
           
 boolean hasShadow()
           
 boolean isArrowable()
           
 boolean isBordersMovable()
           
 boolean isColourable()
           
 boolean isDbleBorderable()
           
 boolean isFillable()
           
 boolean isFilled()
           
 boolean isInteriorStylable()
           
 boolean isLineStylable()
           
 boolean isModified()
           
 boolean isParametersEquals(IShape s, boolean considerShadow)
          Checks if the parameters of the shapes are equals.
 boolean isShadowable()
           
 boolean isShowPts()
           
 boolean isShowPtsable()
           
 boolean isThicknessable()
           
 void mirrorHorizontal(IPoint origin)
          Returns horizontally the shape.
 void mirrorVertical(IPoint origin)
          Returns vertically the shape.
 void rotate(IPoint point, double angle)
          Rotates the shape.
 void scale(double x, double y, IShape.Position pos, java.awt.geom.Rectangle2D bound)
          Scales the shape where the move reference point is the bottom right point, and the fixation point the top left point.
protected  void scaleSetPoints(java.util.List<IPoint> pts, double x, double y, IShape.Position pos, java.awt.geom.Rectangle2D bound)
           
 void setArrowInset(double inset)
          Defines the inset of the arrow.
 void setArrowLength(double lgth)
          Defines the length of the arrow.
 void setArrowSizeDim(double arrowSizeDim)
          Sets the latex parameter arrowSize num.
 void setArrowSizeNum(double arrowSizeNum)
          Sets the latex parameter arrowSize num.
 void setArrowStyle(IArrow.ArrowStyle style, int position)
          Sets the style of the arrow at the given position.
 void setBordersPosition(IShape.BorderPos position)
          Sets the position of the borders.
 void setBracketNum(double bracketNum)
          Sets the latex parameter bracket num.
 void setDashSepBlack(double dashSepBlack)
           
 void setDashSepWhite(double dashSepWhite)
           
 void setDbleBordCol(java.awt.Color dbleBordCol)
           
 void setDbleBordSep(double dbleBordSep)
           
 void setDotSep(double dotSep)
           
 void setDotSizeDim(double dotSizeDim)
          Sets the latex parameter dotsize dim.
 void setDotSizeNum(double dotSizeNum)
          Sets the latex parameter dotsize num.
 void setFilled(boolean isFilled)
           
 void setFillingCol(java.awt.Color fillingCol)
           
 void setFillingStyle(IShape.FillingStyle fillingStyle)
           
 void setGradAngle(double gradAngle)
           
 void setGradColEnd(java.awt.Color gradColEnd)
           
 void setGradColStart(java.awt.Color gradColStart)
           
 void setGradMidPt(double gradMidPt)
           
 void setHasDbleBord(boolean hasDbleBord)
           
 void setHasShadow(boolean hasShadow)
           
 void setHatchingsAngle(double hatchingsAngle)
           
 void setHatchingsCol(java.awt.Color hatchingsCol)
           
 void setHatchingsSep(double hatchingsSep)
           
 void setHatchingsWidth(double hatchingsWidth)
           
 void setId(int id)
           
 void setLineColour(java.awt.Color lineColour)
           
 void setLineStyle(IShape.LineStyle lineStyle)
           
 void setModified(boolean modified)
          Sets the Modifiable object as modified.
 void setNewId()
          Defines a new unique ID to the shape.
 void setOpacity(double opacity)
           
 void setRBracketNum(double rBracketNum)
          Sets the latex parameter rbracket num.
 void setRotationAngle(double rotationAngle)
           
 void setShadowAngle(double shadowAngle)
           
 void setShadowCol(java.awt.Color shadowCol)
           
 void setShadowSize(double shadowSize)
           
 void setShowPts(boolean showPts)
           
 void setTBarSizeDim(double tbarSizeDim)
          Sets the latex parameter tbarsize num.
 void setTBarSizeNum(double tbarSizeNum)
          Sets the latex parameter tbarsize num.
 void setThickness(double thickness)
           
 boolean shadowFillsShape()
           
 void translate(double tx, double ty)
          Translates the shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

number

private static int number
The increment used to define the ID of the shapes.


opacity

protected double opacity
The opacity of the shape (in [0;1]).


thickness

protected double thickness
The thickness of the lines of the shape in pixels.


lineColour

protected java.awt.Color lineColour
The colour of the lines.


lineStyle

protected IShape.LineStyle lineStyle
The style of the lines.


dashSepWhite

protected double dashSepWhite
The white dash separator for dashed lines in pixel.


dashSepBlack

protected double dashSepBlack
The black dash separator for dashed lines in pixel.


dotSep

protected double dotSep
The dot separator for dotted lines.


fillingCol

protected java.awt.Color fillingCol
The colour of the interior of the shape.


fillingStyle

protected IShape.FillingStyle fillingStyle
The style of the interior of the shape.


gradColStart

protected java.awt.Color gradColStart
The start colour of the gradient.


gradColEnd

protected java.awt.Color gradColEnd
The end colour of the gradient.


gradAngle

protected double gradAngle
The angle of the gradient in radian.


gradMidPt

protected double gradMidPt
The middle point of the gradient.


hatchingsSep

protected double hatchingsSep
The separation size between hatchings in pixel.


hatchingsCol

protected java.awt.Color hatchingsCol
The colour of the hatchings.


hatchingsAngle

protected double hatchingsAngle
The angle of the hatchings in radian.


hatchingsWidth

protected double hatchingsWidth
The thickness of the hatchings in pixel.


rotationAngle

protected double rotationAngle
The rotation angle of the shape.


showPts

protected boolean showPts
Defines if the points of the shape must be considered.


id

protected int id
The ID of the shape.


hasDbleBord

protected boolean hasDbleBord
Defines if the shape has double borders.


dbleBordCol

protected java.awt.Color dbleBordCol
The colour of the double borders.


dbleBordSep

protected double dbleBordSep
The separation size of the double borders in pixel.


hasShadow

protected boolean hasShadow
Defines if the shape has a shadow.


shadowCol

protected java.awt.Color shadowCol
The colour of the shadow.


shadowAngle

protected double shadowAngle
The angle of the shadow in radian.


shadowSize

protected double shadowSize
The size of the shadow in pixel.


arrows

protected java.util.List<IArrow> arrows
The arrow of the shape, may be null.


bordersPosition

protected IShape.BorderPos bordersPosition
The position of the border of the shape.


points

protected java.util.List<IPoint> points
The points of the shape.


modified

protected boolean modified
Defined if the shape has been modified.

Constructor Detail

LShape

protected LShape(boolean uniqueID)
The second default constructor

Parameters:
uniqueID - True: the shape 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
Parameters:
s - The shape to copy.

copyArrows

protected void copyArrows(IShape s)

copyPoints

protected void copyPoints(IShape sh)

addToRotationAngle

public void addToRotationAngle(IPoint gravCentre,
                               double angle)
Description copied from interface: IShape
Adds the given angle to the current rotation angle.

Specified by:
addToRotationAngle in interface IShape
Parameters:
gravCentre - The gravity centre of the rotation. If null, the gravity centre of the shape will be used.
angle - The angle to add. In radian.

getArrowAt

public IArrow getArrowAt(int position)
Specified by:
getArrowAt in interface IShape
Parameters:
position - The position of the wanted arrow (-1 for the last arrow).
Returns:
The arrow at the given position or null if the position is not valid.

getArrows

public java.util.List<IArrow> getArrows()
Specified by:
getArrows in interface IShape
Returns:
the arrows.

getBorderGap

public double getBorderGap()
Description copied from interface: IShape
Computes the gap created by the thickness, the double borders and the position of the border. For example, it helps to compute the top left point that considers the attributes of the shape (thickness, double borders,...).

Specified by:
getBorderGap in interface IShape
Returns:
The computed gap.

getBordersPosition

public IShape.BorderPos getBordersPosition()
Specified by:
getBordersPosition in interface IShape
Returns:
the bordersPosition.

getDashSepBlack

public double getDashSepBlack()
Specified by:
getDashSepBlack in interface IShape
Returns:
the dashSepBlack.

getDashSepWhite

public double getDashSepWhite()
Specified by:
getDashSepWhite in interface IShape
Returns:
the dashSepWhite.

getDbleBordCol

public java.awt.Color getDbleBordCol()
Specified by:
getDbleBordCol in interface IShape
Returns:
the dbleBordCol.

getDbleBordSep

public double getDbleBordSep()
Specified by:
getDbleBordSep in interface IShape
Returns:
the dbleBordSep.

getDotSep

public double getDotSep()
Specified by:
getDotSep in interface IShape
Returns:
the dotSep.

getFillingCol

public java.awt.Color getFillingCol()
Specified by:
getFillingCol in interface IShape
Returns:
the fillingCol.

getFillingStyle

public IShape.FillingStyle getFillingStyle()
Specified by:
getFillingStyle in interface IShape
Returns:
the fillingStyle.

getFullBottomRightPoint

public IPoint getFullBottomRightPoint()
Specified by:
getFullBottomRightPoint in interface IShape
Returns:
The bottom right point of the shape. It takes account of the thickness, the rotation angle, the double border, or any parameters but not the rotation angle; in contrary to getBottomRightPoint().

getFullTopLeftPoint

public IPoint getFullTopLeftPoint()
Specified by:
getFullTopLeftPoint in interface IShape
Returns:
The top left point of the shape. It takes account of the thickness, the rotation angle, the double border, or any parameters but not the rotation angle; in contrary to getTopLeftPoint().

getGradAngle

public double getGradAngle()
Specified by:
getGradAngle in interface IShape
Returns:
the gradAngle.

getGradColEnd

public java.awt.Color getGradColEnd()
Specified by:
getGradColEnd in interface IShape
Returns:
the gradColEnd.

getGradColStart

public java.awt.Color getGradColStart()
Specified by:
getGradColStart in interface IShape
Returns:
the gradColStart.

getGradMidPt

public double getGradMidPt()
Specified by:
getGradMidPt in interface IShape
Returns:
the gradMidPt.

getGravityCentre

public IPoint getGravityCentre()
Specified by:
getGravityCentre in interface IShape
Returns:
the gravityCentre.

getHatchingsAngle

public double getHatchingsAngle()
Specified by:
getHatchingsAngle in interface IShape
Returns:
the hatchingsAngle.

getHatchingsCol

public java.awt.Color getHatchingsCol()
Specified by:
getHatchingsCol in interface IShape
Returns:
the hatchingsCol.

getHatchingsSep

public double getHatchingsSep()
Specified by:
getHatchingsSep in interface IShape
Returns:
the hatchingsSep.

getHatchingsWidth

public double getHatchingsWidth()
Specified by:
getHatchingsWidth in interface IShape
Returns:
the hatchingsWidth.

getId

public int getId()
Specified by:
getId in interface IShape
Returns:
the id.

getLineColour

public java.awt.Color getLineColour()
Specified by:
getLineColour in interface IShape
Returns:
the lineColour.

getLineStyle

public IShape.LineStyle getLineStyle()
Specified by:
getLineStyle in interface IShape
Returns:
the lineStyle.

getNbPoints

public int getNbPoints()
Specified by:
getNbPoints in interface IShape
Returns:
The number of points of the shape.

getOpacity

public double getOpacity()
Specified by:
getOpacity in interface IShape
Returns:
the opacity between 0 and 1 included.

getPoints

public java.util.List<IPoint> getPoints()
Specified by:
getPoints in interface IShape
Returns:
The points of the shape.

getPtAt

public IPoint getPtAt(int position)
Specified by:
getPtAt in interface IShape
Parameters:
position - The position of the wanted points (-1 for the last point).
Returns:
The point at the given position or null if the position is not valid.

getRotationAngle

public double getRotationAngle()
Specified by:
getRotationAngle in interface IShape
Returns:
the rotationAngle.

getShadowAngle

public double getShadowAngle()
Specified by:
getShadowAngle in interface IShape
Returns:
the shadowAngle in radian.

getShadowCol

public java.awt.Color getShadowCol()
Specified by:
getShadowCol in interface IShape
Returns:
the shadowCol.

getShadowSize

public double getShadowSize()
Specified by:
getShadowSize in interface IShape
Returns:
the shadowSize in pixel.

getThickness

public double getThickness()
Specified by:
getThickness in interface IShape
Returns:
the thickness.

hasDbleBord

public boolean hasDbleBord()
Specified by:
hasDbleBord in interface IShape
Returns:
the hasDbleBord.

hasGradient

public boolean hasGradient()
Specified by:
hasGradient in interface IShape
Returns:
True if the shape has a gradient.

hasHatchings

public boolean hasHatchings()
Specified by:
hasHatchings in interface IShape
Returns:
True if the shape has hatchings.

hasShadow

public boolean hasShadow()
Specified by:
hasShadow in interface IShape
Returns:
the hasShadow.

isFilled

public boolean isFilled()
Specified by:
isFilled in interface IShape
Returns:
the isFilled.

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

isShowPts

public boolean isShowPts()
Specified by:
isShowPts in interface IShape
Returns:
the showPts.

isColourable

public boolean isColourable()
Specified by:
isColourable in interface IShape
Returns:
True if the shape can have colours.

setBordersPosition

public void setBordersPosition(IShape.BorderPos position)
Description copied from interface: IShape
Sets the position of the borders.

Specified by:
setBordersPosition in interface IShape
Parameters:
position - The new position.

setDashSepBlack

public void setDashSepBlack(double dashSepBlack)
Specified by:
setDashSepBlack in interface IShape
Parameters:
dashSepBlack - the dashSepBlack to set.

setDashSepWhite

public void setDashSepWhite(double dashSepWhite)
Specified by:
setDashSepWhite in interface IShape
Parameters:
dashSepWhite - the dashSepWhite to set.

setDbleBordCol

public void setDbleBordCol(java.awt.Color dbleBordCol)
Specified by:
setDbleBordCol in interface IShape
Parameters:
dbleBordCol - the dbleBordCol to set.

setDbleBordSep

public void setDbleBordSep(double dbleBordSep)
Specified by:
setDbleBordSep in interface IShape
Parameters:
dbleBordSep - the dbleBordSep to set. Must be greater or equal to 0.

setDotSep

public void setDotSep(double dotSep)
Specified by:
setDotSep in interface IShape
Parameters:
dotSep - the dotSep to set.

setFilled

public void setFilled(boolean isFilled)
Specified by:
setFilled in interface IShape
Parameters:
isFilled - the isFilled to set.

setFillingCol

public void setFillingCol(java.awt.Color fillingCol)
Specified by:
setFillingCol in interface IShape
Parameters:
fillingCol - the fillingCol to set.

setFillingStyle

public void setFillingStyle(IShape.FillingStyle fillingStyle)
Specified by:
setFillingStyle in interface IShape
Parameters:
fillingStyle - the fillingStyle to set.

setGradAngle

public void setGradAngle(double gradAngle)
Specified by:
setGradAngle in interface IShape
Parameters:
gradAngle - the gradAngle to set. In radian.

setGradColEnd

public void setGradColEnd(java.awt.Color gradColEnd)
Specified by:
setGradColEnd in interface IShape
Parameters:
gradColEnd - the gradColEnd to set.

setGradColStart

public void setGradColStart(java.awt.Color gradColStart)
Specified by:
setGradColStart in interface IShape
Parameters:
gradColStart - the gradColStart to set.

setGradMidPt

public void setGradMidPt(double gradMidPt)
Specified by:
setGradMidPt in interface IShape
Parameters:
gradMidPt - the gradMidPt to set. Must be in [0,1].

setHasDbleBord

public void setHasDbleBord(boolean hasDbleBord)
Specified by:
setHasDbleBord in interface IShape
Parameters:
hasDbleBord - the hasDbleBord to set.

setHasShadow

public void setHasShadow(boolean hasShadow)
Specified by:
setHasShadow in interface IShape
Parameters:
hasShadow - the hasShadow to set.

setHatchingsAngle

public void setHatchingsAngle(double hatchingsAngle)
Specified by:
setHatchingsAngle in interface IShape
Parameters:
hatchingsAngle - the hatchingsAngle to set. In radian.

setHatchingsCol

public void setHatchingsCol(java.awt.Color hatchingsCol)
Specified by:
setHatchingsCol in interface IShape
Parameters:
hatchingsCol - the hatchingsCol to set.

setHatchingsSep

public void setHatchingsSep(double hatchingsSep)
Specified by:
setHatchingsSep in interface IShape
Parameters:
hatchingsSep - the hatchingsSep to set. Must be greater or equal than 0.

setHatchingsWidth

public void setHatchingsWidth(double hatchingsWidth)
Specified by:
setHatchingsWidth in interface IShape
Parameters:
hatchingsWidth - the hatchingsWidth to set. Must be greater than 0.

setId

public void setId(int id)
Specified by:
setId in interface IShape
Parameters:
id - the id to set.

setLineColour

public void setLineColour(java.awt.Color lineColour)
Specified by:
setLineColour in interface IShape
Parameters:
lineColour - the lineColour to set.

setLineStyle

public void setLineStyle(IShape.LineStyle lineStyle)
Specified by:
setLineStyle in interface IShape
Parameters:
lineStyle - the lineStyle to set.

setNewId

public void setNewId()
Description copied from interface: IShape
Defines a new unique ID to the shape.

Specified by:
setNewId in interface IShape

setOpacity

public void setOpacity(double opacity)
Specified by:
setOpacity in interface IShape
Parameters:
opacity - the opacity to set. Must be in [0,1].

scale

public void scale(double x,
                  double y,
                  IShape.Position pos,
                  java.awt.geom.Rectangle2D bound)
Description copied from interface: IShape
Scales the shape where the move reference point is the bottom right point, and the fixation point the top left point.

Specified by:
scale in interface IShape
Parameters:
x - The X scale factor, in ]0,double].
y - The Y scale factor, in ]0,double].
pos - The position of the reference point: if the reference point is top-left point, then the scale will extend or reduce the shape at the bottom-right point. If the reference position is NORTH or SOUTH the sx parameter will not be used. If it is EAST or WEST the sy parameter will not be used.
bound - The bound (e.g. the border of the selected shapes) used to compute the scaling.

scaleSetPoints

protected void scaleSetPoints(java.util.List<IPoint> pts,
                              double x,
                              double y,
                              IShape.Position pos,
                              java.awt.geom.Rectangle2D bound)

setRotationAngle

public void setRotationAngle(double rotationAngle)
Specified by:
setRotationAngle in interface IShape
Parameters:
rotationAngle - the rotationAngle to set. In radian.

setShadowAngle

public void setShadowAngle(double shadowAngle)
Specified by:
setShadowAngle in interface IShape
Parameters:
shadowAngle - the shadowAngle to set. In radian.

setShadowCol

public void setShadowCol(java.awt.Color shadowCol)
Specified by:
setShadowCol in interface IShape
Parameters:
shadowCol - the shadowCol to set.

setShadowSize

public void setShadowSize(double shadowSize)
Specified by:
setShadowSize in interface IShape
Parameters:
shadowSize - the shadowSize to set. Must be greater than 0.

setShowPts

public void setShowPts(boolean showPts)
Specified by:
setShowPts in interface IShape
Parameters:
showPts - the showPts to set.

setThickness

public void setThickness(double thickness)
Specified by:
setThickness in interface IShape
Parameters:
thickness - the thickness to set.

shadowFillsShape

public boolean shadowFillsShape()
Specified by:
shadowFillsShape in interface IShape
Returns:
True if when the shape has a shadow, it must be filled.

translate

public void translate(double tx,
                      double ty)
Description copied from interface: IShape
Translates the shape.

Specified by:
translate in interface IShape
Parameters:
tx - The X translation.
ty - The Y translation.

mirrorHorizontal

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

Specified by:
mirrorHorizontal in interface IShape
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
Parameters:
origin - The location of the vertical axe.

getBottomRightPoint

public IPoint getBottomRightPoint()
Specified by:
getBottomRightPoint in interface IShape
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.

getBottomLeftPoint

public IPoint getBottomLeftPoint()
Specified by:
getBottomLeftPoint in interface IShape
Returns:
The bottom 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.

getTopLeftPoint

public IPoint getTopLeftPoint()
Specified by:
getTopLeftPoint in interface IShape
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
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.

duplicate

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

Specified by:
duplicate in interface IShape
Returns:
The duplicata.

getShadowGap

public IPoint getShadowGap()
Description copied from interface: IShape
Computes the translation vector between the shape itself and its shadow.

Specified by:
getShadowGap in interface IShape
Returns:
The computed translation vector. (0,0) is the shape cannot have shadow.

setModified

public void setModified(boolean modified)
Description copied from interface: Modifiable
Sets the Modifiable object as modified.

Specified by:
setModified in interface Modifiable
Parameters:
modified - True: the element is will tagged as modified.

isModified

public boolean isModified()
Specified by:
isModified in interface Modifiable
Returns:
True: the object has been modified. False otherwise.

rotate

public void rotate(IPoint point,
                   double angle)
Description copied from interface: IShape
Rotates the shape.

Specified by:
rotate in interface IShape
Parameters:
point - The rotation centre.
angle - The angle of rotation in radians.

getArrowLine

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

isArrowable

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

isBordersMovable

public boolean isBordersMovable()
Specified by:
isBordersMovable in interface IShape
Returns:
True if the borders of the shape can be moved.

isDbleBorderable

public boolean isDbleBorderable()
Specified by:
isDbleBorderable in interface IShape
Returns:
True if the shape can have a double border.

isFillable

public boolean isFillable()
Specified by:
isFillable in interface IShape
Returns:
True if the shape can have an interior colour.

isInteriorStylable

public boolean isInteriorStylable()
Specified by:
isInteriorStylable in interface IShape
Returns:
True if the interior of the shape can have a style (hatchings, gradient).

isLineStylable

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

isShadowable

public boolean isShadowable()
Specified by:
isShadowable in interface IShape
Returns:
True if the shape can have a shadow.

isShowPtsable

public boolean isShowPtsable()
Specified by:
isShowPtsable in interface IShape
Returns:
True if the points of the shape can be displayed.

isThicknessable

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

setDotSizeDim

public void setDotSizeDim(double dotSizeDim)
Description copied from interface: IArrowable
Sets the latex parameter dotsize dim.

Specified by:
setDotSizeDim in interface IArrowable
Parameters:
dotSizeDim - The new dotsize dim.

setDotSizeNum

public void setDotSizeNum(double dotSizeNum)
Description copied from interface: IArrowable
Sets the latex parameter dotsize num.

Specified by:
setDotSizeNum in interface IArrowable
Parameters:
dotSizeNum - The new dotsize num.

setTBarSizeNum

public void setTBarSizeNum(double tbarSizeNum)
Description copied from interface: IArrowable
Sets the latex parameter tbarsize num.

Specified by:
setTBarSizeNum in interface IArrowable
Parameters:
tbarSizeNum - The new tbarsize num.

setTBarSizeDim

public void setTBarSizeDim(double tbarSizeDim)
Description copied from interface: IArrowable
Sets the latex parameter tbarsize num.

Specified by:
setTBarSizeDim in interface IArrowable
Parameters:
tbarSizeDim - The new tbarsize num.

getTBarSizeDim

public double getTBarSizeDim()
Specified by:
getTBarSizeDim in interface IArrowable
Returns:
The tbarsize dim parameter.

getTBarSizeNum

public double getTBarSizeNum()
Specified by:
getTBarSizeNum in interface IArrowable
Returns:
The tbarsize num parameter.

setRBracketNum

public void setRBracketNum(double rBracketNum)
Description copied from interface: IArrowable
Sets the latex parameter rbracket num.

Specified by:
setRBracketNum in interface IArrowable
Parameters:
rBracketNum - The new rbracket num.

setBracketNum

public void setBracketNum(double bracketNum)
Description copied from interface: IArrowable
Sets the latex parameter bracket num.

Specified by:
setBracketNum in interface IArrowable
Parameters:
bracketNum - The new bracket num.

setArrowLength

public void setArrowLength(double lgth)
Description copied from interface: IArrowable
Defines the length of the arrow.

Specified by:
setArrowLength in interface IArrowable
Parameters:
lgth - The new length of the arrow.

setArrowSizeDim

public void setArrowSizeDim(double arrowSizeDim)
Description copied from interface: IArrowable
Sets the latex parameter arrowSize num.

Specified by:
setArrowSizeDim in interface IArrowable
Parameters:
arrowSizeDim - The new arrowSize num.

setArrowSizeNum

public void setArrowSizeNum(double arrowSizeNum)
Description copied from interface: IArrowable
Sets the latex parameter arrowSize num.

Specified by:
setArrowSizeNum in interface IArrowable
Parameters:
arrowSizeNum - The new arrowSize num.

setArrowInset

public void setArrowInset(double inset)
Description copied from interface: IArrowable
Defines the inset of the arrow.

Specified by:
setArrowInset in interface IArrowable
Parameters:
inset - The new inset.

getDotSizeDim

public double getDotSizeDim()
Specified by:
getDotSizeDim in interface IArrowable
Returns:
The dotsize dim parameter.

getDotSizeNum

public double getDotSizeNum()
Specified by:
getDotSizeNum in interface IArrowable
Returns:
The dotsize num parameter.

getBracketNum

public double getBracketNum()
Specified by:
getBracketNum in interface IArrowable
Returns:
The bracket num parameter.

getArrowSizeNum

public double getArrowSizeNum()
Specified by:
getArrowSizeNum in interface IArrowable
Returns:
The arrowsize num parameter.

getArrowSizeDim

public double getArrowSizeDim()
Specified by:
getArrowSizeDim in interface IArrowable
Returns:
The arrowsize dim parameter.

getArrowInset

public double getArrowInset()
Specified by:
getArrowInset in interface IArrowable
Returns:
The inset of the arrow.

getArrowLength

public double getArrowLength()
Specified by:
getArrowLength in interface IArrowable
Returns:
The length of the arrow.

getRBracketNum

public double getRBracketNum()
Specified by:
getRBracketNum in interface IArrowable
Returns:
The rbracket parameter.

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
Parameters:
style - The style to set.
position - The position of the arrow to modify.

getArrowStyle

public IArrow.ArrowStyle getArrowStyle(int position)
Specified by:
getArrowStyle in interface IShape
Parameters:
position - The position of the arrow to use.
Returns:
The style of the arrow at the given position.