oracle.adf.view.faces.bi.model
Class GeoMapDataModel
java.lang.Object
javax.faces.model.DataModel
org.apache.myfaces.trinidad.model.CollectionModel
oracle.adf.view.faces.bi.model.GeoMapDataModel
- All Implemented Interfaces:
- org.apache.myfaces.trinidad.model.RowKeyIndex
public class GeoMapDataModel
- extends org.apache.myfaces.trinidad.model.CollectionModel
Data for each map theme is abstracted in an instance of a GeoMapDataModel.
Users can create their own custom GeoMapDataModel theme data. The examples below
show how to create custom color, bar/pie chart, point, and geocoded point themes.
For each type of theme, the various data values and labels are defined within
GeoRowObjects, and then these GeoRowObjects are used to populate a GeoMapDataModel.
The example data assumes use of the MAP_STATES_NAME theme name.
// Color Theme
String rowId = "Row1";
String location = "New Jersey";
String locationLabel = "The Garden State";
String itemIds[] = new String[]{"Item1"};
String itemLabels[] = new String[]{"Sales"};
Double value[] = new Double[]{10000.0};
String formattedValue[] = new String[]{"$10000.0"};
GeoObject key = new GeoObject(rowId, location, locationLabel);
GeoRowObject rowObj = new GeoRowObject(key, itemIds, itemLabels, value, formattedValue);
// Bar/Pie Theme
String rowId = "Row1";
String location = "New Jersey";
String locationLabel = "The Garden State";
String itemIds[] = new String[]{"Item1", "Item2", "Item3", "Item4"};
String itemLabels[] = new String[]{"IPod Sales", "DVD Sales", "TV Sales", "Video Game Sales"};
Double value[] = new Double[]{10000.0, 20000.0, 30000.0, 40000.0};
String formattedValue[] = new String[]{"$10000.0", "$20000.0", "$30000.0", "$40000.0"};
GeoObject key = new GeoObject(rowId, location, locationLabel);
GeoRowObject rowObj = new GeoRowObject(key, itemIds, itemLabels, value, formattedValue);
// Point Theme
String rowId = "Row1";
String itemIds[] = new String[]{"Item1"};
String itemLabels[] = new String[]{"Sales"};
String locationLabel = "Example Point";
Double value[] = new Double[]{10000.0};
String formattedValue[] = new String[]{"$10000.0"};
double longitude = -122.0;
double latitude = 45.0;
GeoObject key = new GeoObject(rowId, locationLabel, longitude, latitude);
GeoRowObject rowObj = new GeoRowObject(key, itemIds, itemLabels, value, formattedValue);
// Geocoded Point Theme
String rowId = "Row1";
String itemIds[] = new String[]{"Item1"};
String itemLabels[] = new String[]{"Sales"};
String locationLabel = "Oracle";
String countryCode = "USA";
String address = "500 Oracle Parkway\nRedwood City, CA";
Double value[] = new Double[]{10000.0};
String formattedValue[] = new String[]{"$10000.0"};
GeocodedObject geoAddress = new GeocodedObject(locationLabel, rowId, countryCode, address);
GeoRowObject rowObj = new GeoRowObject(geoAddress, itemIds, itemLabels, value, formattedValue);
// Add the rows to an ArrayList
ArrayList data = new ArrayList();
data.add(rowObj);
data.add(...row2...);
// Populating the GeoMapDataModel
// Note that each theme must have its own GeoMapDataModel
// Do not mix GeoRowObjects configured for different themes together
GeoMapDataModel model = new GeoMapDataModel();
model.setWrappedData(data);
Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel |
getRowData, getSortCriteria, isRowAvailable, isSortable, setSortCriteria |
Methods inherited from class javax.faces.model.DataModel |
addDataModelListener, getDataModelListeners, removeDataModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MATCHMODE_EXACT
public static final int MATCHMODE_EXACT
- See Also:
- Constant Field Values
MATCHMODE_RELAX
public static final int MATCHMODE_RELAX
- See Also:
- Constant Field Values
m_arrList
protected java.util.ArrayList m_arrList
GeoMapDataModel
public GeoMapDataModel()
getRowKey
public java.lang.Object getRowKey()
- Specified by:
getRowKey
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
getRowKey
in class org.apache.myfaces.trinidad.model.CollectionModel
setRowKey
public void setRowKey(java.lang.Object object)
- Specified by:
setRowKey
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
setRowKey
in class org.apache.myfaces.trinidad.model.CollectionModel
isRowAvailable
public boolean isRowAvailable()
- Specified by:
isRowAvailable
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
isRowAvailable
in class javax.faces.model.DataModel
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
getRowCount
in class javax.faces.model.DataModel
getRowData
public java.lang.Object getRowData()
- Specified by:
getRowData
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
getRowData
in class javax.faces.model.DataModel
getRowIndex
public int getRowIndex()
- Specified by:
getRowIndex
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
getRowIndex
in class javax.faces.model.DataModel
setRowIndex
public void setRowIndex(int i)
- Specified by:
setRowIndex
in interface org.apache.myfaces.trinidad.model.RowKeyIndex
- Specified by:
setRowIndex
in class javax.faces.model.DataModel
getWrappedData
public java.lang.Object getWrappedData()
- Specified by:
getWrappedData
in class javax.faces.model.DataModel
getArrayList
public java.util.ArrayList getArrayList()
setWrappedData
public void setWrappedData(java.lang.Object object)
- Specified by:
setWrappedData
in class javax.faces.model.DataModel
setAddressMatchMode
public void setAddressMatchMode(int mode)
getAddressMatchMode
public int getAddressMatchMode()
setMaxValues
public void setMaxValues(double[] maxValues)
getMaxValues
public double[] getMaxValues()
setMinValues
public void setMinValues(double[] minValues)
getMinValues
public double[] getMinValues()
getJoinColumns
public java.lang.String getJoinColumns()
setJoinColumns
public void setJoinColumns(java.lang.String joinColumns)
calculateMinMaxValues
public void calculateMinMaxValues()
Copyright © 1997, 2009, Oracle. All rights reserved.