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

All Known Subinterfaces:
IDrawing, IGroup
All Known Implementing Classes:
LDrawing, LGroup

public interface ISetShapes

Defines an interface of a set 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/22/2010

Since:
3.0
Version:
3.0
Author:
Arnaud BLOUIN

Method Summary
 void addShape(IShape s)
          Adds a shape to the drawing.
 void addShape(IShape s, int index)
          Adds a shape to the drawing at at given position.
 void clear()
          Empties the drawing.
 boolean contains(IShape s)
          Allows to know if a shape is in the drawing.
 IShape getShapeAt(int i)
          Allows to get the shape located at the given position.
 java.util.List<IShape> getShapes()
           
 boolean isEmpty()
          Allows to know if the drawing is empty or not.
 IShape removeShape(int i)
          Removes a shape of the drawing a the given position.
 boolean removeShape(IShape s)
          Removes a shape of the drawing.
 int size()
          Allows to get the number of shapes that contains the drawing.
 

Method Detail

addShape

void addShape(IShape s)
Adds a shape to the drawing.

Parameters:
s - The shape to add. Does nothing if the given shape is null.

addShape

void addShape(IShape s,
              int index)
Adds a shape to the drawing at at given position.

Parameters:
s - The shape to add. Does nothing if the given shape is null.
index - The position where the figure must be inserted. Does nothing if the given position is not valid.

removeShape

boolean removeShape(IShape s)
Removes a shape of the drawing.

Parameters:
s - The shape to remove.
Returns:
true if the given shape is removed. False if the given shape is null.

removeShape

IShape removeShape(int i)
Removes a shape of the drawing a the given position.

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.
Since:
1.9.1

getShapeAt

IShape getShapeAt(int i)
Allows to get the shape located at the given position.

Parameters:
i - The position of the figure (-1: the last shape of the drawing).
Returns:
The searched shape if it exists. Null if the given position is not valid.

size

int size()
Allows to get the number of shapes that contains the drawing.

Returns:
The number of shapes in the drawing.

contains

boolean contains(IShape s)
Allows to know if a shape is in the drawing.

Parameters:
s - The shape to check.
Returns:
True if the shape is in the drawing. False when the given shape is null.

isEmpty

boolean isEmpty()
Allows to know if the drawing is empty or not.

Returns:
True if there is at least one shape in the drawing.

clear

void clear()
Empties the drawing.


getShapes

java.util.List<IShape> getShapes()
Returns:
The shapes of the drawing.