info.openrocket.core and info.openrocket.swing modules. Use it to orient yourself when exploring the codebase.
Module folder structure
Both modules follow the standard Gradle source layout:Core module
Thecore module source lives at core/src/main/java/info/openrocket/core/. The following table describes the main packages:
aerodynamics — aerodynamic force and coefficient calculations
aerodynamics — aerodynamic force and coefficient calculations
aerodynamics/barrowman/— Implementation of the extended Barrowman method for calculating CP and aerodynamic coefficients for each component type.
appearance — component visual appearance
appearance — component visual appearance
appearance/defaults/— Default appearance settings applied when no custom appearance is configured.
communication — external communication
communication — external communication
database — component and motor databases
database — component and motor databases
database/motor/— Motor (thrust curve) database loading and lookup.
document — OpenRocket document model
document — OpenRocket document model
document/attachments/— File attachments embedded in a document.document/events/— Events fired when a document or simulation changes.
file — file format parsers and writers
file — file format parsers and writers
| Sub-package | Format |
|---|---|
file/openrocket/importt/ | Read .ork files |
file/openrocket/savers/ | Write .ork files |
file/rasaero/importt/ | Import RASAero II files |
file/rasaero/export/ | Export to RASAero II |
file/rocksim/importt/ | Import RockSim files |
file/rocksim/export/ | Export to RockSim |
file/motor/ | Motor file handling |
file/svg/export/ | SVG export |
file/wavefrontobj/export/ | Wavefront OBJ 3D export |
file/simplesax/ | SAX XML utility |
file/iterator/ | Iterate files in directories or ZIP archives |
l10n — localization
l10n — localization
.properties files in the swing module’s resources.logging — errors, warnings, and diagnostics
logging — errors, warnings, and diagnostics
masscalc — mass and inertia calculations
masscalc — mass and inertia calculations
material — material physical properties
material — material physical properties
models — physical environment models
models — physical environment models
models/atmosphere/— Atmosphere models (e.g., International Standard Atmosphere).models/gravity/— Gravity models.models/wind/— Wind models, including average wind and multi-level wind profiles.
motor — motor configuration and thrust curves
motor — motor configuration and thrust curves
database/motor/.optimization — trajectory optimization engine
optimization — trajectory optimization engine
optimization/general/multidim/— Multidimensional parallel search.optimization/general/onedim/— One-dimensional golden-section search.optimization/rocketoptimization/— Rocket parameter optimization for specified goals (max altitude, max velocity, etc.).
preset — component preset database
preset — component preset database
ComponentPreset model and handles loading/saving of .orc component database files.preset/loader/— Loads component database files.preset/xml/— JAXB-based XML serialization of component presets.
rocketcomponent — rocket component model
rocketcomponent — rocket component model
NoseCone, BodyTube, TrapezoidFinSet, Parachute, and so on. All components extend RocketComponent.rocketcomponent/position/— Component positioning logic (axial offset, radial offset).
simulation — flight simulation engine
simulation — flight simulation engine
simulation/customexpression/— User-defined custom simulation output expressions.simulation/extension/— Simulation extension API and example extensions.simulation/listeners/— Listener interface that hooks into the simulation at each time step.simulation/listeners/system/— Built-in listeners used internally by OpenRocket.
thrustcurve — ThrustCurve.org API and serialization
thrustcurve — ThrustCurve.org API and serialization
serializeEngines Gradle task runs the serialization.unit — unit definitions and conversions
unit — unit definitions and conversions
Unit (a single unit with SI conversion methods) and UnitGroup (a measurable quantity with multiple available units). All display-facing value formatting goes through this package.util / utils — utility methods
util / utils — utility methods
util/enums/ provides enum-to-name conversion helpers.Swing module
Theswing module source lives at swing/src/main/java/info/openrocket/swing/. The following table describes the main packages:
gui/main — main application window
gui/main — main application window
gui/main/componenttree/— The rocket component tree panel shown on the left side of the main window.gui/main/flightconfigpanel/— The flight configuration panel for managing motor configurations.
gui/configdialog — component configuration dialogs
gui/configdialog — component configuration dialogs
gui/rocketfigure — 2D rocket cross-section rendering
gui/rocketfigure — 2D rocket cross-section rendering
RocketComponentShapeService implementation that knows how to draw itself.gui/figure3d — 3D rocket visualization
gui/figure3d — 3D rocket visualization
gui/figure3d/photo/— PhotoStudio mode with exhaust, smoke, sparks, and sky rendering.
gui/plot — simulation results plots
gui/plot — simulation results plots
gui/dialogs — various dialogs
gui/dialogs — various dialogs
gui/dialogs/motor/thrustcurve/— Motor selection and thrust curve browser.gui/dialogs/optimization/— Rocket optimization dialog.gui/dialogs/preferences/— Application preferences dialog.gui/dialogs/preset/— Component preset selection dialog.gui/dialogs/flightconfiguration/— Flight configuration management.
gui/theme — UI theming
gui/theme — UI theming
swing/src/main/resources/themes/ (e.g. FlatLafLight.properties, FlatDarculaLaf.properties). Custom keys are prefixed with OR. and read via UIManager in UITheme.java.gui/components — reusable Swing components
gui/components — reusable Swing components
gui/adaptors — model adaptors
gui/adaptors — model adaptors
TableModel, SpinnerModel). Keeps GUI code decoupled from the domain model.startup — application entry point and Guice wiring
startup — application entry point and Guice wiring
SwingStartup, the main entry point for the desktop application. Sets up the Guice injector and launches the main window.startup/providers/— Guice provider classes.startup/jij/— JAR-in-JAR class loading support.
simulation/extension — Swing-side simulation extensions
simulation/extension — Swing-side simulation extensions
UI theming notes
OpenRocket uses FlatLaf property files for UI colors and other defaults. To add or modify a theme value:- Edit the relevant
OR.*key in each theme file underswing/src/main/resources/themes/. Keep all variants (light, Darcula, One Dark) in sync. - Add a corresponding lookup in
UITheme.Keysinswing/src/main/java/info/openrocket/swing/gui/theme/UITheme.java. - Test by switching themes in Preferences — properties are applied when
UITheme.applyThemeruns.
Input validation
For immediate visual feedback on invalid inputs, useFlatLafOutlines rather than ad-hoc putClientProperty calls:
warnIf for “dubious but allowed” values and errorIf for values that should block confirmation.