net.sf.latexdraw.glib.models.interfaces
Interface IControlPointShape

All Superinterfaces:
IArrowable, IModifiablePointsShape, IShape, Modifiable
All Known Subinterfaces:
IBezierCurve
All Known Implementing Classes:
LAbstractCtrlPointShape, LBezierCurve

public interface IControlPointShape
extends IModifiablePointsShape

Defines an interface that classes defining a shape, containg control points, 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/03/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
static int DEFAULT_BALANCE_GAP
          The default balance gap used to balance all the points of the bézier curve.
static int DEFAULT_POSITION_CTRL
          The default position gap of control points against their reference point.
 
Fields inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
GOLDEN_ANGLE, PPC
 
Method Summary
 void balance()
          Balances all the control points in order the create a rounded shape.
 int getBalanceGap()
           
 IPoint getFirstCtrlPtAt(int position)
           
 java.util.List<IPoint> getFirstCtrlPts()
           
 IPoint getSecondCtrlPtAt(int position)
           
 java.util.List<IPoint> getSecondCtrlPts()
           
 void setBalanceGap(int balanceGap)
           
 void setXFirstCtrlPt(double x, int id)
          Sets the X-coordinate of one of the first control point.
 void setXSecondCtrlPt(double x, int id)
          Sets the X-coordinate of one of the second control point.
 void setYFirstCtrlPt(double y, int id)
          Sets the Y-coordinate of one of the first control point.
 void setYSecondCtrlPt(double y, int id)
          Sets the Y-coordinate of one of the second control point.
 void updateSecondControlPoints()
          Updates the second control points by using the first control points.
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IModifiablePointsShape
addPoint, addPoint, removePoint, removePoint, replacePoint, setPoint, setPoint
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
addToRotationAngle, copy, duplicate, 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, scale, 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
 

Field Detail

DEFAULT_POSITION_CTRL

static final int DEFAULT_POSITION_CTRL
The default position gap of control points against their reference point.

See Also:
Constant Field Values

DEFAULT_BALANCE_GAP

static final int DEFAULT_BALANCE_GAP
The default balance gap used to balance all the points of the bézier curve.

See Also:
Constant Field Values
Method Detail

balance

void balance()
Balances all the control points in order the create a rounded shape.


getBalanceGap

int getBalanceGap()
Returns:
the balanceGap.

setBalanceGap

void setBalanceGap(int balanceGap)
Parameters:
balanceGap - the balanceGap to set.

getFirstCtrlPtAt

IPoint getFirstCtrlPtAt(int position)
Parameters:
position - The position of the wanted points (-1 for the last point).
Returns:
The first control point at the given position or null if the position is not valid.
Since:
3.0

getSecondCtrlPtAt

IPoint getSecondCtrlPtAt(int position)
Parameters:
position - The position of the wanted points (-1 for the last point).
Returns:
The second control point at the given position or null if the position is not valid.
Since:
3.0

updateSecondControlPoints

void updateSecondControlPoints()
Updates the second control points by using the first control points.

Since:
1.9

setXFirstCtrlPt

void setXFirstCtrlPt(double x,
                     int id)
Sets the X-coordinate of one of the first control point.

Parameters:
x - The new X-coordinate.
id - The position of the point to set.
Since:
1.9

setYFirstCtrlPt

void setYFirstCtrlPt(double y,
                     int id)
Sets the Y-coordinate of one of the first control point.

Parameters:
y - The new Y-coordinate.
id - The position of the point to set.
Since:
1.9

setXSecondCtrlPt

void setXSecondCtrlPt(double x,
                      int id)
Sets the X-coordinate of one of the second control point.

Parameters:
x - The new X-coordinate.
id - The position of the point to set.
Since:
1.9

setYSecondCtrlPt

void setYSecondCtrlPt(double y,
                      int id)
Sets the Y-coordinate of one of the second control point.

Parameters:
y - The new Y-coordinate.
id - The position of the point to set.
Since:
1.9

getFirstCtrlPts

java.util.List<IPoint> getFirstCtrlPts()
Returns:
the firstCtrlPts.

getSecondCtrlPts

java.util.List<IPoint> getSecondCtrlPts()
Returns:
the secondCtrlPts.