Package com.j3d

Class StaticRefs

java.lang.Object
com.j3d.StaticRefs

public abstract class StaticRefs extends Object
StaticRefs is a class which holds static references to important instances in the engine, such as the SceneManager, Executor, Main Frame, Camera, etc.

This is used to allow for easy access to these instances from anywhere in the code, without having to pass them around

No app should have static references like this. but this is MY app. (and this app doesn't allow opening multiple windows anyway so having these as static references is a little more convenient than passing it everywhere in the world.)

Author:
Lehlogonolo Poole
  • Field Details

    • sceneManager

      private static SceneManager sceneManager
      The SceneManager Instance. A very important class initialized by EngineFrame who's job it is to store all information and references to the scene.
    • mainFrame

      private static EngineFrame mainFrame
      The Main Frame that is displayed. EngineFrame
    • commandParser

      private static CommandParser commandParser
      The Command Parser Instance. Initialised by EngineFrame and is mainly a parsing utility and manager for the CommandPalette. The engine that parses commands. Initialised and owned by EngineFrame
    • mainPanel

      private static J3DPanel mainPanel
      The Main Draw Panel. This is where all geometry is calculated and drawn onto. Initialised by EngineFrame
    • globalKeybinds

      private static KeyBindings globalKeybinds
      The Key Binds Manager, where all keybinds (Not JMenu accelerators) are stored. Used in conjunction with J3Key. Initialised by EngineFrame
      See Also:
    • hoverLabel

      private static HoverJLabel hoverLabel
      The hover label. Literally just a hovering JLabel below the cursor. Initialised by EngineFrame
    • camera

      private static final Camera camera
      The Camera Instance. The main camera used to view the scene, which is immediately initialised statically and can be changed by say GlobalKeybinds.MOVE_CAM_FORWARD (moving the camera) or OrbitCmd (changing the camera's rotation).

      Initialised to position (20, 50, -90) and with the projection plane at (0, 0) with a focal length of 37.0 (Defined by CameraProperties.focalLength)

    • debugPanel

      private static DebugPanel debugPanel
      The Debug Panel. The panel that holds debug stuff. Initialized by StaticRefs and can be accessed via it's FloatingPanel by the user within the Toolbox.
    • propertiesPanel

      private static PropertiesPanel propertiesPanel
      The Properties Panel. This panel displays and allows editing of properties for selected objects. Initialised by StaticRefs and can be accessed via it's FloatingPanel by the user within the Toolbox.
    • projectFileV1

      private static PF1 projectFileV1
      The Project File V1 instance. Used for reading and writing project files in version 1 format. Lazily initialised.
    • projectFileV2

      private static PF2 projectFileV2
      The Project File V2 instance. Used for reading and writing project files in version 2 format. Lazily initialised.
    • projectFileV3

      private static PF3 projectFileV3
      The Project File V2 instance. Used for reading and writing project files in version 2 format. Lazily initialised.
    • layerTree

      private static LayerTree layerTree
      The layer tree instance which holds the tree view of Layer and Things. The user can access this panel via it's wrapped FloatingPanel version within the Toolbox. Initialised by StaticRefs
    • grid2DPanel

      private static Grid2DPanel grid2DPanel
    • log

      private static Logger log
      The Logger Instance, which simply encapsulates the logging to the DebugPanel.logTextArea and to the output file defined by LogFile within EngineFiles. Lazily initialised by EngineFrame
    • engineFiles

      private static EngineFiles engineFiles
      The Engine Files instances. This encapsulates all the files stored in user.dir/J3Engine. Lazily initialised by StaticRefs.
    • settings

      private static Settings settings
      The Settings Instance. Usually all code accesses settings within Settings statically. This instance is only really used to access it's UI. Initialised by StaticRefs
    • docsProvider

      private static DocsProvider docsProvider
      New help generator. No docs yet. lmao. Initialised by StaticRefs
    • commandManager

      private static CommandsManager commandManager
      The commands manager which just holds the current running SemiStatefulCommand and gets all the commands otherwise. Initialised by StaticRefs
    • macroUtils

      private static MacroUtils macroUtils
      The macro utils which is the... macro recording and fetching utils. whatd u expect
    • errs

      private static final ErrorHandler errs
    • jaivaInstanceManager

      private static final JaivaInstanceManager jaivaInstanceManager
  • Constructor Details

    • StaticRefs

      public StaticRefs()
  • Method Details

    • getSceneManager

      public static SceneManager getSceneManager()
    • registerSceneManager

      public static void registerSceneManager(SceneManager instance)
      Parameters:
      instance - The instance.
    • getMainFrame

      public static EngineFrame getMainFrame()
    • registerMainFrame

      public static void registerMainFrame(EngineFrame instance)
      Parameters:
      instance - The instance.
    • getCommandParser

      public static CommandParser getCommandParser()
    • registerCommandParser

      public static void registerCommandParser(CommandParser instance)
      Parameters:
      instance - The instance.
    • getMainPanel

      public static J3DPanel getMainPanel()
    • registerMainPanel

      public static void registerMainPanel(J3DPanel instance)
      Parameters:
      instance - The instance.
    • getGlobalKeybinds

      public static KeyBindings getGlobalKeybinds()
    • registerGlobalKeybinds

      public static void registerGlobalKeybinds(KeyBindings instance)
      Parameters:
      instance - The instance.
    • getHoverLabel

      public static HoverJLabel getHoverLabel()
    • registerHoverLabel

      public static void registerHoverLabel(HoverJLabel instance)
      Parameters:
      instance - The instance.
    • getCamera

      public static Camera getCamera()
    • getDebugPanel

      public static DebugPanel getDebugPanel()
    • getPropertiesPanel

      public static PropertiesPanel getPropertiesPanel()
    • getProjectFileV1

      public static PF1 getProjectFileV1()
    • getProjectFileV2

      public static PF2 getProjectFileV2()
    • getProjectFileV3

      public static PF3 getProjectFileV3()
    • getLayerTree

      public static LayerTree getLayerTree()
    • getGrid2DPanel

      public static Grid2DPanel getGrid2DPanel()
    • getLog

      public static Logger getLog()
    • getEngineFiles

      public static EngineFiles getEngineFiles()
    • getSettings

      public static Settings getSettings()
    • getDocsProvider

      public static DocsProvider getDocsProvider()
    • getCommandManager

      public static CommandsManager getCommandManager()
    • getMacroUtils

      public static MacroUtils getMacroUtils()
    • getErrs

      public static ErrorHandler getErrs()
    • getJaivaInstanceManager

      public static JaivaInstanceManager getJaivaInstanceManager()
    • logo

      public static Image logo()
      Returns an Image of the J3Engine 1:1 logo for the app icon.
      Returns:
      an Image
    • none

      public static void none()
      Random ass method so static is forced to initialise everything in Main. Does absolutely shit.
    • none

      public static void none(boolean test, String methodName)
    • clear

      public static void clear(boolean clearLogger)
    • clear

      public static void clear()
    • clearLogger

      public static void clearLogger()