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

java.lang.Object
  extended by net.sf.latexdraw.glib.models.impl.LShape
      extended by net.sf.latexdraw.glib.models.impl.LGroup
          extended by net.sf.latexdraw.glib.models.impl.LDrawing
All Implemented Interfaces:
Arcable, Dottable, IArrowable, IAxes, IDrawing, IGroup, ILineArcShape, IPositionShape, ISetShapes, IShape, IStandardGrid, IText, AbstractPresentation, Modifiable, Reinitialisable

 class LDrawing
extends LGroup
implements IDrawing

Defines a drawing that contains a set of shapes and a set of selected shapes. It corresponds to the model of a canvas that contains representations of shapes.

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/25/2010

Since:
3.0
Version:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.IText
IText.TextPosition, IText.TextSize
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.Arcable
Arcable.ArcStyle
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.IAxes
IAxes.AxesStyle, IAxes.PlottingStyle, IAxes.TicksStyle
 
Nested classes/interfaces inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
IShape.BorderPos, IShape.FillingStyle, IShape.LineStyle, IShape.Position
 
Field Summary
protected  IGroup selection
          The selected shapes of the drawing.
protected  IUnary<IShape> tempShape
          A temporary shape in the drawing.
 
Fields inherited from class net.sf.latexdraw.glib.models.impl.LGroup
shapes
 
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.IAxes
GAP_LABEL
 
Fields inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
GOLDEN_ANGLE, PPC
 
Constructor Summary
protected LDrawing()
          Initialises a drawing.
 
Method Summary
 void addToSelection(IShape sh)
          Adds the given shape to the selection.
 void addToSelection(java.util.List<IShape> newSelection)
          Adds the given shapes to the selection.
 void clear()
          Empties the drawing.
 IGroup getSelection()
           
 IShape getTempShape()
           
 IUnary<IShape> getUnaryTempShape()
           
 boolean isModified()
           
 void reinit()
          Reinitialises the object.
 void removeFromSelection(IShape sh)
          Removes the given shape from the selection.
 void removeSelection()
          Clears the selection.
 IShape removeShape(int i)
          Removes a shape of the drawing a the given position.
 boolean removeShape(IShape sh)
          Removes a shape of the drawing.
 void setSelection(IShape sh)
          Selects the given shape and unselect the already selected shapes.
 void setSelection(java.util.List<IShape> newSelection)
          Selects the given shapes and unselect the already selected shapes.
 void setTempShape(IShape tempShape)
          Sets the temporary shape.
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LGroup
addShape, addShape, addToRotationAngle, contains, containsAxes, containsRoundables, containsStandardGrids, containsTexts, duplicate, duplicate, getAngleEnd, getAngleEndList, getAngleStart, getAngleStartList, getArcStyle, getArcStyleList, getArrowAt, getArrowInset, getArrowLength, getArrowLine, getArrows, getArrowSizeDim, getArrowSizeNum, getArrowStyle, getArrowStyleList, getAxesDistLabelsList, getAxesIncrementsList, getAxesLabelsDisplayedList, getAxesShowOriginList, getAxesStyle, getAxesStyleList, getAxesTicksDisplayedList, getAxesTicksSizeList, getAxesTicksStyleList, getBordersPosition, getBordersPositionList, getBottomLeftPoint, getBottomRightPoint, getBracketNum, getDbleBordCol, getDbleBordColList, getDbleBordSep, getDbleBordSepList, getDistLabels, getDistLabelsX, getDistLabelsY, getDotFillingCol, getDotFillingColList, getDotSizeDim, getDotSizeList, getDotSizeNum, getDotStyle, getDotStyleList, getFillingCol, getFillingColList, getFillingStyle, getFillingStyleList, getGradAngle, getGradAngleList, getGradColEnd, getGradColEndList, getGradColStart, getGradColStartList, getGradMidPt, getGradMidPtList, getGravityCentre, getGridEnd, getGridEndList, getGridEndX, getGridEndY, getGridLabelSizeList, getGridMaxX, getGridMaxY, getGridMinX, getGridMinY, getGridOriginList, getGridStart, getGridStartList, getGridStartX, getGridStartY, getGridXLabelSouthList, getGridYLabelWestList, getHatchingsAngle, getHatchingsAngleList, getHatchingsCol, getHatchingsColList, getHatchingsSep, getHatchingsSepList, getHatchingsWidth, getHatchingsWidthList, getIncrement, getIncrementX, getIncrementY, getLabelsDisplayed, getLabelsSize, getLineArc, getLineArcList, getLineColour, getLineColourList, getLineStyle, getLineStyleList, getOriginX, getOriginY, getPosition, getRadius, getRBracketNum, getRotationAngle, getRotationAngleList, getShadowAngle, getShadowAngleList, getShadowCol, getShadowColList, getShadowSize, getShadowSizeList, getShapeAt, getShapes, getStep, getTBarSizeDim, getTBarSizeNum, getText, getTextList, getTextPosition, getTextPositionList, getThickness, getThicknessList, getTicksDisplayed, getTicksSize, getTicksStyle, getTopLeftPoint, getTopRightPoint, getX, getY, hasDbleBord, hasDbleBordList, hasDot, hasGradient, hasHatchings, hasShadow, hasShadowList, isArrowable, isBordersMovable, isColourable, isDbleBorderable, isEmpty, isFillable, isInteriorStylable, isLineStylable, isRoundCorner, isShadowable, isShowOrigin, isShowPtsable, isThicknessable, isXLabelSouth, isYLabelWest, rotate, scale, setAngleEnd, setAngleEndList, setAngleStart, setAngleStartList, setArcStyle, setArcStyleList, setArrowInset, setArrowLength, setArrowSizeDim, setArrowSizeNum, setArrowStyle, setArrowStyleList, setAxesDistLabelsList, setAxesIncrementsList, setAxesLabelsDisplayedList, setAxesShowOriginList, setAxesStyle, setAxesStyleList, setAxesTicksDisplayedList, setAxesTicksSizeList, setAxesTicksStyleList, setBordersPosition, setBordersPositionList, setBracketNum, setDbleBordCol, setDbleBordColList, setDbleBordSep, setDbleBordSepList, setDistLabels, setDistLabelsX, setDistLabelsY, setDotFillingCol, setDotFillingColList, setDotSizeDim, setDotSizeList, setDotSizeNum, setDotStyle, setDotStyleList, setFillingCol, setFillingColList, setFillingStyle, setFillingStyleList, setGradAngle, setGradAngleList, setGradColEnd, setGradColEndList, setGradColStart, setGradColStartList, setGradMidPt, setGradMidPtList, setGridEnd, setGridEndList, setGridEndX, setGridEndY, setGridLabelSizeList, setGridOriginList, setGridStart, setGridStartList, setGridStartX, setGridStartY, setGridXLabelSouthList, setGridYLabelWestList, setHasDbleBord, setHasDbleBordList, setHasShadow, setHasShadowList, setHatchingsAngle, setHatchingsAngleList, setHatchingsCol, setHatchingsColList, setHatchingsSep, setHatchingsSepList, setHatchingsWidth, setHatchingsWidthList, setIncrement, setIncrementX, setIncrementY, setLabelsDisplayed, setLabelsSize, setLineArc, setLineArcList, setLineColour, setLineColourList, setLineStyle, setLineStyleList, setModified, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRadius, setRBracketNum, setRotationAngle, setRotationAngleList, setShadowAngle, setShadowAngleList, setShadowCol, setShadowColList, setShadowSize, setShadowSizeList, setShowOrigin, setTBarSizeDim, setTBarSizeNum, setText, setTextList, setTextPosition, setTextPositionList, setThickness, setThicknessList, setTicksDisplayed, setTicksSize, setTicksStyle, setX, setXLabelSouth, setY, setYLabelWest, size, translate
 
Methods inherited from class net.sf.latexdraw.glib.models.impl.LShape
copy, copyArrows, copyPoints, getBorderGap, getDashSepBlack, getDashSepWhite, getDotSep, getFullBottomRightPoint, getFullTopLeftPoint, getId, getNbPoints, getOpacity, getPoints, getPtAt, getShadowGap, isFilled, isParametersEquals, isShowPts, mirrorHorizontal, mirrorVertical, scaleSetPoints, setDashSepBlack, setDashSepWhite, setDotSep, setFilled, setId, setNewId, setOpacity, setShowPts, shadowFillsShape
 
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.ISetShapes
addShape, addShape, contains, getShapeAt, getShapes, isEmpty, size
 
