|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IShape
Defines an interface that classes defining an abstract shape should implement.
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/02/2009
Nested Class Summary | |
---|---|
static class |
IShape.BorderPos
The different positions of the border. |
static class |
IShape.FillingStyle
The different styles of filling. |
static class |
IShape.LineStyle
The different styles of the lines. |
static class |
IShape.Position
The different cardinal points. |
Field Summary | |
---|---|
static double |
GOLDEN_ANGLE
Corresponds to the golden angle (Useful for golden diamond). |
static int |
PPC
The number of pixels per centimetre by default. |
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. |
IShape |
duplicate()
Creates a duplicate of the shape (however id are not the same). |
IArrow |
getArrowAt(int position)
|
ILine |
getArrowLine(IArrow arrow)
|
java.util.List<IArrow> |
getArrows()
|
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 |
getDashSepBlack()
|
double |
getDashSepWhite()
|
java.awt.Color |
getDbleBordCol()
|
double |
getDbleBordSep()
|
double |
getDotSep()
|
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 |
getRotationAngle()
|
double |
getShadowAngle()
|
java.awt.Color |
getShadowCol()
|
IPoint |
getShadowGap()
Computes the translation vector between the shape itself and its shadow. |
double |
getShadowSize()
|
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 |
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 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 |
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 |
setDashSepBlack(double dashSepBlack)
|
void |
setDashSepWhite(double dashSepWhite)
|
void |
setDbleBordCol(java.awt.Color dbleBordCol)
|
void |
setDbleBordSep(double dbleBordSep)
|
void |
setDotSep(double dotSep)
|
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 |
setNewId()
Defines a new unique ID to the shape. |
void |
setOpacity(double opacity)
|
void |
setRotationAngle(double rotationAngle)
|
void |
setShadowAngle(double shadowAngle)
|
void |
setShadowCol(java.awt.Color shadowCol)
|
void |
setShadowSize(double shadowSize)
|
void |
setShowPts(boolean showPts)
|
void |
setThickness(double thickness)
|
boolean |
shadowFillsShape()
|
void |
translate(double tx,
double ty)
Translates the shape. |
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 |
---|
static final int PPC
static final double GOLDEN_ANGLE
Method Detail |
---|
java.util.List<IPoint> getPoints()
int getNbPoints()
IPoint getPtAt(int position)
position
- The position of the wanted points (-1 for the last point).
void copy(IShape s)
s
- The shape to copy.boolean isThicknessable()
boolean isDbleBorderable()
boolean isColourable()
boolean isFillable()
boolean isBordersMovable()
boolean isInteriorStylable()
boolean isShowPtsable()
boolean isLineStylable()
boolean isShadowable()
boolean isArrowable()
IPoint getTopLeftPoint()
IPoint getTopRightPoint()
IPoint getBottomRightPoint()
IPoint getBottomLeftPoint()
IPoint getFullTopLeftPoint()
IPoint getFullBottomRightPoint()
void scale(double sx, double sy, IShape.Position pos, java.awt.geom.Rectangle2D bound)
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.
java.lang.IllegalArgumentException
- If one of the parameter is not valid.void mirrorHorizontal(IPoint origin)
origin
- The location of the horizontal axe.void mirrorVertical(IPoint origin)
origin
- The location of the vertical axe.void translate(double tx, double ty)
tx
- The X translation.ty
- The Y translation.boolean isParametersEquals(IShape s, boolean considerShadow)
s
- The shape to compare.considerShadow
- True if the parameters of the shadows must be considered.
boolean hasHatchings()
boolean hasGradient()
double getThickness()
void setThickness(double thickness)
thickness
- the thickness to set.java.awt.Color getLineColour()
void setLineColour(java.awt.Color lineColour)
lineColour
- the lineColour to set.IShape.LineStyle getLineStyle()
void setLineStyle(IShape.LineStyle lineStyle)
lineStyle
- the lineStyle to set.double getDashSepWhite()
void setDashSepWhite(double dashSepWhite)
dashSepWhite
- the dashSepWhite to set.double getDashSepBlack()
void setDashSepBlack(double dashSepBlack)
dashSepBlack
- the dashSepBlack to set.double getDotSep()
void setDotSep(double dotSep)
dotSep
- the dotSep to set.java.awt.Color getFillingCol()
void setFillingCol(java.awt.Color fillingCol)
fillingCol
- the fillingCol to set.IShape.FillingStyle getFillingStyle()
void setFillingStyle(IShape.FillingStyle fillingStyle)
fillingStyle
- the fillingStyle to set.java.awt.Color getGradColStart()
void setGradColStart(java.awt.Color gradColStart)
gradColStart
- the gradColStart to set.java.awt.Color getGradColEnd()
void setGradColEnd(java.awt.Color gradColEnd)
gradColEnd
- the gradColEnd to set.double getGradAngle()
void setGradAngle(double gradAngle)
gradAngle
- the gradAngle to set. In radian.double getGradMidPt()
void setGradMidPt(double gradMidPt)
gradMidPt
- the gradMidPt to set. Must be in [0,1].double getHatchingsSep()
void setHatchingsSep(double hatchingsSep)
hatchingsSep
- the hatchingsSep to set. Must be greater or equal than 0.java.awt.Color getHatchingsCol()
void setHatchingsCol(java.awt.Color hatchingsCol)
hatchingsCol
- the hatchingsCol to set.double getHatchingsAngle()
void setHatchingsAngle(double hatchingsAngle)
hatchingsAngle
- the hatchingsAngle to set. In radian.double getHatchingsWidth()
void setHatchingsWidth(double hatchingsWidth)
hatchingsWidth
- the hatchingsWidth to set. Must be greater than 0.double getRotationAngle()
void setRotationAngle(double rotationAngle)
rotationAngle
- the rotationAngle to set. In radian.boolean isShowPts()
void setShowPts(boolean showPts)
showPts
- the showPts to set.boolean hasDbleBord()
void setHasDbleBord(boolean hasDbleBord)
hasDbleBord
- the hasDbleBord to set.java.awt.Color getDbleBordCol()
void setDbleBordCol(java.awt.Color dbleBordCol)
dbleBordCol
- the dbleBordCol to set.double getDbleBordSep()
void setDbleBordSep(double dbleBordSep)
dbleBordSep
- the dbleBordSep to set. Must be greater or equal to 0.boolean hasShadow()
void setHasShadow(boolean hasShadow)
hasShadow
- the hasShadow to set.java.awt.Color getShadowCol()
void setShadowCol(java.awt.Color shadowCol)
shadowCol
- the shadowCol to set.double getShadowAngle()
void setShadowAngle(double shadowAngle)
shadowAngle
- the shadowAngle to set. In radian.IPoint getGravityCentre()
int getId()
java.util.List<IArrow> getArrows()
void setArrowStyle(IArrow.ArrowStyle style, int position)
style
- The style to set.position
- The position of the arrow to modify.IArrow.ArrowStyle getArrowStyle(int position)
position
- The position of the arrow to use.
ILine getArrowLine(IArrow arrow)
arrow
- The arrow to analyse.
IArrow getArrowAt(int position)
position
- The position of the wanted arrow (-1 for the last arrow).
boolean isFilled()
void setFilled(boolean isFilled)
isFilled
- the isFilled to set.void setId(int id)
id
- the id to set.void setNewId()
void addToRotationAngle(IPoint gravCentre, double angle)
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.double getShadowSize()
void setShadowSize(double shadowSize)
shadowSize
- the shadowSize to set. Must be greater than 0.IShape.BorderPos getBordersPosition()
void setBordersPosition(IShape.BorderPos position)
position
- The new position.boolean shadowFillsShape()
double getOpacity()
void setOpacity(double opacity)
opacity
- the opacity to set. Must be in [0,1].double getBorderGap()
IShape duplicate()
IPoint getShadowGap()
void rotate(IPoint point, double angle)
point
- The rotation centre.angle
- The angle of rotation in radians.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |