|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.omGraphics.FilterSupport
public class FilterSupport
This class provides support for implementing the OMGraphicHandler interface. If you already calculate an OMGraphicList, you can use this class to apply filtering to it. The graphics on the list you provide it will be made visible or not depending on whether they meet the filter criteria.
The visibility of the graphics is affected when a filter is applied, and visibility is used as the test if whether a graphic is added to a returned list. Use resetFiltering() to turn visibility back on for all the OMGraphics. If a graphic is not visible when a filter is applied, then the filter test will automatically fail.
Field Summary | |
---|---|
protected boolean |
DEBUG
|
protected OMGraphicList |
list
The source graphic list. |
protected boolean |
precise
A flag to use the Area.intersect(Area) test, which may be a performance hit. |
Constructor Summary | |
---|---|
FilterSupport()
|
|
FilterSupport(OMGraphicList omgl)
|
Method Summary | |
---|---|
boolean |
canSetList()
Indicates if the OMGraphicHandler can have its OMGraphicList set. |
boolean |
doAction(OMGraphic graphic,
OMAction action)
Allows the OMGraphicHandler to receive graphics or take some action on one. |
protected void |
failedFilter(OMGraphic omg)
Method called when FilterSupport finds an OMGraphic that fails the filter test. |
OMGraphicList |
filter(java.awt.Shape withinThisShape)
Filters the OMGraphicHandler graphic list so that graphics within the given shape will be visible. |
OMGraphicList |
filter(java.awt.Shape shapeBoundary,
boolean getInsideBoundary)
Filters the OMGraphicHandler graphic list so that graphics inside or outside the given shape will be visible. |
OMGraphicList |
filter(java.lang.String SQLQuery)
Filters the OMGraphicHandler graphic list so that graphics meeting the SQL query statement will be visible. |
protected OMGraphicList |
filterList(OMGraphicList omgl,
java.awt.geom.Area area,
boolean getInsideArea)
Method that provides a recursive mechanism to go through OMGraphicsLists to filter out areas, inside or outside another. |
OMGraphicList |
getList()
Return the graphic list currently being used by the OMGraphicHandler. |
protected void |
passedFilter(OMGraphic omg)
Method called when FilterSupport finds an OMGraphic that passes the filter test. |
void |
resetFiltering()
Remove all filters, and reset all graphics to be visible. |
void |
setList(OMGraphicList omgl)
Set the OMGraphicList within this OMGraphicHandler. |
boolean |
supportsSQL()
Returns true if the OMGraphicHandler can handle SQL statements for filtering. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OMGraphicList list
protected boolean precise
protected boolean DEBUG
Constructor Detail |
---|
public FilterSupport()
public FilterSupport(OMGraphicList omgl)
Method Detail |
---|
public OMGraphicList filter(java.awt.Shape withinThisShape)
filter
in interface OMGraphicHandler
withinThisShape
- java.awt.Shape object defining a
boundary.
public OMGraphicList filter(java.awt.Shape shapeBoundary, boolean getInsideBoundary)
filter
in interface OMGraphicHandler
shapeBoundary
- java.awt.Shape object defining a boundary.getInsideBoundary
- if true, the filter will look for
shapes inside and contacting the boundary. If false, the
filter will look for shapes outside the boundary.
protected OMGraphicList filterList(OMGraphicList omgl, java.awt.geom.Area area, boolean getInsideArea)
public boolean supportsSQL()
supportsSQL
in interface OMGraphicHandler
public OMGraphicList filter(java.lang.String SQLQuery)
filter
in interface OMGraphicHandler
SQLQuery
- a SELECT SQL statement
public boolean doAction(OMGraphic graphic, OMAction action)
doAction
in interface OMGraphicHandler
graphic
- the OMGraphic to do the action on.action
- the OMAction describing what to do to the
graphic.
public OMGraphicList getList()
getList
in interface OMGraphicHandler
OMGeometry.isVisible()
public boolean canSetList()
canSetList
in interface OMGraphicHandler
public void setList(OMGraphicList omgl)
setList
in interface OMGraphicHandler
public void resetFiltering()
resetFiltering
in interface OMGraphicHandler
protected void failedFilter(OMGraphic omg)
protected void passedFilter(OMGraphic omg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |