com.esri.adf.web.faces.component
Class OverviewControl

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by com.esri.adf.web.faces.component.OverviewControl
All Implemented Interfaces:
Serializable, EventListener, javax.faces.component.ActionSource, javax.faces.component.ActionSource2, javax.faces.component.StateHolder, javax.faces.event.ActionListener, javax.faces.event.FacesListener

public class OverviewControl
extends javax.faces.component.UICommand
implements javax.faces.event.ActionListener, Serializable

The overview control is similar to a map control. However, the purpose of the overview map is to provide a point of reference for the area displayed on its associated map control. The overview control always shows the map at full extent. A small box on the overview map represents the currently displayed area on its associated map control. You can interactively move this box around to pan the area displayed in the map control.
The overview control works with WebOverview object. The actual WebOverview object is created by the parent context control. The OverviewEvent object is used by the control to extract the point on the overview map to center the overview rectangle. The OverviewRenderer class renders the control to the appropriate markup, and the OverviewTag class exposes the control as a JSP custom tag named overview.

See Also:
Serialized Form

Field Summary
static String COMPONENT_FAMILY
          The standard component family for this component.
static String COMPONENT_TYPE
          The standard component type for this component.
static String DEFAULT_XSL_FILE_NAME
          The name of the XSL file used to render this control by default.
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
OverviewControl()
          Initializes the OverviewControl.
 
Method Summary
 String getFamily()
          Returns the family of this control.
 int getHeight()
          Returns the height of the control.
 String getLineColor()
          Returns the color of the line.
 int getLineWidth()
          Returns the width of the line.
 String getMapId()
          Returns the map control id associated with the control.
protected  javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context)
          Returns a design-time renderer if the component is used in an IDE.
 String getStaticImageUrl()
          Returns the URL of the image to be used in overview map.
 String getStyle()
          Returns the style attributes of toolbar control.
 String getStyleClass()
          Returns the file name where the CSS style attributes are defined.
 WebOverview getWebOverview()
          Returns the WebOverview object associated with this control.
 int getWidth()
          Returns the width of the control.
 URL getXslUrl()
          Returns the URL of the XSL file used to render the control.
 boolean isClientPostBack()
          Indicates whether the control supports client side post back.
 boolean isInit()
          Returns an indicator whether this control is initialized.
 void processAction(javax.faces.event.ActionEvent event)
          Processes an action fired by this control.
 void processUpdates(javax.faces.context.FacesContext facesContext)
           
 OverviewEvent queueOverviewEvent(javax.faces.context.FacesContext facesContext, int mode, int minX, int minY, int maxX, int maxY)
          Set the event arguments passed by the client and queues the action event.
 void restoreState(javax.faces.context.FacesContext facesContext, Object state)
          Restores the state of the control.
 Object saveState(javax.faces.context.FacesContext facesContext)
          Saves the state of this control.
 void setClientPostBack(boolean clientPostBack)
          Sets whether the control supports client side post back.
 void setHeight(int height)
          Sets the height of the control.
 void setInit(boolean init)
          Sets an indicator whether to initialize the control.
 void setLineColor(String lineColor)
          Sets the line color for this control.
 void setLineWidth(int lineWidth)
          Sets the line width for this control.
 void setMapId(String mapControlId)
          Sets the map control id associated with the control.
 void setStaticImageUrl(String staticImageUrl)
          Sets the URL of the image to be used in overview map.
 void setStyle(String style)
          Sets the default style for the toolbar control.
 void setStyleClass(String styleClass)
          Sets the CSS class name where the CSS style attributes are defined.
 void setValueExpression(String name, javax.el.ValueExpression binding)
          Sets the value binding.
 void setWidth(int width)
          Sets the width of the control to be displayed.
 void setXslUrl(URL xslUrl)
          Sets the URL of the XSL file used to render the control.
 
Methods inherited from class javax.faces.component.UICommand
addActionListener, broadcast, getAction, getActionExpression, getActionListener, getActionListeners, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
The standard component family for this component.

See Also:
Constant Field Values

COMPONENT_TYPE

public static final String COMPONENT_TYPE
The standard component type for this component.

See Also:
Constant Field Values

DEFAULT_XSL_FILE_NAME

public static final String DEFAULT_XSL_FILE_NAME
The name of the XSL file used to render this control by default.

See Also:
Constant Field Values
Constructor Detail

OverviewControl

public OverviewControl()
Initializes the OverviewControl. The renderer type is set and the control is registered as an ActionListener.

Method Detail

getFamily

public String getFamily()
Returns the family of this control.

Overrides:
getFamily in class javax.faces.component.UICommand
Returns:
String- the COMPONENT_FAMILY

getRenderer

protected javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context)
Returns a design-time renderer if the component is used in an IDE.

Overrides:
getRenderer in class javax.faces.component.UIComponentBase
Parameters:
context - the FacesContext
Returns:
Renderer- the renderer object

processAction

public void processAction(javax.faces.event.ActionEvent event)
                   throws javax.faces.event.AbortProcessingException
