MotorRowFilterTest lives in the wrong package and causes Eclipse
to fail building. Oddly, it still builds using the ant commandline,
but since it declares it should be in the package
net.sf.openrocket.gui.dialogs.motor.thrustcurve this change moves
it to the location it declares.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
When calculating the subject dimensions, use the height as the
radius of the circle which intersects all four corners of the
BoundingBox in the Y, Z plane for both the rear view and the
side view. The rear view was already doing this, but it was
non-obvious that the side view should also be using this to
calculate the height.
It becomes obvious if we think about a winged rocket, i.e. a
rocket who's fins in the Z direction are larger than those in
the Y direction. In this configuration, a height based off of
the fins in along the Y-axis alone will result in a "Fit" scaling
which encapuslates the Y-axis fins. However, rotating that
rocket will move the larger wings (the Z-axis fins) into the
view, but the height will not allow for the wings to draw properly
on the screen.
Thusly, using the radius from the circle intersecting the bounding
box along the Y, Z plane will ensure that the widest point from the
body will be able to fit within the side view, regardless of the
rotation around the X axis.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
- Close hooks are now called for all methods of closing a dialog ('close', 'X', and escape)
- Adds a rocket.removeComponentChangeListener to close hook
- removes redundant / buggy methods
Analysis from Justin Hanney indicates that the CPU is constantly
processing paint events in the ScaleScrollPane.Ruler. Change the
updateSize method to not revalidate and repaint since the
paintComponent method also invokes the updateSize to ensure it is
drawing components of the right size.
This change also refactors the ChangeListener implementation to
have the RulerClass implement the method instead of using an
anonymous class for event handling when ruler units change.
Additionally, this change adds a revalidate call to the scrollPane
to fix an issue where the ruler is not repainted when switching views
from 3D to 2D.
Fixes#615
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Fixes the stage selection buttons to only be active when the stage
is active and properly reflect the displayed stage state.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Use the curConfig.getLength() for the length displayed in the
RocketPanel rather than calculating it based off the bounds.
The length method provided by the FlightConfiguration takes
everything into account that is needed (active stages, etc)
to calculate the length.
Closes#452
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Previously, updateFigure was overridden in RocketFigure in order to
ensure that all component shapes were added to the rocket prior to
calling the paintComponent method. This is superfluous as the
paintComponent method already adds the shapes prior to rendering.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
NoseCones aren't rendered correctly when printing/exporting as PDF
due to the scaleFactor not being honored correctly in TransitionShapes.
There was a good refactor to move some of the scaling pieces out,
however the PrintableNoseCone didn't benefit from these changes.
This restores part of the scaleFactor bits to the TransitionShapes
in order to get the printing to correctly work again. This code should
be transitioned to the new method for scaling.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Stages need to be activated correctly in order to properly
calculate the mass for all components that contribute to
the current launch scenario.
This change ensures that all of the stages from the top-most
stage to the currently active stage are set as activated when
stage mass is being calculated.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Fix the number of motors that are reported. A previous change made
the MotorMount.getMotorCount() return the number of motors which
have been configured. However, according to the javadocs of the
MotorMount interface, the getMotorCount() method is supposed to
return the number of motors that a MotorMount can take for
configuring it. This restores the InnerTube and BodyTube getMotorCount
behavior and adds a new getMotorConfigurationCount() method to
provide the new behavior.
Additionally, the stageMass calculations in the DesignReport were
using a deprecated method which does not return proper component
weights. Change this to use the MassCalculator.calculateLaunch(...)
method, which is consistent with the RocketPanel behavior.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Clean up some of the code in DesignReport, including some
refactoring TODOs in the addMotorData method.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Some refactoring of the code for the RocketFigure class caused
changes which prevent the rocket from being rendered correctly
when printing a report or exporting as PDF. The issue was due
to shapes not being added to the rocket and pixel dimensions
being incorrect for the logic in the DesignReport.
This change ensures that rocket shapes are added when the
RocketFigure's updateFigure method is called. It also modifies
the PrintFigure to expose some of the underlying geometries of
the subject_bounds, which are necessary for the pixel and drawing
calculations used in the DesignReport.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Correct the logic for detecting if a motor has an invalid
FlightConfigurationId and throw an IllegalStateException only in the
case that it has an error.
Additionally, fix the lookup for the stageMass. The wrong value was
passed to the MassCalculator.getCGAnalysis(..) which resulted in
a NullPointerException.
Fixes#531
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Commit a7c0cb2 removed the OrangeExtensions-1.2.jar file from the
swing project, but failed to remove it from the eclipse classpath.
This fixes that.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Previous refactoring of the event listeners lost notifications
to classes which care about changes to the DoubleModel. One
such example is the UnitSelector. Ensure that all the
ChangeEventListeners and StateChangeEventListeners are called
when the setValue method is invoked.
Closes#553
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>