org.opengts.war.tools
Class PushpinIcon

java.lang.Object
  extended by org.opengts.war.tools.PushpinIcon

public class PushpinIcon
extends java.lang.Object


Nested Class Summary
static class PushpinIcon.TextIcon
           
 
Field Summary
static java.lang.String DEFAULT_TEXT_FONT
           
static java.lang.String[] MARKER_ARG_ARROW
           
static java.lang.String[] MARKER_ARG_BORDER_COLOR
           
static java.lang.String[] MARKER_ARG_COLOR
           
static java.lang.String[] MARKER_ARG_FILL_COLOR
           
static java.lang.String[] MARKER_ARG_FRAME
           
static java.lang.String[] MARKER_ARG_ICON
           
static java.lang.String[] MARKER_ARG_TEXT
           
 
Constructor Summary
PushpinIcon(java.lang.String name, java.lang.String imageURL, java.lang.String icon, boolean iconEval, int[] iconSize, int[] iconHotspot, java.lang.String shadow, int[] shadowSize, java.lang.String back, int[] backSize, int[] backOffset)
          Constructor
PushpinIcon(java.lang.String name, java.lang.String imageURL, java.lang.String icon, int[] iconSize, int[] iconHotspot, java.lang.String shadow, int[] shadowSize)
          Constructor
 
Method Summary
 int getBackgroundHeight()
          Gets the Pushpin Icon background image height (in pixels)
 int getBackgroundOffsetX()
          Gets the Pushpin Icon background image 'hotspot' X-offset (in pixels)
 int getBackgroundOffsetY()
          Gets the Pushpin Icon background image 'hotspot' Y-offset (in pixels)
 java.lang.String getBackgroundURL()
          Gets the Pushpin Icon background image URL
 int getBackgroundWidth()
          Gets the Pushpin Icon background image width (in pixels)
 boolean getIconEval()
          Returns true if the icon URL should be run through "eval(...)"
 java.lang.String getIconEvalURL(EventData e, int index)
          This method attempts to duplicate the JavaScript evaluation for generated pushpin URLs which will be used on the maps/reports, etc.
This impelmentation should match the JavaScript implementations in the "jsmaps.js" module.
 int getIconHeight()
          Gets the Pushpin Icon image height (in pixels)
 int getIconHotspotX()
          Gets the Pushpin Icon image 'hotspot' X-offset (in pixels)
 int getIconHotspotY()
          Gets the Pushpin Icon image 'hotspot' Y-offset (in pixels)
 java.lang.String getIconURL()
          Gets the Pushpin Icon image URL
 int getIconWidth()
          Gets the Pushpin Icon image width (in pixels)
 java.lang.String getImageURL()
          Gets the representation image URL for this Pushpin Icon for user selection
 java.lang.String getName()
          Returns the name of this PushPin
 int getShadowHeight()
          Gets the Pushpin Icon shadow image height (in pixels)
 java.lang.String getShadowURL()
          Gets the Pushpin Icon shadow image URL
 int getShadowWidth()
          Gets the Pushpin Icon shadow image width (in pixels)
static javax.swing.ImageIcon LoadImageIcon(java.io.File file)
          Load ImageIcon from File
static javax.swing.ImageIcon LoadImageIcon(java.net.URL url)
          Load ImageIcon from URL
static OrderedMap<java.lang.String,PushpinIcon> newDefaultPushpinIconMap()
          Returns a shalow copy of the PushpinIcon map
 java.lang.String toString()
          Returns the String representation of this Pushpin object
static void writePushpinChooserJS(java.io.PrintWriter out, RequestProperties reqState, boolean inclBlank)
           
static void writePushpinImageArray(java.io.PrintWriter out, OrderedMap<java.lang.String,PushpinIcon> pushpinMap, java.util.Locale locale, boolean inclBlank)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TEXT_FONT

public static java.lang.String DEFAULT_TEXT_FONT

MARKER_ARG_ICON

public static final java.lang.String[] MARKER_ARG_ICON

MARKER_ARG_FRAME

public static final java.lang.String[] MARKER_ARG_FRAME

MARKER_ARG_FILL_COLOR

public static final java.lang.String[] MARKER_ARG_FILL_COLOR

MARKER_ARG_BORDER_COLOR

public static final java.lang.String[] MARKER_ARG_BORDER_COLOR

MARKER_ARG_COLOR

public static final java.lang.String[] MARKER_ARG_COLOR

MARKER_ARG_TEXT

public static final java.lang.String[] MARKER_ARG_TEXT

MARKER_ARG_ARROW

public static final java.lang.String[] MARKER_ARG_ARROW
Constructor Detail

PushpinIcon

public PushpinIcon(java.lang.String name,
                   java.lang.String imageURL,
                   java.lang.String icon,
                   boolean iconEval,
                   int[] iconSize,
                   int[] iconHotspot,
                   java.lang.String shadow,
                   int[] shadowSize,
                   java.lang.String back,
                   int[] backSize,
                   int[] backOffset)
Constructor

