Class OverlayMap

java.lang.Object
  |
  +--OverlayMap

public class OverlayMap
extends java.lang.Object

Class OverlayMap creates an database of named (x,y) scatterplot overlay maps for overlaying on the scatterplot.

List of methods available to Plugin-writers

 lookupOverlayMapIdx() - lookup named scatterplot overlay map index 
 isOverlayMap() - test if a scatterplot named overlay map exists 
 createNewOverlayMap() - define a scatterplot named overlay map 
 setOverlayMapData() - set xy data into named scatterplot overlay map 
 enableOverlayMapDisplay() - enable/disable display of named named overlay map
 setOverlayMapDisplayColor() - set named scatterplot overlay map display color
 setOverlayMapDisplayType() - set line type for named scatterplot overlay map 
 setOverlayMapDisplayChars() - set overlay characters for named overlay map
 setOverlayMapDisplayChars() - set overlay characters for named overlay map

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.

Version:
$Date: 2003/06/12 16:49:34 $ $Revision: 1.2 $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), C. Linder
See Also:
MAExplorer Home


Field Summary
private  MAExplorer dp
          link to global instance
(package private)  boolean enableFlag
          Enable/display the overlay to be drawn when redisplay the scatterplot
private  MAExplorer mae
          link to global instance
(package private) static int MAX_OVERLAY_MAPS
          max # of overlays
(package private) static int maxOverlayMaps
          max # of named overlay maps
(package private) static int nOverlayMaps
          # of entries in the named overlay map
(package private)  int nPoints
          # of (x,y) pairs in the map instance
(package private)  char[] overlayChars
          optional overlay characters [0:nPoints-1] used for overlayType 3
(package private)  java.awt.Color overlayColor
          Color to draw the points
(package private) static OverlayMap[] overlayMapDB
          Named scatterplot overlay map database [0:maxOverlayMaps-1]
(package private)  java.lang.String overlayMapName
          Name of a map instance
(package private)  int overlayType
          Overlay drawing type is 0 for 'o', 1 for continuous line between points, 2 for square, 3 for overlay characters (must setOverlayMapChars() )
(package private)  float[] xyMap
          1D array [0:(nPoints*2)-1] of sequential pairs of (x,y) data in current display space for nPoints in the map instance.
 
Constructor Summary
(package private) OverlayMap(MAExplorer maE, int maxNamedOverlayMaps)
          OverlayMap() - constructor named overlay map
(package private) OverlayMap(java.lang.String overlayMapName, float[] xyMap, int nPoints, java.awt.Color overlayColor, int lineType)
          OverlayMap() - constructor named overlay map
 
Method Summary
static int createNewOverlayMap(java.lang.String overlayMapName)
          createNewOverlayMap() - create a new scatterplot named overlay map.
static boolean enableOverlayMapDisplay(java.lang.String overlayMapName, boolean enableFlag)
          enableOverlayMapDisplay() - enable/disable display of named scatterplot named overlay map.
static boolean isOverlayMap(java.lang.String overlayMapName)
          isOverlayMap() - test if a scatterplot named overlay map exists
static int lookupOverlayMapIdx(java.lang.String overlayMapName)
          lookupOverlayMapIdx() - lookup named scatterplot overlay map index
static boolean removeOverlayMap(java.lang.String overlayMapName)
          removeOverlayMap() - remove named scatterplot overlay map.
static boolean setOverlayMapData(java.lang.String overlayMapName, float[] xyMap, int nPoints)
          setOverlayMapData() - set xy data into named scatterplot overlay map
static boolean setOverlayMapDisplayChars(java.lang.String overlayMapName, char[] overlayChars)
          setOverlayMapDisplayChars() - set overlay characters for named scatterplot overlay map
static boolean setOverlayMapDisplayColor(java.lang.String overlayMapName, java.awt.Color overlayColor)
          setOverlayMapDisplayColor() - set named scatterplot overlay map display color
static boolean setOverlayMapDisplayType(java.lang.String overlayMapName, int overlayType)
          setOverlayMapDisplayType() - set line type for named scatterplot overlay map
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MAX_OVERLAY_MAPS

static final int MAX_OVERLAY_MAPS
max # of overlays

mae

private MAExplorer mae
link to global instance

dp

private MAExplorer dp
link to global instance

overlayMapDB

static OverlayMap[] overlayMapDB
Named scatterplot overlay map database [0:maxOverlayMaps-1]

nOverlayMaps

static int nOverlayMaps
# of entries in the named overlay map

maxOverlayMaps

static int maxOverlayMaps
max # of named overlay maps

overlayMapName

java.lang.String overlayMapName
Name of a map instance

xyMap

float[] xyMap
1D array [0:(nPoints*2)-1] of sequential pairs of (x,y) data in current display space for nPoints in the map instance.

nPoints

int nPoints
# of (x,y) pairs in the map instance

overlayChars

char[] overlayChars
optional overlay characters [0:nPoints-1] used for overlayType 3

overlayColor

java.awt.Color overlayColor
Color to draw the points

overlayType

int overlayType
Overlay drawing type is 0 for 'o', 1 for continuous line between points, 2 for square, 3 for overlay characters (must setOverlayMapChars() )

enableFlag

boolean enableFlag
Enable/display the overlay to be drawn when redisplay the scatterplot
Constructor Detail

OverlayMap

OverlayMap(MAExplorer maE,
           int maxNamedOverlayMaps)
OverlayMap() - constructor named overlay map

OverlayMap

OverlayMap(java.lang.String overlayMapName,
           float[] xyMap,
           int nPoints,
           java.awt.Color overlayColor,
           int lineType)
OverlayMap() - constructor named overlay map
Parameters:
overlayMapName - to either lookup
xyData - 1D array [0:(nPoints*2)-1] of sequential pairs of (x,y) data in current display space for nPoints in the map instance
nPoints - # of (x,y) pairs in the map instance
Method Detail

lookupOverlayMapIdx

public static final int lookupOverlayMapIdx(java.lang.String overlayMapName)
lookupOverlayMapIdx() - lookup named scatterplot overlay map index
Parameters:
overlayMapName - to either lookup
Returns:
index if exists else -1 if not

isOverlayMap

public static final boolean isOverlayMap(java.lang.String overlayMapName)
isOverlayMap() - test if a scatterplot named overlay map exists
Parameters:
overlayMapName - to either lookup if it exists
Returns:
true if the map exists

createNewOverlayMap

public static final int createNewOverlayMap(java.lang.String overlayMapName)
createNewOverlayMap() - create a new scatterplot named overlay map.
Parameters:
overlayMapName - to either lookup if it exists or create if not.
Returns:
index of the map, -1 if fails

removeOverlayMap

public static final boolean removeOverlayMap(java.lang.String overlayMapName)
removeOverlayMap() - remove named scatterplot overlay map.
Parameters:
overlayMapName - to remove
Returns:
true if the map exists

setOverlayMapData

public static final boolean setOverlayMapData(java.lang.String overlayMapName,
                                              float[] xyMap,
                                              int nPoints)
setOverlayMapData() - set xy data into named scatterplot overlay map
Parameters:
overlayMapName - to set the xyMap data
xyMap - is array of (x,y) plot pairs in expression data space. xyMap is [0:(nPoints*2)-1] in size and the successive pairs are stored as: x1,y1,x2,y2,x3,y3, ...
nPoints - is the number of points in xyMap.
Returns:
true if succeed

enableOverlayMapDisplay

public static final boolean enableOverlayMapDisplay(java.lang.String overlayMapName,
                                                    boolean enableFlag)
enableOverlayMapDisplay() - enable/disable display of named scatterplot named overlay map.
Parameters:
overlayMapName - to use in overlaying the scatterplot
enableFlag - is true to enable the display, false do disable the overlay.
Returns:
true if the map exists

setOverlayMapDisplayColor

public static final boolean setOverlayMapDisplayColor(java.lang.String overlayMapName,
                                                      java.awt.Color overlayColor)
setOverlayMapDisplayColor() - set named scatterplot overlay map display color
Parameters:
overlayMapName - to use in overlaying the scatterplot
overlayColor - to use when drawing the data
Returns:
true if the map exists

setOverlayMapDisplayType

public static final boolean setOverlayMapDisplayType(java.lang.String overlayMapName,
                                                     int overlayType)
setOverlayMapDisplayType() - set line type for named scatterplot overlay map
Parameters:
overlayMapName - to use in overlaying the scatterplot
overlayType - is 0 for 'o', 1 for continuous line between points, 2 for square, 3 for overlay characters (must setOverlayMapChars() )
Returns:
true if the map exists

setOverlayMapDisplayChars

public static final boolean setOverlayMapDisplayChars(java.lang.String overlayMapName,
                                                      char[] overlayChars)
setOverlayMapDisplayChars() - set overlay characters for named scatterplot overlay map
Parameters:
overlayMapName - to use in overlaying the scatterplot
overlayChars - are the overlay characters for overlayType 3 - 1 for each point displayed
Returns:
true if the map exists