Class BarStyle.Form

  • Enclosing class:
    BarStyle

    public abstract static class BarStyle.Form
    extends java.lang.Object
    Describes the form of a bar style, that is what each bar looks like.
    • Constructor Summary

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

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void drawBar​(java.awt.Graphics g, int x, int y, int width, int height)
      Draws a bar.
      void drawEdge​(java.awt.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.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Form

        protected Form​(java.lang.String name,
                       boolean isOpaque)
    • Method Detail

      • drawBar

        public abstract void drawBar​(java.awt.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​(java.awt.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object