khartzToolz
Class BarSegment

java.lang.Object
  |
  +--khartzToolz.ChartSegment
        |
        +--khartzToolz.BarSegment

public class BarSegment
extends khartzToolz.ChartSegment

The basic class for creating a bar chart segment

Since:
23/2/2003
Version:
1.1
Author:
Austin Warren

Field Summary
 khartzToolz.KhartzLabel segValLabel
           
 java.awt.Label theLabel
           
 
Constructor Summary
BarSegment(KhartzChart k, int seq, double value, java.lang.String label, java.awt.Rectangle layout, java.awt.Color barColor)
          Standard constructor for a bar chart segment
 
Method Summary
 void calcClickArea()
          Calculates the area that can be clicked on with a mouse to perform an action.
 int compareTo(java.lang.Object o)
          This method attempts to determine a logical ordering between objects using the segment characteristics to determine this.
 boolean contains(java.awt.Point p)
           
 boolean equals(khartzToolz.ChartSegment cs)
           
 java.awt.Rectangle getBarArea()
          Access method for the barArea property.
 java.awt.Point getCentre()
          Access method for the centre property.
 KhartzChart getChart()
          Returns the current containing chart
 java.awt.Color getColor()
          Fetches the current chart segment's colour
 java.util.Date getDate()
          Returns the date associated with the current segment
 boolean getHighlight()
           
 java.lang.String getLabel()
          Returns the current label
 java.awt.Polygon getSegArea()
          Returns the current segment area
 int getSequence()
          Fetches the segment's current sequence within the chart.
 java.awt.Rectangle getSize()
          Returns the dimensions of the current chart segment
 java.awt.Color getTextColor()
          Returns the current selected text color for the segment
 double getValue()
           
 khartzToolz.KhartzLabel getXLabel()
          Access method for the xLabel property.
 void initialisePoly(java.awt.Rectangle r)
          The common initialisation for the Polygon area contained by the chart segment
 void paint(java.awt.Graphics g)
          This is the standard drawing routine for the segment and must be overridden
 void setBarArea(java.awt.Rectangle aBarArea)
          Sets the value of the barArea property.
 void setCentre(java.awt.Point aCentre)
          Sets the value of the centre property.
 void setColor(java.awt.Color c)
          Sets the current colour for the chart segment
 void setDate(java.util.Date d)
           
 void setHighlight(boolean b)
           
 void setLabel(java.lang.String s)
          Sets the label for the segment
 void setSegArea(java.awt.Polygon p)
           
 void setTextColor(java.awt.Color c)
          Sets the text color for the current chart segment
 void setValue(double val)
          Sets the current value for the segment
 void setXLabel(khartzToolz.KhartzLabel aXLabel)
          Sets the value of the xLabel property.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theLabel

public java.awt.Label theLabel

segValLabel

public khartzToolz.KhartzLabel segValLabel
Constructor Detail

BarSegment

public BarSegment(KhartzChart k,
                  int seq,
                  double value,
                  java.lang.String label,
                  java.awt.Rectangle layout,
                  java.awt.Color barColor)
Standard constructor for a bar chart segment
Parameters:
k - An instance of the containing chart
seq - An integer representing this segments position within the sequence of segments in the chart.
value - The value that this segment is displaying
label - The text label for this segment
layout - A rectangle that contains the position and the height and width of the rectangle.
barColor - The display color for this segment
Since:
30/12/2002
Method Detail

getBarArea

public java.awt.Rectangle getBarArea()
Access method for the barArea property.
Returns:
the current value of the barArea property

setBarArea

public void setBarArea(java.awt.Rectangle aBarArea)
Sets the value of the barArea property.
Parameters:
aBarArea - the new value of the barArea property

getXLabel

public khartzToolz.KhartzLabel getXLabel()
Access method for the xLabel property.
Returns:
the current value of the xLabel property

setXLabel

public void setXLabel(khartzToolz.KhartzLabel aXLabel)
Sets the value of the xLabel property.
Parameters:
aXLabel - the new value of the xLabel property

toString

public java.lang.String toString()
Overrides:
toString in class khartzToolz.ChartSegment
Returns:
String
Since:
30/12/2002

equals

public boolean equals(khartzToolz.ChartSegment cs)
Overrides:
equals in class khartzToolz.ChartSegment
Parameters:
cs -  
Returns:
boolean
Since:
30/12/2002

contains

public boolean contains(java.awt.Point p)
Overrides:
contains in class khartzToolz.ChartSegment
Parameters:
p -  
Returns:
boolean
Since:
30/12/2002

paint

public void paint(java.awt.Graphics g)
Description copied from class: khartzToolz.ChartSegment
This is the standard drawing routine for the segment and must be overridden
Overrides:
paint in class khartzToolz.ChartSegment
Parameters:
g -  
Since:
30/12/2002

calcClickArea

public void calcClickArea()
Description copied from class: khartzToolz.ChartSegment
Calculates the area that can be clicked on with a mouse to perform an action. Defined wtihin each chart type
Overrides:
calcClickArea in class khartzToolz.ChartSegment
Since:
30/12/2002

compareTo

public int compareTo(java.lang.Object o)
Description copied from class: khartzToolz.ChartSegment
This method attempts to determine a logical ordering between objects using the segment characteristics to determine this. This is not related to the equals() method.
Overrides:
compareTo in class khartzToolz.ChartSegment
Parameters:
o -  
Returns:
int
Since:
30/12/2002

getCentre

public java.awt.Point getCentre()
Access method for the centre property.
Returns:
the current value of the centre property

setCentre

public void setCentre(java.awt.Point aCentre)
Sets the value of the centre property.
Parameters:
aCentre - the new value of the centre property

getValue

public double getValue()
Returns:
double
Since:
30/12/2002

setValue

public void setValue(double val)
Sets the current value for the segment
Parameters:
val -  
Since:
30/12/2002

setLabel

public void setLabel(java.lang.String s)
Sets the label for the segment
Parameters:
s - A String containing the text to be displayed as a label
Since:
30/12/2002

setDate

public void setDate(java.util.Date d)
Parameters:
d -  
Since:
30/12/2002

setColor

public void setColor(java.awt.Color c)
Sets the current colour for the chart segment
Parameters:
c -  
Since:
30/12/2002

getColor

public java.awt.Color getColor()
Fetches the current chart segment's colour
Returns:
Returns the current segment colour
Since:
30/12/2002

initialisePoly

public void initialisePoly(java.awt.Rectangle r)
The common initialisation for the Polygon area contained by the chart segment
Parameters:
r - A Rectangle representing the chart segment display area
Since:
30/12/2002

setTextColor

public void setTextColor(java.awt.Color c)
Sets the text color for the current chart segment
Parameters:
c -  
Since:
30/12/2002

getTextColor

public java.awt.Color getTextColor()
Returns the current selected text color for the segment
Returns:
Returns the currently selected Color for the segment text
Since:
30/12/2002

getSequence

public int getSequence()
Fetches the segment's current sequence within the chart.
Returns:
int
Since:
30/12/2002

getHighlight

public boolean getHighlight()
Returns:
boolean
Since:
30/12/2002

setHighlight

public void setHighlight(boolean b)
Parameters:
b -  
Since:
30/12/2002

getSize

public java.awt.Rectangle getSize()
Returns the dimensions of the current chart segment
Returns:
A rectangle containg the x,y coordinates and the dimensions of the segment.
Since:
30/12/2002

getLabel

public java.lang.String getLabel()
Returns the current label
Returns:
The current label
Since:
30/12/2002

getDate

public java.util.Date getDate()
Returns the date associated with the current segment
Returns:
Return a Date
Since:
30/12/2002

getChart

public KhartzChart getChart()
Returns the current containing chart
Returns:
khartzToolz.KhartzChart
Since:
30/12/2002

getSegArea

public java.awt.Polygon getSegArea()
Returns the current segment area
Returns:
java.awt.Polygon
Since:
30/12/2002

setSegArea

public void setSegArea(java.awt.Polygon p)
Parameters:
p -  
Since:
30/12/2002