com.jinsight.jetchart
Class Note

java.lang.Object
  |
  +--com.jinsight.jetchart.Note
Direct Known Subclasses:
ToolTip

public class Note
extends java.lang.Object

The Note class displays notes on the chart area. Note objects can be dropped at any place and can be dragged.


Field Summary
static int CENTER
          Constant used to set text alignment to center.
static int LEFT
          Constant used to set text alignment to left.
static int RIGHT
          Constant used to set text alignment to right.
 
Constructor Summary
Note()
          Creates a Note object.
Note(java.lang.String[] note, int x, int y)
          Creates a Note object.
 
Method Summary
protected  void finalize()
           
 void setAlignment(int alignment)
          Sets text alignment.
 void setBackground(java.awt.Color background)
          Sets background color.
 void setBorderColor(java.awt.Color borderColor)
          Sets border color.
 void setBorderEnabled(boolean isBorderEnabled)
          Enables/disables a border around a Note object.
 void setBorderThickness(int borderThickness)
          Sets the border thickness.
 void setBounds(java.awt.Rectangle bounds)
          Sets the bounds of this Note object.
 void setDraggingEnabled(boolean isDraggingEnabled)
          Enables/disables dragging of a Note object.
 void setFont(java.awt.Font font)
          Sets the Note object font.
 void setForeground(java.awt.Color foreground)
          Sets foreground color.
 void setLocation(int x, int y)
          Sets the location of the Note object.
 void setOpacityEnabled(boolean isOpaque)
          Enables/disables opacity.
 void setShadowColor(java.awt.Color shadowColor)
          Sets shadow color.
 void setShadowEnabled(boolean isShadowEnabled)
          Enables/disables shadow.
 void setText(java.lang.String[] note)
          Sets text to be displayed in the Note object.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Constant used to set text alignment to left.
See Also:
setAlignment(int)

RIGHT

public static final int RIGHT
Constant used to set text alignment to right.
See Also:
setAlignment(int)

CENTER

public static final int CENTER
Constant used to set text alignment to center.
See Also:
setAlignment(int)
Constructor Detail

Note

public Note()
Creates a Note object.

Note

public Note(java.lang.String[] note,
            int x,
            int y)
Creates a Note object.
Parameters:
note - An array of strings. Each string is a new line in the Note object text.
x - An integer number representing the upper-left x coordinate of the Note object.
y - An integer number representing the upper-left y coordinate of the Note object.
Method Detail

setLocation

public void setLocation(int x,
                        int y)
Sets the location of the Note object.
Parameters:
x - An integer number representing the upper-left x coordinate of the Note object.
y - An integer number representing the upper-left y coordinate of the Note object.

setBounds

public void setBounds(java.awt.Rectangle bounds)
Sets the bounds of this Note object. By default, the width and height are calculated in respect to the width of the largest string and the sum of the height of all strings passed to a Note object, respectively. This method explicitly set the Note object dimensions, in which case the default behaviour is ignored.
Parameters:
bounds - A Rectangle object.

setText

public void setText(java.lang.String[] note)
Sets text to be displayed in the Note object.
Parameters:
note - An array of strings. Each string is a new line in the Note object.

setAlignment

public void setAlignment(int alignment)
Sets text alignment. Default alignment is LEFT.
See Also:
LEFT, RIGHT, CENTER

setFont

public void setFont(java.awt.Font font)
Sets the Note object font.
Parameters:
font - A Font object.

setForeground

public void setForeground(java.awt.Color foreground)
Sets foreground color. Text is displayed in this color. Default color is black.
Parameters:
foreground - A Color object.

setBackground

public void setBackground(java.awt.Color background)
Sets background color. If opacity is disabled, the background color is not painted. Default color is white.
Parameters:
background - A Color object.
See Also:
setOpacityEnabled(boolean)

setOpacityEnabled

public void setOpacityEnabled(boolean isOpaque)
Enables/disables opacity. If disabled, the background color is not painted. Default value is true.
Parameters:
isOpaque - A boolean value(true/false).

setDraggingEnabled

public void setDraggingEnabled(boolean isDraggingEnabled)
Enables/disables dragging of a Note object. Dragging is enabled by default.
Parameters:
isDraggingEnabled - A boolean value(true/false).

setBorderEnabled

public void setBorderEnabled(boolean isBorderEnabled)
Enables/disables a border around a Note object. The border is enabled by default.
Parameters:
isBorderEnabled - A boolean value(true/false).

setBorderColor

public void setBorderColor(java.awt.Color borderColor)
Sets border color. The border color is black by default.
Parameters:
borderColor - A Color object.

setBorderThickness

public void setBorderThickness(int borderThickness)
Sets the border thickness. The border thickness is 1 pixel by default.
Parameters:
borderThickness - An integer number equal to or larger than 1.

setShadowEnabled

public void setShadowEnabled(boolean isShadowEnabled)
Enables/disables shadow. The shadow is enabled by default.
Parameters:
isShadowEnabled - A boolean value(true/false).

setShadowColor

public void setShadowColor(java.awt.Color shadowColor)
Sets shadow color. The shadow color is black by default.
Parameters:
shadowColor - A Color object.
See Also:
setShadowEnabled(boolean)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object