|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.glib.models.impl.LShape
abstract class LShape
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
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 |
---|
private static int number
protected double opacity
protected double thickness
protected java.awt.Color lineColour
protected IShape.LineStyle lineStyle
protected double dashSepWhite
protected double dashSepBlack
protected double dotSep
protected java.awt.Color fillingCol
protected IShape.FillingStyle fillingStyle
protected java.awt.Color gradColStart
protected java.awt.Color gradColEnd
protected double gradAngle
protected double gradMidPt
protected double hatchingsSep
protected java.awt.Color hatchingsCol
protected double hatchingsAngle
protected double hatchingsWidth
protected double rotationAngle
protected boolean showPts
protected int id
protected boolean hasDbleBord
protected java.awt.Color dbleBordCol
protected double dbleBordSep
protected boolean hasShadow
protected java.awt.Color shadowCol
protected double shadowAngle
protected double shadowSize
protected java.util.List<IArrow> arrows
protected IShape.BorderPos bordersPosition
protected java.util.List<IPoint> points
protected boolean modified
Constructor Detail |
---|
protected LShape(boolean uniqueID)
uniqueID
- True: the shape will have a unique ID.Method Detail |
---|
public void copy(IShape s)
IShape
copy
in interface IShape
s
- The shape to copy.protected void copyArrows(IShape s)
protected void copyPoints(IShape sh)
public void addToRotationAngle(IPoint gravCentre, double angle)
IShape
addToRotationAngle
in interface IShape
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.public IArrow getArrowAt(int position)
getArrowAt
in interface IShape
position
- The position of the wanted arrow (-1 for the last arrow).
public java.util.List<IArrow> getArrows()
getArrows
in interface IShape
public double getBorderGap()
IShape
getBorderGap
in interface IShape
public IShape.BorderPos getBordersPosition()
getBordersPosition
in interface IShape
public double getDashSepBlack()
getDashSepBlack
in interface IShape
public double getDashSepWhite()
getDashSepWhite
in interface IShape
public java.awt.Color getDbleBordCol()
getDbleBordCol
in interface IShape
public double getDbleBordSep()
getDbleBordSep
in interface IShape
public double getDotSep()
getDotSep
in interface IShape
public java.awt.Color getFillingCol()
getFillingCol
in interface IShape
public IShape.FillingStyle getFillingStyle()
getFillingStyle
in interface IShape
public IPoint getFullBottomRightPoint()
getFullBottomRightPoint
in interface IShape
public IPoint getFullTopLeftPoint()
getFullTopLeftPoint
in interface IShape
public double getGradAngle()
getGradAngle
in interface IShape
public java.awt.Color getGradColEnd()
getGradColEnd
in interface IShape
public java.awt.Color getGradColStart()
getGradColStart
in interface IShape
public double getGradMidPt()
getGradMidPt
in interface IShape
public IPoint getGravityCentre()
getGravityCentre
in interface IShape
public double getHatchingsAngle()
getHatchingsAngle
in interface IShape
public java.awt.Color getHatchingsCol()
getHatchingsCol
in interface IShape
public double getHatchingsSep()
getHatchingsSep
in interface IShape
public double getHatchingsWidth()
getHatchingsWidth
in interface IShape
public int getId()
getId
in interface IShape
public java.awt.Color getLineColour()
getLineColour
in interface IShape
public IShape.LineStyle getLineStyle()
getLineStyle
in interface IShape
public int getNbPoints()
getNbPoints
in interface IShape
public double getOpacity()
getOpacity
in interface IShape
public java.util.List<IPoint> getPoints()
getPoints
in interface IShape
public IPoint getPtAt(int position)
getPtAt
in interface IShape
position
- The position of the wanted points (-1 for the last point).
public double getRotationAngle()
getRotationAngle
in interface IShape
public double getShadowAngle()
getShadowAngle
in interface IShape
public java.awt.Color getShadowCol()
getShadowCol
in interface IShape
public double getShadowSize()
getShadowSize
in interface IShape
public double getThickness()
getThickness
in interface IShape
public boolean hasDbleBord()
hasDbleBord
in interface IShape
public boolean hasGradient()
hasGradient
in interface IShape
public boolean hasHatchings()
hasHatchings
in interface IShape
public boolean hasShadow()
hasShadow
in interface IShape
public boolean isFilled()
isFilled
in interface IShape
public boolean isParametersEquals(IShape s, boolean considerShadow)
IShape
isParametersEquals
in interface IShape
s
- The shape to compare.considerShadow
- True if the parameters of the shadows must be considered.
public boolean isShowPts()
isShowPts
in interface IShape
public boolean isColourable()
isColourable
in interface IShape
public void setBordersPosition(IShape.BorderPos position)
IShape
setBordersPosition
in interface IShape
position
- The new position.public void setDashSepBlack(double dashSepBlack)
setDashSepBlack
in interface IShape
dashSepBlack
- the dashSepBlack to set.public void setDashSepWhite(double dashSepWhite)
setDashSepWhite
in interface IShape
dashSepWhite
- the dashSepWhite to set.public void setDbleBordCol(java.awt.Color dbleBordCol)
setDbleBordCol
in interface IShape
dbleBordCol
- the dbleBordCol to set.public void setDbleBordSep(double dbleBordSep)
setDbleBordSep
in interface IShape
dbleBordSep
- the dbleBordSep to set. Must be greater or equal to 0.public void setDotSep(double dotSep)
setDotSep
in interface IShape
dotSep
- the dotSep to set.public void setFilled(boolean isFilled)
setFilled
in interface IShape
isFilled
- the isFilled to set.public void setFillingCol(java.awt.Color fillingCol)
setFillingCol
in interface IShape
fillingCol
- the fillingCol to set.public void setFillingStyle(IShape.FillingStyle fillingStyle)
setFillingStyle
in interface IShape
fillingStyle
- the fillingStyle to set.public void setGradAngle(double gradAngle)
setGradAngle
in interface IShape
gradAngle
- the gradAngle to set. In radian.public void setGradColEnd(java.awt.Color gradColEnd)
setGradColEnd
in interface IShape
gradColEnd
- the gradColEnd to set.public void setGradColStart(java.awt.Color gradColStart)
setGradColStart
in interface IShape
gradColStart
- the gradColStart to set.public void setGradMidPt(double gradMidPt)
setGradMidPt
in interface IShape
gradMidPt
- the gradMidPt to set. Must be in [0,1].public void setHasDbleBord(boolean hasDbleBord)
setHasDbleBord
in interface IShape
hasDbleBord
- the hasDbleBord to set.public void setHasShadow(boolean hasShadow)
setHasShadow
in interface IShape
hasShadow
- the hasShadow to set.public void setHatchingsAngle(double hatchingsAngle)
setHatchingsAngle
in interface IShape
hatchingsAngle
- the hatchingsAngle to set. In radian.public void setHatchingsCol(java.awt.Color hatchingsCol)
setHatchingsCol
in interface IShape
hatchingsCol
- the hatchingsCol to set.public void setHatchingsSep(double hatchingsSep)
setHatchingsSep
in interface IShape
hatchingsSep
- the hatchingsSep to set. Must be greater or equal than 0.public void setHatchingsWidth(double hatchingsWidth)
setHatchingsWidth
in interface IShape
hatchingsWidth
- the hatchingsWidth to set. Must be greater than 0.public void setId(int id)
setId
in interface IShape
id
- the id to set.public void setLineColour(java.awt.Color lineColour)
setLineColour
in interface IShape
lineColour
- the lineColour to set.public void setLineStyle(IShape.LineStyle lineStyle)
setLineStyle
in interface IShape
lineStyle
- the lineStyle to set.public void setNewId()
IShape
setNewId
in interface IShape
public void setOpacity(double opacity)
setOpacity
in interface IShape
opacity
- the opacity to set. Must be in [0,1].public void scale(double x, double y, IShape.Position pos, java.awt.geom.Rectangle2D bound)
IShape
scale
in interface IShape
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.protected void scaleSetPoints(java.util.List<IPoint> pts, double x, double y, IShape.Position pos, java.awt.geom.Rectangle2D bound)
public void setRotationAngle(double rotationAngle)
setRotationAngle
in interface IShape
rotationAngle
- the rotationAngle to set. In radian.public void setShadowAngle(double shadowAngle)
setShadowAngle
in interface IShape
shadowAngle
- the shadowAngle to set. In radian.public void setShadowCol(java.awt.Color shadowCol)
setShadowCol
in interface IShape
shadowCol
- the shadowCol to set.public void setShadowSize(double shadowSize)
setShadowSize
in interface IShape
shadowSize
- the shadowSize to set. Must be greater than 0.public void setShowPts(boolean showPts)
setShowPts
in interface IShape
showPts
- the showPts to set.public void setThickness(double thickness)
setThickness
in interface IShape
thickness
- the thickness to set.public boolean shadowFillsShape()
shadowFillsShape
in interface IShape
public void translate(double tx, double ty)
IShape
translate
in interface IShape
tx
- The X translation.ty
- The Y translation.public void mirrorHorizontal(IPoint origin)
IShape
mirrorHorizontal
in interface IShape
origin
- The location of the horizontal axe.public void mirrorVertical(IPoint origin)
IShape
mirrorVertical
in interface IShape
origin
- The location of the vertical axe.public IPoint getBottomRightPoint()
getBottomRightPoint
in interface IShape
public IPoint getBottomLeftPoint()
getBottomLeftPoint
in interface IShape
public IPoint getTopLeftPoint()
getTopLeftPoint
in interface IShape
public IPoint getTopRightPoint()
getTopRightPoint
in interface IShape
public IShape duplicate()
IShape
duplicate
in interface IShape
public IPoint getShadowGap()
IShape
getShadowGap
in interface IShape
public void setModified(boolean modified)
Modifiable
setModified
in interface Modifiable
modified
- True: the element is will tagged as modified.public boolean isModified()
isModified
in interface Modifiable
public void rotate(IPoint point, double angle)
IShape
rotate
in interface IShape
point
- The rotation centre.angle
- The angle of rotation in radians.public ILine getArrowLine(IArrow arrow)
getArrowLine
in interface IShape
arrow
- The arrow to analyse.
public boolean isArrowable()
isArrowable
in interface IShape
public boolean isBordersMovable()
isBordersMovable
in interface IShape
public boolean isDbleBorderable()
isDbleBorderable
in interface IShape
public boolean isFillable()
isFillable
in interface IShape
public boolean isInteriorStylable()
isInteriorStylable
in interface IShape
public boolean isLineStylable()
isLineStylable
in interface IShape
public boolean isShadowable()
isShadowable
in interface IShape
public boolean isShowPtsable()
isShowPtsable
in interface IShape
public boolean isThicknessable()
isThicknessable
in interface IShape
public void setDotSizeDim(double dotSizeDim)
IArrowable
setDotSizeDim
in interface IArrowable
dotSizeDim
- The new dotsize dim.public void setDotSizeNum(double dotSizeNum)
IArrowable
setDotSizeNum
in interface IArrowable
dotSizeNum
- The new dotsize num.public void setTBarSizeNum(double tbarSizeNum)
IArrowable
setTBarSizeNum
in interface IArrowable
tbarSizeNum
- The new tbarsize num.public void setTBarSizeDim(double tbarSizeDim)
IArrowable
setTBarSizeDim
in interface IArrowable
tbarSizeDim
- The new tbarsize num.public double getTBarSizeDim()
getTBarSizeDim
in interface IArrowable
public double getTBarSizeNum()
getTBarSizeNum
in interface IArrowable
public void setRBracketNum(double rBracketNum)
IArrowable
setRBracketNum
in interface IArrowable
rBracketNum
- The new rbracket num.public void setBracketNum(double bracketNum)
IArrowable
setBracketNum
in interface IArrowable
bracketNum
- The new bracket num.public void setArrowLength(double lgth)
IArrowable
setArrowLength
in interface IArrowable
lgth
- The new length of the arrow.public void setArrowSizeDim(double arrowSizeDim)
IArrowable
setArrowSizeDim
in interface IArrowable
arrowSizeDim
- The new arrowSize num.public void setArrowSizeNum(double arrowSizeNum)
IArrowable
setArrowSizeNum
in interface IArrowable
arrowSizeNum
- The new arrowSize num.public void setArrowInset(double inset)
IArrowable
setArrowInset
in interface IArrowable
inset
- The new inset.public double getDotSizeDim()
getDotSizeDim
in interface IArrowable
public double getDotSizeNum()
getDotSizeNum
in interface IArrowable
public double getBracketNum()
getBracketNum
in interface IArrowable
public double getArrowSizeNum()
getArrowSizeNum
in interface IArrowable
public double getArrowSizeDim()
getArrowSizeDim
in interface IArrowable
public double getArrowInset()
getArrowInset
in interface IArrowable
public double getArrowLength()
getArrowLength
in interface IArrowable
public double getRBracketNum()
getRBracketNum
in interface IArrowable
public void setArrowStyle(IArrow.ArrowStyle style, int position)
IShape
setArrowStyle
in interface IShape
style
- The style to set.position
- The position of the arrow to modify.public IArrow.ArrowStyle getArrowStyle(int position)
getArrowStyle
in interface IShape
position
- The position of the arrow to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |