ilog.views.faces.component
Class IlvFacesView

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIGraphic
              extended by ilog.views.faces.component.IlvBasicView
                  extended by ilog.views.faces.component.IlvFacesView
All Implemented Interfaces:
IlvFacesComponent, IlvFacesConstants, IlvFrameworkConstants, Serializable, StateHolder
Direct Known Subclasses:
IltFacesGraphView, IlvFacesDashboardView, IlvFacesDHTMLView, IlvFacesDiagrammerView

public class IlvFacesView
extends IlvBasicView
implements IlvFrameworkConstants

This class defines a base view on which you can interact through interactors.

This view has two main modes: regular or tiled mode.

Each attribute of the view may have a slight different effect on the view depending of the selected mode.
The mode is determined by the tileSize property value. If this size is greater than 0, the view is in tiled mode, or in regular mode otherwise.
By default, the view is in regular mode.

Since:
JViews 6.5
See Also:
Serialized Form

Field Summary
static Double MAX_ZOOM_DEFAULT_VALUE
          The maximum zoom level.
static Double MIN_ZOOM_DEFAULT_VALUE
          The minimum zoom level.
static Double PAN_FACTOR_DEFAULT_VALUE
          The factor used when pan JavaScript actions are called (like panNorth, and so on)
static Double ZOOM_FACTOR_DEFAULT_VALUE
          The factor used when zoomIn or zoomOut JavaScript actions are called.
 
Fields inherited from class ilog.views.faces.component.IlvBasicView
DEFAULT_OBJECT_FINDER
 
Fields inherited from class javax.faces.component.UIGraphic
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Fields inherited from interface ilog.views.faces.IlvFrameworkConstants
ACTION_NAME, AUTO_REFRESH, BOUNDING_BOX, CONSTRAINED_ON_CONTENTS, INTERACTOR, INTERACTOR_ID, MAX_ZOOM_LEVEL, MIN_ZOOM_LEVEL, NB_BUTTONS, ORIENTATION, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, PAN_FACTOR, STATIC_LAYERS_COUNT, TILE_SIZE, VISIBLE_LAYERS, ZOOM_FACTOR, ZOOM_LEVELS
 
Fields inherited from interface ilog.views.faces.IlvFacesConstants
BUTTON_GROUP_ID, BUTTON_TYPE, CHARTS_BUNDLE, CORE_BUNDLE, CURSOR, DATA, DECODED_PROPERTY, DEFAULT_LINE_COLOR, DELETION_ALLOWED, DIAGRAMMER_BUNDLE, ENABLED, FILL_ON, FORCE_UPDATE_PROPERTIES, FRAMEWORK_BUNDLE, GANTT_BUNDLE, HEIGHT, IMAGE, IMAGE_MODE, INFO_PROVIDER_MB, INT_NOT_DEFINED, ITEM_DISABLED_STYLE_CLASS, ITEM_HIGHLIGHTED_STYLE_CLASS, ITEM_STYLE_CLASS, LINE_COLOR, LINE_WIDTH, MAPS_BUNDLE, MENU_MODEL_ID, MESSAGE, MESSAGE_BOX, MESSAGE_BOX_ID, MOVE_ALLOWED, OBJECT_FINDER, PARAM_COMPID, PARAM_DATA, PARAM_KEY, PARAM_NAMESPACE, PARAM_RESOURCE, PARAM_SERVICE, PARAM_TYPE, POPUP_MENU, POPUP_MENU_FACTORY, POPUP_MENU_FACTORY_CLASS, PORTLET_NAMESPACE, PROJECT, RESOURCES_PATH, RESOURCES_PATH_PREFIX, ROLLOVER_IMAGE, SELECTED, SELECTED_IMAGE, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVLET, SERVLET_CLASS, SERVLET_URL, STYLE, STYLE_CLASS, TGO_BUNDLE, TITLE, TOGGLE, VALUE, VIEW, VIEW_ID, WIDTH
 
Constructor Summary
IlvFacesView()
          Creates a new IlvFacesView instance.
 
Method Summary
 IlvRect getBoundingBox()
          Returns the bounding box of the displayed view in manager coordinate system.
 IlvObjectSelectedFinder getDefaultObjectFinder()
          Returns the default finder of this view.
 IlvFacesInteractor getInteractor()
          Returns the interactor currently set on this view.
 String getInteractorId()
          Returns the interactor identifier currently set on this view.
 double getMaxZoomLevel()
          Returns the maximum zoom level of the view when the zoom is free.
 double getMinZoomLevel()
          Returns the minimum zoom level of the view when the zoom is free.
 double getPanFactor()
          Returns the pan factor used in the client built-in pan actions.
 int getStaticLayersCount()
          Returns the number of static layers.
 int getTileSize()
          Returns the tile size.
 IlvManagerView getView()
          Returns the manager view that will be displayed by the view.
 ArrayList getVisibleLayers()
          Returns the visible manager layer names.
 double getZoomFactor()
          Returns the zoom factor used during client zoomIn and zoomOut actions.
 double[] getZoomLevels()
          Returns the fixed zoom levels displayed by the view.
 boolean isConstrainedOnContents()
          Returns whether the view is constrained to the manager content bounds or not.
 void processValidators(FacesContext context)
          
 void restoreState(FacesContext context, Object stateObj)
          Restores the state of this component from the stateObj parameter.
 Object saveState(FacesContext context)
          Returns the state of this component.
 void setBoundingBox(IlvRect boundingBox)
          Sets the view bounding box.
 void setConstrainedOnContents(boolean constrainedOnContents)
          Defines whether the view is constrained to the manager content bounds or not.
 void setInteractor(IlvFacesInteractor interactor)
          The interactor property.
 void setInteractorId(String interactorId)
          The interactor identifier property.
 void setMaxZoomLevel(double maxZoomLevel)
          Sets the maximum zoom level.
 void setMinZoomLevel(double minZoomLevel)
          Sets the minimum zoom level.
 void setPanFactor(double panFactor)
          The factor used in the client built-in pan actions.
 void setStaticLayersCount(int layersCount)
          Sets the number of static layers.
 void setTileSize(int tileSize)
          Sets the size of a tile.
 void setView(IlvManagerView view)
          Sets the manager view that will be displayed by the view.
 void setVisibleLayers(ArrayList visibleLayers)
          Sets the visible manager layer names.
 void setZoomFactor(double zoomFactor)
          Sets the factor used when zoomIn or zoomOut JavaScript actions are called.
 void setZoomLevels(double[] zoomLevels)
          Sets the fixed zoom levels displayed by the view.
 void updateModel(FacesContext context)
          This method updates the referenced values with the local values of the component if these values were updated from the client.
 
Methods inherited from class ilog.views.faces.component.IlvBasicView
clearDecodedPropertyMap, createFacesComponent, getAttributes, getComponentType, getData, getFamily, getHeight, getMessageBox, getMessageBoxId, getStyle, getStyleClass, getWidth, isDecodedProperty, processUpdates, resetDecodedProperties, setData, setDecodedProperty, setHeight, setMessageBox, setMessageBoxId, setStyle, setStyleClass, setWidth
 
Methods inherited from class javax.faces.component.UIGraphic
getUrl, getValue, getValueBinding, getValueExpression, setUrl, setValue, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZOOM_FACTOR_DEFAULT_VALUE

public static final Double ZOOM_FACTOR_DEFAULT_VALUE
The factor used when zoomIn or zoomOut JavaScript actions are called.


PAN_FACTOR_DEFAULT_VALUE

public static final Double PAN_FACTOR_DEFAULT_VALUE
The factor used when pan JavaScript actions are called (like panNorth, and so on)


MAX_ZOOM_DEFAULT_VALUE

public static final Double MAX_ZOOM_DEFAULT_VALUE
The maximum zoom level. This property is used if and only if the zoomLevels property is not used.

The default value is 10.

Since:
JViews 8.0

MIN_ZOOM_DEFAULT_VALUE

