Class SVGButton


  • public class SVGButton
    extends java.lang.Object
    Class to draw a button as SVG.
    Since:
    0.5.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private CSSClass butcss
      Class for the buttons main CSS
      static java.lang.String DEFAULT_BUTTON_COLOR
      Default button color
      static java.lang.String DEFAULT_TEXT_COLOR
      Default text color
      private double h
      Height
      private double r
      Corner rounding factor.
      private java.lang.String title
      Button title, optional
      private CSSClass titlecss
      Title styling
      private double w
      Width
      private double x
      X position
      private double y
      Y position
    • Constructor Summary

      Constructors 
      Constructor Description
      SVGButton​(double x, double y, double w, double h, double r)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.w3c.dom.Element render​(SVGPlot svgp)
      Produce the actual SVG elements for the button.
      void setTitle​(java.lang.String title, java.lang.String textcolor)
      Set the button title
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_BUTTON_COLOR

        public static final java.lang.String DEFAULT_BUTTON_COLOR
        Default button color
        See Also:
        Constant Field Values
      • DEFAULT_TEXT_COLOR

        public static final java.lang.String DEFAULT_TEXT_COLOR
        Default text color
        See Also:
        Constant Field Values
      • x

        private double x
        X position
      • y

        private double y
        Y position
      • w

        private double w
        Width
      • h

        private double h
        Height
      • r

        private double r
        Corner rounding factor. NaN = no rounding
      • butcss

        private CSSClass butcss
        Class for the buttons main CSS
      • title

        private java.lang.String title
        Button title, optional
      • titlecss

        private CSSClass titlecss
        Title styling
    • Constructor Detail

      • SVGButton

        public SVGButton​(double x,
                         double y,
                         double w,
                         double h,
                         double r)
        Constructor.
        Parameters:
        x - Position X
        y - Position Y
        w - Width
        h - Height
        r - Rounded radius
    • Method Detail

      • render

        public org.w3c.dom.Element render​(SVGPlot svgp)
        Produce the actual SVG elements for the button.
        Parameters:
        svgp - Plot to draw to
        Returns:
        Button wrapper element
      • setTitle

        public void setTitle​(java.lang.String title,
                             java.lang.String textcolor)
        Set the button title
        Parameters:
        title - Button title
        textcolor - Color