Save reference to document in rocket
This commit is contained in:
parent
00acb8b68f
commit
7472ad7c8c
@ -110,6 +110,7 @@ public class OpenRocketDocument implements ComponentChangeListener, StateChangeL
|
||||
*/
|
||||
OpenRocketDocument(Rocket rocket) {
|
||||
this.rocket = rocket;
|
||||
rocket.setDocument(this);
|
||||
this.objOptions = prefs.loadOBJExportOptions(rocket);
|
||||
rocket.enableEvents();
|
||||
init();
|
||||
|
@ -3,6 +3,7 @@ package info.openrocket.core.rocketcomponent;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import info.openrocket.core.document.OpenRocketDocument;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -51,6 +52,7 @@ public class Rocket extends ComponentAssembly {
|
||||
|
||||
private boolean eventsEnabled = false;
|
||||
|
||||
private OpenRocketDocument document;
|
||||
private ReferenceType refType = ReferenceType.MAXIMUM; // Set in constructor
|
||||
private double customReferenceLength = DEFAULT_REFERENCE_LENGTH;
|
||||
|
||||
@ -191,7 +193,23 @@ public class Rocket extends ComponentAssembly {
|
||||
public int getFunctionalModID() {
|
||||
return functionalModID;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the OpenRocketDocument that this rocket is part of, or null if it is not part of any document.
|
||||
* @return the document, or null
|
||||
*/
|
||||
public OpenRocketDocument getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the OpenRocketDocument that this rocket is part of.
|
||||
* @param document the document
|
||||
*/
|
||||
public void setDocument(OpenRocketDocument document) {
|
||||
this.document = document;
|
||||
}
|
||||
|
||||
public Collection<AxialStage> getStageList() {
|
||||
return this.stageMap.values();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user