net.sf.latexdraw.mapping
Class ShapeList2ViewListMapping
java.lang.Object
org.malai.mapping.List2ObjectMapping<E,java.util.List<F>>
org.malai.mapping.List2ListMapping<E,F>
org.malai.mapping.SymmetricList2ListMapping<IShape,IViewShape>
net.sf.latexdraw.mapping.ShapeList2ViewListMapping
- All Implemented Interfaces:
- IMapping
public class ShapeList2ViewListMapping
- extends SymmetricList2ListMapping<IShape,IViewShape>
Defines a mapping that link a list of IShape to a list of IShapeView.
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.
05/15/10
- Since:
- 3.0
- Version:
- 3.0
- Author:
- Arnaud BLOUIN
Method Summary |
protected IViewShape |
createTargetObject(java.lang.Object sourceObject)
Creates an instance of the target type using the given source object. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShapeList2ViewListMapping
public ShapeList2ViewListMapping(java.util.List<IShape> source,
java.util.List<IViewShape> target)
SymmetricList2ListMapping.SymmetricList2ListMapping(List, List)
createTargetObject
protected IViewShape createTargetObject(java.lang.Object sourceObject)
- Description copied from class:
SymmetricList2ListMapping
- Creates an instance of the target type using the given source object.
- Specified by:
createTargetObject
in class SymmetricList2ListMapping<IShape,IViewShape>
- Parameters:
sourceObject
- The source object used to create the target object.
- Returns:
- The created target object.
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 SymmetricList2ListMapping<IShape,IViewShape>
- 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 SymmetricList2ListMapping<IShape,IViewShape>
- 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 SymmetricList2ListMapping<IShape,IViewShape>
- Parameters:
list
- The list before the cleaning, i.e. it still contains all the elements in
order to know which elements have been removed.