|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.mapping.ShapeList2ExporterMapping
public class ShapeList2ExporterMapping
Creates a mapping between a list of shapes and the instrument exporter.
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/24/2010
Field Summary | |
---|---|
protected Exporter |
exporter
The instrument exporter to update. |
protected java.util.List<IShape> |
shapes
The list of shapes to listen. |
Constructor Summary | |
---|---|
ShapeList2ExporterMapping(java.util.List<IShape> shapes,
Exporter exporter)
Creates a mapping between a list of shapes and the instrument exporter. |
Method Summary | |
---|---|
void |
clear()
Removes the references of the mapped objects of the mapping to avoid memory leaks. |
java.util.List<IShape> |
getSource()
Returns the source object of the mapping. |
Exporter |
getTarget()
Returns the target object of the mapping. |
void |
init()
At start, the mapping must be executed one time to initialise the binding between source and target objects. |
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 |
onObjectModified(java.lang.Object object)
Executes the mapping for the modification of an object. |
void |
onObjectMoved(java.lang.Object list,
java.lang.Object object,
int srcIndex,
int targetIndex)
Executes the mapping for the move of an object. |
void |
onObjectRemoved(java.lang.Object list,
java.lang.Object object,
int index)
Executes the mapping for the deletion of an object. |
void |
onObjectReplaced(IUnary<?> object,
java.lang.Object replacedObject)
Executes the mapping when an object has been replaced by an other one. |
protected void |
updateExporter()
Updates the activation of the instrument exporter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<IShape> shapes
protected Exporter exporter
Constructor Detail |
---|
public ShapeList2ExporterMapping(java.util.List<IShape> shapes, Exporter exporter)
shapes
- The list of shapes.exporter
- The instrument exporter to update.
java.lang.IllegalArgumentException
- If one of the given parameters is null.Method Detail |
---|
protected void updateExporter()
public void onObjectAdded(java.lang.Object list, java.lang.Object object, int index)
IMapping
onObjectAdded
in interface IMapping
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
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
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 onObjectMoved(java.lang.Object list, java.lang.Object object, int srcIndex, int targetIndex)
IMapping
onObjectMoved
in interface IMapping
list
- The modified source list.object
- The move object.srcIndex
- The source position of the object. -1 = the last position.targetIndex
- The target position of the object. -1 = the last position.public void onObjectReplaced(IUnary<?> object, java.lang.Object replacedObject)
IMapping
onObjectReplaced
in interface IMapping
object
- The singleton that contains the new object.replacedObject
- The old object contained in the singleton that has been replaced.public void onObjectModified(java.lang.Object object)
IMapping
onObjectModified
in interface IMapping
object
- The modified object.public void init()
IMapping
init
in interface IMapping
public void clear()
IMapping
clear
in interface IMapping
public java.util.List<IShape> getSource()
IMapping
getSource
in interface IMapping
public Exporter getTarget()
IMapping
getTarget
in interface IMapping
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |