|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.vectomatic.common.model.DrawingModel
public class DrawingModel
Class to represent a drawing. Contains the collection of shapes in the drawing stored in a linked list.
Nested Class Summary | |
---|---|
protected class |
DrawingModel.AscendingIterator
|
protected static class |
DrawingModel.AscendingNodeComparator
|
protected class |
DrawingModel.DescendingIterator
|
protected static class |
DrawingModel.DescendingNodeComparator
|
protected class |
DrawingModel.Node
|
Field Summary | |
---|---|
protected DrawingModel.AscendingIterator |
_ascIterator
Linked list forward traversal (back to front) |
protected DrawingModel.DescendingIterator |
_descIterator
Linked list reverse traversal (front to back) |
protected List<IDrawingModelListener> |
_drawingModelListeners
|
protected DrawingModel.Node |
_head
Shape linked list head node |
protected Set<Shape> |
_shapeSet
Temporary set used for ordering computations |
protected Map<Shape,DrawingModel.Node> |
_shapeToNode
A Map |
protected DrawingModel.Node |
_tail
Shape linked list tail node |
protected static Comparator<DrawingModel.Node> |
ORDER_ASCENDING
To sort Node based on their depth in ascending order |
protected static Comparator<DrawingModel.Node> |
ORDER_DESCENDING
To sort Node based on their depth in descending order |
Constructor Summary | |
---|---|
DrawingModel()
|
Method Summary | |
---|---|
void |
addDrawingModelListener(IDrawingModelListener listener)
|
void |
addShape(Shape shape)
|
List<Float> |
bringForward(List<Shape> shapes)
|
List<Float> |
bringToFront(List<Shape> shapes)
|
boolean |
canBringForward(List<Shape> shapes)
|
boolean |
canBringToFront(List<Shape> shapes)
|
boolean |
canSendBackward(List<Shape> shapes)
|
boolean |
canSendToBack(List<Shape> shapes)
|
void |
clear()
|
boolean |
contains(Shape shape)
|
int |
count()
|
void |
fireModelHasChanged()
|
void |
fromShapeArray(Shape[] shapeArray)
|
Iterator<Shape> |
iterator()
|
void |
removeDrawingModelListener(IDrawingModelListener listener)
|
void |
removeShape(Shape shape)
|
void |
reorder(List<Shape> shapes,
List<Float> orders)
|
Iterator<Shape> |
reverseIterator()
|
List<Float> |
sendBackward(List<Shape> shapes)
|
List<Float> |
sendToBack(List<Shape> shapes)
|
protected DrawingModel.Node[] |
toNodeArray(List<Shape> shapes)
|
Shape[] |
toShapeArray()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<IDrawingModelListener> _drawingModelListeners
protected DrawingModel.Node _head
protected DrawingModel.Node _tail
protected Map<Shape,DrawingModel.Node> _shapeToNode
protected DrawingModel.AscendingIterator _ascIterator
protected DrawingModel.DescendingIterator _descIterator
protected static final Comparator<DrawingModel.Node> ORDER_ASCENDING
protected static final Comparator<DrawingModel.Node> ORDER_DESCENDING
protected Set<Shape> _shapeSet
Constructor Detail |
---|
public DrawingModel()
Method Detail |
---|
public void addDrawingModelListener(IDrawingModelListener listener)
public void removeDrawingModelListener(IDrawingModelListener listener)
public void fireModelHasChanged()
public void addShape(Shape shape)
public void removeShape(Shape shape)
public void clear()
public void reorder(List<Shape> shapes, List<Float> orders)
public int count()
public Iterator<Shape> iterator()
public Iterator<Shape> reverseIterator()
protected DrawingModel.Node[] toNodeArray(List<Shape> shapes)
public boolean canBringToFront(List<Shape> shapes)
public boolean canSendToBack(List<Shape> shapes)
public boolean canBringForward(List<Shape> shapes)
public boolean canSendBackward(List<Shape> shapes)
public List<Float> bringToFront(List<Shape> shapes)
public List<Float> sendToBack(List<Shape> shapes)
public List<Float> bringForward(List<Shape> shapes)
public List<Float> sendBackward(List<Shape> shapes)
public boolean contains(Shape shape)
public Shape[] toShapeArray()
public void fromShapeArray(Shape[] shapeArray)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |