Class BarStyle.Form

java.lang.Object
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

    Constructors
    Modifier
    Constructor
    Description
    protected
    Form(String name, boolean isOpaque)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    Indicates whether this bar form is as opaque as the colour of the supplied graphics context.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Form

      protected Form(String name, boolean isOpaque)
  • Method Details

    • 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