jApp
Class SimpleSelection<T extends Selectable>

java.lang.Object
  extended by jApp.AbstractSelection<T>
      extended by jApp.SimpleSelection<T>
All Implemented Interfaces:
Selection<T>, java.lang.Iterable<T>

public class SimpleSelection<T extends Selectable>
extends AbstractSelection<T>


Constructor Summary
SimpleSelection()
           
 
Method Summary
 void add(Selectable x)
           
 void addItemsToRightClick(javax.swing.JPopupMenu popupMenu)
           
 void clear()
           
 boolean contains(Selectable x)
           
protected  java.awt.Paint getEraseHatchPaint()
           
protected  java.awt.Paint getHatchPaint()
           
 java.util.List<T> getSelected()
          Return a list of selected items.
 boolean isEmpty()
          Returns true if the selection is empty (nothing selected).
 java.util.ListIterator iterator()
           
 void paint(java.awt.Graphics2D g)
          The selection paints itself in the give graphics context.
 void paint(java.awt.Graphics2D g, java.awt.geom.AffineTransform tf, T obj, boolean selected)
          The selection paints itself in the given graphicss context through the given transformation.
 void remove(Selectable x)
           
 void restoreSelection(java.util.List<T> list)
           
protected  void setOutlineStroke(java.awt.Graphics2D g)
           
 int size()
           
 
Methods inherited from class jApp.AbstractSelection
addChangeListener, fireSelectionChangedEvent, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSelection

public SimpleSelection()
Method Detail

addItemsToRightClick

public void addItemsToRightClick(javax.swing.JPopupMenu popupMenu)

isEmpty

public boolean isEmpty()
Description copied from interface: Selection
Returns true if the selection is empty (nothing selected).

Returns:
true if nothing selected.

size

public int size()

add

public void add(Selectable x)

remove

public void remove(Selectable x)

contains

public boolean contains(Selectable x)

clear

public void clear()

iterator

public java.util.ListIterator iterator()

setOutlineStroke

protected void setOutlineStroke(java.awt.Graphics2D g)

paint

public void paint(java.awt.Graphics2D g)
Description copied from interface: Selection
The selection paints itself in the give graphics context.

Parameters:
g - the Graphics2D context to draw in.

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.geom.AffineTransform tf,
                  T obj,
                  boolean selected)
Description copied from interface: Selection
The selection paints itself in the given graphicss context through the given transformation.


getHatchPaint

protected java.awt.Paint getHatchPaint()

getEraseHatchPaint

protected java.awt.Paint getEraseHatchPaint()

restoreSelection

public void restoreSelection(java.util.List<T> list)

getSelected

public java.util.List<T> getSelected()
Description copied from interface: Selection
Return a list of selected items. This list is a copy can be modified without changing the selection.

Returns:
a list of selected items.