com.bbn.openmap
Class StandardMapBeanRepaintPolicy

java.lang.Object
  extended by com.bbn.openmap.MapHandlerChild
      extended by com.bbn.openmap.OMComponent
          extended by com.bbn.openmap.StandardMapBeanRepaintPolicy
All Implemented Interfaces:
LightMapHandlerChild, MapBeanRepaintPolicy, PropertyConsumer, SoloMapComponent, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
HintsMapBeanRepaintPolicy

public class StandardMapBeanRepaintPolicy
extends OMComponent
implements MapBeanRepaintPolicy, SoloMapComponent, java.lang.Cloneable

A MapBeanRepaintPolicy that just forwards layer repaint requests normally, and does nothing for java.awt.Graphics before painting. If this class or any subclass of it is added to the MapHandler, it will find the MapBean and set itself on it.

A StandardMapBeanRepaintPolicy is automatically set in the MapBean, so you don't have to add one of these to the MapHandler. The OMComponent inheritance is here to make it easier for subclasses to be added and for properties to be set.


Field Summary
protected  boolean DEBUG
           
protected  MapBean map
           
 
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
StandardMapBeanRepaintPolicy()
           
StandardMapBeanRepaintPolicy(MapBean mb)
           
 
Method Summary
 java.lang.Object clone()
          Provide a configured copy (except for the MapBean).
 void findAndInit(java.lang.Object someObj)
          If a MapBean is passed to this StandardMapBeanRepaintPolicy, it will set itself on it.
 void findAndUndo(java.lang.Object someObj)
          If a MapBean is passed to this StandardMapBeanRepaintPolicy, it will check if it is the repaint policy set on the MapBean and if so, remove itself from it.
 MapBean getMap()
           
 java.awt.Graphics modifyGraphicsForPainting(java.awt.Graphics graphics)
          A hook for the RepaintPolicy to make any adjustments to the java.awt.Graphics object before sending the Graphics object to the layers for painting.
 void repaint(Layer layer)
          Take some action based on a repaint request from this particular layer.
 void setMap(MapBean mb)
          Set the MapBean to call repaint on when a layer requests it.
 
Methods inherited from class com.bbn.openmap.OMComponent
getProperties, getPropertyInfo, getPropertyPrefix, setProperties, setProperties, setPropertyPrefix
 
Methods inherited from class com.bbn.openmap.MapHandlerChild
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected MapBean map

DEBUG

protected boolean DEBUG
Constructor Detail

StandardMapBeanRepaintPolicy

public StandardMapBeanRepaintPolicy()

StandardMapBeanRepaintPolicy

public StandardMapBeanRepaintPolicy(MapBean mb)
Method Detail

setMap

public void setMap(MapBean mb)
Description copied from interface: MapBeanRepaintPolicy
Set the MapBean to call repaint on when a layer requests it.

Specified by:
setMap in interface MapBeanRepaintPolicy

getMap

public MapBean getMap()

repaint

public void repaint(Layer layer)
Take some action based on a repaint request from this particular layer. The StandardMapBeanRepaintPolicy just forwards requests on.

Specified by:
repaint in interface MapBeanRepaintPolicy

modifyGraphicsForPainting

public java.awt.Graphics modifyGraphicsForPainting(java.awt.Graphics graphics)
A hook for the RepaintPolicy to make any adjustments to the java.awt.Graphics object before sending the Graphics object to the layers for painting. Gives the policy a chance to make rendering hint changes on Graphic2D objects, setting anti-aliasing configurations, etc. No modifications are made.

Specified by:
modifyGraphicsForPainting in interface MapBeanRepaintPolicy

findAndInit

public void findAndInit(java.lang.Object someObj)
If a MapBean is passed to this StandardMapBeanRepaintPolicy, it will set itself on it.

Specified by:
findAndInit in interface LightMapHandlerChild
Overrides:
findAndInit in class MapHandlerChild

findAndUndo

public void findAndUndo(java.lang.Object someObj)
If a MapBean is passed to this StandardMapBeanRepaintPolicy, it will check if it is the repaint policy set on the MapBean and if so, remove itself from it.

Specified by:
findAndUndo in interface LightMapHandlerChild
Overrides:
findAndUndo in class MapHandlerChild

clone

public java.lang.Object clone()
Description copied from interface: MapBeanRepaintPolicy
Provide a configured copy (except for the MapBean).

Specified by:
clone in interface MapBeanRepaintPolicy
Overrides:
clone in class java.lang.Object


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details