|
||||||||||
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
net.sf.latexdraw.glib.models.impl.LPositionShape
net.sf.latexdraw.glib.models.impl.LDot
class LDot
Defines a model of a dot.
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.IDot |
---|
IDot.DotStyle |
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 |
radius
The radius of the dot. |
protected IDot.DotStyle |
style
The current style of the dot. |
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.IDot |
---|
PLUS_COEFF_WIDTH, THICKNESS_O_STYLE_FACTOR |
Fields inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape |
---|
GOLDEN_ANGLE, PPC |
Constructor Summary | |
---|---|
|
LDot(IPoint pt)
Initialises a dot using a centre point. |
protected |
LDot(IPoint pt,
boolean isUniqueID)
|
Method Summary | |
---|---|
void |
copy(IShape sh)
Copies a shape using another. |
IDot |
duplicate()
Creates a duplicate of the shape (however id are not the same). |
double |
getBarGap()
|
double |
getBarThickness()
|
IPoint |
getBottomLeftPoint()
|
IPoint |
getBottomRightPoint()
|
double |
getCrossGap()
|
java.awt.Color |
getDotFillingCol()
|
IDot.DotStyle |
getDotStyle()
|
java.awt.Color |
getFillingCol()
|
double |
getGeneralGap()
|
IPoint |
getLazyBottomRightPoint()
While getBottomRightPoint takes care about the current shape of the dot to compute the bottom right point, this function computes the bottom right point only using the centre and the width of the dot which are the same for all the dot styles |
IPoint |
getLazyTopLeftPoint()
While getTopLeftPoint takes care about the current shape of the dot to compute the top left point, this function computes the top left point only using the centre and the width of the dot which are the same for all the dot styles |
protected double |
getNewRadius(double value,
boolean isX)
Returns the radius computed using a new position (value) and an axe (isX). |
double |
getOGap()
|
double |
getPlusGap()
|
IPoint |
getPosition()
|
double |
getRadius()
|
protected void |
getTopLeftBottomRightPoints(IPoint tl,
IPoint br)
Gives the top-left point and the bottom-right point of the dot considering its current style. |
IPoint |
getTopLeftPoint()
|
IPoint |
getTopRightPoint()
|
double |
getX()
|
double |
getY()
|
boolean |
hasDot()
|
boolean |
isFillable()
|
boolean |
isFilled()
|
boolean |
isParametersEquals(IShape s,
boolean considerShadow)
Checks if the parameters of the shapes are equals. |
void |
mirrorHorizontal(IPoint origin)
Returns horizontally the shape. |
void |
mirrorVertical(IPoint origin)
Returns vertically 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. |
void |
setDotFillingCol(java.awt.Color value)
Sets the filling colour of the dottable. |
void |
setDotStyle(IDot.DotStyle style)
Defines the style of the dot. |
void |
setRadius(double radius)
Defines the radius of the dot. |
void |
setX(double x)
Sets the X coordinate of the shape (of the bottom-left point of the shape). |
void |
setY(double y)
Sets the Y coordinate of the shape (of the bottom-left point of the shape). |
Methods inherited from class net.sf.latexdraw.glib.models.impl.LPositionShape |
---|
setPosition, setPosition |
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.IPositionShape |
---|
setPosition, setPosition |
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 |
---|
protected IDot.DotStyle style
protected double radius
Constructor Detail |
---|
protected LDot(IPoint pt, boolean isUniqueID)
isUniqueID
- True: the shape will have a unique ID.pt
- The centre of the dot.public LDot(IPoint pt)
pt
- The centre of the dot.Method Detail |
---|
public IDot duplicate()
IShape
duplicate
in interface IDot
duplicate
in interface IShape
duplicate
in class LShape
public java.awt.Color getFillingCol()
getFillingCol
in interface IShape
getFillingCol
in class LShape
public IDot.DotStyle getDotStyle()
getDotStyle
in interface Dottable
public double getRadius()
getRadius
in interface Dottable
public void setDotStyle(IDot.DotStyle style)
Dottable
setDotStyle
in interface Dottable
style
- The new style.public void setRadius(double radius)
Dottable
setRadius
in interface Dottable
radius
- the radius to set. Must be greater than 0.protected double getNewRadius(double value, boolean isX)
value
- The new X or Y coordinate of the extremity of the dot.isX
- True: the value will be considered on the X-axe. Otherwise, on the Y-axe.
public void mirrorHorizontal(IPoint origin)
IShape
mirrorHorizontal
in interface IShape
mirrorHorizontal
in class LShape
origin
- The location of the horizontal axe.public void mirrorVertical(IPoint origin)
IShape
mirrorVertical
in interface IShape
mirrorVertical
in class LShape
origin
- The location of the vertical axe.public void setX(double x)
IPositionShape
setX
in interface IPositionShape
setX
in class LPositionShape
x
- The X coordinate of the shape.public void setY(double y)
IPositionShape
setY
in interface IPositionShape
setY
in class LPositionShape
y
- The Y coordinate of the shape.public double getX()
getX
in interface IPositionShape
getX
in class LPositionShape
public double getY()
getY
in interface IPositionShape
getY
in class LPositionShape
public void scale(double x, double y, IShape.Position pos, java.awt.geom.Rectangle2D bound)
IShape
scale
in interface IShape
scale
in class LShape
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.public IPoint getPosition()
getPosition
in interface IPositionShape
getPosition
in class LPositionShape
public void copy(IShape sh)
IShape
copy
in interface IShape
copy
in class LShape
sh
- The shape to copy.public IPoint getBottomLeftPoint()
getBottomLeftPoint
in interface IShape
getBottomLeftPoint
in class LShape
public IPoint getBottomRightPoint()
getBottomRightPoint
in interface IShape
getBottomRightPoint
in class LShape
public IPoint getTopLeftPoint()
getTopLeftPoint
in interface IShape
getTopLeftPoint
in class LShape
public IPoint getTopRightPoint()
getTopRightPoint
in interface IShape
getTopRightPoint
in class LShape
protected void getTopLeftBottomRightPoints(IPoint tl, IPoint br)
tl
- The top-left point to set. Must not be null.br
- The bottom-right point to set. Must not be null.
java.lang.NullPointerException
- If tl or br is null.public boolean isFillable()
isFillable
in interface Dottable
isFillable
in interface IShape
isFillable
in class LShape
public boolean isFilled()
isFilled
in interface IShape
isFilled
in class LShape
public boolean isParametersEquals(IShape s, boolean considerShadow)
IShape
isParametersEquals
in interface IShape
isParametersEquals
in class LShape
s
- The shape to compare.considerShadow
- True if the parameters of the shadows must be considered.
public IPoint getLazyTopLeftPoint()
IDot
getLazyTopLeftPoint
in interface IDot
public IPoint getLazyBottomRightPoint()
IDot
getLazyBottomRightPoint
in interface IDot
public double getPlusGap()
getPlusGap
in interface IDot
public double getCrossGap()
getCrossGap
in interface IDot
public double getBarGap()
getBarGap
in interface IDot
public double getBarThickness()
getBarThickness
in interface IDot
public double getGeneralGap()
getGeneralGap
in interface IDot
public double getOGap()
getOGap
in interface IDot
public boolean hasDot()
hasDot
in interface Dottable
public java.awt.Color getDotFillingCol()
getDotFillingCol
in interface Dottable
public void setDotFillingCol(java.awt.Color value)
Dottable
setDotFillingCol
in interface Dottable
value
- its new colour.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |