Package com.j3d
Class StaticRefs
java.lang.Object
com.j3d.StaticRefs
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final CameraThe Camera Instance.private static CommandsManagerThe commands manager which just holds the current runningSemiStatefulCommandand gets all the commands otherwise.private static CommandParserThe Command Parser Instance.private static DebugPanelThe Debug Panel.private static DocsProviderNew help generator.private static EngineFilesThe Engine Files instances.private static final ErrorHandlerprivate static KeyBindingsThe Key Binds Manager, where all keybinds (NotJMenuaccelerators) are stored.private static Grid2DPanelprivate static HoverJLabelThe hover label.private static final JaivaInstanceManagerprivate static LayerTreeprivate static LoggerThe Logger Instance, which simply encapsulates the logging to theDebugPanel.logTextAreaand to the output file defined byLogFilewithinEngineFiles.private static MacroUtilsThe macro utils which is the... macro recording and fetching utils. whatd u expectprivate static EngineFrameThe Main Frame that is displayed.private static J3DPanelThe Main Draw Panel.private static PF1The Project File V1 instance.private static PF2The Project File V2 instance.private static PF3The Project File V2 instance.private static PropertiesPanelThe Properties Panel.private static SceneManagerThe SceneManager Instance.private static SettingsThe Settings Instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()static voidclear(boolean clearLogger) static voidstatic Camerastatic CommandsManagerstatic CommandParserstatic DebugPanelstatic DocsProviderstatic EngineFilesstatic ErrorHandlergetErrs()static KeyBindingsstatic Grid2DPanelstatic HoverJLabelstatic JaivaInstanceManagerstatic LayerTreestatic LoggergetLog()static MacroUtilsstatic EngineFramestatic J3DPanelstatic PF1static PF2static PF3static PropertiesPanelstatic SceneManagerstatic Settingsstatic Imagelogo()Returns anImageof the J3Engine 1:1 logo for the app icon.static voidnone()Random ass method so static is forced to initialise everything inMain.static voidstatic voidregisterCommandParser(CommandParser instance) static voidregisterGlobalKeybinds(KeyBindings instance) static voidregisterHoverLabel(HoverJLabel instance) static voidregisterMainFrame(EngineFrame instance) static voidregisterMainPanel(J3DPanel instance) static voidregisterSceneManager(SceneManager instance)
-
Field Details
-
sceneManager
The SceneManager Instance. A very important class initialized byEngineFramewho's job it is to store all information and references to the scene. -
mainFrame
The Main Frame that is displayed.EngineFrame -
commandParser
The Command Parser Instance. Initialised byEngineFrameand is mainly a parsing utility and manager for theCommandPalette. The engine that parses commands. Initialised and owned byEngineFrame -
mainPanel
The Main Draw Panel. This is where all geometry is calculated and drawn onto. Initialised byEngineFrame -
globalKeybinds
The Key Binds Manager, where all keybinds (NotJMenuaccelerators) are stored. Used in conjunction withJ3Key. Initialised byEngineFrame- See Also:
-
hoverLabel
The hover label. Literally just a hoveringJLabelbelow the cursor. Initialised byEngineFrame -
camera
The Camera Instance. The main camera used to view the scene, which is immediately initialised statically and can be changed by sayGlobalKeybinds.MOVE_CAM_FORWARD(moving the camera) orOrbitCmd(changing the camera's rotation).Initialised to position
(20, 50, -90)and with the projection plane at (0, 0) with a focal length of37.0(Defined byCameraProperties.focalLength) -
debugPanel
The Debug Panel. The panel that holds debug stuff. Initialized by StaticRefs and can be accessed via it'sFloatingPanelby the user within theToolbox. -
propertiesPanel
The Properties Panel. This panel displays and allows editing of properties for selected objects. Initialised by StaticRefs and can be accessed via it'sFloatingPanelby the user within theToolbox. -
projectFileV1
The Project File V1 instance. Used for reading and writing project files in version 1 format. Lazily initialised. -
projectFileV2
The Project File V2 instance. Used for reading and writing project files in version 2 format. Lazily initialised. -
projectFileV3
The Project File V2 instance. Used for reading and writing project files in version 2 format. Lazily initialised. -
layerTree
The layer tree instance which holds the tree view ofLayerandThings. The user can access this panel via it's wrappedFloatingPanelversion within theToolbox. Initialised by StaticRefs -
grid2DPanel
-
log
The Logger Instance, which simply encapsulates the logging to theDebugPanel.logTextAreaand to the output file defined byLogFilewithinEngineFiles. Lazily initialised byEngineFrame -
engineFiles
The Engine Files instances. This encapsulates all the files stored inuser.dir/J3Engine. Lazily initialised by StaticRefs. -
settings
The Settings Instance. Usually all code accesses settings withinSettingsstatically. This instance is only really used to access it's UI. Initialised by StaticRefs -
docsProvider
New help generator. No docs yet. lmao. Initialised by StaticRefs -
commandManager
The commands manager which just holds the current runningSemiStatefulCommandand gets all the commands otherwise. Initialised by StaticRefs -
macroUtils
The macro utils which is the... macro recording and fetching utils. whatd u expect -
errs
-
jaivaInstanceManager
-
-
Constructor Details
-
StaticRefs
public StaticRefs()
-
-
Method Details
-
getSceneManager
-
registerSceneManager
- Parameters:
instance- The instance.
-
getMainFrame
-
registerMainFrame
- Parameters:
instance- The instance.
-
getCommandParser
-
registerCommandParser
- Parameters:
instance- The instance.
-
getMainPanel
-
registerMainPanel
- Parameters:
instance- The instance.
-
getGlobalKeybinds
-
registerGlobalKeybinds
- Parameters:
instance- The instance.
-
getHoverLabel
-
registerHoverLabel
- Parameters:
instance- The instance.
-
getCamera
-
getDebugPanel
-
getPropertiesPanel
-
getProjectFileV1
-
getProjectFileV2
-
getProjectFileV3
-
getLayerTree
-
getGrid2DPanel
-
getLog
-
getEngineFiles
-
getSettings
-
getDocsProvider
-
getCommandManager
-
getMacroUtils
-
getErrs
-
getJaivaInstanceManager
-
logo
Returns anImageof 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 inMain. Does absolutely shit. -
none
-
clear
public static void clear(boolean clearLogger) -
clear
public static void clear() -
clearLogger
public static void clearLogger()
-