|
|||||||||||
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.OMGraphic
com.bbn.openmap.omGraphics.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 | |
protected static class |
OMGraphicList.OMDist
RetVal for closest object/distance calculations. |
Field Summary | |
protected boolean |
allowDuplicates
Flag used to allow duplicates in the OMGraphicList. |
static int |
FIRST_ADDED_ON_TOP
Used to set the order in which the list is traversed to draw or search the objects. |
protected java.util.List |
graphics
The list of graphics. |
static int |
LAST_ADDED_ON_TOP
Used to set the order in which the list is traversed to draw or search the objects. |
static int |
NONE
Used for searches, when OMDist doesn't have a graphic. |
protected boolean |
processAllGeometries
Override flag for shouldProcess method. |
protected int |
traverseMode
List traversal mode. |
protected boolean |
vague
Flag to adjust behavior of OMGraphicList for certain queries. |
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphic |
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask |
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible |
Constructor Summary | |
OMGraphicList()
Construct an OMGraphicList. |
|
OMGraphicList(int initialCapacity)
Construct an OMGraphicList with an initial capacity. |
|
OMGraphicList(int initialCapacity,
int capacityIncrement)
Deprecated. capacityIncrement no longer used. |
|
OMGraphicList(java.util.List list)
Construct an OMGraphicList around a List of OMGraphics. |
Method Summary | |
protected void |
_add(OMGeometry g)
Add an OMGeometry to the list. |
protected void |
_doAction(OMGeometry graphic,
OMAction action)
Perform an action on the provided geometry. |
protected OMGraphicList.OMDist |
_findClosest(int x,
int y,
float limit)
Calls _findClosest(x, y, limit, false); |
protected OMGraphicList.OMDist |
_findClosest(int x,
int y,
float limit,
boolean resetSelect)
Find the closest Object and its distance. |
protected OMGeometry |
_getAt(int location)
Get the geometry at the location number on the list. |
protected OMGeometry |
_getContains(int x,
int y)
Finds the first OMGeometry (the one on top) that is under this pixel. |
protected OMGeometry |
_getWithAppObject(java.lang.Object appObj)
Get the graphic with the appObject. |
protected int |
_indexOf(OMGeometry geometry)
Return the index of the OMGeometry in the list. |
protected void |
_insert(OMGeometry geometry,
int location)
Insert the geometry at the location number. |
protected java.lang.Object |
_remove(int location)
Remove the graphic at a location in the list. |
protected boolean |
_remove(OMGeometry geometry)
Remove the graphic. |
protected OMGeometry |
_selectClosest(int x,
int y,
float limit)
Finds the object located the closest to the point, if the object distance away is within the limit, and sets the paint of that graphic to its select paint. |
protected void |
_setAt(OMGeometry graphic,
int index)
Set the geometry at the specified location. |
void |
add(OMGraphic g)
Add an OMGraphic to the list. |
void |
addOMGraphic(OMGraphic g)
Add an OMGraphic to the GraphicList. |
protected void |
checkForDuplicate(OMGeometry g)
Convenience function for methods that may add a OMGeometry. |
void |
clear()
Remove all elements from the graphic list. |
java.lang.Object |
clone()
Generic return of SinkGraphic for subclasses that don't implement clone properly for some reason. |
boolean |
contains(OMGeometry g)
Checks if an OMGeometry is on this list. |
void |
deselect()
If you call deselect() on an OMGraphicList, it deselects all the graphics it contains. |
void |
deselectAll()
Deselects all the items on the graphic list. |
float |
distance(int x,
int y)
Finds the distance to the closest OMGeometry. |
void |
doAction(OMGraphic graphic,
OMAction action)
Perform an action on the provided graphic. |
OMGraphicList |
findAll(int x,
int y,
float limit)
Find all of the OMGraphics on this list that are located within the pixel limit of the x, y pixel location. |
protected OMGraphicList |
findAll(int x,
int y,
float limit,
boolean resetSelect,
OMGraphicList addTo)
Find all of the OMGraphics on this list that are located within the pixel limit of the x, y pixel location. |
protected boolean |
findAllTest(int x,
int y,
float limit,
boolean resetSelect,
OMGraphicList addTo,
OMGeometry omg,
OMGraphicList.OMDist omd)
Test to find out if an OMGeometry is located within the pixel limit of the x, y pixel location. |
OMGraphic |
findClosest(int x,
int y)
Finds the object located the closest to the point, regardless of how far away it is. |
OMGraphic |
findClosest(int x,
int y,
float limit)
Finds the object located the closest to the point, if the object distance away is within the limit. |
protected OMGraphicList.OMDist |
findClosestTest(OMGraphicList.OMDist current,
int index,
OMGeometry graphic,
int x,
int y,
float limit,
boolean resetSelect)
Test the omgraphic distance away from the x, y point, and compare it to the current OMDist passed in. |
int |
findIndexOfClosest(int x,
int y)
Finds the object located the closest to the point, regardless of how far away it is. |
int |
findIndexOfClosest(int x,
int y,
float limit)
Finds the object located the closest to the point, if the object distance away is within the limit. |
boolean |
generate(Projection p)
Prepare the graphics for rendering. |
void |
generate(Projection p,
boolean forceProjectAll)
Prepare the graphics for rendering. |
boolean |
getAllowDuplicates()
Get whether the list will allow duplicate entries added. |
java.lang.String |
getDescription()
OMGraphic method for returning a simple description of the list. |
java.lang.String |
getDescription(int level)
OMGraphic method, for returning a simple description if the contents of the list. |
OMGraphic |
getOMGraphicAt(int location)
Get the graphic at the location number on the list. |
OMGraphic |
getOMGraphicThatContains(int x,
int y)
Finds the first OMGraphic (the one on top) that is under this pixel. |
OMGraphic |
getOMGraphicWithAppObject(java.lang.Object appObj)
Get the graphic with the appObject. |
boolean |
getProcessAllGeometries()
Get the settings for the programmatic override for shouldProcess method to always process geometries. |
java.util.List |
getTargets()
Get a reference to the graphics vector. |
int |
getTraverseMode()
Get the order in which the list is traversed to draw or search the objects. |
int |
indexOf(OMGraphic graphic)
Return the index of the OMGraphic in the list. |
void |
insertOMGraphicAt(OMGraphic graphic,
int location)
Insert the graphic at the location number. |
boolean |
isEmpty()
Find out if the list is empty. |
boolean |
isVague()
Get whether the list returns the specific OMGraphic in response to a query, or itself. |
boolean |
isVisible()
Get the visibility variable. |
java.util.Iterator |
iterator()
Get an Iterator containing the OMGeometrys. |
void |
moveIndexedOneToBack(int location)
Moves the graphic at the given index toward the back of the list by one spot, sliding the other graphic up on in the list in order. |
void |
moveIndexedOneToBottom(int location)
Moves the graphic at the given index to the part of the list where it will be drawn under one of the other graphics, its neighbor on the list. |
void |
moveIndexedOneToFront(int location)
Moves the graphic at the given index toward the front of the list by one spot, sliding the other graphic back on in the list in order. |
void |
moveIndexedOneToTop(int location)
Moves the graphic at the given index to the part of the list where it will be drawn on top of one of the other graphics which is its neighbor on the list. |
void |
moveIndexedToBottom(int location)
Moves the graphic at the given index to the part of the list where it will be drawn under all of the other graphics. |
void |
moveIndexedToFirst(int location)
Moves the graphic at the given index to the front of the list, sliding the other graphics back on in the list in order. |
void |
moveIndexedToLast(int location)
Moves the graphic at the given index to the end of the list, sliding the other graphics up on in the list in order. |
void |
moveIndexedToTop(int location)
Moves the graphic at the given index to the part of the list where it will be drawn on top of the other graphics. |
protected OMGraphic |
objectToOMGraphic(java.lang.Object obj)
Convenience method to cast an object to an OMGraphic if it is one. |
void |
project(Projection p)
Projects any graphics needing projection. |
void |
project(Projection p,
boolean forceProjectAll)
Projects the OMGeometrys on the list. |
void |
readGraphics(java.io.ObjectInputStream objstream)
Read a cache of OMGraphics, given a ObjectInputStream. |
void |
readGraphics(java.net.URL cacheURL)
Read a cache of OMGeometrys, given an URL. |
boolean |
remove(OMGraphic graphic)
Remove the graphic. |
void |
removeOMGraphicAt(int location)
Remove the graphic at the location number. |
void |
render(java.awt.Graphics gr)
Renders all the objects in the list a graphics context. |
void |
renderAllAsSelected(java.awt.Graphics gr)
Renders all the objects in the list a graphics context, in their 'selected' mode. |
void |
select()
If you call select() on an OMGraphicList, it selects all the graphics it contains. |
void |
selectAll()
Selects all the items on the graphic list. |
OMGraphic |
selectClosest(int x,
int y)
Finds the object located the closest to the coordinates, regardless of how far away it is. |
OMGraphic |
selectClosest(int x,
int y,
float limit)
Finds the object located the closest to the point, if the object distance away is within the limit, and sets the paint of that graphic to its select paint. |
protected OMGraphicList.OMDist |
selectClosestTest(OMGraphicList.OMDist current,
int index,
OMGeometry graphic,
int x,
int y,
float limit)
A variation on findClosestTest, manages select() and deselect(). |
void |
setAllowDuplicates(boolean set)
Set whether the list will allow duplicate entries added. |
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 |
setProcessAllGeometries(boolean set)
Set the programmatic override for shouldProcess method to always process geometries. |
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 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 |
setTraverseMode(int mode)
Set the order in which the list is traversed to draw or search the objects. |
void |
setVague(boolean value)
Set whether the list returns the specific OMGraphic in response to a query, or itself. |
void |
setVisible(boolean visible)
Set the visibility variable. |
protected boolean |
shouldProcess(OMGeometry omg)
This method is called internally for those methods where skipping invisible OMGeometries would save processing time and effort. |
int |
size()
Find out the number of graphics in the list. |
void |
sort()
This sort method is a placeholder 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, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry |
clearAttributes, contains, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate |
Field Detail |
public static final transient int LAST_ADDED_ON_TOP
public static final transient int FIRST_ADDED_ON_TOP
public static final int NONE
protected int traverseMode
protected boolean vague
protected java.util.List graphics
protected boolean allowDuplicates
protected boolean processAllGeometries
Constructor Detail |
public OMGraphicList()
public OMGraphicList(int initialCapacity)
initialCapacity
- the initial capacity of the listpublic OMGraphicList(int initialCapacity, int capacityIncrement)
initialCapacity
- the initial capacity of the listcapacityIncrement
- the capacityIncrement for resizingpublic OMGraphicList(java.util.List list)
list
- List of OMGraphics.Method Detail |
public java.lang.String getDescription()
getDescription
in class OMGraphic
public java.lang.String getDescription(int level)
getDescription
in class OMGraphic
level
- used by OMGraphicLists to provide an offset, or a
notion of embedding.
public void setVague(boolean value)
public boolean isVague()
public void addOMGraphic(OMGraphic g)
g
- the non-null OMGraphic to add
java.lang.IllegalArgumentException
- if OMGraphic is nullpublic void add(OMGraphic g)
protected void _add(OMGeometry g)
public void setTraverseMode(int mode)
mode
- traversal modepublic int getTraverseMode()
public void clear()
public boolean isEmpty()
public int size()
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 location)
location
- the location of the OMGraphic to return
java.lang.ArrayIndexOutOfBoundsException
- if location < 0
or location >=
this.size()
protected OMGeometry _getAt(int location)
location
- the location of the OMGeometry to return
java.lang.ArrayIndexOutOfBoundsException
- if location < 0
or location >=
this.size()
protected void _setAt(OMGeometry graphic, int index)
graphic
- OMGeometryindex
- index of the OMGeometry to return
java.lang.ArrayIndexOutOfBoundsException
- if index is out-of-boundspublic OMGraphic getOMGraphicWithAppObject(java.lang.Object appObj)
appObj
- appObject of the wanted graphic.
Object.equals(java.lang.Object)
,
OMGeometry.setAppObject(java.lang.Object)
,
OMGeometry.getAppObject()
protected OMGeometry _getWithAppObject(java.lang.Object appObj)
If this list contains OMGraphicLists that are not vague, and the those lists' appObject doesn't match, the object will be passed to those lists as well for a check, with their OMGraphic being passed back with a successful search.
appObj
- appObject of the wanted graphic.
Object.equals(java.lang.Object)
,
OMGeometry.setAppObject(java.lang.Object)
,
OMGeometry.getAppObject()
public void removeOMGraphicAt(int location)
location
- the location of the OMGraphic to remove.public boolean remove(OMGraphic graphic)
graphic
- the OMGraphic object to remove.
protected java.lang.Object _remove(int location)
location
- the OMGraphic object to remove.
protected boolean _remove(OMGeometry geometry)
geometry
- the OMGeometry object to remove.
public int indexOf(OMGraphic graphic)
graphic
- the graphic to look for
protected int _indexOf(OMGeometry geometry)
geometry
- the geometry to look for
public void insertOMGraphicAt(OMGraphic graphic, int location)
graphic
- the OMGraphic to insert.location
- the location of the OMGraphic to insert
java.lang.IllegalArgumentException
- if OMGraphic is null
java.lang.ArrayIndexOutOfBoundsException
- if index is out-of-boundsprotected void _insert(OMGeometry geometry, int location)
geometry
- the OMGeometry to insert.location
- the location of the OMGeometry to insert
java.lang.IllegalArgumentException
- if OMGeometry is null
java.lang.ArrayIndexOutOfBoundsException
- if index is out-of-boundspublic void moveIndexedOneToTop(int location)
location
- the index location of the graphic to move.moveIndexedOneToFront(int)
,
moveIndexedOneToBack(int)
public void moveIndexedToTop(int location)
location
- the index location of the graphic to move.public void moveIndexedOneToBottom(int location)
location
- the index location of the graphic to move.moveIndexedOneToFront(int)
,
moveIndexedOneToBack(int)
public void moveIndexedToBottom(int location)
location
- the index location of the graphic to move.public void moveIndexedToFirst(int location)
location
- the index of the graphic to move.moveIndexedToBottom(int)
,
moveIndexedToTop(int)
public void moveIndexedOneToFront(int location)
location
- the index of the graphic to move.public void moveIndexedToLast(int location)
location
- the index of the graphic to move.moveIndexedToBottom(int)
,
moveIndexedToTop(int)
public void moveIndexedOneToBack(int location)
location
- the index of the graphic to move.public void setStroke(java.awt.Stroke stroke)
setStroke
in class OMGraphic
stroke
- the stroke object to use.Stroke
,
BasicStroke
public void setFillPaint(java.awt.Paint paint)
setFillPaint
in class OMGraphic
paint
- java.awt.Paintpublic void setTextureMask(java.awt.TexturePaint texture)
setTextureMask
in class OMGraphic
public void setLinePaint(java.awt.Paint paint)
setLinePaint
in class OMGraphic
paint
- java.awt.Paintpublic void setSelectPaint(java.awt.Paint paint)
setSelectPaint
in class OMGraphic
paint
- java.awt.Paintpublic void setMattingPaint(java.awt.Paint paint)
setMattingPaint
in class OMGraphic
paint
- java.awt.Paintpublic void setMatted(boolean value)
setMatted
in class OMGraphic
public void project(Projection p)
generate(Projection, boolean)
with
forceProjectAll
set to true
. This is the
same as calling generate(p, false)
p
- a Projection
generate(Projection, boolean)
public void project(Projection p, boolean forceProjectAll)
generate(p, forceProjectAll)
.
p
- a Projection
forceProjectAll
- if true, all the graphics on the list are
generated with the new projection. If false they are only
generated if getNeedToRegenerate() returns truegenerate(Projection, boolean)
public boolean generate(Projection p)
project(p, true)
.
generate
in interface OMGeometry
generate
in class OMGraphic
p
- a Projection
generate(Projection, boolean)
public void generate(Projection p, boolean forceProjectAll)
render()
! This recursively calls generate() on the
OMGraphics on the list.
p
- a Projection
forceProjectAll
- if true, all the graphics on the list are
generated with the new projection. If false they are only
generated if getNeedToRegenerate() returns trueOMGraphic.generate(com.bbn.openmap.proj.Projection)
,
OMGraphic.regenerate(com.bbn.openmap.proj.Projection)
public void render(java.awt.Graphics gr)
paint()
for AWT components. The graphics are rendered
in the order of traverseMode. Any graphics where isVisible()
returns false are not rendered.
render
in class OMGraphic
gr
- the AWT Graphics contextpublic void renderAllAsSelected(java.awt.Graphics gr)
paint()
for AWT
components. The graphics are rendered in the order of traverseMode. Any
graphics where isVisible()
returns false are not rendered.
All of the graphics on the list are returned to their deselected state.
gr
- the AWT Graphics contextprotected boolean shouldProcess(OMGeometry omg)
public void setProcessAllGeometries(boolean set)
public boolean getProcessAllGeometries()
public float distance(int x, int y)
distance
in interface OMGeometry
distance
in class OMGraphic
x
- x coordy
- y coord
findClosest(int, int, float)
protected OMGraphicList.OMDist _findClosest(int x, int y, float limit, boolean resetSelect)
x
- x coordy
- y coordlimit
- the max distance that a graphic has to be within to be
returned, in pixels.resetSelect
- deselect any OMGraphic touched.
protected OMGraphicList.OMDist findClosestTest(OMGraphicList.OMDist current, int index, OMGeometry graphic, int x, int y, float limit, boolean resetSelect)
current
- the OMDist that contains the current best result of a
search.index
- the index in the graphic list of the provied OMGeometrygraphic
- the OMGeometry to testx
- the window horiontal pixel value.y
- the window vertical pixel value.resetSelect
- flag to call deselect on any OMGeometry contacted.
Used here to pass on in case the OMGeometry provided is an
OMGraphicList, and to use to decide if deselect should be called
on the provided graphic.
public OMGraphic findClosest(int x, int y, float limit)
isVisible()
returns false are not considered.
x
- the x coordinate on the component the graphics are displayed on.y
- the y coordinate on the component the graphics are displayed on.limit
- the max distance that a graphic has to be within to be
returned, in pixels.
public OMGraphicList findAll(int x, int y, float limit)
x
- the x coordinate on the component the graphics are displayed on.y
- the y coordinate on the component the graphics are displayed on.limit
- the max distance that a graphic has to be within to be
returned, in pixels.
protected OMGraphicList findAll(int x, int y, float limit, boolean resetSelect, OMGraphicList addTo)
x
- the x coordinate on the component the graphics are displayed on.y
- the y coordinate on the component the graphics are displayed on.limit
- the max distance that a graphic has to be within to be
returned, in pixels.resetSelect
- call deselect on OMGraphics not within limit.addTo
- OMGraphicList to add found OMGraphics to, if null a list
will be created.
protected boolean findAllTest(int x, int y, float limit, boolean resetSelect, OMGraphicList addTo, OMGeometry omg, OMGraphicList.OMDist omd)
x
- the x coordinate on the component the graphics are displayed on.y
- the y coordinate on the component the graphics are displayed on.limit
- the max distance that a graphic has to be within to be
returned, in pixels.resetSelect
- call deselect on OMGeometry not within limit.addTo
- OMGraphicList to add found OMGeometries to, if null a list
will be created.omg
- OMGeometry to test.omd
- OMDist to use for test, provided to avoid recurring memory
allocations for loops.
public OMGraphic findClosest(int x, int y)
findClosest(x, y, Float.MAX_VALUE)
.
x
- the horizontal pixel position of the window, from the left of
the window.y
- the vertical pixel position of the window, from the top of the
window.
findClosest(int, int, float)
public int findIndexOfClosest(int x, int y, float limit)
isVisible()
returns false are not considered.
x
- the x coordinate on the component the graphics are displayed on.y
- the y coordinate on the component the graphics are displayed on.limit
- the max distance that a graphic has to be within to be
returned, in pixels.
public int findIndexOfClosest(int x, int y)
findClosest(x, y, Float.MAX_VALUE)
.
x
- the horizontal pixel position of the window, from the left of
the window.y
- the vertical pixel position of the window, from the top of the
window.
findIndexOfClosest(int, int, float)
protected OMGraphicList.OMDist _findClosest(int x, int y, float limit)
public OMGraphic selectClosest(int x, int y)
x
- the x coordinate on the component the graphics are displayed on.y
- the y coordinate on the component the graphics are displayed on.
public OMGraphic selectClosest(int x, int y, float limit)
isVisible()
returns false are not considered.
x
- the horizontal pixel position of the window, from the left of
the window.y
- the vertical pixel position of the window, from the top of the
window.limit
- the max distance that a graphic has to be within to be
returned, in pixels.
protected OMGeometry _selectClosest(int x, int y, float limit)
isVisible()
returns false are not considered.
x
- the horizontal pixel position of the window, from the left of
the window.y
- the vertical pixel position of the window, from the top of the
window.limit
- the max distance that a graphic has to be within to be
returned, in pixels.
protected OMGraphicList.OMDist selectClosestTest(OMGraphicList.OMDist current, int index, OMGeometry graphic, int x, int y, float limit)
current
- the OMDist that contains the current best result of a
search.index
- the index in the graphic list of the provied OMGeometrygraphic
- the OMGeometry to testx
- the window horiontal pixel value.y
- the window vertical pixel value.
public void select()
select
in interface OMGeometry
select
in class OMGraphic
public OMGraphic getOMGraphicThatContains(int x, int y)
x
- the horizontal pixel position of the window, from the left of
the window.y
- the vertical pixel position of the window, from the top of the
window.
protected OMGeometry _getContains(int x, int y)
x
- the horizontal pixel position of the window, from the left of
the window.y
- the vertical pixel position of the window, from the top of the
window.
public void deselect()
deselect
in interface OMGeometry
deselect
in class OMGraphic
public void deselectAll()
public void selectAll()
public void doAction(OMGraphic graphic, OMAction action)
protected void _doAction(OMGeometry graphic, OMAction action)
public void setVisible(boolean visible)
setVisible
in interface OMGeometry
setVisible
in class BasicGeometry
visible
- booleanpublic boolean isVisible()
isVisible
in interface OMGeometry
isVisible
in class BasicGeometry
public void setAllowDuplicates(boolean set)
public boolean getAllowDuplicates()
protected void checkForDuplicate(OMGeometry g)
public boolean contains(OMGeometry g)
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 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 OMGeometryList if it's being used in two or more threads...
public void setTargets(java.util.List list)
public java.util.Iterator iterator()
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.IOException
public void sort()
protected OMGraphic objectToOMGraphic(java.lang.Object obj)
public java.lang.Object clone()
OMGraphic
clone
in class OMGraphic
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |