gcspy.vis.plugins.histogram
Class HistogramConfig

java.lang.Object
  extended by gcspy.vis.plugins.histogram.HistogramConfig

 class HistogramConfig
extends java.lang.Object

Wrapped up settings for the histogram graph

Author:
Hanspeter Johner

Constructor Summary
HistogramConfig(int streamID, TileManagerColors tmColors)
          A new histogram configuration
 
Method Summary
(package private)  int calcTileForPoint(int imageX, int imageY)
          Calculate the tile corresponding to a position on the chart
(package private)  int calcWidth(int tileNum)
          Get/calculate the width of the canvas
(package private)  java.awt.Color getBGColor()
          Get the background colour
(package private)  int getBottomFreeBorder()
          Get the size of the chart's bottom border in pixels
(package private)  int getCanvasHeight()
          Get the height of the canvas
(package private)  int getCanvasWidth()
          Get the width of the canvas
(package private)  java.awt.Color getChartAxisColor()
          Get the colour of the axis
(package private)  java.awt.Font getChartFont()
          Get the chart's font
(package private)  java.awt.Color getChartFontColor()
          Get the font colour
(package private)  java.awt.Color getChartLineColor()
          Get the colour of the line
(package private)  java.awt.Color getColorForTile(int index)
          Get the colour of a tile
(package private)  int getColumnDrawablePercent()
          Get the maximum fraction of the column height that we are prepared to draw
(package private)  int getColumnMaxHeight()
          Get the maximum height of a column in pixels
(package private)  int getLeftFreeBorder()
          Get the size of the chart's left border in pixels
(package private)  java.awt.Color getMarkColor()
          Get the zero colour
(package private)  int getOverflowTopGap()
          Get the overflow gap
(package private)  int getOverflowTopRectHeight()
          Get the overflow height
(package private)  int getRightFreeBorder()
          Get the size of the chart's right border in pixels
 int getStream()
          Get selected stream
(package private)  int getTileWidth()
          Get the width of a tile (column) in pixels
(package private)  int getTopFreeBorder()
          Get the size of the chart's top border in pixels
(package private)  int getXZero()
          Get the x-coordinate of the chart's origin
(package private)  int getYZero()
          Get the yx-coordinate of the chart's origin
(package private)  java.awt.Color getZeroColor()
          Get the zero colour
(package private)  void setColorForTile(int index, java.awt.Color color)
          Set the colour of a tile
 void setStream(int stream)
          Set selected stream
 void setStreamColor(java.awt.Color color)
          Set the stream color for the histogram image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistogramConfig

HistogramConfig(int streamID,
                TileManagerColors tmColors)
A new histogram configuration

Parameters:
streamID - The stream to graph
tmColors - the tile color configuration
Method Detail

calcWidth

int calcWidth(int tileNum)
Get/calculate the width of the canvas

Parameters:
tileNum - Current number of tiles
Returns:
the width

getCanvasWidth

int getCanvasWidth()
Get the width of the canvas

Returns:
the width

getCanvasHeight

int getCanvasHeight()
Get the height of the canvas

Returns:
the height

getXZero

int getXZero()
Get the x-coordinate of the chart's origin

Returns:
the coordinate

getYZero

int getYZero()
Get the yx-coordinate of the chart's origin

Returns:
the coordinate

getTopFreeBorder

int getTopFreeBorder()
Get the size of the chart's top border in pixels

Returns:
the size

getRightFreeBorder

int getRightFreeBorder()
Get the size of the chart's right border in pixels

Returns:
the size

getBottomFreeBorder

int getBottomFreeBorder()
Get the size of the chart's bottom border in pixels

Returns:
the size

getLeftFreeBorder

int getLeftFreeBorder()
Get the size of the chart's left border in pixels

Returns:
the size

getTileWidth

int getTileWidth()
Get the width of a tile (column) in pixels

Returns:
the width

getColumnMaxHeight

int getColumnMaxHeight()
Get the maximum height of a column in pixels

Returns:
the height

getColumnDrawablePercent

int getColumnDrawablePercent()
Get the maximum fraction of the column height that we are prepared to draw

Returns:
the fraction as a percentage

getOverflowTopRectHeight

int getOverflowTopRectHeight()
Get the overflow height

Returns:
the height

getOverflowTopGap

int getOverflowTopGap()
Get the overflow gap

Returns:
the gap

calcTileForPoint

int calcTileForPoint(int imageX,
                     int imageY)
Calculate the tile corresponding to a position on the chart

Parameters:
imageX - The x-coordinate
imageY - The y-coordinate
Returns:
The tile index

getChartAxisColor

java.awt.Color getChartAxisColor()
Get the colour of the axis

Returns:
the colour

getChartLineColor

java.awt.Color getChartLineColor()
Get the colour of the line

Returns:
the colour

getBGColor

java.awt.Color getBGColor()
Get the background colour

Returns:
the colour

getZeroColor

java.awt.Color getZeroColor()
Get the zero colour

Returns:
the colour

getColorForTile

java.awt.Color getColorForTile(int index)
Get the colour of a tile

Parameters:
index - the tile's index
Returns:
the colour

getChartFontColor

java.awt.Color getChartFontColor()
Get the font colour

Returns:
the colour

getMarkColor

java.awt.Color getMarkColor()
Get the zero colour

Returns:
the colour

getChartFont

java.awt.Font getChartFont()
Get the chart's font

Returns:
the font

setColorForTile

void setColorForTile(int index,
                     java.awt.Color color)
Set the colour of a tile

Parameters:
index - the tile's index
color - the tile's colour

setStream

public void setStream(int stream)
Set selected stream

Parameters:
stream - Stream's index

getStream

public int getStream()
Get selected stream

Returns:
Stream's index

setStreamColor

public void setStreamColor(java.awt.Color color)
Set the stream color for the histogram image

Parameters:
color - The Stream's base color