uk.ac.starlink.ttools.plot
Class BarStyle.Form

java.lang.Object
  extended by uk.ac.starlink.ttools.plot.BarStyle.Form
Enclosing class:
BarStyle

public abstract static class BarStyle.Form
extends Object

Describes the form of a bar style, that is what each bar looks like.


Constructor Summary
protected BarStyle.Form(String name, boolean isOpaque)
           
 
Method Summary
abstract  void drawBar(Graphics g, int x, int y, int width, int height)
          Draws a bar.
 void drawEdge(Graphics g, int x, int y1, int y2)
          Draws the edge of a bar.
 boolean isOpaque()
          Indicates whether this bar form is as opaque as the colour of the supplied graphics context.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BarStyle.Form

protected BarStyle.Form(String name,
                        boolean isOpaque)
Method Detail

drawBar

public abstract void drawBar(Graphics g,
                             int x,
                             int y,
                             int width,
                             int height)
Draws a bar. The whole region described by x, y, width and height is available for drawing in.

Parameters:
g - graphics context
x - left X coordinate of region (lowest X value permitted)
y - lower Y coordinate of region (lowest Y value permitted)
width - width of region (x+width is highest X value permitted)
height - height of region (y+height is highest Y value permitted)

drawEdge

public void drawEdge(Graphics g,
                     int x,
                     int y1,
                     int y2)
Draws the edge of a bar. This can be invoked to draw the boundary between one bar and its immediate neighbour; the edge described by the call's parameters is not the edge of the block representing the bar's data, but the edge between the current bar and its neighbour on one side or the other, so it may go up or down from the Y value.

The default implementation does nothing, which is correct for many forms.

Parameters:
g - graphics context
x - x position of the edge
y1 - one y value of the edge
y2 - other y value of the edge

isOpaque

public boolean isOpaque()
Indicates whether this bar form is as opaque as the colour of the supplied graphics context. If it adjusts the alpha of the supplied colour, it must return false.

Returns:
true iff alpha is not adjusted

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.