public TextureJButton(Image image) { this.texImage = image; int w = texImage.getWidth(this); int h = texImage.getHeight(this); ratio = w / (double) h; texImage = ImageHook.scaleImage(texImage, 100, (int) (100 / ratio)); }
@Override public PluginInfo getPluginInfo() { PluginInfo info = new PluginInfo(); info.name = "Terrain"; info.vendorName = "Ulrich Pinkall"; info.icon = ImageHook.getIcon("vr/world.png"); return info; }
@Override public PluginInfo getPluginInfo() { PluginInfo info = new PluginInfo(); info.name = "Export"; info.vendorName = "Ulrich Pinkall"; info.icon = ImageHook.getIcon("arrow.png"); return info; }
@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"); }
public TextureJButton(String texResource) { if (texResource == null) { setText(""); return; } else { try { Input texInput = Input.getInput(texResource); texImage = ImageIO.read(texInput.getInputStream()); int w = texImage.getWidth(this); int h = texImage.getHeight(this); ratio = w / (double) h; texImage = ImageHook.scaleImage(texImage, 100, (int) (100 / ratio)); } catch (IOException e) { } } }
@Override public PluginInfo getPluginInfo() { PluginInfo info = new PluginInfo("Main Tools", "jReality Group"); info.icon = ImageHook.getIcon("wrench_orange.png"); return info; }
public Terrain() { appearance.setAttribute(CommonAttributes.EDGE_DRAW, false); appearance.setAttribute(CommonAttributes.VERTEX_DRAW, false); terrain.setAppearance(appearance); MatrixBuilder.euclidean().rotateX(Math.PI / 2).assignTo(plane); plane.setGeometry(bigMesh(50, 50, 2000)); plane.getGeometry().setGeometryAttributes("infinite plane", Boolean.TRUE); PickUtility.assignFaceAABBTrees(plane); terrain.addChild(plane); textures.put("2 Grid", "textures/grid.jpeg"); textures.put("3 Black Grid", "textures/gridBlack.jpg"); textures.put("4 Tiles", "textures/recycfloor1_clean2.png"); textures.put("5 Rust", "textures/outfactory3.png"); textures.put("1 None", null); shrinkPanel.setLayout(new GridLayout()); shrinkPanel.setIcon(getPluginInfo().icon); shrinkPanel.setShrinked(true); shrinkPanel.add(panel); GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(1, 0, 1, 0); c.fill = BOTH; c.weightx = 1.0; c.weighty = 1.0; c.gridwidth = REMAINDER; c.anchor = WEST; colorPanel.setLayout(new GridBagLayout()); faceColorChooser.setMinimumSize(new Dimension(10, 230)); faceColorChooser.setPreferredSize(new Dimension(10, 230)); colorPanel.add(faceColorChooser, c); c.fill = VERTICAL; c.weighty = 0.0; colorPanel.add(closeButton, c); // panel panel.setLayout(new MinSizeGridBagLayout()); c.fill = BOTH; visibleCheckBox.setSelected(DEFAULT_TERRAIN_VISIBLE); c.weightx = 0.0; c.gridwidth = RELATIVE; panel.add(visibleCheckBox, c); c.weightx = 1.0; c.gridwidth = REMAINDER; panel.add(faceColorButton, c); c.weightx = 0.0; c.weighty = 0.0; c.gridwidth = RELATIVE; panel.add(facesReflecting, c); c.weightx = 1.0; c.gridwidth = REMAINDER; panel.add(faceReflectionSlider, c); c.weightx = 0.0; c.gridwidth = RELATIVE; panel.add(transparency, c); c.weightx = 1.0; c.gridwidth = REMAINDER; panel.add(transparencySlider, c); c.weightx = 1.0; c.gridwidth = REMAINDER; panel.add(reflectScene, c); reflectScene.setEnabled(false); reflectScene.setToolTipText("Coming soon..."); textureInspector.setMaximalTextureScale(MAXIMAL_TEXTURE_SCALE); textureInspector.setLogarithmicRange(LOGARITHMIC_RANGE); textureInspector.setTextureUScale(DEFAULT_TEXTURE_SCALE); c.weightx = 1.0; c.weighty = 1.0; c.gridwidth = REMAINDER; textureShrinker.setIcon(ImageHook.getIcon("photo.png")); textureShrinker.setShrinked(true); textureShrinker.setLayout(new GridLayout()); textureShrinker.add(textureInspector); panel.add(textureShrinker, c); closeButton.addActionListener(this); visibleCheckBox.addActionListener(this); facesReflecting.addActionListener(this); transparency.addActionListener(this); faceColorButton.addActionListener(this); reflectScene.addActionListener(this); faceReflectionSlider.addChangeListener(this); transparencySlider.addChangeListener(this); faceColorChooser.getColorPanel().addChangeListener(this); }