com.oziexplorer
Class MapComment

java.lang.Object
  extended by com.oziexplorer.MapComment

public class MapComment
extends Object

This class represents map comments. See OziAPI.addMapComment(MapComment).

Copyright 2011 Alan Burlison, . All rights reserved. Use is subject to license terms, see LICENSE.txt.
SourceForge.net


Field Summary
protected  int backColor
          The RGB background color.
protected  int fontSize
          The font size in points.
protected  int fontStyle
          The font style.
protected  int foreColor
          The RGB foreground color.
protected  int height
          The height in pixels.
protected  String name
          The comment name (displayed string).
protected  int number
          Comment number, set by JNI code.
protected  Position position
          The position of the comment.
protected  int width
          The width in pixels.
 
Constructor Summary
MapComment(String name, Position position)
          Create a new map comment, with default values.
MapComment(String name, Position position, int foreColor, int backColor, int width, int height, int fontSize, int fontStyle)
          Create a new map comment.
 
Method Summary
 boolean equals(Object that)
          Test if two map comments are equal.
 int getBackColor()
          Retrieve the RGB background color.
 int getFontSize()
          Retrieve the font size, in points.
 int getFontStyle()
          Retrieve the font style.
 int getForeColor()
          Retrieve the RGB foregeound color.
 int getHeight()
          Retrieve the height of the comment, in pixels.
 String getName()
          Retrieve the name of the comment (displayed string).
 int getNumber()
          Retrieve the comment number.
 Position getPosition()
          Retrieve the Position of the comment.
 int getWidth()
          Retrieve the width of the comment, in pixels.
 int hashCode()
          Return the hash code for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final String name
The comment name (displayed string).


position

protected final Position position
The position of the comment.


foreColor

protected final int foreColor
The RGB foreground color.


backColor

protected final int backColor
The RGB background color.


width

protected final int width
The width in pixels.


height

protected final int height
The height in pixels.


fontSize

protected final int fontSize
The font size in points.


fontStyle

protected final int fontStyle
The font style.


number

protected final int number
Comment number, set by JNI code.

Constructor Detail

MapComment

public MapComment(String name,
                  Position position,
                  int foreColor,
                  int backColor,
                  int width,
                  int height,
                  int fontSize,
                  int fontStyle)
Create a new map comment.

Parameters:
name - the comment name (displayed string).
position - the Position of the comment
foreColor - the RGB foreground color, or OziAPI.DEFVAL.
backColor - the RGB background color, or OziAPI.DEFVAL.
width - the comment width in pixels, or OziAPI.DEFVAL.
height - the comment width in pixels, or OziAPI.DEFVAL.
fontSize - the font size in points, or OziAPI.DEFVAL.
fontStyle - the forn styke - 0 = normal, 1 = bold, or OziAPI.DEFVAL.

MapComment

public MapComment(String name,
                  Position position)
Create a new map comment, with default values.

Parameters:
name - the comment name (displayed string).
position - the Position of the comment.
Method Detail

equals

public boolean equals(Object that)
Test if two map comments are equal. All the fields with the exception of the number OziExplorer assigns to the map comment are used in the comparison.

Overrides:
equals in class Object
Parameters:
that - the object to compare against.
Returns:
true if the objects are equal.

hashCode

public int hashCode()
Return the hash code for this object.

Overrides:
hashCode in class Object
Returns:
the hash code for this object.

getName

public String getName()
Retrieve the name of the comment (displayed string).

Returns:
the name of the comment.

getPosition

public Position getPosition()
Retrieve the Position of the comment.

Returns:
the position of the comment.

getForeColor

public int getForeColor()
Retrieve the RGB foregeound color.

Returns:
the foreground color.

getBackColor

public int getBackColor()
Retrieve the RGB background color.

Returns:
the background color.

getWidth

public int getWidth()
Retrieve the width of the comment, in pixels.

Returns:
the width of the comment.

getHeight

public int getHeight()
Retrieve the height of the comment, in pixels.

Returns:
the height of the comment.

getFontSize

public int getFontSize()
Retrieve the font size, in points.

Returns:
the font size.

getFontStyle

public int getFontStyle()
Retrieve the font style. 0 = normal, 1 = bold.

Returns:
the font style.

getNumber

public int getNumber()
Retrieve the comment number. This is set when the comment is displayed by a call to OziAPI.addMapComment(MapComment).

Returns:
the comment number.