Class PointElement

java.lang.Object
  extended byPointElement
All Implemented Interfaces:
Selectable

public class PointElement
extends java.lang.Object
implements Selectable

This class contains the both the bitmap and UTM coordinates of the locations on the map and various other information. It has methods for drawing the point on the map and creating the bitmap coordinates.


Field Summary
private  int bitmapX
           
private  int bitmapY
           
private  java.awt.Color colour
           
private  java.lang.String coordType
           
private  int coordX
           
private  int coordY
           
private  java.util.Vector dateStrings
           
private static java.awt.Color defaultColour
           
private static int defaultSize
           
private  StatisticDialog dialog
           
private  boolean enabled
           
private  java.util.Date fromDate
           
private  java.util.Vector measureStrings
           
private  MapElement parentMap
           
private  java.lang.String pointName
           
private  java.lang.String pointType
           
private  java.awt.Rectangle rectangleOutline
           
private  int size
           
private  boolean sizeIsSet
           
private  int[] textCoords
           
private  java.util.Date toDate
           
 
Constructor Summary
PointElement(MapElement parent, java.lang.String name, java.lang.String pointType, java.lang.String coordType, int x, int y, java.util.Date from, java.util.Date to)
          Creates a new instance of PointElement
 
Method Summary
 void addStatisticColumn(java.util.Hashtable hash, java.lang.String title)
          Adds a column of statistics to the dialog showing stats for this point.
 void addStatisticURL(java.lang.String eqName, java.lang.String URLtemplate, int timestamp, java.lang.String statName)
           
 void addTimestamp(java.util.Date statisticDate, java.lang.String statName)
          Creates strings that displays the name of the statistic and the time at which it was measured and adds them the list of strings.
 void addURL(java.lang.String url, java.lang.String urlInfo, java.util.Date date)
          Adds an url button to the dialog showing stats for this point.
 void checkEnabled(java.util.Date date)
          Enable this point if it exists within the given point, otherwise disable it.
 boolean contains(java.awt.Point point)
          Check if the rectangle outline of this point contains the supplied point.
private  void createBitmapCoords()
          Create a set of bitmap coordinates.
 void createRectangleOutline()
           
 int distance(PointElement otherPoint)
          Returns the distance to the supplied pointelement.
 void drawMe(java.awt.Graphics _g)
          Draw the unselected version of the point.
 void drawSelected(java.awt.Graphics _g)
          Draw the selected version of the point.
 int getBitmapX()
           
 int getBitmapY()
           
 java.lang.String getType()
           
 boolean isEnabled()
           
 void performMouseClickAction(MapFrame mapFrame, java.awt.event.MouseEvent e)
          Opens a statistic dialog showing stats and urls when the mouse is clicked on the line.
 void resetStatistics()
          Set all the statistics to default values.
 void setColour(java.awt.Color colour)
           
 void setSize(int size)
           
 java.lang.String toString()
           
 void updateBitmapX(int x)
           
 void updateBitmapY(int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parentMap

private MapElement parentMap

pointName

private java.lang.String pointName

pointType

private java.lang.String pointType

coordType

private java.lang.String coordType

coordX

private int coordX

coordY

private int coordY

bitmapX

private int bitmapX

bitmapY

private int bitmapY

fromDate

private java.util.Date fromDate

toDate

private java.util.Date toDate

size

private int size

colour

private java.awt.Color colour

rectangleOutline

private java.awt.Rectangle rectangleOutline

textCoords

private int[] textCoords

dateStrings

private java.util.Vector dateStrings

measureStrings

private java.util.Vector measureStrings

dialog

private StatisticDialog dialog

defaultColour

private static java.awt.Color defaultColour

defaultSize

private static int defaultSize

sizeIsSet

private boolean sizeIsSet

enabled

private boolean enabled
Constructor Detail

PointElement

public PointElement(MapElement parent,
                    java.lang.String name,
                    java.lang.String pointType,
                    java.lang.String coordType,
                    int x,
                    int y,
                    java.util.Date from,
                    java.util.Date to)
Creates a new instance of PointElement

Method Detail

createBitmapCoords

private void createBitmapCoords()
Create a set of bitmap coordinates.


getBitmapX

public int getBitmapX()

getBitmapY

public int getBitmapY()

distance

public int distance(PointElement otherPoint)
Returns the distance to the supplied pointelement.


updateBitmapX

public void updateBitmapX(int x)

updateBitmapY

public void updateBitmapY(int y)

getType

public java.lang.String getType()

setSize

public void setSize(int size)

setColour

public void setColour(java.awt.Color colour)

resetStatistics

public void resetStatistics()
Set all the statistics to default values.


contains

public boolean contains(java.awt.Point point)
Check if the rectangle outline of this point contains the supplied point.


checkEnabled

public void checkEnabled(java.util.Date date)
Enable this point if it exists within the given point, otherwise disable it.


isEnabled

public boolean isEnabled()

createRectangleOutline

public void createRectangleOutline()

addTimestamp

public void addTimestamp(java.util.Date statisticDate,
                         java.lang.String statName)
Creates strings that displays the name of the statistic and the time at which it was measured and adds them the list of strings.


drawSelected

public void drawSelected(java.awt.Graphics _g)
Draw the selected version of the point.

Specified by:
drawSelected in interface Selectable

drawMe

public void drawMe(java.awt.Graphics _g)
Draw the unselected version of the point.


addStatisticColumn

public void addStatisticColumn(java.util.Hashtable hash,
                               java.lang.String title)
Adds a column of statistics to the dialog showing stats for this point.


addStatisticURL

public void addStatisticURL(java.lang.String eqName,
                            java.lang.String URLtemplate,
                            int timestamp,
                            java.lang.String statName)

addURL

public void addURL(java.lang.String url,
                   java.lang.String urlInfo,
                   java.util.Date date)
Adds an url button to the dialog showing stats for this point.


performMouseClickAction

public void performMouseClickAction(MapFrame mapFrame,
                                    java.awt.event.MouseEvent e)
Opens a statistic dialog showing stats and urls when the mouse is clicked on the line.

Specified by:
performMouseClickAction in interface Selectable

toString

public java.lang.String toString()