From 7ee423ba6dc0752f0cec33ee09238d73ee296615 Mon Sep 17 00:00:00 2001 From: Bill Kuker Date: Sun, 1 Jul 2012 14:45:27 +0000 Subject: [PATCH] Give RocketComponents an Appearance --- .../rocketcomponent/RocketComponent.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java index e941d9cf0..d1cec78a2 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java +++ b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java @@ -6,6 +6,7 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; +import net.sf.openrocket.appearance.Appearance; import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.logging.LogHelper; import net.sf.openrocket.preset.ComponentPreset; @@ -124,6 +125,9 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab // Preset component this component is based upon private ComponentPreset presetComponent = null; + + // The realistic appearance of this component + private Appearance appearance = null; /** @@ -402,6 +406,27 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab ////////// Common parameter setting/getting ////////// + + /** + * Get the realistic appearance of this component. + * null = use the default for this material + * + * @return The component's realistic appearance, or null + */ + public Appearance getAppearance() { + return appearance; + } + + /** + * Set the realistic appearance of this component. + * Use null for default. + * + * @param appearance + */ + public void setAppearance(Appearance appearance) { + this.appearance = appearance; + fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE); + } /** * Return the color of the object to use in 2D figures, or null