Methods inherited from interface org.malai.properties.Modifiable
setModified
 
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IShape
copy, getBorderGap, getDashSepBlack, getDashSepWhite, getDotSep, getFullBottomRightPoint, getFullTopLeftPoint, getId, getNbPoints, getOpacity, getPoints, getPtAt, getShadowGap, isFilled, isParametersEquals, isShowPts, mirrorHorizontal, mirrorVertical, setDashSepBlack, setDashSepWhite, setDotSep, setFilled, setId, setNewId, setOpacity, setShowPts, shadowFillsShape
 

Field Detail

selection

protected IGroup selection
The selected shapes of the drawing.


tempShape

protected IUnary<IShape> tempShape
A temporary shape in the drawing.

Constructor Detail

LDrawing

protected LDrawing()
Initialises a drawing.

Since:
3.0
Method Detail

addToSelection

public void addToSelection(IShape sh)
Description copied from interface: IDrawing
Adds the given shape to the selection.

Specified by:
addToSelection in interface IDrawing
Parameters:
sh - The shape to select.

addToSelection

public void addToSelection(java.util.List<IShape> newSelection)
Description copied from interface: IDrawing
Adds the given shapes to the selection.

Specified by:
addToSelection in interface IDrawing
Parameters:
newSelection - The shapes to select.

getSelection

public IGroup getSelection()
Specified by:
getSelection in interface IDrawing
Returns:
The group that contains the selected shape. Cannot be null.

removeFromSelection

public void removeFromSelection(IShape sh)
Description copied from interface: IDrawing
Removes the given shape from the selection.

Specified by:
removeFromSelection in interface IDrawing
Parameters:
sh - The shape to remove from the selection.

removeSelection

public void removeSelection()
Description copied from interface: IDrawing
Clears the selection.

Specified by:
removeSelection in interface IDrawing

setSelection

public void setSelection(IShape sh)
Description copied from interface: IDrawing
Selects the given shape and unselect the already selected shapes.

Specified by:
setSelection in interface IDrawing
Parameters:
sh - The shape to select.

setSelection

public void setSelection(java.util.List<IShape> newSelection)
Description copied from interface: IDrawing
Selects the given shapes and unselect the already selected shapes.

Specified by:
setSelection in interface IDrawing
Parameters:
newSelection - The shapes to select.

clear

public void clear()
Description copied from interface: ISetShapes
Empties the drawing.

Specified by:
clear in interface ISetShapes
Overrides:
clear in class LGroup

removeShape

public boolean removeShape(IShape sh)
Description copied from interface: ISetShapes
Removes a shape of the drawing.

Specified by:
removeShape in interface ISetShapes
Overrides:
removeShape in class LGroup
Parameters:
sh - The shape to remove.
Returns:
true if the given shape is removed. False if the given shape is null.

removeShape

public IShape removeShape(int i)
Description copied from interface: ISetShapes
Removes a shape of the drawing a the given position.

Specified by:
removeShape in interface ISetShapes
Overrides:
removeShape in class LGroup
Parameters:
i - the position of the shape in the vector (-1: the last shape of the vector).
Returns:
The deleted shape if it exists. Null if the given position is not valid.

getTempShape

public IShape getTempShape()
Specified by:
getTempShape in interface IDrawing
Returns:
The temporary shape. Null is there is no temporary shape.

getUnaryTempShape

public IUnary<IShape> getUnaryTempShape()
Specified by:
getUnaryTempShape in interface IDrawing
Returns:
The unary relation that contains the temporary shape.

setTempShape

public void setTempShape(IShape tempShape)
Description copied from interface: IDrawing
Sets the temporary shape.

Specified by:
setTempShape in interface IDrawing
Parameters:
tempShape - The new temporary shape. Can be null.

isModified

public boolean isModified()
Specified by:
isModified in interface Modifiable
Overrides:
isModified in class LShape
Returns:
True: the object has been modified. False otherwise.

reinit

public void reinit()
Description copied from interface: Reinitialisable
Reinitialises the object.

Specified by:
reinit in interface Reinitialisable