|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.omGraphics.geom.BasicGeometry
com.bbn.openmap.omGraphics.OMGraphicAdapter
com.bbn.openmap.omGraphics.OMList<OMGraphic>
com.bbn.openmap.omGraphics.OMGraphicList
public class OMGraphicList
This class encapsulates a List of OMGraphics.
There are several things that this list does that make it better that any ol' List. You can make several common OMGraphic modification calls on the list, and the list handles the iteration and changing of all the graphics while taking into account a travese order.
An additional benefit is that because the OMGraphicList extends OMGraphic it can contain other instances of OMGraphicList. This way you can manage groupings of graphics, (for instance, an OMGraphicList of OMGraphicLists which each have an OMRaster and OMText).
Many methods, such as generate() and findClosest() traverse the items in the GraphicsList recursively. The direction that the list is traversed is controlled by then traverseMode variable. The traverseMode mode lets you set whether the first or last object added to the list (FIRST_ADDED_ON_TOP or LAST_ADDED_ON_TOP) is drawn on top of the list and considered first for searches.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.OMList |
|---|
OMList.OMDist<T> |
| Field Summary |
|---|
| Fields inherited from class com.bbn.openmap.omGraphics.OMList |
|---|
allowDuplicates, FIRST_ADDED_ON_TOP, graphics, LAST_ADDED_ON_TOP, NONE, processAllGeometries, traverseMode, vague |
| Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter |
|---|
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask |
| Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
|---|
attributes, lineType, needToRegenerate, shape, visible |
| Constructor Summary | |
|---|---|
OMGraphicList()
Construct an OMGraphicList. |
|
OMGraphicList(java.util.Collection<OMGraphic> c)
Construct an OMGraphicList to include a Collection of OMGraphics. |
|
OMGraphicList(int initialCapacity)
Construct an OMGraphicList with an initial capacity. |
|
| Method Summary | |
|---|---|
void |
add(int index,
OMGraphic element)
|
boolean |
add(OMGraphic g)
Add an OMGraphic to the list. |
boolean |
addAll(java.util.Collection<? extends OMGraphic> c)
|
boolean |
addAll(int index,
java.util.Collection<? extends OMGraphic> c)
|
java.lang.Object |
clone()
Generic return of SinkGraphic for subclasses that don't implement clone properly. |
OMList<OMGraphic> |
create()
|
protected OMList.OMDist<OMGraphic> |
createDist()
|
OMGraphic |
get(int location)
Get the geometry at the location number on the list. |
OMGraphic |
getOMGraphicAt(int index)
|
java.util.List<OMGraphic> |
getTargets()
Get a reference to the graphics vector. |
java.util.Iterator<OMGraphic> |
iteratorCopy()
Returns a iterator of a shallow copy of the current list, to avoid concurrent modification exceptions if the list is being generated or rendered while the list is being reviewed for other reasons. |
java.util.ListIterator<OMGraphic> |
listIteratorCopy()
Returns a iterator of a shallow copy of the current list, to avoid concurrent modification exceptions if the list is being generated or rendered while the list is being reviewed for other reasons. |
java.util.ListIterator<OMGraphic> |
listIteratorCopy(int size)
Returns a iterator of a shallow copy of the current list, to avoid concurrent modification exceptions if the list is being generated or rendered while the list is being reviewed for other reasons. |
protected OMGraphic |
objectToOMGraphic(java.lang.Object obj)
Convenience method to cast an object to an OMGraphic if it is one. |
void |
readGraphics(java.io.ObjectInputStream objstream)
Read a cache of OMGraphics, given a ObjectInputStream. |
void |
readGraphics(java.net.URL cacheURL)
Read a cache of OMGraphics, given an URL. |
OMGraphic |
remove(int location)
Remove the geometry at the location number. |
OMGraphic |
set(int index,
OMGraphic element)
|
void |
setFillPaint(java.awt.Paint paint)
Set the fill paint for all the objects on the list. |
void |
setGridGenerator(OMGridGenerator generator,
Projection proj)
Goes through the list, finds the OMGrid objects, and sets the generator for all of them. |
void |
setLinePaint(java.awt.Paint paint)
Set the line paint for all the objects on the list. |
void |
setMatted(boolean value)
Set the matting flag for all the objects on the list. |
void |
setMattingPaint(java.awt.Paint paint)
Set the matting paint for all the objects on the list. |
void |
setOMGraphicAt(OMGraphic graphic,
int index)
Set the graphic at the specified location. |
void |
setSelectPaint(java.awt.Paint paint)
Set the selection paint for all the objects on the list. |
void |
setStroke(java.awt.Stroke stroke)
Set the stroke of all the graphics on the list. |
void |
setTargets(java.util.List<OMGraphic> list)
Set the List used to hold the OMGraphics. |
void |
setTextureMask(java.awt.TexturePaint texture)
Set the texture mask for the OMGraphics on the list. |
void |
sort()
This sort method is a place-holder for OMGraphicList extensions to implement their own particular criteria for sorting an OMGraphicList. |
void |
writeGraphics(java.io.ObjectOutputStream objectstream)
Write the graphics out to a ObjectOutputStream |
void |
writeGraphics(java.lang.String graphicsSaveFile)
Write the graphics out to a file |
| Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
|---|
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
equals, hashCode |
| Methods inherited from interface com.bbn.openmap.omGraphics.OMGraphic |
|---|
getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, setDeclutterType, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setRenderType, setSelected, setShowEditablePalette, shouldRenderEdge, shouldRenderFill |
| Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry |
|---|
clearAttributes, contains, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape |
| Constructor Detail |
|---|
public OMGraphicList()
public OMGraphicList(int initialCapacity)
initialCapacity - the initial capacity of the listpublic OMGraphicList(java.util.Collection<OMGraphic> c)
c - Collection of OMGraphics.| Method Detail |
|---|
public java.util.Iterator<OMGraphic> iteratorCopy()
public java.util.ListIterator<OMGraphic> listIteratorCopy()
public java.util.ListIterator<OMGraphic> listIteratorCopy(int size)
public boolean add(OMGraphic g)
add in interface java.util.Collection<OMGraphic>add in interface java.util.List<OMGraphic>add in class OMList<OMGraphic>
public void setOMGraphicAt(OMGraphic graphic,
int index)
graphic - OMGraphicindex - index of the OMGraphic to return
java.lang.ArrayIndexOutOfBoundsException - if index is out-of-boundspublic OMGraphic getOMGraphicAt(int index)
public OMGraphic get(int location)
get in interface java.util.List<OMGraphic>location - the location of the OMGraphic to return
java.lang.ArrayIndexOutOfBoundsException - if location < 0
or location >=
this.size()public void setStroke(java.awt.Stroke stroke)
setStroke in interface OMGraphicsetStroke in class OMGraphicAdapterstroke - the stroke object to use.Stroke,
BasicStrokepublic void setFillPaint(java.awt.Paint paint)
setFillPaint in interface OMGraphicsetFillPaint in class OMGraphicAdapterpaint - java.awt.Paintpublic void setTextureMask(java.awt.TexturePaint texture)
setTextureMask in interface OMGraphicsetTextureMask in class OMGraphicAdapterpublic void setLinePaint(java.awt.Paint paint)
setLinePaint in interface OMGraphicsetLinePaint in class OMGraphicAdapterpaint - java.awt.Paintpublic void setSelectPaint(java.awt.Paint paint)
setSelectPaint in interface OMGraphicsetSelectPaint in class OMGraphicAdapterpaint - java.awt.Paintpublic void setMattingPaint(java.awt.Paint paint)
setMattingPaint in interface OMGraphicsetMattingPaint in class OMGraphicAdapterpaint - java.awt.Paintpublic void setMatted(boolean value)
setMatted in interface OMGraphicsetMatted in class OMGraphicAdapter
public void setGridGenerator(OMGridGenerator generator,
Projection proj)
generator - an OMGridGenerator to create a renderable graphic from
the OMGrid.proj - a projection to use to generate the graphic. If null, the
generator will create a renderable graphic the next time a
projection is handed to the list.public java.util.List<OMGraphic> getTargets()
HACK this method should either return a clone of the graphics list or a quick reference. Currently it returns the latter for simplicity and minor speed improvement. We should allow a way for the user to set the desired behavior, depending on whether they want responsibility for list synchronization. Right now, the user is responsible for synchronizing the OMGraphicList if it's being used in two or more threads...
public void setTargets(java.util.List<OMGraphic> list)
public void readGraphics(java.net.URL cacheURL)
throws java.io.IOException
cacheURL - URL of serialized graphic list.
java.io.IOException
public void readGraphics(java.io.ObjectInputStream objstream)
throws java.io.IOException
objstream - ObjectInputStream of graphic list.
java.io.IOException
public void writeGraphics(java.lang.String graphicsSaveFile)
throws java.io.IOException
graphicsSaveFile -
java.io.IOException
public void writeGraphics(java.io.ObjectOutputStream objectstream)
throws java.io.IOException
objectstream - ObjectOutputStream
java.io.IOExceptionpublic void sort()
sort in class OMList<OMGraphic>protected OMGraphic objectToOMGraphic(java.lang.Object obj)
objectToOMGraphic in class OMList<OMGraphic>public java.lang.Object clone()
OMGraphicAdapter
clone in interface OMGraphicclone in class OMGraphicAdapterpublic OMList<OMGraphic> create()
create in class OMList<OMGraphic>protected OMList.OMDist<OMGraphic> createDist()
createDist in class OMList<OMGraphic>
public void add(int index,
OMGraphic element)
add in interface java.util.List<OMGraphic>add in class OMList<OMGraphic>public boolean addAll(java.util.Collection<? extends OMGraphic> c)
addAll in interface java.util.Collection<OMGraphic>addAll in interface java.util.List<OMGraphic>
public boolean addAll(int index,
java.util.Collection<? extends OMGraphic> c)
addAll in interface java.util.List<OMGraphic>
public OMGraphic set(int index,
OMGraphic element)
set in interface java.util.List<OMGraphic>public OMGraphic remove(int location)
remove in interface java.util.List<OMGraphic>remove in class OMList<OMGraphic>location - the location of the OMGeometry to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||