|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.MapHandlerChild com.bbn.openmap.OMComponent com.bbn.openmap.omGraphics.rule.RuleHandler<T>
public abstract class RuleHandler<T>
The RuleHandler manages a set of Rules and will evaluate OMGraphics against them for a current projection.
For List rules, something like this:
# Rule marker names specified in space-separated list neroads.rules=rule0 rule1 # global scale settings can be used so work is only performed within scale range of minScale/maxScale neroads.maxScale=1000000f # rule0 definition: # CLASS_RTE is a DBF column name neroads.rule0.key=CLASS_RTE # operation, if key value is less than 2 neroads.rule0.op=lt neroads.rule0.val=2 # If rule is met, then actions can be performed: # Column names can be added together in a label by specifying them in a space-separated list neroads.rule0.label=PREFIX PRETYPE NAME TYPE SUFFIX # Labels can have scale limits imposed, so they don't appear if map scale is # greater than maxScale or less than minScale neroads.rule0.label.maxScale=1000000 # Visibility can be controlled with respect to scale as well neroads.rule0.render.maxScale=1000000 # Rendering attributes can be specified. neroads.rule0.lineColor=FFFA73 neroads.rule0.lineWidth=4 neroads.rule0.mattingColor=55AAAAAA # rule1 definition: neroads.rule1.key=CLASS_RTE neroads.rule1.op=all neroads.rule1.label=PREFIX PRETYPE NAME TYPE SUFFIX neroads.rule1.label.maxScale=200000 neroads.rule1.render.maxScale=500000 neroads.rule1.lineColor=FFFFFF neroads.rule1.lineWidth=3 neroads.rule1.mattingColor=55AAAAAA # The render attribute is assumed to be true. You can hide OMGraphics by setting it to false.
Field Summary | |
---|---|
protected java.lang.String |
lastLabel
Used to help prevent consecutive repeat label values. |
Fields inherited from class com.bbn.openmap.OMComponent |
---|
i18n, propertyPrefix |
Fields inherited from class com.bbn.openmap.MapHandlerChild |
---|
beanContextChildSupport, isolated |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
---|---|
RuleHandler()
|
Method Summary | |
---|---|
void |
addRule(Rule rule)
|
void |
clearRules()
|
abstract Rule |
createRule()
Create a Rule object that knows how to interpret properties to create the proper indices into the record List. |
OMGraphic |
evaluate(OMGraphic omg,
OMGraphicList labelList,
Projection proj)
This is the main call that a layer would use to modify/update an OMGraphic based on dbf file contents. |
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent. |
abstract T |
getRecordDataForOMGraphic(OMGraphic omg)
Return a record Map for a particular OMGraphic, like a properties table. |
java.util.List<Rule> |
getRules()
|
boolean |
removeRule(Rule rule)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
void |
setRules(java.util.List<Rule> rules)
|
Methods inherited from class com.bbn.openmap.OMComponent |
---|
getPropertyInfo, getPropertyPrefix, setProperties, setPropertyPrefix |
Methods inherited from class com.bbn.openmap.MapHandlerChild |
---|
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String lastLabel
Constructor Detail |
---|
public RuleHandler()
Method Detail |
---|
public abstract Rule createRule()
public abstract T getRecordDataForOMGraphic(OMGraphic omg)
omg
- OMGraphic being queried
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMComponent
setProperties
in interface PropertyConsumer
setProperties
in class OMComponent
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
OMComponent
getProperties
in interface PropertyConsumer
getProperties
in class OMComponent
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.
public void setRules(java.util.List<Rule> rules)
public void addRule(Rule rule)
public boolean removeRule(Rule rule)
public void clearRules()
public java.util.List<Rule> getRules()
public OMGraphic evaluate(OMGraphic omg, OMGraphicList labelList, Projection proj)
omg
- the OMGraphic in questionlabelList
- an OMGraphicList to add the label to, so it gets
rendered on top.proj
- the current map projection, for scale appropriateness
determinations.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |