|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
org.jscience.architecture.traffic.Selection
public class Selection
Selections can be made in the simulator and editor
| Constructor Summary | |
|---|---|
Selection(Selection copy)
Creates a new Selection object that is a clone of the given Selection object |
|
Selection(View v)
|
|
Selection(View v,
java.lang.Class[] sf)
|
|
Selection(View v,
java.lang.Class[] sf,
SelectionStarter ss)
|
|
| Method Summary | |
|---|---|
void |
addToSelection(java.awt.Point p)
Adds the Selectable located at given point to the selection |
void |
addToSelection(java.awt.Rectangle r)
Adds all Selectables inside given rectangle to selection. |
void |
deselect(Selectable o)
Removes a Selectable from the list of selected objects. |
void |
deselectAll()
Removes all objects from the list of selected objects. |
int |
getNumSelectedObjects()
Return the number of currently selected object |
java.util.LinkedList |
getSelectedObjects()
Returns the list of all selected objects |
java.lang.Class[] |
getSelectionFilter()
Returns the current selection filter |
SelectionStarter |
getSelectionStarter()
Returns the current selection starter |
View |
getView()
Returns the view associated with this selection |
void |
invertWithSelection(java.awt.Point p)
Removes the Selectable located at given point from the selection. |
boolean |
isEmpty()
Checks if the selection is empty |
void |
newSelection(java.awt.Point p)
Creates a new selection holding the Selectable located at given point. |
void |
newSelection(java.awt.Rectangle r)
Creates a new selection holding all Selectables inside given rectangle |
void |
newSelection(Selectable o)
Creates a new selection containing the given Selectable |
int |
overlayType()
Returns the type of overlay. 1 indicates a view overlay. 2 indicates a buffer overlay. |
void |
paint(java.awt.Graphics gr)
Draws this Overlay on a given Graphics object. |
void |
selectAll()
Adds all objects to the list of selected objects. |
static java.lang.Object |
selectObject(java.lang.Class[] sf,
SelectionStarter ss,
java.awt.Point p)
Returns the closest object selected by given point using given SelectionStarter |
void |
setSelectedObjects(java.util.LinkedList l)
Sets the list of all selected objects |
void |
setSelection(Selection s)
Sets this selection to the given selection |
void |
setSelectionFilter(java.lang.Class[] sf)
Sets the current selection filter |
void |
setSelectionStarter(SelectionStarter ss)
Sets the current selection starter |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Selection(View v)
public Selection(View v,
java.lang.Class[] sf)
public Selection(View v,
java.lang.Class[] sf,
SelectionStarter ss)
public Selection(Selection copy)
| Method Detail |
|---|
public int overlayType()
Overlay
overlayType in interface Overlay
public void paint(java.awt.Graphics gr)
throws TrafficException
Overlay
paint in interface Overlaygr - The Graphics object to draw this Paintable on
TrafficException - DOCUMENT ME!public View getView()
public SelectionStarter getSelectionStarter()
public void setSelectionStarter(SelectionStarter ss)
public java.lang.Class[] getSelectionFilter()
public void setSelectionFilter(java.lang.Class[] sf)
public java.util.LinkedList getSelectedObjects()
public void setSelectedObjects(java.util.LinkedList l)
public int getNumSelectedObjects()
public boolean isEmpty()
public void setSelection(Selection s)
public void deselectAll()
public void deselect(Selectable o)
o - The Selectable to remove from the listpublic void selectAll()
o - The Selectable that contains a recursive list of all objects to addpublic void newSelection(Selectable o)
o - The Selectable the new selection should containpublic void newSelection(java.awt.Point p)
p - The point of the Selectable to add to the new selectionpublic void addToSelection(java.awt.Point p)
p - The location of the Selectable to addpublic void invertWithSelection(java.awt.Point p)
p - The point the Selectable is located atpublic void addToSelection(java.awt.Rectangle r)
r - The rectangle enclosing Selectables to addpublic void newSelection(java.awt.Rectangle r)
r - The rectangle enclosing Selectables
public static java.lang.Object selectObject(java.lang.Class[] sf,
SelectionStarter ss,
java.awt.Point p)
sf - The selection filter to aplyss - The selection starterp - The point
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||