NetCharts Server

netcharts.server.util
Class ImageMapCreator

java.lang.Object
  |
  +--netcharts.server.util.ImageMapCreator

public class ImageMapCreator
extends java.lang.Object

Basic Image Map Creator implementation. This class produces a MAP tag suitable for inclusion in an HTML page. Each of the MapElements passed to createImageMap will result in a corresponding AREA tag within the resultant MAP tag. Each of these AREA tags have the HREF defined in the MapElement, as well as its target. The parameters onMouseOver and onMouseOut to the method createImageMap allow for the creation of OnMouseOver and OnMouseOut attributes on the resultant AREA tags. The text of these attributes can include information that is specific to the MapElement corresponding to the AREA tag. Namely, the MapElement's HREF, target, or label can be inserted anywhere in the OnMouseOver or OnMouseOut text. This can be accomplished by using the value of LABEL_REPLACE, HREF_REPLACE, or TARGET_REPLACE in the text of your onMouseOver or onMouseOut parameter. For example:

 ImageMapCreator.createImageMap(sgi.getMap(), sgi.getUniqueID(), "return popup('" + ImageMapCreator.LABEL_REPLACE + "')", "return popdown()", "javascript://");
 

The preceeding code would create an onMouseOver attribute in each AREA tag that had that specific MapElement's label inserted in the javascript call to popup. It would also create onMouseOut attributes which made a call to the javascript function popdown. As in:

<AREA COORDS="23,45,12,45" onMouseOver="return popup('245.56')" onMouseOut="return popdown()" HREF="http://www.visualmining.com">


Field Summary
static java.lang.String HREF_REPLACE
          The text in the onMouseOver or onMouseOut String that will be replaced by the url value of the MapElement.
static java.lang.String INDEX_REPLACE
          The text in the onMouseOver or onMouseOut String that will be replaced by the selectedItemIndex value of the MapElement.
static java.lang.String LABEL_REPLACE
          The text in the onMouseOver or onMouseOut String that will be replaced by the label value of the MapElement.
static java.lang.String LABELS_REPLACE
          The text in the onMouseOver or onMouseOut String that will be replaced by the selectedItemLabels value of the MapElement.
static java.lang.String PARAM_REPLACE
          The text in the onMouseOver or onMouseOut String that will be replaced by the selectedItemParam value of the MapElement.
static java.lang.String TARGET_REPLACE
          The text in the onMouseOver or onMouseOut String that will be replaced by the target value of the MapElement.
 
Constructor Summary
ImageMapCreator()
           
 
Method Summary
static java.lang.String createImageMap(MapElement[] mapElements, java.lang.String mapName, java.lang.String onMouseOver, java.lang.String onMouseOut, java.lang.String defaultHref)
          Creates an image map using the given parameters.
static java.lang.String createImageMap(MapElement[] mapElements, java.lang.String mapName, java.lang.String onMouseOver, java.lang.String onMouseOut, java.lang.String alt, java.lang.String defaultHref)
          Creates an image map using the given parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LABEL_REPLACE

public static final java.lang.String LABEL_REPLACE
The text in the onMouseOver or onMouseOut String that will be replaced by the label value of the MapElement.

HREF_REPLACE

public static final java.lang.String HREF_REPLACE
The text in the onMouseOver or onMouseOut String that will be replaced by the url value of the MapElement.

TARGET_REPLACE

public static final java.lang.String TARGET_REPLACE
The text in the onMouseOver or onMouseOut String that will be replaced by the target value of the MapElement.

INDEX_REPLACE

public static final java.lang.String INDEX_REPLACE
The text in the onMouseOver or onMouseOut String that will be replaced by the selectedItemIndex value of the MapElement.

PARAM_REPLACE

public static final java.lang.String PARAM_REPLACE
The text in the onMouseOver or onMouseOut String that will be replaced by the selectedItemParam value of the MapElement.

LABELS_REPLACE

public static final java.lang.String LABELS_REPLACE
The text in the onMouseOver or onMouseOut String that will be replaced by the selectedItemLabels value of the MapElement.
Constructor Detail

ImageMapCreator

public ImageMapCreator()
Method Detail

createImageMap

public static java.lang.String createImageMap(MapElement[] mapElements,
                                              java.lang.String mapName,
                                              java.lang.String onMouseOver,
                                              java.lang.String onMouseOut,
                                              java.lang.String defaultHref)
Creates an image map using the given parameters.
Parameters:
mapElements - Array of MapElement objects. MapElements contain a shape that specifies coordinates for the area tag in the image map. It also provides target, href, label information.
mapName - The name of the image map.
onMouseOver - String containing javascript to run on the onMouseOver event of the area tag.
onMouseOut - String containing javascript to run on the onMouseOut event of the area tag.
defaultHref - Href to use if one isn't defined for the area tag.

createImageMap

public static java.lang.String createImageMap(MapElement[] mapElements,
                                              java.lang.String mapName,
                                              java.lang.String onMouseOver,
                                              java.lang.String onMouseOut,
                                              java.lang.String alt,
                                              java.lang.String defaultHref)
Creates an image map using the given parameters.
Parameters:
mapElements - Array of MapElement objects. MapElements contain a shape that specifies coordinates for the area tag in the image map. It also provides target, href, label information.
mapName - The name of the image map.
onMouseOver - String containing javascript to run on the onMouseOver event of the area tag.
onMouseOut - String containing javascript to run on the onMouseOut event of the area tag.
alt - String containing text for alt and title attributes of the area tag.
defaultHref - Href to use if one isn't defined for the area tag.

NetCharts Server


Visual Mining, Inc.
15825 Shady Grove Rd.
Suite 20
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2006
All Rights Reserved.

NetCharts Server TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Nov 26, 2006