Class SVGCheckbox


  • public class SVGCheckbox
    extends java.lang.Object
    SVG checkbox.
    Since:
    0.5.0
    Author:
    Sascha Goldhofer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean checked
      Status flag
      protected java.lang.String label
      Checkbox label
      protected javax.swing.event.EventListenerList listenerList
      Event listeners
    • Constructor Summary

      Constructors 
      Constructor Description
      SVGCheckbox​(boolean checked)
      Constructor, without label
      SVGCheckbox​(boolean checked, java.lang.String label)
      Constructor, with label
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCheckBoxListener​(javax.swing.event.ChangeListener listener)
      Register a listener for this checkbox.
      protected void fireSwitchEvent​(javax.swing.event.ChangeEvent evt)
      Fire the event to listeners
      boolean isChecked()
      Return the checkmark status.
      void removeCheckBoxListener​(javax.swing.event.ChangeListener listener)
      Remove a listener for this checkbox.
      org.w3c.dom.Element renderCheckBox​(SVGPlot svgp, double x, double y, double size)
      Render the SVG checkbox to a plot
      • Methods inherited from class java.lang.Object

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

      • checked

        protected boolean checked
        Status flag
      • listenerList

        protected javax.swing.event.EventListenerList listenerList
        Event listeners
      • label

        protected java.lang.String label
        Checkbox label
    • Constructor Detail

      • SVGCheckbox

        public SVGCheckbox​(boolean checked)
        Constructor, without label
        Parameters:
        checked - Checked status
      • SVGCheckbox

        public SVGCheckbox​(boolean checked,
                           java.lang.String label)
        Constructor, with label
        Parameters:
        checked - Checked status
        label - Label
    • Method Detail

      • renderCheckBox

        public org.w3c.dom.Element renderCheckBox​(SVGPlot svgp,
                                                  double x,
                                                  double y,
                                                  double size)
        Render the SVG checkbox to a plot
        Parameters:
        svgp - Plot to draw to
        x - X offset
        y - Y offset
        size - Size factor
        Returns:
        Container element
      • addCheckBoxListener

        public void addCheckBoxListener​(javax.swing.event.ChangeListener listener)
        Register a listener for this checkbox.
        Parameters:
        listener - Listener to add
      • removeCheckBoxListener

        public void removeCheckBoxListener​(javax.swing.event.ChangeListener listener)
        Remove a listener for this checkbox.
        Parameters:
        listener - Listener to remove
      • isChecked

        public boolean isChecked()
        Return the checkmark status.
        Returns:
        true, when checked
      • fireSwitchEvent

        protected void fireSwitchEvent​(javax.swing.event.ChangeEvent evt)
        Fire the event to listeners
        Parameters:
        evt - Event to fire