java.lang.Object
org.opensourcephysics.display3d.simple3d.Element
org.opensourcephysics.display3d.simple3d.Group
All Implemented Interfaces:
Data, Element, Group, InteractionSource
Direct Known Subclasses:
Set

public class Group extends Element implements Group

Title: Group

Description: A Group is an element that is made of other elements.

The group's position, size, visibility and transformation do affect the elements in the group. The group's style doesn't, though.
Version:
March 2005
Author:
Francisco Esquembre
See Also:
  • Field Details

    • datasetID

      protected int datasetID
      an integer ID that identifies this object
  • Constructor Details

    • Group

      public Group()
  • Method Details

    • addElement

      public void addElement(Element element)
      Description copied from interface: Group
      Adds an Element to this Group.
      Specified by:
      addElement in interface Group
      Parameters:
      element - Element
      See Also:
    • addElements

      public void addElements(Collection<Element> elements)
    • removeElement

      public void removeElement(Element element)
      Description copied from interface: Group
      Removes an Element from this Group
      Specified by:
      removeElement in interface Group
      Parameters:
      element - Element
      See Also:
    • removeAllElements

      public void removeAllElements()
      Description copied from interface: Group
      Removes all Elements from this Group
      Specified by:
      removeAllElements in interface Group
      See Also:
    • getElements

      public List<Element> getElements()
      Description copied from interface: Group
      Gets the cloned list of Elements in the group. (Should be synchronized.)
      Specified by:
      getElements in interface Group
      Returns:
      cloned list
    • getElement

      public Element getElement(int index)
      Description copied from interface: Group
      Gets the elements of the group at a given index.
      Specified by:
      getElement in interface Group
      Returns:
      the given element (null if the index is not within allowed bounds)
    • getExtrema

      public void getExtrema(double[] min, double[] max)
    • getTargetHit

      public 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
    • setID

      public void setID(int id)
      Sets the ID number of this Data.
      Specified by:
      setID in interface Data
      Parameters:
      id - the ID number
    • getID

      public int getID()
      Returns a unique identifier for this Data.
      Specified by:
      getID in interface Data
      Returns:
      the ID number
    • getData2D

      public double[][] getData2D()
      Description copied from interface: Data
      Gets a 2D array of data. The first column, double[0][] often contains x-values; Remaining columns often contain y values. May return null if data not yet generated or object does not support 2D data.
      Specified by:
      getData2D in interface Data
      Returns:
      double[][]
    • getData3D

      public double[][][] getData3D()
      Description copied from interface: Data
      Gets a 3D array of data. May return null if data not yet generated or object does not support 3D data.
      Specified by:
      getData3D in interface Data
      Returns:
      double[][][]
    • getColumnNames

      public String[] getColumnNames()
      Description copied from interface: Data
      The column names to be used in the data display tool
      Specified by:
      getColumnNames in interface Data
      Returns:
      an array of names
    • getLineColors

      public Color[] getLineColors()
      Description copied from interface: Data
      Line color to use for this data
      Specified by:
      getLineColors in interface Data
      Returns:
      a color
    • getFillColors

      public Color[] getFillColors()
      Description copied from interface: Data
      Fill color to use for this data
      Specified by:
      getFillColors in interface Data
      Returns:
      a color
    • getDataList

      public List<Data> getDataList()
      Description copied from interface: Data
      Some Data objects (e.g., a Group) do not contain data, but a list of Data objects which do. This method is used by Data displaying tools to create as many pages as needed.
      Specified by:
      getDataList in interface Data
      Returns:
      a list of Data objects, or null if this object contains data
    • getDatasets

      public ArrayList<Dataset> getDatasets()
      Description copied from interface: Data
      Gets a list of OSP Datasets. May return null if data not yet generated or object does not support Datasets.
      Specified by:
      getDatasets in interface Data
      Returns:
      list of Datasets
    • getLoader

      public static XML.ObjectLoader getLoader()