|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLineElement
This class contains the coordinates, current statistic values and various other information about a line. It contains methods for clipping the line if it extends the border of the map and methods for drawing it on the map.
Field Summary | |
private int |
bitmapX1
|
private int |
bitmapX2
|
private int |
bitmapY1
|
private int |
bitmapY2
|
private java.util.Vector |
dateStrings
|
private static java.awt.Color |
defaultColour
|
private static int |
defaultSize
|
private PointElement |
destination
|
private java.awt.Color |
destinationColour
|
private int |
destinationSize
|
private StatisticDialog |
dialog
|
private boolean |
enabled
|
private java.util.Date |
fromDate
|
private java.lang.String |
lineName
|
private java.lang.String |
lineType
|
private java.util.Vector |
measureStrings
|
private PointElement |
origin
|
private java.awt.Color |
originColour
|
private int |
originSize
|
private MapElement |
parentMap
|
private java.awt.Polygon |
polygonOutline
|
private java.util.Date |
toDate
|
Constructor Summary | |
LineElement(MapElement parent,
PointElement origin,
PointElement destination,
java.lang.String name,
java.lang.String type,
java.util.Date from,
java.util.Date to)
Creates a new instance of LineElement |
Method Summary | |
void |
addStatisticColumn(java.util.Hashtable hash,
java.lang.String title)
Adds a column of statistics to the dialog showing stats for this line. |
void |
addStatisticURL(java.lang.String lineName,
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 the the dialog showing stats for this line. |
private void |
checkCoordBounds()
Check if the line crosses any border of the map, and update the origin or destination pointelements to lie on the map border instead. |
void |
checkEnabled(java.util.Date date)
Enables this line if it exists at the given date, otherwise it is disabled. |
int |
compareTo(java.lang.Object o)
Compares the length of lines. |
boolean |
contains(java.awt.Point point)
Checks if the polygon outline of this line contains the given point. |
void |
createPolygonOutline()
Creates a polygon outline for this line to be used for hit testing. |
void |
drawMe(java.awt.Graphics _g)
Draw the unselected version of the line. |
void |
drawSelected(java.awt.Graphics _g)
Draw the selected version of the line. |
PointElement |
getDestination()
|
PointElement |
getOrigin()
|
java.awt.Polygon |
getPolygonOutline()
|
int |
getSize()
Returns the length of the line. |
java.lang.String |
getType()
|
int |
getX1()
|
int |
getX2()
|
int |
getY1()
|
int |
getY2()
|
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 |
resetBitmapCoordinates()
|
void |
resetStatistics()
Sets all the statistics to the default values. |
void |
setDestinationColour(java.awt.Color colour)
|
void |
setDestinationSize(int size)
|
void |
setOriginColour(java.awt.Color colour)
|
void |
setOriginSize(int size)
|
void |
setX1(int x1)
|
void |
setX2(int x2)
|
void |
setY1(int y1)
|
void |
setY2(int y2)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private MapElement parentMap
private PointElement origin
private PointElement destination
private java.lang.String lineName
private java.lang.String lineType
private int originSize
private int destinationSize
private java.awt.Color destinationColour
private java.awt.Color originColour
private java.awt.Polygon polygonOutline
private java.util.Date fromDate
private java.util.Date toDate
private int bitmapX1
private int bitmapY1
private int bitmapX2
private int bitmapY2
private java.util.Vector dateStrings
private java.util.Vector measureStrings
private StatisticDialog dialog
private static java.awt.Color defaultColour
private static int defaultSize
private boolean enabled
Constructor Detail |
public LineElement(MapElement parent, PointElement origin, PointElement destination, java.lang.String name, java.lang.String type, java.util.Date from, java.util.Date to)
Method Detail |
private void checkCoordBounds()
public java.lang.String getType()
public PointElement getOrigin()
public PointElement getDestination()
public void setOriginSize(int size)
public void setDestinationSize(int size)
public void setOriginColour(java.awt.Color colour)
public void setDestinationColour(java.awt.Color colour)
public int getX1()
public int getY1()
public int getX2()
public int getY2()
public void setX1(int x1)
public void setX2(int x2)
public void setY1(int y1)
public void setY2(int y2)
public java.awt.Polygon getPolygonOutline()
public void addTimestamp(java.util.Date statisticDate, java.lang.String statName)
public int getSize()
public void resetStatistics()
public void resetBitmapCoordinates()
public boolean contains(java.awt.Point point)
public void checkEnabled(java.util.Date date)
public boolean isEnabled()
public void createPolygonOutline()
public void drawSelected(java.awt.Graphics _g)
drawSelected
in interface Selectable
public void drawMe(java.awt.Graphics _g)
public void performMouseClickAction(MapFrame mapFrame, java.awt.event.MouseEvent e)
performMouseClickAction
in interface Selectable
public void addStatisticColumn(java.util.Hashtable hash, java.lang.String title)
public void addStatisticURL(java.lang.String lineName, java.lang.String URLtemplate, int timestamp, java.lang.String statName)
public void addURL(java.lang.String url, java.lang.String urlInfo, java.util.Date date)
public java.lang.String toString()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |