|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMapElement
MapElement contains the graphical image of a map along with lists of its points and lines. It has methods for adjusting the position of overlapping lines and for placing text on the map. Further it can assign statistic values to lines and points.
Field Summary | |
private java.awt.Image |
backgroundImage
|
private float |
bitmapFactor
|
private int |
bitmapHeight
|
private int |
bitmapWidth
|
static int |
BORDER_SIZE
|
private java.lang.String |
coordType
|
private int |
coordX1
|
private int |
coordX2
|
private int |
coordY1
|
private int |
coordY2
|
private java.util.Vector |
filteredLineList
|
private java.util.Vector |
filteredPointList
|
private static int |
FREE
|
static int |
GRID_SIZE
|
private java.net.URL |
imageURL
|
private boolean |
isSuperRegion
|
private java.util.Vector |
lineList
|
private java.lang.String |
mapName
|
private static int |
OCCUPIED
|
private java.util.Vector |
pointList
|
private java.awt.Rectangle |
rectangleOutline
|
private int[][] |
textMap
|
private int |
UTMZone
|
private int |
zoomLevel
|
Constructor Summary | |
MapElement(java.lang.String name,
java.lang.String coord,
int width,
int height,
int x1,
int y1,
int x2,
int y2,
int zoom,
java.net.URL imageURL,
float factor)
Creates a new instance of MapElement |
Method Summary | |
void |
adjustOverlappingLines()
Checks all the lines and moves those that are on top of each other. |
void |
adjustOverlappingPoints()
Checks points along the border of the map and moves those that overlap. |
void |
assignLineStatistics(java.util.Vector lineStatList)
Assigns all the available line statistics to line elements. |
void |
assignPointStatistics(java.util.Vector pointStatList)
Assigns all the available point statistics to point elements. |
void |
clearTextMap()
Resets the text map. |
int |
compareTo(java.lang.Object o)
Returns the string comparison of the map names. |
boolean |
contains(MapElement otherElement)
Returns true if the given map element is contained inside this map element. |
boolean |
contains(java.awt.Point point)
Returns true if the given point is located within this map element. |
void |
createLineRegions()
Creates regions for all the lines. |
void |
createPointRegions()
Creates regions for all the points. |
void |
createRectangleOutline(int x,
int y,
int width,
int height)
Creates a rectangle outline with the given dimensions. |
void |
createSubRegion(MapElement subElement)
Marks the given map element as a sub region for this map element. |
void |
createSuperRegion(MapElement superElement)
Marks the given map element as a super region for this map element. |
void |
displaceLine(LineElement line1,
LineElement line2)
Displaces two lines with respect to each other. |
void |
drawSelected(java.awt.Graphics _g)
Draws the map region when selected with the mouse pointer. |
double |
factorX()
Returns the ratio of coords/pixels along the x-axis. |
double |
factorY()
Returns the ratio of coords/pixels along the y-axis. |
void |
filterLines(java.lang.String lineType)
Filters all the lines, keeping only those with a spesific linetype. |
void |
filterPoints(java.lang.String pointType)
Filters all the points, keeping only those with a spesific pointtype. |
java.awt.Image |
getBackgroundImage()
Returns the clean map image. |
java.awt.Rectangle |
getContourRectangle()
Returns the contour rectangle, which is the same as the outline of the map. |
java.net.URL |
getImageURL()
|
java.awt.Rectangle |
getIntersectionRectangle()
Returns the intersection rectangle, which is in the middle between the map and the border. |
int |
getIntersectLength(LineElement line1,
LineElement line2)
Returns the length of the overlap of two lines. |
LineElement |
getLineAtPoint(java.awt.Point point)
Returns the line element at a given point. |
LineElement |
getLineElement(java.lang.String lineName)
Returns a line element given a linename. |
java.util.Vector |
getLineTypes()
Returns all the linetypes. |
java.awt.Image |
getMapImage(java.util.Date date)
Returns the map image for a given date with lines, points and text drawn on it. |
java.lang.String |
getMapName()
|
PointElement |
getNodeAtPoint(java.awt.Point point)
Returns the point element at a given point. |
PointElement |
getPointElement(java.lang.String pointName)
Returns a point element given a pointname. |
java.util.Vector |
getPointTypes()
Returns all the pointtypes. |
int |
getRegionSize()
|
int[] |
getTextCoords(int pointX,
int pointY,
int length)
Returns the coordinates of where the text should be placed given a pair of coordinates and text length. |
int |
getUTMZone()
|
int |
getX1()
|
int |
getX2()
|
int |
getY1()
|
int |
getY2()
|
int |
getZoomLevel()
|
boolean |
isLoaded()
Returns true if the image has been loaded, false otherwise. |
boolean |
isSuperRegion()
Returns true if this map element is a super region. |
boolean |
overlaps(MapElement otherElement)
|
void |
performMouseClickAction(MapFrame mapFrame,
java.awt.event.MouseEvent e)
Selects this map when it is clicked on with the mouse. |
void |
removeRegion()
Clears the rectangle outline. |
void |
resetLineStatistics()
Clears all the line statistics. |
void |
resetPointStatistics()
Clears all the point statistics. |
void |
setBackgroundImage(java.awt.Image image)
Sets the clean map image, draws a border around it and initializes the text map. |
void |
setLineList(java.util.Vector lineList)
|
void |
setOccupiedText(int x,
int y,
int length)
Marks the given slot in the text map as occupied. |
void |
setPointList(java.util.Vector pointList)
|
void |
setSuperRegion(boolean isSuper)
Sets this map element as a super region. |
java.lang.String |
toString()
Returns the name of the map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.Vector lineList
private java.util.Vector filteredLineList
private java.util.Vector pointList
private java.util.Vector filteredPointList
private java.lang.String mapName
private java.lang.String coordType
private int bitmapWidth
private int bitmapHeight
private int coordX1
private int coordY1
private int coordX2
private int coordY2
private int zoomLevel
private int UTMZone
private java.awt.Image backgroundImage
private java.net.URL imageURL
private float bitmapFactor
private java.awt.Rectangle rectangleOutline
private int[][] textMap
private boolean isSuperRegion
public static final int BORDER_SIZE
public static final int GRID_SIZE
private static final int OCCUPIED
private static final int FREE
Constructor Detail |
public MapElement(java.lang.String name, java.lang.String coord, int width, int height, int x1, int y1, int x2, int y2, int zoom, java.net.URL imageURL, float factor)
Method Detail |
public void setPointList(java.util.Vector pointList)
public void setLineList(java.util.Vector lineList)
public boolean isLoaded()
public void adjustOverlappingPoints()
public void adjustOverlappingLines()
public int getIntersectLength(LineElement line1, LineElement line2)
public void displaceLine(LineElement line1, LineElement line2)
public void setBackgroundImage(java.awt.Image image)
public java.awt.Image getBackgroundImage()
public int[] getTextCoords(int pointX, int pointY, int length)
public void setOccupiedText(int x, int y, int length)
public void clearTextMap()
public java.awt.Rectangle getIntersectionRectangle()
public java.awt.Rectangle getContourRectangle()
public java.awt.Image getMapImage(java.util.Date date)
public PointElement getPointElement(java.lang.String pointName)
public LineElement getLineElement(java.lang.String lineName)
public boolean contains(MapElement otherElement)
public boolean overlaps(MapElement otherElement)
public boolean contains(java.awt.Point point)
public double factorX()
public double factorY()
public int getX1()
public int getY1()
public int getX2()
public int getY2()
public int getUTMZone()
public int getZoomLevel()
public java.lang.String getMapName()
public java.net.URL getImageURL()
public int getRegionSize()
public void createSuperRegion(MapElement superElement)
public void createSubRegion(MapElement subElement)
public void createRectangleOutline(int x, int y, int width, int height)
public void removeRegion()
public boolean isSuperRegion()
public void setSuperRegion(boolean isSuper)
public void createLineRegions()
public void createPointRegions()
public PointElement getNodeAtPoint(java.awt.Point point)
public LineElement getLineAtPoint(java.awt.Point point)
public void filterLines(java.lang.String lineType)
public void filterPoints(java.lang.String pointType)
public java.util.Vector getLineTypes()
public java.util.Vector getPointTypes()
public void assignLineStatistics(java.util.Vector lineStatList)
public void assignPointStatistics(java.util.Vector pointStatList)
public void resetPointStatistics()
public void resetLineStatistics()
public void drawSelected(java.awt.Graphics _g)
drawSelected
in interface Selectable
public void performMouseClickAction(MapFrame mapFrame, java.awt.event.MouseEvent e)
performMouseClickAction
in interface Selectable
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 |