Class KnobFigure

    • Field Detail

      • WHITE_COLOR

        private static final org.eclipse.swt.graphics.Color WHITE_COLOR
      • GRAY_COLOR

        private static final org.eclipse.swt.graphics.Color GRAY_COLOR
      • DEFAULT_LABEL_FONT

        private static final org.eclipse.swt.graphics.Font DEFAULT_LABEL_FONT
      • DISABLED_ALPHA

        private static final int DISABLED_ALPHA
        The alpha (0 is transparency and 255 is opaque) for disabled paint
        See Also:
        Constant Field Values
      • effect3D

        private boolean effect3D
      • increment

        private double increment
      • bulb

        private Bulb bulb
      • thumbColor

        private org.eclipse.swt.graphics.Color thumbColor
      • valueLabel

        private org.eclipse.draw2d.Label valueLabel
    • Constructor Detail

      • KnobFigure

        public KnobFigure()
    • Method Detail

      • addManualValueChangeListener

        public void addManualValueChangeListener​(IManualValueChangeListener listener)
        Add a knob listener.
        Parameters:
        listener - The knob listener to add.
      • calcValueChange

        private double calcValueChange​(double difference,
                                       double oldValue)
        Convert the difference of two points to the corresponding value to be changed.
        Parameters:
        difference - the different theta value in degrees between two polar points.
        oldValue - the old value before this change
        Returns:
        the value to be changed
      • fireManualValueChange

        private void fireManualValueChange​(double newManualValue)
        Inform all knob listeners, that the manual value has changed.
        Parameters:
        newManualValue - the new manual value
      • getIncrement

        public double getIncrement()
        Returns:
        the increment
      • getThumbColor

        public org.eclipse.swt.graphics.Color getThumbColor()
        Returns:
        the thumbColor
      • isEffect3D

        public boolean isEffect3D()
        Returns:
        the effect3D
      • manualSetValue

        public void manualSetValue​(double value)
        Set Value from manual control of the widget. Value will be coerced in range.
        Parameters:
        value -
      • paintClientArea

        protected void paintClientArea​(org.eclipse.draw2d.Graphics graphics)
        Overrides:
        paintClientArea in class org.eclipse.draw2d.Figure
      • setBounds

        public void setBounds​(org.eclipse.draw2d.geometry.Rectangle rect)
        Specified by:
        setBounds in interface org.eclipse.draw2d.IFigure
        Overrides:
        setBounds in class org.eclipse.draw2d.Figure
      • setBulbColor

        public void setBulbColor​(org.eclipse.swt.graphics.Color color)
        Parameters:
        color - the bulb color to set
      • setCursor

        public void setCursor​(org.eclipse.swt.graphics.Cursor cursor)
        Specified by:
        setCursor in interface org.eclipse.draw2d.IFigure
        Overrides:
        setCursor in class org.eclipse.draw2d.Figure
      • setEffect3D

        public void setEffect3D​(boolean effect3D)
        Parameters:
        effect3D - the effect3D to set
      • setEnabled

        public void setEnabled​(boolean value)
        Specified by:
        setEnabled in interface org.eclipse.draw2d.IFigure
        Overrides:
        setEnabled in class org.eclipse.draw2d.Figure
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font f)
        Specified by:
        setFont in interface org.eclipse.draw2d.IFigure
        Overrides:
        setFont in class org.eclipse.draw2d.Figure
      • setIncrement

        public void setIncrement​(double increment)
        Parameters:
        increment - the increment to set
      • setThumbColor

        public void setThumbColor​(org.eclipse.swt.graphics.Color thumbColor)
        Parameters:
        thumbColor - the thumbColor to set
      • setValueLabelVisibility

        public void setValueLabelVisibility​(boolean visible)