|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ontimize.util.gis.client.utils.GisViewerUtilities
public class GisViewerUtilities
Static methods useful for the gis map viewer
| Field Summary | |
|---|---|
static java.util.HashMap<java.lang.String,java.awt.Cursor> |
cursorsMap
Static map used to store the cursor for the application GIS panels |
| Constructor Summary | |
|---|---|
GisViewerUtilities()
|
|
| Method Summary | |
|---|---|
static org.opengis.filter.Filter |
buildAndFilter(org.opengis.filter.Filter filterA,
org.opengis.filter.Filter filterB)
Build an AND operation filter using the given filters |
static org.jdesktop.animation.timing.Animator |
buildAnimator(org.jdesktop.animation.timing.TimingTarget target,
int time,
int resolution,
float acceleration,
float deceleration)
|
static java.lang.Object |
buildFilterForLayer(int filterType,
java.lang.String[] filteredFields,
java.lang.Object[] filteredValues)
Build a filter instance |
static org.opengis.filter.Filter |
buildOrFilter(org.opengis.filter.Filter filterA,
org.opengis.filter.Filter filterB)
Build an OR operation filter using the given filters |
static double |
calculateMaxExpansion(java.util.List<IGisLayer> layers,
double pixelSize)
Calculates the maximum expansion for the given layers in order to improve the GIS panel repaint methods |
static double |
calculateMaxExpansionForLayer(IGisLayer layer,
double pixelSize)
Calculates the maximum expansion for the given layer in order to improve the GIS panel repaint methods |
static boolean |
checkIfRecordIsInCurrentData(java.util.Hashtable recordToInsert,
java.util.List<java.util.Hashtable> actualData)
|
static com.vividsolutions.jts.geom.Envelope |
configureMapArea(java.awt.Rectangle oldRect,
java.awt.Rectangle newRect,
com.vividsolutions.jts.geom.Envelope boundingBox)
Get the map area corresponding to the new map panel bounds |
static java.awt.image.BufferedImage |
convertGrayScaleToColor(java.awt.image.BufferedImage image)
|
static int |
countTotalObjects(java.util.Hashtable<java.lang.String,java.util.List> data)
Count the total elements overlapped on the same point |
static java.awt.image.BufferedImage |
createBuffer(java.awt.image.BufferedImage buffImage)
Create an opaque buffered image with the same dimension as the buffImage parameters |
static java.awt.image.BufferedImage |
createBuffer(java.awt.Dimension dimension)
Create an opaque buffered image with the same size as the given dimension parameter |
static java.awt.image.BufferedImage |
createBuffer(int width,
int height)
Create an opaque buffered image with the given dimension |
static java.awt.image.BufferedImage |
createBuffer(java.awt.Rectangle rectangle)
Create an opaque buffered image with the same size as the given rectangle parameter |
static java.awt.image.VolatileImage |
createVolatile(int width,
int height)
Create a volatile image with the given dimension |
static java.util.Hashtable<java.lang.String,java.util.List> |
deleteDuplicateValues(java.util.Hashtable<java.lang.String,java.util.List> selectedData)
Delete duplicate values from the given selected data |
static void |
drawRectangle(java.awt.Graphics2D g2d,
java.awt.Color rectColor,
float alpha,
int x,
int y,
int width,
int height)
|
static void |
drawRectangle(java.awt.Graphics2D g2d,
java.awt.Color rectColor,
float alpha,
java.awt.Rectangle bounds)
|
static void |
drawSelectorCenterElement(java.awt.Graphics2D g2d,
float alpha,
java.awt.Color fillColor,
java.awt.Color borderColor,
float strokeWidth,
int[] location,
int radius)
|
static void |
drawSelectorElement(java.awt.Graphics2D g2d,
float alpha,
java.awt.Color fillColor,
java.awt.Color borderColor,
float strokeWidth,
int[] location,
int radius)
|
static void |
drawSelectorTipText(java.awt.Graphics2D g2d,
java.lang.String tipText,
java.awt.Color haloColor,
java.awt.Color textColor,
float strokeWidth,
int[] location,
double radius,
double angle,
int textSize)
|
static boolean |
evaluateFilter(org.opengis.filter.Filter filter,
java.util.Map<java.lang.String,java.lang.Object> recordValues)
Evaluate the filter with the given data |
static boolean |
evaluateFilterArray(org.opengis.filter.Filter[] filterArray,
java.util.Map<java.lang.String,java.lang.Object> recordValues)
Check if the given values pass the defined filter array |
static boolean |
evaluateFilters(IGisLayer layer,
java.util.Hashtable<java.lang.String,java.lang.Object> recordValues)
Evaluate the layer defined filters for the given data |
static java.util.List<java.util.Hashtable> |
expandSelectionByDistance(java.util.List<java.util.Hashtable> layerData,
java.util.List<java.util.Hashtable> selectedData,
IGisLayer selectionLayer,
double distance)
|
static void |
fillGraphics(java.awt.Graphics2D g2d,
java.awt.Color fillColor,
float alpha,
int width,
int height)
|
static void |
fillGraphics(java.awt.Graphics2D g2d,
java.awt.Color fillColor,
int width,
int height)
|
static java.awt.Graphics2D |
fillImageAndGetGraphics(java.awt.image.BufferedImage buffImage,
java.awt.Color fillColor)
|
static java.awt.Graphics2D |
fillImageAndGetGraphics(java.awt.image.BufferedImage buffImage,
java.awt.Color fillColor,
int width,
int height)
|
static com.vividsolutions.jts.geom.Envelope |
fixAspectRatio(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope mapArea)
Adjusts the given bounding box area to the given panel aspect ratio |
static java.awt.Cursor |
getAddCursor()
Get the "add" cursor |
static int[] |
getBBoxLowerRightCoordinate(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope panelBBox,
com.vividsolutions.jts.geom.Envelope dataBBox)
Gets the lower right coordinate of a given data bounding box in screen coordinates |
static java.awt.Rectangle |
getBBoxRectangle(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope panelBBox,
com.vividsolutions.jts.geom.Envelope dataBBox)
Gets the rectangle related to a given data bounding box in screen coordinates |
static int[] |
getBBoxUpperLeftCoordinate(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope panelBBox,
com.vividsolutions.jts.geom.Envelope dataBBox)
Gets the upper left coordinate of a given data bounding box in screen coordinates |
static java.awt.Rectangle |
getClipBoundsForEnvelope(com.vividsolutions.jts.geom.Envelope geomBBox,
com.vividsolutions.jts.geom.Envelope boundingBox,
java.awt.Rectangle panelRect)
Get the clip bounds for the given area inside the map viewer component |
static java.awt.Cursor |
getClosedHandCursor()
Get the "closed hand" cursor |
static com.vividsolutions.jts.geom.Envelope |
getEnvelopeForObject(int actualId,
int totalObjects,
com.vividsolutions.jts.geom.Envelope prevBBox,
double radius,
double pixelSize,
double initAngle)
Get translated envelope in order to paint the given element in the desired location of the multiple elements selector |
static com.vividsolutions.jts.geom.Envelope |
getEnvelopeToCenterView(com.vividsolutions.jts.geom.Envelope panelBounds,
java.awt.Rectangle viewerBounds)
Get the adjusted envelope for the map viewer panel with the given dimension and the new map area |
static com.vividsolutions.jts.geom.Envelope |
getEnvelopeToCenterView(java.awt.Rectangle panelBounds,
com.vividsolutions.jts.geom.Envelope boundingBox)
Get the new panel area obtained after applying the new bounds from parameter panelBounds |
static com.vividsolutions.jts.geom.Envelope |
getLayersBoundingBox(java.util.List<IGisLayer> layers,
int index)
|
static java.util.List<java.util.Hashtable> |
getMapAreaLayerData(java.lang.String layerAttribute,
com.vividsolutions.jts.geom.Envelope boundingBox,
java.util.Map viewerData)
Get the data from the given layer that is inside or overlapped wth the given map area |
static int[] |
getPanelLocation(double[] geoLocation,
com.vividsolutions.jts.geom.Envelope mapArea,
java.awt.Rectangle panelBounds)
Get the screen location corresponding to the given geographic location and map area |
static com.vividsolutions.jts.geom.Envelope |
getPanEnvelope(double stX,
double endX,
double stY,
double endY,
com.vividsolutions.jts.geom.Envelope boundingBox)
|
static java.util.Map |
getSmallerRasterMapCopy(java.util.Hashtable<java.lang.String,java.lang.Object> dataHT)
|
static java.awt.Cursor |
getViewerCursor(int viewerState)
Get the actual cursor for the map viewer |
static com.vividsolutions.jts.geom.Envelope |
getZoomOutEnvelope(double stX,
double endX,
double stY,
double endY,
com.vividsolutions.jts.geom.Envelope boundingBox)
|
static java.awt.image.VolatileImage |
paintVZoomIn(int[] mousePos,
float fraction,
java.awt.image.VolatileImage tempImage)
Paint zoom in effect corners for the given volatile image |
static java.awt.image.VolatileImage |
paintVZoomOut(int[] mousePos,
float fraction,
java.awt.image.VolatileImage tempImage)
Paint zoom out effect corners for the given volatile image |
static java.awt.image.BufferedImage |
paintZoomIn(int[] mousePos,
float fraction,
java.awt.image.BufferedImage tempImage)
Paint zoom in effect corners for the given buffered image |
static java.awt.image.BufferedImage |
paintZoomOut(int[] mousePos,
float fraction,
java.awt.image.BufferedImage tempImage)
Paint zoom out effect corners for the given buffered image |
static java.util.List<IGisLayer> |
reorderLayersToPreference(java.lang.String[] layersOrder,
java.util.List<IGisLayer> layers)
Adjust the actual gis viewer layers list order to the order saved on remote preferences |
static void |
saveLayersOrderPreference(IGisViewer gisViewer)
Save actual gis viewer layers order on remote preferences |
static void |
saveVisibleLayersPreference(IGisViewer gisViewer)
Save actual gis viewer visible layers on remote preferences |
static java.util.List<IGisLayer> |
setVisibleLayersByPreferences(java.lang.String[] layersVisible,
java.lang.String[] layersNotVisible,
java.util.List<IGisLayer> layers)
Adjust the actual gis viewer visible layers to the list saved on remote preferences |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.HashMap<java.lang.String,java.awt.Cursor> cursorsMap
| Constructor Detail |
|---|
public GisViewerUtilities()
| Method Detail |
|---|
public static com.vividsolutions.jts.geom.Envelope getEnvelopeToCenterView(com.vividsolutions.jts.geom.Envelope panelBounds,
java.awt.Rectangle viewerBounds)
panelBounds - New map viewer bounding boxviewerBounds - Actual map viewer component dimension
public static com.vividsolutions.jts.geom.Envelope getEnvelopeToCenterView(java.awt.Rectangle panelBounds,
com.vividsolutions.jts.geom.Envelope boundingBox)
panelBounds
panelBounds - New panel boundsboundingBox - Map panel actual area
public static java.util.List<java.util.Hashtable> getMapAreaLayerData(java.lang.String layerAttribute,
com.vividsolutions.jts.geom.Envelope boundingBox,
java.util.Map viewerData)
layerAttribute - Layer attributeboundingBox - Map area to obtain dataviewerData - All data contained on the map viewer
public static java.awt.image.BufferedImage createBuffer(java.awt.image.BufferedImage buffImage)
buffImage - Image used to set new image dimension
public static java.awt.image.BufferedImage createBuffer(java.awt.Rectangle rectangle)
rectangle - Rectangle to indicate the desired image size
public static java.awt.image.BufferedImage createBuffer(java.awt.Dimension dimension)
dimension - Dimension to indicate the desired image size
public static java.awt.image.BufferedImage createBuffer(int width,
int height)
width - Image widthheight - Image height
public static java.awt.image.VolatileImage createVolatile(int width,
int height)
width - Image widthheight - Image height
public static java.awt.image.BufferedImage paintZoomIn(int[] mousePos,
float fraction,
java.awt.image.BufferedImage tempImage)
mousePos - Mouse position on zooming in event actionfraction - Fraction of the current zoom animationtempImage - Image to paint on
public static java.awt.image.VolatileImage paintVZoomIn(int[] mousePos,
float fraction,
java.awt.image.VolatileImage tempImage)
mousePos - Mouse position on zooming in event actionfraction - Fraction of the current zoom animationtempImage - Image to paint on
public static java.awt.image.BufferedImage paintZoomOut(int[] mousePos,
float fraction,
java.awt.image.BufferedImage tempImage)
mousePos - Mouse position on zooming out event actionfraction - Fraction of the current zoom animationtempImage - Image to paint on
public static java.awt.image.VolatileImage paintVZoomOut(int[] mousePos,
float fraction,
java.awt.image.VolatileImage tempImage)
mousePos - Mouse position on zooming out event actionfraction - Fraction of the current zoom animationtempImage - Image to paint on
public static com.vividsolutions.jts.geom.Envelope configureMapArea(java.awt.Rectangle oldRect,
java.awt.Rectangle newRect,
com.vividsolutions.jts.geom.Envelope boundingBox)
oldRect - Previous panel boundsnewRect - New panel boundsboundingBox - Previous panel map bounding box
public static boolean evaluateFilters(IGisLayer layer,
java.util.Hashtable<java.lang.String,java.lang.Object> recordValues)
layer - Gis layer instancerecordValues - Data to validate
public static boolean evaluateFilter(org.opengis.filter.Filter filter,
java.util.Map<java.lang.String,java.lang.Object> recordValues)
filter - Filter instancerecordValues - Data to validate
public static boolean evaluateFilterArray(org.opengis.filter.Filter[] filterArray,
java.util.Map<java.lang.String,java.lang.Object> recordValues)
filterArray - Filter arrayrecordValues - Record to evaluate
public static org.opengis.filter.Filter buildAndFilter(org.opengis.filter.Filter filterA,
org.opengis.filter.Filter filterB)
filterA - Left filter for the AND operationfilterB - Right filter for the AND operation
public static org.opengis.filter.Filter buildOrFilter(org.opengis.filter.Filter filterA,
org.opengis.filter.Filter filterB)
filterA - Left filter for the OR operationfilterB - Right filter for the OR operation
public static java.lang.Object buildFilterForLayer(int filterType,
java.lang.String[] filteredFields,
java.lang.Object[] filteredValues)
filterType - Filter typefilteredFields - Layer fields to filtersfilteredValues - Values for filter creation
public static com.vividsolutions.jts.geom.Envelope fixAspectRatio(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope mapArea)
r - Bounds of the panelmapArea - Bounding box to adjust
public static int[] getBBoxUpperLeftCoordinate(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope panelBBox,
com.vividsolutions.jts.geom.Envelope dataBBox)
r - Bounds of the map panelpanelBBox - Panel bounding boxdataBBox - Data bounding box
public static int[] getBBoxLowerRightCoordinate(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope panelBBox,
com.vividsolutions.jts.geom.Envelope dataBBox)
r - Bounds of the map panelpanelBBox - Panel bounding boxdataBBox - Data bounding box
public static java.awt.Rectangle getBBoxRectangle(java.awt.Rectangle r,
com.vividsolutions.jts.geom.Envelope panelBBox,
com.vividsolutions.jts.geom.Envelope dataBBox)
r - Bounds of the map panelpanelBBox - Panel bounding boxdataBBox - Data bounding box
public static int[] getPanelLocation(double[] geoLocation,
com.vividsolutions.jts.geom.Envelope mapArea,
java.awt.Rectangle panelBounds)
geoLocation - Interest geographic locationmapArea - Map bounds of the panelpanelBounds - Size of the panel
public static void saveLayersOrderPreference(IGisViewer gisViewer)
gisViewer - Gis viewerpublic static void saveVisibleLayersPreference(IGisViewer gisViewer)
gisViewer - Gis viewer
public static java.util.List<IGisLayer> reorderLayersToPreference(java.lang.String[] layersOrder,
java.util.List<IGisLayer> layers)
layersOrder - Layers order obtained from remote preferenceslayers - Actual gis viewer layer list
public static java.util.List<IGisLayer> setVisibleLayersByPreferences(java.lang.String[] layersVisible,
java.lang.String[] layersNotVisible,
java.util.List<IGisLayer> layers)
layersVisible - Visible layers obtained from remote preferenceslayers - Actual gis viewer layer list
public static java.awt.Cursor getClosedHandCursor()
public static java.awt.Cursor getAddCursor()
public static java.awt.Cursor getViewerCursor(int viewerState)
viewerState - New state of the viewer
public static java.awt.Rectangle getClipBoundsForEnvelope(com.vividsolutions.jts.geom.Envelope geomBBox,
com.vividsolutions.jts.geom.Envelope boundingBox,
java.awt.Rectangle panelRect)
geomBBox - Interest areaboundingBox - Map viewer areapanelRect - Map viewer panel dimension
public static java.util.List<java.util.Hashtable> expandSelectionByDistance(java.util.List<java.util.Hashtable> layerData,
java.util.List<java.util.Hashtable> selectedData,
IGisLayer selectionLayer,
double distance)
public static com.vividsolutions.jts.geom.Envelope getEnvelopeForObject(int actualId,
int totalObjects,
com.vividsolutions.jts.geom.Envelope prevBBox,
double radius,
double pixelSize,
double initAngle)
actualId - Actual element idtotalObjects - Number of elements in the selectorprevBBox - Previous map enveloperadius - Selector radius in pixels
public static int countTotalObjects(java.util.Hashtable<java.lang.String,java.util.List> data)
public static double calculateMaxExpansion(java.util.List<IGisLayer> layers,
double pixelSize)
layers - List of layers to repaintpixelSize - Actual panel pixel size
public static double calculateMaxExpansionForLayer(IGisLayer layer,
double pixelSize)
layer - Layer to repaintpixelSize - Actual panel pixel size
public static void drawSelectorElement(java.awt.Graphics2D g2d,
float alpha,
java.awt.Color fillColor,
java.awt.Color borderColor,
float strokeWidth,
int[] location,
int radius)
public static void drawSelectorCenterElement(java.awt.Graphics2D g2d,
float alpha,
java.awt.Color fillColor,
java.awt.Color borderColor,
float strokeWidth,
int[] location,
int radius)
public static void drawSelectorTipText(java.awt.Graphics2D g2d,
java.lang.String tipText,
java.awt.Color haloColor,
java.awt.Color textColor,
float strokeWidth,
int[] location,
double radius,
double angle,
int textSize)
public static java.awt.Graphics2D fillImageAndGetGraphics(java.awt.image.BufferedImage buffImage,
java.awt.Color fillColor)
public static java.awt.Graphics2D fillImageAndGetGraphics(java.awt.image.BufferedImage buffImage,
java.awt.Color fillColor,
int width,
int height)
public static void fillGraphics(java.awt.Graphics2D g2d,
java.awt.Color fillColor,
int width,
int height)
public static void fillGraphics(java.awt.Graphics2D g2d,
java.awt.Color fillColor,
float alpha,
int width,
int height)
public static void drawRectangle(java.awt.Graphics2D g2d,
java.awt.Color rectColor,
float alpha,
java.awt.Rectangle bounds)
public static void drawRectangle(java.awt.Graphics2D g2d,
java.awt.Color rectColor,
float alpha,
int x,
int y,
int width,
int height)
public static org.jdesktop.animation.timing.Animator buildAnimator(org.jdesktop.animation.timing.TimingTarget target,
int time,
int resolution,
float acceleration,
float deceleration)
public static boolean checkIfRecordIsInCurrentData(java.util.Hashtable recordToInsert,
java.util.List<java.util.Hashtable> actualData)
public static com.vividsolutions.jts.geom.Envelope getZoomOutEnvelope(double stX,
double endX,
double stY,
double endY,
com.vividsolutions.jts.geom.Envelope boundingBox)
public static com.vividsolutions.jts.geom.Envelope getPanEnvelope(double stX,
double endX,
double stY,
double endY,
com.vividsolutions.jts.geom.Envelope boundingBox)
public static java.util.Hashtable<java.lang.String,java.util.List> deleteDuplicateValues(java.util.Hashtable<java.lang.String,java.util.List> selectedData)
selectedData - Hastable containing data from different GIS layers.
Each layer will contain a List with the selected data for that layer
public static java.util.Map getSmallerRasterMapCopy(java.util.Hashtable<java.lang.String,java.lang.Object> dataHT)
public static com.vividsolutions.jts.geom.Envelope getLayersBoundingBox(java.util.List<IGisLayer> layers,
int index)
public static java.awt.image.BufferedImage convertGrayScaleToColor(java.awt.image.BufferedImage image)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||