Parameters:
name - This PushPin name
imageURL - The image used to represent the icon for user selection
icon - The icon image URL, for Javascript command which returns the icon URL
iconEval - "false" indicates that 'icon' specifies a fixed URL, "true" indicates that 'icon' is a Javascript line that when evaluated, will return the icon URL.
iconSize - 2 element array containing the icon image width/height (in pixels)
iconHotspot - 2 element array specifying the icon image X/Y 'hotspot' (in pixels)
shadow - The icon shadow image url
shadowSize - 2 element array containing the icon shadow width/height (in pixels)
back - The icon background url
backSize - 2 element array containing the icon background image width/height (in pixels)
backOffset - 2 element array specifying the icon background image X/Y 'hotspot' (in pixels)

PushpinIcon

public PushpinIcon(java.lang.String name,
                   java.lang.String imageURL,
                   java.lang.String icon,
                   int[] iconSize,
                   int[] iconHotspot,
                   java.lang.String shadow,
                   int[] shadowSize)
Constructor

Parameters:
name - This PushPin name
imageURL - The image used to represent the icon for user selection
icon - The icon image URL
iconSize - 2 element array containing the icon image width/height (in pixels)
iconHotspot - 2 element array specifying the icon image X/Y 'hotspot' (in pixels)
shadow - The icon shadow image url
shadowSize - 2 element array containing the icon shadow width/height (in pixels)
Method Detail

newDefaultPushpinIconMap

public static OrderedMap<java.lang.String,PushpinIcon> newDefaultPushpinIconMap()
Returns a shalow copy of the PushpinIcon map

Returns:
The PushpinIcon map

LoadImageIcon

public static javax.swing.ImageIcon LoadImageIcon(java.io.File file)
Load ImageIcon from File


LoadImageIcon

public static javax.swing.ImageIcon LoadImageIcon(java.net.URL url)
Load ImageIcon from URL


writePushpinChooserJS

public static void writePushpinChooserJS(java.io.PrintWriter out,
                                         RequestProperties reqState,
                                         boolean inclBlank)
                                  throws java.io.IOException
Throws:
java.io.IOException

writePushpinImageArray

public static void writePushpinImageArray(java.io.PrintWriter out,
                                          OrderedMap<java.lang.String,PushpinIcon> pushpinMap,
                                          java.util.Locale locale,
                                          boolean inclBlank)
                                   throws java.io.IOException
Throws:
java.io.IOException

getName

public java.lang.String getName()
Returns the name of this PushPin

Returns:
The name of this PushPin

getImageURL

public java.lang.String getImageURL()
Gets the representation image URL for this Pushpin Icon for user selection

Returns:
The representation image url

getIconURL

public java.lang.String getIconURL()
Gets the Pushpin Icon image URL

Returns:
The icon image url

getIconEval

public boolean getIconEval()
Returns true if the icon URL should be run through "eval(...)"

Returns:
True if the icon URL should be run through "eval(...)"

getIconEvalURL

public java.lang.String getIconEvalURL(EventData e,
                                       int index)
This method attempts to duplicate the JavaScript evaluation for generated pushpin URLs which will be used on the maps/reports, etc.
This impelmentation should match the JavaScript implementations in the "jsmaps.js" module. The following JavaScript functions are duplicated here:

Parameters:
e - The EventData instance
index - The event index (starting with '1')
Returns:
The pushpin URL

getIconWidth

public int getIconWidth()
Gets the Pushpin Icon image width (in pixels)

Returns:
The icon image width

getIconHeight

public int getIconHeight()
Gets the Pushpin Icon image height (in pixels)

Returns:
The icon image height

getIconHotspotX

public int getIconHotspotX()
Gets the Pushpin Icon image 'hotspot' X-offset (in pixels)

Returns:
The icon image 'hotspot' X-offset

getIconHotspotY

public int getIconHotspotY()
Gets the Pushpin Icon image 'hotspot' Y-offset (in pixels)

Returns:
The icon image 'hotspot' Y-offset

getShadowURL

public java.lang.String getShadowURL()
Gets the Pushpin Icon shadow image URL

Returns:
The icon shadow image url

getShadowWidth

public int getShadowWidth()
Gets the Pushpin Icon shadow image width (in pixels)

Returns:
The icon shadow image width

getShadowHeight

public int getShadowHeight()
Gets the Pushpin Icon shadow image height (in pixels)

Returns:
The icon shadow image height

getBackgroundURL

public java.lang.String getBackgroundURL()
Gets the Pushpin Icon background image URL

Returns:
The icon background image url

getBackgroundWidth

public int getBackgroundWidth()
Gets the Pushpin Icon background image width (in pixels)

Returns:
The icon background image width

getBackgroundHeight

public int getBackgroundHeight()
Gets the Pushpin Icon background image height (in pixels)

Returns:
The icon background image height

getBackgroundOffsetX

public int getBackgroundOffsetX()
Gets the Pushpin Icon background image 'hotspot' X-offset (in pixels)

Returns:
The icon image 'hotspot' X-offset

getBackgroundOffsetY

public int getBackgroundOffsetY()
Gets the Pushpin Icon background image 'hotspot' Y-offset (in pixels)

Returns:
The icon image 'hotspot' Y-offset

toString

public java.lang.String toString()
Returns the String representation of this Pushpin object

Overrides:
toString in class java.lang.Object
Returns:
The String representation of this Pushpin object