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) {
|
OpenRocketDocument(Rocket rocket) {
|
||||||
this.rocket = rocket;
|
this.rocket = rocket;
|
||||||
|
rocket.setDocument(this);
|
||||||
this.objOptions = prefs.loadOBJExportOptions(rocket);
|
this.objOptions = prefs.loadOBJExportOptions(rocket);
|
||||||
rocket.enableEvents();
|
rocket.enableEvents();
|
||||||
init();
|
init();
|
||||||
|
@ -3,6 +3,7 @@ package info.openrocket.core.rocketcomponent;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import info.openrocket.core.document.OpenRocketDocument;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ public class Rocket extends ComponentAssembly {
|
|||||||
|
|
||||||
private boolean eventsEnabled = false;
|
private boolean eventsEnabled = false;
|
||||||
|
|
||||||
|
private OpenRocketDocument document;
|
||||||
private ReferenceType refType = ReferenceType.MAXIMUM; // Set in constructor
|
private ReferenceType refType = ReferenceType.MAXIMUM; // Set in constructor
|
||||||
private double customReferenceLength = DEFAULT_REFERENCE_LENGTH;
|
private double customReferenceLength = DEFAULT_REFERENCE_LENGTH;
|
||||||
|
|
||||||
@ -192,6 +194,22 @@ public class Rocket extends ComponentAssembly {
|
|||||||
return functionalModID;
|
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() {
|
public Collection<AxialStage> getStageList() {
|
||||||
return this.stageMap.values();
|
return this.stageMap.values();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user