net.sf.latexdraw.mapping
Class ViewList2TooltipableList

java.lang.Object
  extended by org.malai.mapping.List2ObjectMapping<E,java.util.List<F>>
      extended by org.malai.mapping.List2ListMapping<IViewShape,ToolTipable>
          extended by net.sf.latexdraw.mapping.ViewList2TooltipableList
All Implemented Interfaces:
IMapping

public class ViewList2TooltipableList
extends List2ListMapping<IViewShape,ToolTipable>

Defines a mapping that link the views of a canvas to a set of tooltipable views. This last list is used to avoid a full exploration of the set of views (that can be huge). So a synchronisation between these two lists must be performed.

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.

19/01/12

Since:
3.0
Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
 
Fields inherited from class org.malai.mapping.List2ObjectMapping
source, target
 
Constructor Summary
ViewList2TooltipableList(java.util.List<IViewShape> source, java.util.List<ToolTipable> target)
          Creates the mapping.
 
Method Summary
 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.
 
Methods inherited from class org.malai.mapping.List2ObjectMapping
clear, getSource, getTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewList2TooltipableList

public ViewList2TooltipableList(java.util.List<IViewShape> source,
                                java.util.List<ToolTipable> target)
Creates the mapping.

Parameters:
source - The list of views.
target - The subset of tooltipable views.
Throws:
java.lang.IllegalArgumentException - If one of the given argument is null.
Since:
3.0
Method Detail

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.

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.

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.

Parameters:
list - The list before the cleaning, i.e. it still contains all the elements in order to know which elements have been removed.

onObjectReplaced

public void onObjectReplaced(IUnary<?> object,
                             java.lang.Object replacedObject)
Description copied from interface: IMapping
Executes the mapping when an object has been replaced by an other one.

Parameters:
object - The singleton that contains the new object.
replacedObject - The old object contained in the singleton that has been replaced.

onObjectMoved

public void onObjectMoved(java.lang.Object list,
                          java.lang.Object object,
                          int srcIndex,
                          int targetIndex)
Description copied from interface: IMapping
Executes the mapping for the move of an object.

Parameters:
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.

onObjectModified

public void onObjectModified(java.lang.Object object)
Description copied from interface: IMapping
Executes the mapping for the modification of an object.

Parameters:
object - The modified object.

init

public void init()
Description copied from interface: IMapping
At start, the mapping must be executed one time to initialise the binding between source and target objects.