com.sencha.gxt.chart.client.draw.sprite
Class SpriteList<S extends Sprite>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<S>
          extended by com.sencha.gxt.chart.client.draw.sprite.SpriteList<S>
Type Parameters:
S - the type of Sprite this composite contains
All Implemented Interfaces:
Iterable<S>, Collection<S>, List<S>
Direct Known Subclasses:
LegendItem

public class SpriteList<S extends Sprite>
extends AbstractList<S>

Handles a group of sprites with common methods to a sprite. These methods are applied to the set of sprites added to the group.


Constructor Summary
SpriteList()
           
 
Method Summary
 void add(int index, S sprite)
           
 boolean add(S sprite)
           
 void clear()
          Clears all items from the composite and removes them their surface.
 S get(int index)
           
 PreciseRectangle getBBox()
          Returns the calculated bounding box of all sprites contained in the composite.
 Surface getSurface()
          Returns the surface that the composite is attached.
 void hide()
          Hides all the sprites contained in the composite.
 S remove(int index)
           
 S set(int index, S element)
           
 void setSurface(Surface surface)
          Sets the surface that the composite is attached.
 void show()
          Shows all of the sprites contained in the composite.
 int size()
           
 
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

SpriteList

public SpriteList()
Method Detail

add

public void add(int index,
                S sprite)
Specified by:
add in interface List<S extends Sprite>
Overrides:
add in class AbstractList<S extends Sprite>

add

public boolean add(S sprite)
Specified by:
add in interface Collection<S extends Sprite>
Specified by:
add in interface List<S extends Sprite>
Overrides:
add in class AbstractList<S extends Sprite>

clear

public void clear()
Clears all items from the composite and removes them their surface.

Specified by:
clear in interface Collection<S extends Sprite>
Specified by:
clear in interface List<S extends Sprite>
Overrides:
clear in class AbstractList<S extends Sprite>

get

public S get(int index)
Specified by:
get in interface List<S extends Sprite>
Specified by:
get in class AbstractList<S extends Sprite>

getBBox

public PreciseRectangle getBBox()
Returns the calculated bounding box of all sprites contained in the composite.

Returns:
the calculated bounding box of all sprites contained in the composite

getSurface

public Surface getSurface()
Returns the surface that the composite is attached.

Returns:
the surface that the composite is attached

hide

public void hide()
Hides all the sprites contained in the composite.


remove

public S remove(int index)
Specified by:
remove in interface List<S extends Sprite>
Overrides:
remove in class AbstractList<S extends Sprite>

set

public S set(int index,
             S element)
Specified by:
set in interface List<S extends Sprite>
Overrides:
set in class AbstractList<S extends Sprite>

setSurface

public void setSurface(Surface surface)
Sets the surface that the composite is attached.

Parameters:
surface - the surface that the composite is attached

show

public void show()
Shows all of the sprites contained in the composite.


size

public int size()
Specified by:
size in interface Collection<S extends Sprite>
Specified by:
size in interface List<S extends Sprite>
Specified by:
size in class AbstractCollection<S extends Sprite>


Copyright © 2011. All Rights Reserved.