|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<Diagram2DComponent>
optics.graphics.Diagram2D
public class Diagram2D
Class to a displayable vector of Diagram2DComponents
which itself inplements the Diagram2DComponent
interface, so allowing complex line diagrams to be assembled
Field Summary | |
---|---|
static boolean |
DynamicBounds
Public static to determins of the graphical bounds are recalulated on every display update. |
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
Diagram2D()
Form a blank Diagram2D to which components can be
added. |
Method Summary | |
---|---|
void |
addComponent(Diagram2DComponent comp)
Method to add a DiagramComponent to the current Diagram. |
void |
addComponent(LensSystem lens)
Method to add an LensSystem to the current Diagram. |
void |
clear()
Method to clear the Diagram and reset the bounds to zero. |
void |
draw(java.awt.Graphics2D g)
Method to graw the Compound object in a Graphic2D
context. |
java.awt.geom.Rectangle2D |
getBounds()
Method to get the Diagram bounds. |
void |
setBounds(double x,
double y,
double w,
double h)
Method to set the Bound to specifed value. |
void |
setDynamicBounds(boolean b)
Method to set the static DynamicBounds flag. |
Methods inherited from class java.util.Vector |
---|
add, add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
iterator, listIterator, listIterator |
Field Detail |
---|
public static boolean DynamicBounds
Constructor Detail |
---|
public Diagram2D()
Diagram2D
to which components can be
added.
Method Detail |
---|
public void addComponent(Diagram2DComponent comp)
Use this is preference to the underlying
addElement()
as to ensure the bounds are correct.
comp
- the componentpublic void addComponent(LensSystem lens)
LensSystem
to the current Diagram.
It is added as selfcontained Daigram2D
lens
- the Opticalgroup.public void clear()
clear
in interface java.util.Collection<Diagram2DComponent>
clear
in interface java.util.List<Diagram2DComponent>
clear
in class java.util.Vector<Diagram2DComponent>
public void setDynamicBounds(boolean b)
true
(the default), then diagram
bounds will be recalculated on each repaint. If
set
public java.awt.geom.Rectangle2D getBounds()
getBounds
in interface Diagram2DComponent
Rectangle
the boundspublic void setBounds(double x, double y, double w, double h)
DynamicBounds
is false.
x
- x location of rectangley
- y location of rectangew
- widthh
- heightpublic void draw(java.awt.Graphics2D g)
Graphic2D
context.
draw
in interface Diagram2DComponent
g
- the Graphics2D context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |