Class JDSlider


public class JDSlider extends JDRectangular
JDraw Slider graphic object.
  • Field Details

    • SLIDER_HORIZONTAL_LEFT

      public static final int SLIDER_HORIZONTAL_LEFT
      Horizontal bar , min at feft
      See Also:
    • SLIDER_HORIZONTAL_RIGHT

      public static final int SLIDER_HORIZONTAL_RIGHT
      Horizontal bar , min at right
      See Also:
    • SLIDER_VERTICAL_TOP

      public static final int SLIDER_VERTICAL_TOP
      Vertical bar , min at top
      See Also:
    • SLIDER_VERTICAL_BOTTOM

      public static final int SLIDER_VERTICAL_BOTTOM
      Vertical bar , min at bottom
      See Also:
  • Constructor Details

    • JDSlider

      public JDSlider(String objectName, int x, int y, int w, int h)
      Contructs a JDSlider.
      Parameters:
      objectName - Object name
      x - Up left corner x coordinate
      y - Up left corner y coordinate
      w - Rectangle width
      h - Rectangle height
  • Method Details

    • copy

      public JDObject copy(int x, int y)
      Description copied from class: JDObject
      Returns a copy of this object at the specified location.
      Specified by:
      copy in class JDObject
      Parameters:
      x - Horizontal position of the copied object (pixel)
      y - Vertical Position of the copied object (pixel)
      Returns:
      The copy of this object.
    • isInsideObject

      public boolean isInsideObject(int x, int y)
      Overrides:
      isInsideObject in class JDObject
      Parameters:
      x - X coordinate (pixel)
      y - Y coordinate (pixel)
      Returns:
      whether the specified point is inside this object.
    • paint

      public void paint(JDrawEditor parent, Graphics g)
      Description copied from class: JDObject
      Paints this object.
      Overrides:
      paint in class JDRectangular
      Parameters:
      parent - JdrawEditor parent (Can be null except for JDSwingObject)
      g - the specified Graphics window
    • setMaximum

      public void setMaximum(double m)
      Sets the slider's maximum value . It is used to handle the bar position calculation.
      Parameters:
      m - Maximum value
    • getMaximum

      public double getMaximum()
      Returns:
      the slider's maximum value.
      See Also:
    • setMinimum

      public void setMinimum(double m)
      Sets the slider's minimum value . It is used to handle the slider position calculation.
      Parameters:
      m - Miniimum value
    • getMinimum

      public double getMinimum()
      Returns:
      the slider's maximum value.
      See Also:
    • setSliderValue

      public void setSliderValue(double v)
      Sets the slider value.
      Parameters:
      v - slider value.
    • getSliderValue

      public double getSliderValue()
      Returns:
      the current slider value.
    • setOrientation

      public void setOrientation(int o)
      Sets the bar orientation.
      Parameters:
      o - Orientation value
      See Also:
    • getOrientation

      public int getOrientation()
      Returns:
      the current bar orientation.
      See Also:
    • getCursor

      public JDObject getCursor()
      Returns:
      the current cursor object.
      See Also:
    • setCursor

      public void setCursor(JDObject nCursor)
      Sets the cursor object.
      Parameters:
      nCursor - Cursor object