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

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.LRectangularShape
              extended by net.sf.latexdraw.glib.models.impl.LEllipse
                  extended by net.sf.latexdraw.glib.models.impl.LCircle
All Implemented Interfaces:
IArrowable, ICircle, IEllipse, IPositionShape, IRectangularShape, IShape, Modifiable

 class LCircle
extends LEllipse
implements ICircle

Defines a model of a circle.

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

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
 
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 LCircle(boolean isUniqueID)
          Creates a square.
protected LCircle(IPoint pt, double radius, boolean isUniqueID)
          Creates a circle.
 
Method Summary
 ICircle duplicate()
          Creates a duplicate of the shape (however id are not the same).
 double getA()
           
 double getB()
           
 void scale(double sx, double sy, 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.
 void setHeight(double height)
          Sets the height of the rectangle (the reference point is the bottom-left point of the rectangle).
 void setRx(double rx)
          Sets the x radius of the ellipse.
 void setRy(double rx)
          Sets the y radius of the ellipse.
 void setWidth(double width)
          Sets the width of the rectangle (the reference point is the bottom-left point of the rectangle).
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LEllipse
getIntersection, getRx, getRy, setCentre
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LRectangularShape
getHeight, getWidth, isBordersMovable, isDbleBorderable, isFillable, isInteriorStylable, isLineStylable, isShadowable, isThicknessable
 
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, copy, copyArrows, copyPoints, getArrowAt, getArrowInset, getArrowLength, getArrowLine, getArrows, getArrowSizeDim, getArrowSizeNum, getArrowStyle, getBorderGap, getBordersPosition, getBottomLeftPoint, getBottomRightPoint, 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, getTopLeftPoint, getTopRightPoint, hasDbleBord, hasGradient, hasHatchings, hasShadow, isArrowable, isColourable, isFilled, isModified, isParametersEquals, isShowPts, isShowPtsable, mirrorHorizontal, mirrorVertical, rotate, 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.IEllipse
getIntersection, getRx, getRy, setCentre
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IRectangularShape
getHeight, getWidth
 
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, copy, getArrowAt, getArrowLine, 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, isArrowable, isBordersMovable, isColourable, isDbleBorderable, isFillable, isFilled, isInteriorStylable, isLineStylable, isParametersEquals, isShadowable, isShowPts, isShowPtsable, isThicknessable, mirrorHorizontal, mirrorVertical, rotate, 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
 

Constructor Detail

LCircle

protected LCircle(boolean isUniqueID)
Creates a square.

Parameters:
isUniqueID - isUniqueID True: the model will have a unique ID.
Since:
3.0

LCircle

protected LCircle(IPoint pt,
                  double radius,
                  boolean isUniqueID)
Creates a circle.

Parameters:
pt - The centre of the circle.
radius - The radius.
isUniqueID - True: the model will have a unique ID.
Throws:
java.lang.IllegalArgumentException - If the radius is not valid.
Method Detail

duplicate

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

Specified by:
duplicate in interface ICircle
Specified by:
duplicate in interface IEllipse
Specified by:
duplicate in interface IShape
Overrides:
duplicate in class LEllipse
Returns:
The duplicata.

scale

public void scale(double sx,
                  double sy,
                  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
Overrides:
scale in class LShape
Parameters:
sx - The X scale factor, in ]0,double].
sy - 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.

setRx

public void setRx(double rx)
Description copied from interface: IEllipse
Sets the x radius of the ellipse.

Specified by:
setRx in interface IEllipse
Overrides:
setRx in class LEllipse
Parameters:
rx - The new x radius.

setRy

public void setRy(double rx)
Description copied from interface: IEllipse
Sets the y radius of the ellipse.

Specified by:
setRy in interface IEllipse
Overrides:
setRy in class LEllipse
Parameters:
rx - The new y radius.

getA

public double getA()
Specified by:
getA in interface IEllipse
Overrides:
getA in class LEllipse
Returns:
The half of the biggest axe.

getB

public double getB()
Specified by:
getB in interface IEllipse
Overrides:
getB in class LEllipse
Returns:
The half of the smallest axe.

setWidth

public void setWidth(double width)
Description copied from interface: IRectangularShape
Sets the width of the rectangle (the reference point is the bottom-left point of the rectangle).

Specified by:
setWidth in interface IRectangularShape
Overrides:
setWidth in class LRectangularShape
Parameters:
width - The new width.

setHeight

public void setHeight(double height)
Description copied from interface: IRectangularShape
Sets the height of the rectangle (the reference point is the bottom-left point of the rectangle).

Specified by:
setHeight in interface IRectangularShape
Overrides:
setHeight in class LRectangularShape
Parameters:
height - The new height.