I18 changes
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / Stage.java
1 package net.sf.openrocket.rocketcomponent;
2
3 import net.sf.openrocket.l10n.Translator;
4 import net.sf.openrocket.startup.Application;
5
6 public class Stage extends ComponentAssembly {
7         
8         private static final Translator trans = Application.getTranslator();
9
10     @Override
11     public String getComponentName () {
12         //// Stage
13         return trans.get("Stage.Stage");
14     }
15         
16         
17         @Override
18         public boolean allowsChildren() {
19                 return true;
20         }
21         
22     /**
23          * Check whether the given type can be added to this component.  A Stage allows 
24          * only BodyComponents to be added.
25      *
26      * @param type The RocketComponent class type to add.
27      *
28      * @return Whether such a component can be added.
29      */
30     @Override
31     public boolean isCompatible (Class<? extends RocketComponent> type) {
32         return BodyComponent.class.isAssignableFrom(type);
33     }
34
35     /**
36      * Accept a visitor to this Stage in the component hierarchy.
37      * 
38      * @param theVisitor  the visitor that will be called back with a reference to this Stage
39      */    
40     @Override 
41     public void accept (final ComponentVisitor theVisitor) {
42         theVisitor.visit(this);
43     }
44 }