org.kaboum.geom
Class KaboumGGDIndex

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.kaboum.util.KaboumList
                  extended by org.kaboum.geom.KaboumGGDIndex
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class KaboumGGDIndex
extends KaboumList

This class define an indexed KaboumList of KaboumGeometryGlobalDescriptor.

Author:
Jérôme Gasperi aka jrom
See Also:
Serialized Form

Field Summary
static int onTopID
          The geometry with identificator unpaintID is not paint
static int RESERVED_ID
          CONSTANT : RESERVED ID
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
KaboumGGDIndex(Kaboum parent)
          Default Constructor
KaboumGGDIndex(Kaboum parent, KaboumExtent extent)
          Default Constructor
 
Method Summary
 KaboumGeometryGlobalDescriptor addGeometry(int id, KaboumGeometry geometry, KaboumGeometryDisplayDescriptor dd, KaboumGeometryPropertiesDescriptor pd, java.awt.Color color)
          Add a geometry object
 KaboumGeometryGlobalDescriptor getGGD(int id)
          Return the position of geometry with identifier id
 int getGGDIndex(int id)
          Return the position of geometry with identifier id
 KaboumGeometryGlobalDescriptor[] getVisibleGeometries()
          Return the array of visible objects within the current extent
 void paint(java.awt.Graphics g)
          This method only paint objects that lie into the current extent.
 void paintTooltip(java.awt.Graphics g, java.awt.Point mp)
          This method paint tooltip box corresponding to geometry lying under the mouse cursor.
 void reconstructVisibleGeometries()
          Reconstruct the visible KaboumList according to the current extent
 void removeAllGeometries()
          Remove all the elements from this geoObject
 void removeAllGeometries(KaboumGeometryPropertiesDescriptor tmpPD)
          Remove all the elements from this geoObject linked with input Properties Descriptor
 boolean removeGeometry(int id)
          Remove an element from this Array.
 void setExtent(KaboumExtent extent)
          Set the new extent
 void shiftDown(int id)
          Shift one unit down geometry with identifier id
 void shiftOnBottom(int id)
          Move geometry with identifier id on bottom of the KaboumList.
 void shiftOnTop(int id)
          Move geometry with identifier id on top of the KaboumList.
 void shiftUp(int id)
          Shift one unit up geometry with identifier id
 
Methods inherited from class org.kaboum.util.KaboumList
toCoordinateArray, toGeometryArray, toKaboumList, toLinearRingArray, toLineStringArray, toMultiLineStringArray, toMultiPointArray, toMultiPolygonArray, toPointArray, toPolygonArray
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

RESERVED_ID

public static final int RESERVED_ID
CONSTANT : RESERVED ID

See Also:
Constant Field Values

onTopID

public static int onTopID
The geometry with identificator unpaintID is not paint

Constructor Detail

KaboumGGDIndex

public KaboumGGDIndex(Kaboum parent,
                      KaboumExtent extent)
Default Constructor

Parameters:
extent - Current extent view

KaboumGGDIndex

public KaboumGGDIndex(Kaboum parent)
Default Constructor

Method Detail

setExtent

public void setExtent(KaboumExtent extent)
Set the new extent


reconstructVisibleGeometries

public void reconstructVisibleGeometries()
Reconstruct the visible KaboumList according to the current extent


getVisibleGeometries

public KaboumGeometryGlobalDescriptor[] getVisibleGeometries()
Return the array of visible objects within the current extent


removeGeometry

public boolean removeGeometry(int id)
Remove an element from this Array. In fact, element is not strictly removed (except for K_NEW_GEOMETRY), but it's geometry is set to null

Parameters:
id - Id of the element to remove

removeAllGeometries

public void removeAllGeometries()
Remove all the elements from this geoObject


removeAllGeometries

public void removeAllGeometries(KaboumGeometryPropertiesDescriptor tmpPD)
Remove all the elements from this geoObject linked with input Properties Descriptor


addGeometry

public KaboumGeometryGlobalDescriptor addGeometry(int id,
                                                  KaboumGeometry geometry,
                                                  KaboumGeometryDisplayDescriptor dd,
                                                  KaboumGeometryPropertiesDescriptor pd,
                                                  java.awt.Color color)
Add a geometry object

Parameters:
id - Unique id

getGGD

public KaboumGeometryGlobalDescriptor getGGD(int id)
Return the position of geometry with identifier id

Parameters:
id - Identifier

getGGDIndex

public int getGGDIndex(int id)
Return the position of geometry with identifier id

Parameters:
id - Identifier

shiftUp

public void shiftUp(int id)
Shift one unit up geometry with identifier id

Parameters:
id - identifier of the geometry

shiftDown

public void shiftDown(int id)
Shift one unit down geometry with identifier id

Parameters:
id - identifier of the geometry

shiftOnTop

public void shiftOnTop(int id)
Move geometry with identifier id on top of the KaboumList.

Parameters:
id - identifier of the geometry

shiftOnBottom

public void shiftOnBottom(int id)
Move geometry with identifier id on bottom of the KaboumList.

Parameters:
id - identifier of the geometry

paintTooltip

public void paintTooltip(java.awt.Graphics g,
                         java.awt.Point mp)
This method paint tooltip box corresponding to geometry lying under the mouse cursor. Does nothing if no geometries are under the mouse cursor

Parameters:
g - Graphical context
mp - Mouse position

paint

public void paint(java.awt.Graphics g)
This method only paint objects that lie into the current extent.



Copyright © 2005 Kaboum team. All Rights Reserved.