Class ElementSpring

java.lang.Object
org.opensourcephysics.display3d.simple3d.Element
org.opensourcephysics.display3d.simple3d.ElementSpring
All Implemented Interfaces:
Element, ElementSpring, InteractionSource

public class ElementSpring extends Element implements ElementSpring

Title: ElementSegment

Description: A Segment using the painter's algorithm

Version:
March 2005
Author:
Francisco Esquembre
  • Constructor Details

    • ElementSpring

      public ElementSpring()
  • Method Details

    • setRadius

      public void setRadius(double radius)
      Description copied from interface: ElementSpring
      Sets the radius of the spring.
      Specified by:
      setRadius in interface ElementSpring
      Parameters:
      radius - the radius of the spring (normal to its direction)
    • getRadius

      public double getRadius()
      Description copied from interface: ElementSpring
      Gets the radius of the spring.
      Specified by:
      getRadius in interface ElementSpring
    • getTargetHit

      protected InteractionTarget getTargetHit(int x, int y)
      Description copied from class: Element
      Gets the target that is under the (x,y) position of the screen
      Overrides:
      getTargetHit in class Element
      Parameters:
      x - int
      y - int
      Returns:
      InteractionTarget
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load object data.
      Returns:
      the XML.ObjectLoader