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

java.lang.Object
  extended by net.sf.latexdraw.glib.models.impl.LShape
      extended by net.sf.latexdraw.glib.models.impl.LModifiablePointsShape
All Implemented Interfaces:
IArrowable, IModifiablePointsShape, IShape, Modifiable
Direct Known Subclasses:
LAbstractCtrlPointShape, LFreehand, LPolygon

abstract class LModifiablePointsShape
extends LShape
implements IModifiablePointsShape

Defines a model of a shape that contains points that can be modified.

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/14/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
LModifiablePointsShape(boolean uniqueID)
          Creates the shape.
 
Method Summary
 void addPoint(IPoint pt)
          Adds a point to the shape model.
 void addPoint(IPoint pt, int position)
          Adds the given point to the points list at the given position.
 IPoint removePoint(int position)
          Removes the point at the given position.
 boolean removePoint(IPoint pt)
          Removes the given point of the shape.
 IPoint replacePoint(IPoint pt, int position)
          Replaces the point at the given position by the given point.
 boolean setPoint(double x, double y, int position)
          Sets the point at the given position to the given coordinate.
 boolean setPoint(IPoint p, int position)
          Sets the point at the given position to the given coordinate.
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LShape
addToRotationAngle, copy, copyArrows, copyPoints, duplicate, 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, isBordersMovable, isColourable, isDbleBorderable, isFillable, isFilled, isInteriorStylable, isLineStylable, isModified, isParametersEquals, isShadowable, isShowPts, isShowPtsable, isThicknessable, mirrorHorizontal, mirrorVertical, rotate, scale, 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.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
 

Constructor Detail

LModifiablePointsShape

public LModifiablePointsShape(boolean uniqueID)
Creates the shape.

Parameters:
uniqueID - True: the model will have a unique ID.
Method Detail

setPoint

public boolean setPoint(IPoint p,
                        int position)
Description copied from interface: IModifiablePointsShape
Sets the point at the given position to the given coordinate. The model is not updated!

Specified by:
setPoint in interface IModifiablePointsShape
Parameters:
p - The new position of the wanted point.
position - The position of the point to move in the points list (-1 corresponds to the last point).
Returns:
true if the operation is successful.

setPoint

public boolean setPoint(double x,
                        double y,
                        int position)
Description copied from interface: IModifiablePointsShape
Sets the point at the given position to the given coordinate.

Specified by:
setPoint in interface IModifiablePointsShape
Parameters:
x - The new X-coordinate. The model is not updated!
y - The new Y-coordinate.
position - The position of the point to move in the points list (-1 corresponds to the last point).
Returns:
true if the operation is successful.

removePoint

public boolean removePoint(IPoint pt)
Description copied from interface: IModifiablePointsShape
Removes the given point of the shape.

Specified by:
removePoint in interface IModifiablePointsShape
Parameters:
pt - The point to remove.
Returns:
True if the point is removed. False otherwise.

removePoint

public IPoint removePoint(int position)
Description copied from interface: IModifiablePointsShape
Removes the point at the given position.

Specified by:
removePoint in interface IModifiablePointsShape
Parameters:
position - The position of the point to remove (-1 corresponds to the last point).
Returns:
The removed point or null.

replacePoint

public IPoint replacePoint(IPoint pt,
                           int position)
Description copied from interface: IModifiablePointsShape
Replaces the point at the given position by the given point.

Specified by:
replacePoint in interface IModifiablePointsShape
Parameters:
pt - The new point. Must not be a point of the shape.
position - The position of the point to remove (-1 corresponds to the last point).
Returns:
The removed point or null.

addPoint

public void addPoint(IPoint pt)
Description copied from interface: IModifiablePointsShape
Adds a point to the shape model.

Specified by:
addPoint in interface IModifiablePointsShape
Parameters:
pt - The point to add. Must be valid.

addPoint

public void addPoint(IPoint pt,
                     int position)
Description copied from interface: IModifiablePointsShape
Adds the given point to the points list at the given position. The model is not updated!

Specified by:
addPoint in interface IModifiablePointsShape
Parameters:
pt - The point to add.
position - The position of insertion (-1 corresponds to the last point).