public static final Double MIN_ZOOM_DEFAULT_VALUE
The minimum zoom level. This property is used if and only if the zoomLevels property is not used.

The default value is 1 (fit to content).

Since:
JViews 8.1
Constructor Detail

IlvFacesView

public IlvFacesView()
Creates a new IlvFacesView instance.

Method Detail

getInteractor

public IlvFacesInteractor getInteractor()
Returns the interactor currently set on this view.

Returns:
The interactor.

setInteractor

public void setInteractor(IlvFacesInteractor interactor)
The interactor property.

Parameters:
interactor - The interactor to set.

getInteractorId

public String getInteractorId()
Returns the interactor identifier currently set on this view.

Returns:
The interactor ID.

setInteractorId

public void setInteractorId(String interactorId)
The interactor identifier property.

Parameters:
interactorId - The interactor ID to set.

getZoomFactor

public double getZoomFactor()
Returns the zoom factor used during client zoomIn and zoomOut actions.

The zoom is limited by the maxZoomLevel property.

This factor is used, if and only if, the zoom is free, for example, if the zoomLevel property is not set.

Returns:
The current zoom factor.

setZoomFactor

public void setZoomFactor(double zoomFactor)
Sets the factor used when zoomIn or zoomOut JavaScript actions are called.

This factor is used, if and only if, the zoom levels are free, for example, if the zoomLevel property is not set.

Parameters:
zoomFactor - The zoom factor to set.

getPanFactor

public double getPanFactor()
Returns the pan factor used in the client built-in pan actions.

Returns:
The current pan factor.

setPanFactor

public void setPanFactor(double panFactor)
The factor used in the client built-in pan actions.

Parameters:
panFactor - The panFactor to set.

getBoundingBox

public IlvRect getBoundingBox()
Returns the bounding box of the displayed view in manager coordinate system.

If this property is bound to a String bean property, this value is converted, if possible, in a valid IlvRect instance.

Returns:
The view bounding box.

setBoundingBox

public void setBoundingBox(IlvRect boundingBox)
Sets the view bounding box.

Note that the view may adapt this bounding box according to some constraints, such as fixed zoom levels.

Parameters:
boundingBox - The bounding box in the manager coordinate system.

setView

public void setView(IlvManagerView view)
Sets the manager view that will be displayed by the view.

Parameters:
view - The manager view to be displayed.

getView

public IlvManagerView getView()
                       throws Exception
Returns the manager view that will be displayed by the view.

Returns:
The manager view.
Throws:
Exception

getZoomLevels

public double[] getZoomLevels()
Returns the fixed zoom levels displayed by the view.

If the zoom levels are not specified, the zoom is only bound by the maxZoomLevel property.

Returns:
The zoom levels of this view.
Since:
JViews 8.0

setZoomLevels

public void setZoomLevels(double[] zoomLevels)
Sets the fixed zoom levels displayed by the view.

If the zoom levels are not specified, the zoom is only bound by the maxZoomLevel property.

Parameters:
zoomLevels - The zoom levels to set.
Since:
JViews 8.0

getMaxZoomLevel

public double getMaxZoomLevel()
Returns the maximum zoom level of the view when the zoom is free.

This property is used if, and only if, the zoomLevels property is not used.
The default value is 10.

Returns:
The max zoom level.
Since:
JViews 8.0

setMaxZoomLevel

public void setMaxZoomLevel(double maxZoomLevel)
Sets the maximum zoom level.

This property is used if, and only if, the zoomLevels property is not used.
The default value is 10.

Parameters:
maxZoomLevel - The max zoom level to set.
Since:
JViews 8.0

getMinZoomLevel

public double getMinZoomLevel()
Returns the minimum zoom level of the view when the zoom is free.

This property is used if, and only if, the zoomLevels property is not used.
The default value is 1.

Returns:
The min zoom level.
Since:
JViews 8.1

setMinZoomLevel

public void setMinZoomLevel(double minZoomLevel)
Sets the minimum zoom level.

This property is used if, and only if, the zoomLevels property is not used.
The default value is 1.

Parameters:
minZoomLevel - The min zoom level to set.
Since:
JViews 8.1

getTileSize

public int getTileSize()
Returns the tile size. If the tile size is greater than or equal to 0, the view will be in tiled mode. Otherwise, the view is in regular mode.

By default the tile size is -1, which means that tiled mode is disabled.

Returns:
The tile size of a tiled view or a negative number.
Since:
JViews 8.0

setTileSize

public void setTileSize(int tileSize)
Sets the size of a tile. If the tile size is greater than or equal to 0, the view will be set in tiled mode.

The tile size must be carefully chosen for performance reasons.
See the dedicated section of the user manual for more information.

Parameters:
tileSize - The tile size to set.
Since:
JViews 8.0
See Also:
getTileSize()

getStaticLayersCount

public int getStaticLayersCount()
Returns the number of static layers. In tiled view mode the static layers are tiled, as opposed to dynamic layers, which are drawn on top of them. This number represents the count of layers at the bottom of the view that are considered to be static. The default value is zero.

Returns:
The number of static layers.
Since:
JViews 8.0

setStaticLayersCount

public void setStaticLayersCount(int layersCount)
Sets the number of static layers. In tiled view mode the static layers are tiled, as opposed to dynamic layers, which are drawn on top of them. This number represents the count of layers at the bottom of the view that are considered to be static.

Parameters:
layersCount - The number of static layers.
Since:
JViews 8.0
See Also:
getStaticLayersCount()

setVisibleLayers

public void setVisibleLayers(ArrayList visibleLayers)
Sets the visible manager layer names.

This property controls the manager layers that are visible. If the view is in tiled mode, manipulating only dynamic layer visibility is mandatory. Static layers are meant to be cached and must not be updated.

Parameters:
visibleLayers - The visible layer name list to set.
Since:
JViews 8.0

getVisibleLayers

public ArrayList getVisibleLayers()
Returns the visible manager layer names.

This property controls the manager layers that are visible. If the view is in tiled mode, manipulating only dynamic layer visibilty is mandatory. Static layers are meant to be cached and must not be updated.

Returns:
The visibleLayers.
Since:
JViews 8.0

isConstrainedOnContents

public boolean isConstrainedOnContents()
Returns whether the view is constrained to the manager content bounds or not. The default value is true.

Note that zoom levels (set by minZoomLevel or zoomLevels) lower than 1 will not be allowed if this property is set to true.

Returns:
Returns whether the view is constrained or not.
Since:
JViews 8.1

setConstrainedOnContents

public void setConstrainedOnContents(boolean constrainedOnContents)
Defines whether the view is constrained to the manager content bounds or not. The default value is true.

Note that zoom levels (set by minZoomLevel or zoomLevels) lower than 1 will not be allowed if this property is set to true.

Parameters:
constrainedOnContents - Defines whether the view is constrained or not.
Since:
JViews 8.1

processValidators

public void processValidators(FacesContext context)

Overrides:
processValidators in class UIComponentBase
Internal method or field: do not use!

getDefaultObjectFinder

public IlvObjectSelectedFinder getDefaultObjectFinder()
Returns the default finder of this view.

Overrides:
getDefaultObjectFinder in class IlvBasicView
Returns:
The default finder, if any, or null.
Since:
JViews 7.5
Internal method or field: do not use!

updateModel

public void updateModel(FacesContext context)
This method updates the referenced values with the local values of the component if these values were updated from the client.

Overrides:
updateModel in class IlvBasicView
Parameters:
context - The current faces context.

saveState

public Object saveState(FacesContext context)
Returns the state of this component.

Specified by:
saveState in interface IlvFacesComponent
Specified by:
saveState in interface StateHolder
Overrides:
saveState in class IlvBasicView
Parameters:
context - The current faces context.
Returns:
The state of this component.

restoreState

public void restoreState(FacesContext context,
                         Object stateObj)
Restores the state of this component from the stateObj parameter.

Specified by:
restoreState in interface IlvFacesComponent
Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class IlvBasicView
Parameters:
context - The current faces context.
stateObj - The previously saved state of this component.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.