|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.mapping.SelectionMapping
net.sf.latexdraw.mapping.Selection2DeleterMapping
public class Selection2DeleterMapping
This mapping maps the selected shapes of the drawing to the instrument that can delete them.
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.
01/07/10
Field Summary | |
---|---|
protected ShapeDeleter |
deleter
The instrument that removes shapes. |
Fields inherited from class net.sf.latexdraw.mapping.SelectionMapping |
---|
selection |
Constructor Summary | |
---|---|
Selection2DeleterMapping(java.util.List<IShape> selection,
ShapeDeleter deleter)
Creates the mapping. |
Method Summary | |
---|---|
void |
clear()
Removes the references of the mapped objects of the mapping to avoid memory leaks. |
ShapeDeleter |
getTarget()
Returns the target object of the mapping. |
void |
onListCleaned(java.lang.Object list)
Executes the mapping when all the elements of the source were removed. |
void |
onObjectAdded(java.lang.Object list,
java.lang.Object object,
int index)
Executes the mapping for the addition of an object. |
void |
onObjectRemoved(java.lang.Object list,
java.lang.Object object,
int index)
Executes the mapping for the deletion of an object. |
Methods inherited from class net.sf.latexdraw.mapping.SelectionMapping |
---|
getSource, init, onObjectModified, onObjectMoved, onObjectReplaced |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ShapeDeleter deleter
Constructor Detail |
---|
public Selection2DeleterMapping(java.util.List<IShape> selection, ShapeDeleter deleter)
selection
- The list of selected shapes.deleter
- The instrument that removes shapes.
java.lang.IllegalArgumentException
- If one of the given parameter is null.Method Detail |
---|
public ShapeDeleter getTarget()
IMapping
public void onObjectAdded(java.lang.Object list, java.lang.Object object, int index)
IMapping
onObjectAdded
in interface IMapping
onObjectAdded
in class SelectionMapping
list
- The modified source list.object
- The added object.index
- The position where the object has been added. -1 = the last position.public void onObjectRemoved(java.lang.Object list, java.lang.Object object, int index)
IMapping
onObjectRemoved
in interface IMapping
onObjectRemoved
in class SelectionMapping
list
- The modified source list.object
- The deleted object.index
- The position where the object has been deleted. -1 = the last position.public void onListCleaned(java.lang.Object list)
IMapping
onListCleaned
in interface IMapping
onListCleaned
in class SelectionMapping
list
- The list before the cleaning, i.e. it still contains all the elements in
order to know which elements have been removed.public void clear()
IMapping
clear
in interface IMapping
clear
in class SelectionMapping
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |