Package gaiasky.data

Class JsonLoader<T extends SceneGraphNode>

java.lang.Object
gaiasky.data.JsonLoader<T>
All Implemented Interfaces:
ISceneGraphLoader

public class JsonLoader<T extends SceneGraphNode>
extends java.lang.Object
implements ISceneGraphLoader
Implements the loading of scene graph nodes using libgdx's json library. It loads entities in the JSON format described in this link.
  • Constructor Summary

    Constructors
    Constructor Description
    JsonLoader()  
  • Method Summary

    Modifier and Type Method Description
    java.util.Map<java.lang.String,​java.lang.Object> convertJsonToMap​(com.badlogic.gdx.utils.JsonValue json)  
    int depth​(com.badlogic.gdx.utils.JsonValue attribute)  
    void initialize​(java.lang.String[] files)  
    void initialize​(uk.ac.starlink.util.DataSource ds)  
    com.badlogic.gdx.utils.Array<? extends SceneGraphNode> loadData()  
    void setDescription​(java.lang.String description)  
    void setName​(java.lang.String name)  
    void setParams​(java.util.Map<java.lang.String,​java.lang.Object> params)  
    Pair<java.lang.Object,​java.lang.Class> to1DoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)  
    Pair<java.lang.Object,​java.lang.Class> to2DoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)  
    Pair<java.lang.Object,​java.lang.Class> to3DoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)  
    Pair<java.lang.Object,​java.lang.Class> toMultidimDoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JsonLoader

      public JsonLoader()
  • Method Details

    • initialize

      public void initialize​(java.lang.String[] files)
      Specified by:
      initialize in interface ISceneGraphLoader
    • initialize

      public void initialize​(uk.ac.starlink.util.DataSource ds)
      Specified by:
      initialize in interface ISceneGraphLoader
    • loadData

      public com.badlogic.gdx.utils.Array<? extends SceneGraphNode> loadData()
      Specified by:
      loadData in interface ISceneGraphLoader
    • depth

      public int depth​(com.badlogic.gdx.utils.JsonValue attribute)
    • toMultidimDoubleArray

      public Pair<java.lang.Object,​java.lang.Class> toMultidimDoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)
    • to1DoubleArray

      public Pair<java.lang.Object,​java.lang.Class> to1DoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)
    • to2DoubleArray

      public Pair<java.lang.Object,​java.lang.Class> to2DoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)
    • to3DoubleArray

      public Pair<java.lang.Object,​java.lang.Class> to3DoubleArray​(com.badlogic.gdx.utils.JsonValue attribute)
    • convertJsonToMap

      public java.util.Map<java.lang.String,​java.lang.Object> convertJsonToMap​(com.badlogic.gdx.utils.JsonValue json)
    • setName

      public void setName​(java.lang.String name)
      Specified by:
      setName in interface ISceneGraphLoader
    • setDescription

      public void setDescription​(java.lang.String description)
      Specified by:
      setDescription in interface ISceneGraphLoader
    • setParams

      public void setParams​(java.util.Map<java.lang.String,​java.lang.Object> params)
      Specified by:
      setParams in interface ISceneGraphLoader