Package hec.map
Class MapLabelItem
java.lang.Object
hec.map.MapTextObject
hec.map.MapLabelItem
MapLabelItem class used by MapCanvas to prevent cluttering of text on screen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
east positionstatic final int
north positionstatic final int
northeast positionstatic final int
northwest positionstatic final String[]
the positions as stringsstatic final int
south positionstatic final int
southeast positionstatic final int
southwest positionstatic final int
west position -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new MapLabelItem objectMapLabelItem
(String txt, int x, int y, int pos, int offset, float priority, Font font, Color fg, Color bg, boolean drawBorder, Graphics g) Create a new MapLabelItem objectMapLabelItem
(String txt, int x, int y, int pos, int size, float priority, Font font, Color fg, Color bg, Graphics g) Create a new MapLabelItem objectMapLabelItem
(String txt, int x, int y, int pos, int iconWidth, int iconHeight, float priority, Font font, Color fg, Color bg, boolean drawBorder, Graphics g) Create a new MapLabelItem object -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method DescriptionGets the Bounds attribute of the MapLabelItem objectGets the LocalRect attribute of the MapLabelItem objectGets the LocalRect attribute of the MapLabelItem objectgetText()
Gets the Text attribute of the MapLabelItem objectboolean
intersects
(MapTextObject obj) Method Description
-
Field Details
-
EAST
public static final int EASTeast position- See Also:
-
NORTHEAST
public static final int NORTHEASTnortheast position- See Also:
-
NORTH
public static final int NORTHnorth position- See Also:
-
NORTHWEST
public static final int NORTHWESTnorthwest position- See Also:
-
WEST
public static final int WESTwest position- See Also:
-
SOUTHWEST
public static final int SOUTHWESTsouthwest position- See Also:
-
SOUTH
public static final int SOUTHsouth position- See Also:
-
SOUTHEAST
public static final int SOUTHEASTsoutheast position- See Also:
-
POSITION_STRINGS
the positions as strings
-
-
Constructor Details
-
MapLabelItem
public MapLabelItem(String txt, int x, int y, int pos, int iconWidth, int iconHeight, float priority, Font font, Color fg, Color bg, boolean drawBorder, Graphics g) Create a new MapLabelItem object- Parameters:
txt
- the text to displayx
- the x positiony
- the y positionpos
- the position NORTH, SOURTH etciconWidth
- the width of the iconiconHeight
- the height of the iconpriority
- the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlapfont
- the font to usefg
- the foreground colorbg
- the background colordrawBorder
- whether to draw a border or notg
- the graphics context to draw in
-
MapLabelItem
public MapLabelItem(String txt, int x, int y, int pos, int size, float priority, Font font, Color fg, Color bg, Graphics g) Create a new MapLabelItem object- Parameters:
txt
- the text to displayx
- the x positiony
- the y positionpos
- the position NORTH, SOURTH etcsize
- the icon sizepriority
- the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlap * @param font the font to usefg
- the foreground colorbg
- the background colorg
- the graphics context to draw in
-
MapLabelItem
public MapLabelItem(String txt, int x, int y, float priority, Font font, Color fg, Color bg, Graphics g) Create a new MapLabelItem object- Parameters:
txt
- the text to displayx
- the x positiony
- the y positionpriority
- the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlapfont
- the font to usefg
- the foreground colorbg
- the background colorg
- the graphics context to draw in
-
MapLabelItem
public MapLabelItem(String txt, int x, int y, int pos, int offset, float priority, Font font, Color fg, Color bg, boolean drawBorder, Graphics g) Create a new MapLabelItem object- Parameters:
txt
- the text to displayx
- the x positiony
- the y positionpos
- the position NORTH, SOURTH etcoffset
-priority
- the priority. -1 always draw. otherwise higher priority takes precidence of lower when labels overlapfont
- the font to usefg
- the foreground colorbg
- the background colordrawBorder
- whether to draw a border or notg
- the graphics context to draw in
-
-
Method Details
-
intersects
Method Description- Overrides:
intersects
in classMapTextObject
- Parameters:
obj
- Description- Returns:
- Description
-
getBounds
Gets the Bounds attribute of the MapLabelItem object- Specified by:
getBounds
in classMapTextObject
- Returns:
- The Bounds value
-
getLocalRect
Gets the LocalRect attribute of the MapLabelItem object- Returns:
- The LocalRect value
-
getLocalRect
Gets the LocalRect attribute of the MapLabelItem object- Parameters:
rc
- Description- Returns:
- The LocalRect value
-
draw
Method Description- Specified by:
draw
in classMapTextObject
- Parameters:
g
- Description
-
getText
Gets the Text attribute of the MapLabelItem object- Returns:
- The Text value
-