com.ijchart.xychart.marker
Class CategoryMarker

java.lang.Object
  extended by com.ijchart.xychart.marker.AbstractMarker
      extended by com.ijchart.xychart.marker.CategoryMarker
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class CategoryMarker
extends AbstractMarker
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

A marker for a category.
Note that for serialization to work correctly, the category key must be an instance of a serializable class.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static boolean DEFAULT_DRAW_AS_LINE
           A default flag that the marker should be drawn as a line rather than a region.
 
Fields inherited from class com.ijchart.xychart.marker.AbstractMarker
DEFAULT_FILL_PAINT, DEFAULT_TEXT_POSITION
 
Constructor Summary
CategoryMarker(java.lang.Object datasetRowOrColumnKey)
           Creates a new category marker for the specified category.
CategoryMarker(java.lang.Object datasetRowOrColumnKey, java.awt.Paint fillPaint)
           Creates a new category marker.
CategoryMarker(java.lang.Object datasetRowOrColumnKey, java.awt.Paint fillPaint, java.awt.Paint borderPaint, java.awt.Stroke borderStroke, float fillAlpha)
           Creates a new category marker.
 
Method Summary
 java.lang.Object clone()
           Creates a clone of the marker.
 boolean equals(java.lang.Object obj)
           Tests the marker for equality with an arbitrary object.
 java.lang.Object getKey()
           Returns the dataset rowKey or colKey value.
 int hashCode()
           Returns a hash code value for the object.
 boolean isDrawAsLine()
           Returns the flag that controls whether the marker is drawn as a region or a line.
 void setDrawAsLine(boolean drawAsLine)
           Sets the flag that controls whether the marker is drawn as a region or as a line, and sends a MarkerChangeEvent to all registered listeners.
 void setKey(java.lang.Object datasetRowOrColumnKey)
           Sets the dataset rowKey and sends a MarkerChangeEvent to all registered listeners.
 java.lang.String toString()
           Returns a string representation of the object.
 
Methods inherited from class com.ijchart.xychart.marker.AbstractMarker
addChangeListener, fireMarkerChanged, getBorderPaint, getBorderStroke, getFillAlpha, getFillPaint, getListeners, getMargin, getText, getTextFont, getTextHorizontalAlign, getTextPaint, getTextPosition, getTextVerticalAlign, isDrawBorder, isDrawText, isFillShape, notifyListeners, removeChangeListener, setBorderPaint, setBorderStroke, setDrawBorder, setDrawText, setFillAlpha, setFillPaint, setFillShape, setMargin, setText, setTextFont, setTextHorizontalAlign, setTextPaint, setTextPosition, setTextVerticalAlign
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DRAW_AS_LINE

public static final boolean DEFAULT_DRAW_AS_LINE
A default flag that the marker should be drawn as a line rather than a region.

See Also:
Constant Field Values
Constructor Detail

CategoryMarker

public CategoryMarker(java.lang.Object datasetRowOrColumnKey)
Creates a new category marker for the specified category.

Parameters:
datasetRowOrColumnKey - Object The dataset rowKey or colKey value (null not permitted).

CategoryMarker

public CategoryMarker(java.lang.Object datasetRowOrColumnKey,
                      java.awt.Paint fillPaint)
Creates a new category marker.

Parameters:
datasetRowOrColumnKey - Object The dataset rowKey or colKey value.
fillPaint - The fill paint (null not permitted).

CategoryMarker

public CategoryMarker(java.lang.Object datasetRowOrColumnKey,
                      java.awt.Paint fillPaint,
                      java.awt.Paint borderPaint,
                      java.awt.Stroke borderStroke,
                      float fillAlpha)
Creates a new category marker.

Parameters:
datasetRowOrColumnKey - Object The dataset rowKey or colKey value.
fillPaint - The fill paint (null not permitted).
borderPaint - The border paint (null permitted).
borderStroke - The border stroke (null permitted).
fillAlpha - The alpha transparency (must be in the range 0.0f to 1.0f).
Method Detail

getKey

public java.lang.Object getKey()
Returns the dataset rowKey or colKey value.

Returns:
Object The dataset rowKey or colKey value (never null).

setKey

public void setKey(java.lang.Object datasetRowOrColumnKey)
Sets the dataset rowKey and sends a MarkerChangeEvent to all registered listeners.

Parameters:
datasetRowOrColumnKey - The dataset rowKey or colKey value.

isDrawAsLine

public boolean isDrawAsLine()
Returns the flag that controls whether the marker is drawn as a region or a line.

Returns:
boolean A boolean.

setDrawAsLine

public void setDrawAsLine(boolean drawAsLine)
Sets the flag that controls whether the marker is drawn as a region or as a line, and sends a MarkerChangeEvent to all registered listeners.

Parameters:
drawAsLine - boolean A boolean.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class AbstractMarker
Returns:
int The hashcode value.

equals

public boolean equals(java.lang.Object obj)
Tests the marker for equality with an arbitrary object.

Overrides:
equals in class AbstractMarker
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a clone of the marker.

Overrides:
clone in class AbstractMarker
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - never.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class AbstractMarker
Returns:
a string representation of the object.