Class SliderSource

    • Field Detail

      • slider

        public javax.swing.JSlider slider
        The slider that controls the output of this actor.
      • minimum

        public Parameter minimum
        The minimum value of the slider. The value must be an integer. The default value is -10.
      • maximum

        public Parameter maximum
        The maximum value of the slider. The value must be an integer. The default value is 10.
      • majorTickSpacing

        public Parameter majorTickSpacing
        The major tick spacing of the slider. The value must be an integer. The default value is 10.
      • minorTickSpacing

        public Parameter minorTickSpacing
        The minor tick spacing of the slider. The value must be an integer. The default value is 1.
    • Method Detail

      • getBackground

        public java.awt.Color getBackground()
        Return the background.
        Returns:
        The background color.
        See Also:
        setBackground(Color)
      • place

        public void place​(java.awt.Container container)
        Specify the container in which the slider should be displayed. An instance of JSlider will be added to that container. This method needs to be called before the first call to initialize(). Otherwise, an instance of JSlider will be placed in its own frame. The slider is also placed in its own frame if this method is called with a null argument. The background of the slider is set equal to that of the container (unless it is null).
        Specified by:
        place in interface Placeable
        Parameters:
        container - The container into which to place the slider.
      • prefire

        public boolean prefire()
                        throws IllegalActionException
        Record the current value of the slider. This value is output in the subsequent firings of this actor.
        Specified by:
        prefire in interface Executable
        Overrides:
        prefire in class Source
        Returns:
        True, unless the trigger input is connected and has no input.
        Throws:
        IllegalActionException - If checking the trigger for a token throws it or if the super class throws it.
      • setBackground

        public void setBackground​(java.awt.Color background)
        Set the background color of the panel that contains the slider.
        Parameters:
        background - The background color.
        See Also:
        getBackground()
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        The value of the slider changed, record the new value.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener