|
sdr 0.21 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.cscott.sdr.calls.Formation
public class Formation
A Formation is a set of dancers and positions for them. Certain dancers in the formation can be selected. In addition, all dancers can be tagged with modifiers such as 'BEAU', 'BELLE', 'LEADER', 'TRAILER', etc.
Field Summary | |
---|---|
static Formation |
FOUR_SQUARE
|
protected Map<Dancer,Position> |
location
|
protected Set<Dancer> |
selected
|
static Formation |
SQUARED_SET
|
Constructor Summary | |
---|---|
|
Formation(Formation f,
Map<Dancer,Dancer> map)
|
|
Formation(Map<Dancer,Position> location)
|
protected |
Formation(Map<Dancer,Position> location,
Set<Dancer> selected)
|
Method Summary | |
---|---|
Box |
bounds()
Return the bounds of this formation, which is the bounding box around all the dancers' bounding boxes. |
Box |
bounds(Dancer d)
Return the bounds of the given dancer -- always its position plus or minus 1 unit on the x and y axes. |
Set<Dancer> |
dancers()
|
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isCentered()
|
boolean |
isSelected(Dancer d)
|
Position |
location(Dancer d)
|
Formation |
onlySelected()
Create a new formation containing only the selected dancers from this formation. |
Formation |
recenter()
Build a new formation, centered on 0,0 |
Formation |
rotate(ExactRotation rotation)
Build a new formation, like this one except rotated around 0,0. |
Formation |
select(Set<Dancer> s)
Build a new formation with only the given dancers selected. |
Set<Dancer> |
selectedDancers()
|
String |
toString()
|
String |
toStringDiagram()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Map<Dancer,Position> location
protected final Set<Dancer> selected
public static final Formation SQUARED_SET
public static final Formation FOUR_SQUARE
Constructor Detail |
---|
protected Formation(Map<Dancer,Position> location, Set<Dancer> selected)
public Formation(Map<Dancer,Position> location)
public Formation(Formation f, Map<Dancer,Dancer> map)
Method Detail |
---|
public Formation onlySelected()
public boolean isSelected(Dancer d)
public Set<Dancer> selectedDancers()
public Set<Dancer> dancers()
public Position location(Dancer d)
public Box bounds()
bounds(Dancer)
applies here
as well. If there are no dancers, returns a zero-width,
zero-height box centered at the origin.
public Box bounds(Dancer d)
public Formation select(Set<Dancer> s)
public Formation recenter()
public Formation rotate(ExactRotation rotation)
rotation
parameter;
"north" corresponds to no rotation.
public boolean isCentered()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String toStringDiagram()
|
sdr 0.21 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |