@Override public void uninstall(Controller c) throws Exception { super.uninstall(c); Scene scene = c.getPlugin(Scene.class); scene.getBackdropComponent().removeChild(terrain); viewPreferences.removeColorPickerChangedListener(this); VRPanel vp = c.getPlugin(VRPanel.class); vp.removeAll(getClass()); }
@Override public void storeStates(Controller c) throws Exception { c.storeProperty(getClass(), "textures", textureInspector.getTextures()); c.storeProperty(getClass(), "texture", textureInspector.getActiveTexture()); c.storeProperty(getClass(), "textureScale", textureInspector.getTextureUScale()); c.storeProperty(getClass(), "visible", isVisible()); c.storeProperty(getClass(), "faceColor", getFaceColor()); c.storeProperty(getClass(), "transparency", getTransparency()); c.storeProperty(getClass(), "transparencyEnabled", isTransparencyEnabled()); c.storeProperty(getClass(), "facesReflecting", isFacesReflecting()); c.storeProperty(getClass(), "faceReflection", getFaceReflection()); c.storeProperty(getClass(), "reflectSceneContent", isReflectSceneContent()); c.storeProperty(getClass(), "visible", isVisible()); super.storeStates(c); }
@Override public void restoreStates(Controller c) throws Exception { setFaceColor(c.getProperty(getClass(), "faceColor", DEFAULT_TERRAIN_COLOR)); setTransparency(c.getProperty(getClass(), "transparency", DEFAULT_TRANSPARENCY)); setTransparencyEnabled( c.getProperty(getClass(), "transparencyEnabled", DEFAULT_TRANSPARENCY_ENABLED)); setFacesReflecting(c.getProperty(getClass(), "facesReflecting", DEFAULT_FACES_REFLECTING)); setFaceReflection(c.getProperty(getClass(), "faceReflection", DEFAULT_FACE_REFLECTION)); setReflectSceneContent(c.getProperty(getClass(), "reflectSceneContent", false)); textureInspector.setTextures(c.getProperty(getClass(), "textures", textures)); textureInspector.setTexture(c.getProperty(getClass(), "texture", DEFAULT_TEXTURE)); textureInspector.setTextureUScale( c.getProperty(getClass(), "textureScale", DEFAULT_TEXTURE_SCALE)); setVisible(c.getProperty(getClass(), "visible", true)); updateAll(); super.restoreStates(c); }
@Override public void install(Controller c) throws Exception { super.install(c); // scene Scene scene = c.getPlugin(Scene.class); scene.getBackdropComponent().addChild(terrain); scene.setAutomaticClippingPlanes(false); viewPreferences = c.getPlugin(ViewPreferences.class); viewPreferences.addColorPickerChangedListener(this); faceColorChooser.getColorPanel().setMode(viewPreferences.getColorPickerMode()); textureInspector.setAppearance(appearance); updateFaceColor(); updateFacesReflecting(); updateFaceReflection(); updateTransparencyEnabled(); updateTransparency(); VRPanel vp = c.getPlugin(VRPanel.class); vp.addComponent(getClass(), shrinkPanel, 1.0, "VR"); }
@Override public void install(Controller c) throws Exception { super.install(c); viewMenuBar = c.getPlugin(ViewMenuBar.class); View view = c.getPlugin(View.class); ViewerSwitch viewer = view.getViewer(); Component parent = viewer.getViewingComponent(); exportMenu.setIcon(ImageHook.getIcon("disk.png")); exportMenu.add(new ExportImage("Image", viewer, parent)); exportMenu.add(new ExportScreenshot("Screenshot", viewer, parent)); exportMenu.add(new ExportRIB("RIB", viewer, parent)); exportMenu.add(new ExportSVG("SVG", viewer, parent)); exportMenu.add(new ExportPS("PS", viewer, parent)); exportMenu.add(new ExportVRML("VRML", viewer, parent)); exportMenu.add(new ExportSTL("STL", viewer, parent)); exportMenu.add(new ExportOBJ("OBJ", viewer, parent)); exportMenu.add(new ExportU3D("U3D", viewer, parent)); exportMenu.add(exportPDF = new ExportPDF("PDF", viewer, parent)); exportMenu.add(new SunflowMenu(viewer)); SaveScene saveSceneAction = new SaveScene("Save Scene", viewer, parent); saveSceneAction.setIcon(ImageHook.getIcon("disk.png")); viewMenuBar.addMenuItem(getClass(), 1, saveSceneAction, "File"); viewMenuBar.addMenuItem(getClass(), 2, exportMenu, "File"); }
@Override public void uninstall(Controller c) throws Exception { viewMenuBar.removeMenu(getClass(), exportMenu); super.uninstall(c); }