net.sf.latexdraw.mapping
Class Selection2MetaCustumiserMapping

java.lang.Object
  extended by net.sf.latexdraw.mapping.SelectionMapping
      extended by net.sf.latexdraw.mapping.Selection2MetaCustumiserMapping
All Implemented Interfaces:
IMapping

public class Selection2MetaCustumiserMapping
extends SelectionMapping

This mapping maps the selected shapes of the drawing to the instrument that manages the instruments customising the shapes and the pencil.

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.

10/31/10

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  MetaShapeCustomiser shapeCustomiser
          The instrument that manages the instruments customising the shapes and the pencil.
 
Fields inherited from class net.sf.latexdraw.mapping.SelectionMapping
selection
 
Constructor Summary
Selection2MetaCustumiserMapping(java.util.List<IShape> selection, MetaShapeCustomiser shapeCustomiser)
          Creates the mapping.
 
Method Summary
 void clear()
          Removes the references of the mapped objects of the mapping to avoid memory leaks.
 MetaShapeCustomiser 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

shapeCustomiser

protected MetaShapeCustomiser shapeCustomiser
The instrument that manages the instruments customising the shapes and the pencil.

Constructor Detail

Selection2MetaCustumiserMapping

public Selection2MetaCustumiserMapping(java.util.List<IShape> selection,
                                       MetaShapeCustomiser shapeCustomiser)
Creates the mapping.

Parameters:
selection - The list of selected shapes.
shapeCustomiser - The instrument that manages the instruments customising the shapes and the pencil.
Throws:
java.lang.IllegalArgumentException - If on of the given parameter is null.
Since:
3.0
Method Detail

getTarget

public MetaShapeCustomiser getTarget()
Description copied from interface: IMapping
Returns the target object of the mapping. If there is several target objects, a collection is returned.

Returns:
The source object of the mapping.

onObjectAdded

public void onObjectAdded(java.lang.Object list,
                          java.lang.Object object,
                          int index)
Description copied from interface: IMapping
Executes the mapping for the addition of an object.

Specified by:
onObjectAdded in interface IMapping
Overrides:
onObjectAdded in class SelectionMapping
Parameters:
list - The modified source list.
object - The added object.
index - The position where the object has been added. -1 = the last position.

onObjectRemoved

public void onObjectRemoved(java.lang.Object list,
                            java.lang.Object object,
                            int index)
Description copied from interface: IMapping
Executes the mapping for the deletion of an object.

Specified by:
onObjectRemoved in interface IMapping
Overrides:
onObjectRemoved in class SelectionMapping
Parameters:
list - The modified source list.
object - The deleted object.
index - The position where the object has been deleted. -1 = the last position.

onListCleaned

public void onListCleaned(java.lang.Object list)
Description copied from interface: IMapping
Executes the mapping when all the elements of the source were removed.

Specified by:
onListCleaned in interface IMapping
Overrides:
onListCleaned in class SelectionMapping
Parameters:
list - The list before the cleaning, i.e. it still contains all the elements in order to know which elements have been removed.

clear

public void clear()
Description copied from interface: IMapping
Removes the references of the mapped objects of the mapping to avoid memory leaks.

Specified by:
clear in interface IMapping
Overrides:
clear in class SelectionMapping