public double getContentPriority(Content c) { if (DirectContent.class.equals(c.getClass())) { return 0.0; } if (CenteredAndScaledContent.class.equals(c.getClass())) { return 1.0; } if (TerrainAlignedContent.class.equals(c.getClass())) { return 2.0; } return 10.0; }
@Override public void uninstall(Controller c) throws Exception { MainPanel msp = c.getPlugin(MainPanel.class); msp.removeAll(getClass()); transformationComponent.removeChild(scalingComponent); super.uninstall(c); }
@Override public void install(Controller c) throws Exception { super.install(c); Scene scene = c.getPlugin(Scene.class); setContentSize(contentSize); setVerticalOffset(verticalOffset); transformationComponent = scene.getContentComponent(); scalingComponent.setTransformation(new Transformation("scaling trafo")); transformationComponent.addChild(scalingComponent); SceneGraphPath newEmptyPick = scene.getContentPath().pushNew(scalingComponent); scene.setEmptyPickPath(newEmptyPick); createGUI(); MainPanel msp = c.getPlugin(MainPanel.class); msp.addComponent(getClass(), panel, 0.0, "Content"); }
@Override public void storeStates(Controller c) throws Exception { c.storeProperty(getClass(), "size", getContentSize()); c.storeProperty(getClass(), "offset", getVerticalOffset()); super.storeStates(c); }
@Override public void restoreStates(Controller c) throws Exception { setContentSize(c.getProperty(getClass(), "size", DEFAULT_CONTENT_SIZE)); setVerticalOffset(c.getProperty(getClass(), "offset", DEFAULT_VERTICAL_OFFSET)); super.restoreStates(c); }