Processes an action fired by this control. The overview control delegates processing of this action to the handleEvent method of the WebOverview.

Specified by:
processAction in interface javax.faces.event.ActionListener
Parameters:
event - the ActionEvent
Throws:
javax.faces.event.AbortProcessingException - if the action can not be processed

queueOverviewEvent

public OverviewEvent queueOverviewEvent(javax.faces.context.FacesContext facesContext,
                                        int mode,
                                        int minX,
                                        int minY,
                                        int maxX,
                                        int maxY)
Set the event arguments passed by the client and queues the action event. A new OverviewEvent is created and populated with the event arguments containing the WebContext and the coordinate to center at.

Parameters:
facesContext - the FacesContext
mode - the action to perform in the map control
minX - the minx value in screen coordinates
minY - the miny value in screen coordinates
maxX - the maxx value in screen coordinates
maxY - the maxy value in screen coordinates
Returns:
OverviewEvent- the overview event arguments

getWebOverview

public WebOverview getWebOverview()
Returns the WebOverview object associated with this control.

Returns:
WebOverview- the WebOverview

setInit

public void setInit(boolean init)
Sets an indicator whether to initialize the control.

Parameters:
init - if true, initialize the control

isInit

public boolean isInit()
Returns an indicator whether this control is initialized.

Returns:
boolean- if true, the control is initialized

setValueExpression

public void setValueExpression(String name,
                               javax.el.ValueExpression binding)
Sets the value binding. For the "value" attribute it checks if it is an instanceof WebOverview or not. If not, it throws an ADFException. For all other cases, it simply calls super.setValueBinding()

Overrides:
setValueExpression in class javax.faces.component.UIComponent
Parameters:
name - the name of the attribute or property for which to set a ValueBinding
binding - the ValueBinding to set. If null, remove any currently set ValueBinding.

getMapId

public String getMapId()
Returns the map control id associated with the control.

Returns:
String - the map control id

setMapId

public void setMapId(String mapControlId)
Sets the map control id associated with the control.

Parameters:
mapControlId - the map control id.

setWidth

public void setWidth(int width)
Sets the width of the control to be displayed.

Parameters:
width - the width in pixels

getWidth

public int getWidth()
Returns the width of the control.

Returns:
int- the width in pixels

setHeight

public void setHeight(int height)
Sets the height of the control.

Parameters:
height - the height in pixels

getHeight

public int getHeight()
Returns the height of the control.

Returns:
int- the height in pixels

setXslUrl

public void setXslUrl(URL xslUrl)
Sets the URL of the XSL file used to render the control.

Parameters:
xslUrl - the URL of the XSL file

getXslUrl

public URL getXslUrl()
Returns the URL of the XSL file used to render the control.

Returns:
URL- the URL object

getStyle

public String getStyle()
Returns the style attributes of toolbar control.

Returns:
String- the style attributes

setStyle

public void setStyle(String style)
Sets the default style for the toolbar control.

Parameters:
style - the default style for the toolbar control

getStyleClass

public String getStyleClass()
Returns the file name where the CSS style attributes are defined.

Returns:
String- the CSS class

setStyleClass

public void setStyleClass(String styleClass)
Sets the CSS class name where the CSS style attributes are defined.

Parameters:
styleClass - the CSS class

isClientPostBack

public boolean isClientPostBack()
Indicates whether the control supports client side post back.

Returns:
boolean- if true, the client side post back is supported

setClientPostBack

public void setClientPostBack(boolean clientPostBack)
Sets whether the control supports client side post back.

Parameters:
clientPostBack - if true, the client side post back is supported

setLineColor

public void setLineColor(String lineColor)
Sets the line color for this control.

Parameters:
lineColor - an HTML color string

getLineColor

public String getLineColor()
Returns the color of the line.

Returns:
String- the line color

setLineWidth

public void setLineWidth(int lineWidth)
Sets the line width for this control.

Parameters:
lineWidth - the line width in pixels

getLineWidth

public int getLineWidth()
Returns the width of the line.

Returns:
int- the line width

setStaticImageUrl

public void setStaticImageUrl(String staticImageUrl)
Sets the URL of the image to be used in overview map. The image must represent the full extent of the main map. If URL is not specified, the services associated with WebMap are used to generate the image.
 For Example,
   overview.setStaticImageUrl("http://localhost/mycontext/images/overview.png");
        [OR}
   overview.setStaticImageUrl("/images/overview.png");
 

Parameters:
staticImageUrl - the URL of the static image.

getStaticImageUrl

public String getStaticImageUrl()
Returns the URL of the image to be used in overview map.

Returns:
the static image URL of the overview map

saveState

public Object saveState(javax.faces.context.FacesContext facesContext)
Saves the state of this control.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UICommand
Parameters:
facesContext - the associated FacesContext
Returns:
Object- the object to be saved

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         Object state)
Restores the state of the control.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UICommand
Parameters:
facesContext - the associated FacesContext
state - the object to restore the state of the control from

processUpdates

public void processUpdates(javax.faces.context.FacesContext facesContext)
Overrides:
processUpdates in class javax.faces.component.UIComponentBase