aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/org/jdesktop/j3d/examples/jcanvas3d
diff options
context:
space:
mode:
authorphil <[email protected]>2016-11-06 17:03:11 +1300
committerphil <[email protected]>2016-11-06 17:03:11 +1300
commitb519162cc27f380d36c5d2f779189628a42b3800 (patch)
tree05da9b1cb5045da85665cee0b0484257552dbe73 /src/classes/org/jdesktop/j3d/examples/jcanvas3d
parent7d153738e397b6f9e7b51ea2d127fc55cdff6032 (diff)
move java into maven standard src/main/java and resources into
src/main/resources
Diffstat (limited to 'src/classes/org/jdesktop/j3d/examples/jcanvas3d')
-rw-r--r--src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.form142
-rw-r--r--src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.java195
-rw-r--r--src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExampleGL2ES2.java175
-rw-r--r--src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorld.java232
-rw-r--r--src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorldGL2ES2.java211
5 files changed, 0 insertions, 955 deletions
diff --git a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.form b/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.form
deleted file mode 100644
index 5efa763..0000000
--- a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.form
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<Form version="1.0" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
- <Properties>
- <Property name="defaultCloseOperation" type="int" value="3"/>
- </Properties>
- <SyntheticProperties>
- <SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,-35,0,0,3,-13"/>
- <SyntheticProperty name="formSizePolicy" type="int" value="0"/>
- <SyntheticProperty name="generateSize" type="boolean" value="true"/>
- <SyntheticProperty name="generateCenter" type="boolean" value="true"/>
- </SyntheticProperties>
- <AuxValues>
- <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="2"/>
- <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
- </AuxValues>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JSplitPane" name="splitPane">
- <Properties>
- <Property name="dividerLocation" type="int" value="300"/>
- <Property name="dividerSize" type="int" value="8"/>
- <Property name="continuousLayout" type="boolean" value="true"/>
- <Property name="oneTouchExpandable" type="boolean" value="true"/>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
- <SubComponents>
- <Container class="javax.swing.JScrollPane" name="scrollPane">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
- <JSplitPaneConstraints position="left"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="panel">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
- <SubComponents>
- <Component class="javax.swing.JButton" name="addButton">
- <Properties>
- <Property name="text" type="java.lang.String" value="Create New Frame"/>
- <Property name="toolTipText" type="java.lang.String" value="Adds a new frame containing an universe into the desktop pane"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addButtonActionPerformed"/>
- </Events>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
- <Component class="javax.swing.JCheckBox" name="delayCheckBox">
- <Properties>
- <Property name="text" type="java.lang.String" value="Resize Delayed"/>
- <Property name="toolTipText" type="java.lang.String" value="Shows the effect of using a delayed resizing to the internal frames."/>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
- <Component class="javax.swing.JCheckBox" name="interactiveCheckBox">
- <Properties>
- <Property name="selected" type="boolean" value="true"/>
- <Property name="text" type="java.lang.String" value="Interactive Cube"/>
- <Property name="toolTipText" type="java.lang.String" value="Tests the use of AWT behaviors on the displayed component."/>
- <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
- <EmptyBorder bottom="0" left="0" right="0" top="0"/>
- </Border>
- </Property>
- <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
- <Insets value="[0, 0, 0, 0]"/>
- </Property>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="interactiveCheckBoxActionPerformed"/>
- </Events>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
- <Component class="javax.swing.JCheckBox" name="randomCheckBox">
- <Properties>
- <Property name="text" type="java.lang.String" value="Random start angle"/>
- <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
- <EmptyBorder bottom="0" left="0" right="0" top="0"/>
- </Border>
- </Property>
- <Property name="enabled" type="boolean" value="false"/>
- <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
- <Insets value="[0, 0, 0, 0]"/>
- </Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JDesktopPane" name="desktopPane">
- <Properties>
- <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
- <Color blue="c9" green="99" red="99" type="rgb"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[300, 300]"/>
- </Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
- <JSplitPaneConstraints position="right"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JLayeredPaneSupportLayout"/>
- </Container>
- </SubComponents>
- </Container>
- </SubComponents>
-</Form>
diff --git a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.java b/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.java
deleted file mode 100644
index 1a83fdd..0000000
--- a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExample.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * $RCSfile$
- *
- * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any
- * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
- * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
- * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
- * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
- * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
- * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
- * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
- * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
- * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
- * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed, licensed or
- * intended for use in the design, construction, operation or
- * maintenance of any nuclear facility.
- *
- * $Revision$
- * $Date$
- * $State$
- */
-
-package org.jdesktop.j3d.examples.jcanvas3d;
-
-
-/**
- * Simple Java 3D example program that displays universes within lightweight swing components, layed in JInternalFrame objects.
- */
-import java.awt.Toolkit;
-
-public class JCanvas3DExample extends javax.swing.JFrame implements java.awt.event.ActionListener
-{
-
- /**
- * Creates new form JCanvas3DExample
- */
- public JCanvas3DExample()
- {
- initComponents();
- Toolkit.getDefaultToolkit().setDynamicLayout( true );
- setDefaultCloseOperation( EXIT_ON_CLOSE );
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
- private void initComponents() {
- java.awt.GridBagConstraints gridBagConstraints;
-
- splitPane = new javax.swing.JSplitPane();
- scrollPane = new javax.swing.JScrollPane();
- panel = new javax.swing.JPanel();
- addButton = new javax.swing.JButton();
- delayCheckBox = new javax.swing.JCheckBox();
- interactiveCheckBox = new javax.swing.JCheckBox();
- randomCheckBox = new javax.swing.JCheckBox();
- desktopPane = new javax.swing.JDesktopPane();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- splitPane.setDividerLocation(300);
- splitPane.setDividerSize(8);
- splitPane.setContinuousLayout(true);
- splitPane.setOneTouchExpandable(true);
- panel.setLayout(new java.awt.GridBagLayout());
-
- addButton.setText("Create New Frame");
- addButton.setToolTipText("Adds a new frame containing an universe into the desktop pane");
- addButton.addActionListener(this);
-
- panel.add(addButton, new java.awt.GridBagConstraints());
-
- delayCheckBox.setText("Resize Delayed");
- delayCheckBox.setToolTipText("Shows the effect of using a delayed resizing to the internal frames.");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- panel.add(delayCheckBox, gridBagConstraints);
-
- interactiveCheckBox.setSelected(true);
- interactiveCheckBox.setText("Interactive Cube");
- interactiveCheckBox.setToolTipText("Tests the use of AWT behaviors on the displayed component.");
- interactiveCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
- interactiveCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
- interactiveCheckBox.addActionListener(this);
-
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- panel.add(interactiveCheckBox, gridBagConstraints);
-
- randomCheckBox.setText("Random start angle");
- randomCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
- randomCheckBox.setEnabled(false);
- randomCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- panel.add(randomCheckBox, gridBagConstraints);
-
- scrollPane.setViewportView(panel);
-
- splitPane.setLeftComponent(scrollPane);
-
- desktopPane.setBackground(new java.awt.Color(153, 153, 201));
- desktopPane.setPreferredSize(new java.awt.Dimension(300, 300));
- splitPane.setRightComponent(desktopPane);
-
- getContentPane().add(splitPane, java.awt.BorderLayout.CENTER);
-
- java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
- setBounds((screenSize.width-1011)/2, (screenSize.height-733)/2, 1011, 733);
- }
-
- // Code for dispatching events from components to event handlers.
-
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- if (evt.getSource() == addButton) {
- JCanvas3DExample.this.addButtonActionPerformed(evt);
- }
- else if (evt.getSource() == interactiveCheckBox) {
- JCanvas3DExample.this.interactiveCheckBoxActionPerformed(evt);
- }
- }// </editor-fold>//GEN-END:initComponents
-
- private void interactiveCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interactiveCheckBoxActionPerformed
- randomCheckBox.setEnabled( interactiveCheckBox.isSelected() ? false:true );
- }//GEN-LAST:event_interactiveCheckBoxActionPerformed
-
- private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
- JInternalWorld iWorld;
- // we create an internal world to be added within the JDesktop.
- iWorld = new JInternalWorld( interactiveCheckBox.isSelected(),
- delayCheckBox.isSelected(),
- randomCheckBox.isSelected() );
- iWorld.setSize( 256, 256 );
- iWorld.setLocation( 50, 50 );
- iWorld.setResizable( true );
- desktopPane.add( iWorld );
- iWorld.setVisible(true);
- }//GEN-LAST:event_addButtonActionPerformed
-
- /**
- * @param args the command line arguments
- */
- public static void main(String args[])
- {
- java.awt.EventQueue.invokeLater(new Runnable()
- {
- public void run()
- {
- new JCanvas3DExample().setVisible(true);
- }
- });
- }
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton addButton;
- private javax.swing.JCheckBox delayCheckBox;
- private javax.swing.JDesktopPane desktopPane;
- private javax.swing.JCheckBox interactiveCheckBox;
- private javax.swing.JPanel panel;
- private javax.swing.JCheckBox randomCheckBox;
- private javax.swing.JScrollPane scrollPane;
- private javax.swing.JSplitPane splitPane;
- // End of variables declaration//GEN-END:variables
-
-}
diff --git a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExampleGL2ES2.java b/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExampleGL2ES2.java
deleted file mode 100644
index 45dccc0..0000000
--- a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JCanvas3DExampleGL2ES2.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2016 JogAmp Community. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-package org.jdesktop.j3d.examples.jcanvas3d;
-
-
-/**
- * Simple Java 3D example program that displays universes within lightweight swing components, layed in JInternalFrame objects.
- */
-import java.awt.Toolkit;
-
-public class JCanvas3DExampleGL2ES2 extends javax.swing.JFrame implements java.awt.event.ActionListener
-{
-
- /**
- * Creates new form JCanvas3DExample
- */
- public JCanvas3DExampleGL2ES2()
- {
- initComponents();
- Toolkit.getDefaultToolkit().setDynamicLayout( true );
- setDefaultCloseOperation( EXIT_ON_CLOSE );
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
- private void initComponents() {
- java.awt.GridBagConstraints gridBagConstraints;
-
- splitPane = new javax.swing.JSplitPane();
- scrollPane = new javax.swing.JScrollPane();
- panel = new javax.swing.JPanel();
- addButton = new javax.swing.JButton();
- delayCheckBox = new javax.swing.JCheckBox();
- interactiveCheckBox = new javax.swing.JCheckBox();
- randomCheckBox = new javax.swing.JCheckBox();
- desktopPane = new javax.swing.JDesktopPane();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- splitPane.setDividerLocation(300);
- splitPane.setDividerSize(8);
- splitPane.setContinuousLayout(true);
- splitPane.setOneTouchExpandable(true);
- panel.setLayout(new java.awt.GridBagLayout());
-
- addButton.setText("Create New Frame");
- addButton.setToolTipText("Adds a new frame containing an universe into the desktop pane");
- addButton.addActionListener(this);
-
- panel.add(addButton, new java.awt.GridBagConstraints());
-
- delayCheckBox.setText("Resize Delayed");
- delayCheckBox.setToolTipText("Shows the effect of using a delayed resizing to the internal frames.");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- panel.add(delayCheckBox, gridBagConstraints);
-
- interactiveCheckBox.setSelected(true);
- interactiveCheckBox.setText("Interactive Cube");
- interactiveCheckBox.setToolTipText("Tests the use of AWT behaviors on the displayed component.");
- interactiveCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
- interactiveCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
- interactiveCheckBox.addActionListener(this);
-
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- panel.add(interactiveCheckBox, gridBagConstraints);
-
- randomCheckBox.setText("Random start angle");
- randomCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
- randomCheckBox.setEnabled(false);
- randomCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- panel.add(randomCheckBox, gridBagConstraints);
-
- scrollPane.setViewportView(panel);
-
- splitPane.setLeftComponent(scrollPane);
-
- desktopPane.setBackground(new java.awt.Color(153, 153, 201));
- desktopPane.setPreferredSize(new java.awt.Dimension(300, 300));
- splitPane.setRightComponent(desktopPane);
-
- getContentPane().add(splitPane, java.awt.BorderLayout.CENTER);
-
- java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
- setBounds((screenSize.width-1011)/2, (screenSize.height-733)/2, 1011, 733);
- }
-
- // Code for dispatching events from components to event handlers.
-
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- if (evt.getSource() == addButton) {
- JCanvas3DExampleGL2ES2.this.addButtonActionPerformed(evt);
- }
- else if (evt.getSource() == interactiveCheckBox) {
- JCanvas3DExampleGL2ES2.this.interactiveCheckBoxActionPerformed(evt);
- }
- }// </editor-fold>//GEN-END:initComponents
-
- private void interactiveCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interactiveCheckBoxActionPerformed
- randomCheckBox.setEnabled( interactiveCheckBox.isSelected() ? false:true );
- }//GEN-LAST:event_interactiveCheckBoxActionPerformed
-
- private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
- JInternalWorldGL2ES2 iWorld;
- // we create an internal world to be added within the JDesktop.
- iWorld = new JInternalWorldGL2ES2( interactiveCheckBox.isSelected(),
- delayCheckBox.isSelected(),
- randomCheckBox.isSelected() );
- iWorld.setSize( 256, 256 );
- iWorld.setLocation( 50, 50 );
- iWorld.setResizable( true );
- desktopPane.add( iWorld );
- iWorld.setVisible(true);
- }//GEN-LAST:event_addButtonActionPerformed
-
- /**
- * @param args the command line arguments
- */
- public static void main(String args[])
- {System.setProperty("sun.awt.noerasebackground", "true");
- System.setProperty("j3d.rend", "jogl2es2");
- System.setProperty("j3d.displaylist", "false");
- java.awt.EventQueue.invokeLater(new Runnable()
- {
- public void run()
- {
- new JCanvas3DExampleGL2ES2().setVisible(true);
- }
- });
- }
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton addButton;
- private javax.swing.JCheckBox delayCheckBox;
- private javax.swing.JDesktopPane desktopPane;
- private javax.swing.JCheckBox interactiveCheckBox;
- private javax.swing.JPanel panel;
- private javax.swing.JCheckBox randomCheckBox;
- private javax.swing.JScrollPane scrollPane;
- private javax.swing.JSplitPane splitPane;
- // End of variables declaration//GEN-END:variables
-
-}
diff --git a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorld.java b/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorld.java
deleted file mode 100644
index e702bc2..0000000
--- a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorld.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * $RCSfile$
- *
- * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any
- * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
- * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
- * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
- * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
- * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
- * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
- * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
- * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
- * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
- * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed, licensed or
- * intended for use in the design, construction, operation or
- * maintenance of any nuclear facility.
- *
- * $Revision$
- * $Date$
- * $State$
- */
-
-package org.jdesktop.j3d.examples.jcanvas3d;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-
-import javax.swing.JInternalFrame;
-
-import org.jogamp.java3d.Alpha;
-import org.jogamp.java3d.AmbientLight;
-import org.jogamp.java3d.Appearance;
-import org.jogamp.java3d.BoundingSphere;
-import org.jogamp.java3d.BranchGroup;
-import org.jogamp.java3d.DirectionalLight;
-import org.jogamp.java3d.Font3D;
-import org.jogamp.java3d.FontExtrusion;
-import org.jogamp.java3d.GraphicsConfigTemplate3D;
-import org.jogamp.java3d.Material;
-import org.jogamp.java3d.RotationInterpolator;
-import org.jogamp.java3d.Shape3D;
-import org.jogamp.java3d.Text3D;
-import org.jogamp.java3d.Transform3D;
-import org.jogamp.java3d.TransformGroup;
-import org.jogamp.java3d.exp.swing.JCanvas3D;
-import org.jogamp.java3d.utils.behaviors.mouse.MouseRotate;
-import org.jogamp.java3d.utils.universe.SimpleUniverse;
-import org.jogamp.vecmath.Color3f;
-import org.jogamp.vecmath.Point3d;
-import org.jogamp.vecmath.Point3f;
-import org.jogamp.vecmath.Vector3d;
-import org.jogamp.vecmath.Vector3f;
-
-
-/**
- * This is a JInternalFrame holding an universe, which can be configured to
- * be interactive -that is, where user can interact with object- or automatic
- * -where the object spins only-. When in automatic mode, spinning speed is
- * changed so that they look less the same. Changing the spinning start angle
- * helps unsynchronizing the rotations too.
- *
- * @author pepe
- */
-public class JInternalWorld extends JInternalFrame {
- /** DOCUMENT ME! */
- private Component comp;
-
- /**
- * Creates a new JInternalWorld object.
- *
- * @param isInteractive tells the world to be constructed as interactive
- * @param isDelayed tells the rotator to start at a random alpha.
- */
- public JInternalWorld(boolean isInteractive, boolean isDelayed, boolean isRandom) {
- super();
- setSize(256, 256);
- setClosable(true);
-
- JCanvas3D canvas = new JCanvas3D(new GraphicsConfigTemplate3D());
-
- if (true == isDelayed) {
- canvas.setResizeMode(canvas.RESIZE_DELAYED);
- }
-
- comp = canvas;
-
- Dimension dim = new Dimension(256, 256);
- comp.setPreferredSize(dim);
- comp.setSize(dim);
- getContentPane().setLayout(new BorderLayout());
- getContentPane().add(comp, BorderLayout.CENTER);
- pack();
-
- // Create a simple scene and attach it to the virtual universe
- BranchGroup scene = createSceneGraph(isInteractive, isRandom);
- SimpleUniverse universe = new SimpleUniverse(canvas.getOffscreenCanvas3D()); //TODO: this is awful and must not be done like that in final version
-
- // This will move the ViewPlatform back a bit so the
- // objects in the scene can be viewed.
- universe.getViewingPlatform().setNominalViewingTransform();
- universe.getViewer().getView().setMinimumFrameCycleTime(30);
- universe.addBranchGraph(scene);
- }
-
- /**
- * Creates the world. Only exists to cleanup the source a bit
- *
- * @param isInteractive tells the world to be constructed as interactive
- * @param isDelayed tells the rotator to start at a random alpha.
- *
- * @return a global branchgroup containing the world, as desired.
- */
- private BranchGroup createSceneGraph(boolean isInteractive, boolean isRandom) {
- // Create the root of the branch graph
- BranchGroup objRoot = new BranchGroup();
-
- // Create the TransformGroup node and initialize it to the
- // identity. Enable the TRANSFORM_WRITE capability so that
- // our behavior code can modify it at run time. Add it to
- // the root of the subgraph.
- TransformGroup objTrans = new TransformGroup();
- Transform3D t3dTrans = new Transform3D();
- t3dTrans.setTranslation(new Vector3d(0, 0, -1));
- objTrans.setTransform(t3dTrans);
-
- TransformGroup objRot = new TransformGroup();
- objRot.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
- objRoot.addChild(objTrans);
- objTrans.addChild(objRot);
-
- // Create a simple Shape3D node; add it to the scene graph.
- // issue 383: changed the cube to a text, so that any graphical problem related to Yup can be seen.
- Font3D f3d = new Font3D(new Font("dialog", Font.PLAIN, 1),
- new FontExtrusion());
- Text3D text = new Text3D(f3d, "JCanvas3D",
- new Point3f( -2.3f, -0.5f, 0.f));
-
- Shape3D sh = new Shape3D();
- Appearance app = new Appearance();
- Material mm = new Material();
- mm.setLightingEnable(true);
- app.setMaterial(mm);
- sh.setGeometry(text);
- sh.setAppearance(app);
-
- objRot.addChild( sh );
-
- BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
- 100.0);
-
- // Set up the ambient light
- Color3f ambientColor = new Color3f(0.3f, 0.3f, 0.3f);
- AmbientLight ambientLightNode = new AmbientLight(ambientColor);
- ambientLightNode.setInfluencingBounds(bounds);
- objRoot.addChild(ambientLightNode);
-
- // Set up the directional lights
- Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
- Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
- Color3f light2Color = new Color3f(1.0f, 1.0f, 0.9f);
- Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
-
- DirectionalLight light1
- = new DirectionalLight(light1Color, light1Direction);
- light1.setInfluencingBounds(bounds);
- objRoot.addChild(light1);
-
- DirectionalLight light2
- = new DirectionalLight(light2Color, light2Direction);
- light2.setInfluencingBounds(bounds);
- objRoot.addChild(light2);
-
-
- if (true == isInteractive) {
- MouseRotate mr = new MouseRotate(comp, objRot);
- mr.setSchedulingBounds(bounds);
- mr.setSchedulingInterval(1);
- objRoot.addChild(mr);
- } else {
- // Create a new Behavior object that will perform the
- // desired operation on the specified transform and add
- // it into the scene graph.
- Transform3D yAxis = new Transform3D();
-
- // rotation speed is randomized a bit so that it does not go at the same speed on every canvases,
- // which will make it more natural and express the differences between every present universes
- Alpha rotationAlpha = null;
-
- if (true == isRandom) {
- int duration = Math.max(2000, (int) (Math.random() * 8000.));
- rotationAlpha = new Alpha(-1,
- (int) ((double) duration * Math.random()), 0, duration,
- 0, 0);
- } else {
- rotationAlpha = new Alpha(-1, 4000);
- }
-
- RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,
- objRot, yAxis, 0.0f, (float) Math.PI * 2.0f);
-
- rotator.setSchedulingBounds(bounds);
- objRoot.addChild(rotator);
- }
-
- return objRoot;
- }
-
-}
diff --git a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorldGL2ES2.java b/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorldGL2ES2.java
deleted file mode 100644
index d38dc6e..0000000
--- a/src/classes/org/jdesktop/j3d/examples/jcanvas3d/JInternalWorldGL2ES2.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2016 JogAmp Community. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-package org.jdesktop.j3d.examples.jcanvas3d;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-
-import javax.swing.JInternalFrame;
-
-import org.jdesktop.j3d.examples.gl2es2pipeline.SimpleShaderAppearance;
-import org.jogamp.java3d.Alpha;
-import org.jogamp.java3d.AmbientLight;
-import org.jogamp.java3d.Appearance;
-import org.jogamp.java3d.BoundingSphere;
-import org.jogamp.java3d.BranchGroup;
-import org.jogamp.java3d.DirectionalLight;
-import org.jogamp.java3d.Font3D;
-import org.jogamp.java3d.FontExtrusion;
-import org.jogamp.java3d.GraphicsConfigTemplate3D;
-import org.jogamp.java3d.Material;
-import org.jogamp.java3d.RotationInterpolator;
-import org.jogamp.java3d.Shape3D;
-import org.jogamp.java3d.Text3D;
-import org.jogamp.java3d.Transform3D;
-import org.jogamp.java3d.TransformGroup;
-import org.jogamp.java3d.exp.swing.JCanvas3D;
-import org.jogamp.java3d.utils.behaviors.mouse.MouseRotate;
-import org.jogamp.java3d.utils.universe.SimpleUniverse;
-import org.jogamp.vecmath.Color3f;
-import org.jogamp.vecmath.Point3d;
-import org.jogamp.vecmath.Point3f;
-import org.jogamp.vecmath.Vector3d;
-import org.jogamp.vecmath.Vector3f;
-
-
-/**
- * This is a JInternalFrame holding an universe, which can be configured to
- * be interactive -that is, where user can interact with object- or automatic
- * -where the object spins only-. When in automatic mode, spinning speed is
- * changed so that they look less the same. Changing the spinning start angle
- * helps unsynchronizing the rotations too.
- *
- * @author pepe
- */
-public class JInternalWorldGL2ES2 extends JInternalFrame {
- /** DOCUMENT ME! */
- private Component comp;
-
- /**
- * Creates a new JInternalWorld object.
- *
- * @param isInteractive tells the world to be constructed as interactive
- * @param isDelayed tells the rotator to start at a random alpha.
- */
- public JInternalWorldGL2ES2(boolean isInteractive, boolean isDelayed, boolean isRandom) {
- super();
- setSize(256, 256);
- setClosable(true);
-
- JCanvas3D canvas = new JCanvas3D(new GraphicsConfigTemplate3D());
-
- if (true == isDelayed) {
- canvas.setResizeMode(canvas.RESIZE_DELAYED);
- }
-
- comp = canvas;
-
- Dimension dim = new Dimension(256, 256);
- comp.setPreferredSize(dim);
- comp.setSize(dim);
- getContentPane().setLayout(new BorderLayout());
- getContentPane().add(comp, BorderLayout.CENTER);
- pack();
-
- // Create a simple scene and attach it to the virtual universe
- BranchGroup scene = createSceneGraph(isInteractive, isRandom);
- SimpleUniverse universe = new SimpleUniverse(canvas.getOffscreenCanvas3D()); //TODO: this is awful and must not be done like that in final version
-
- // This will move the ViewPlatform back a bit so the
- // objects in the scene can be viewed.
- universe.getViewingPlatform().setNominalViewingTransform();
- universe.getViewer().getView().setMinimumFrameCycleTime(30);
- universe.addBranchGraph(scene);
- }
-
- /**
- * Creates the world. Only exists to cleanup the source a bit
- *
- * @param isInteractive tells the world to be constructed as interactive
- * @param isDelayed tells the rotator to start at a random alpha.
- *
- * @return a global branchgroup containing the world, as desired.
- */
- private BranchGroup createSceneGraph(boolean isInteractive, boolean isRandom) {
- // Create the root of the branch graph
- BranchGroup objRoot = new BranchGroup();
-
- // Create the TransformGroup node and initialize it to the
- // identity. Enable the TRANSFORM_WRITE capability so that
- // our behavior code can modify it at run time. Add it to
- // the root of the subgraph.
- TransformGroup objTrans = new TransformGroup();
- Transform3D t3dTrans = new Transform3D();
- t3dTrans.setTranslation(new Vector3d(0, 0, -1));
- objTrans.setTransform(t3dTrans);
-
- TransformGroup objRot = new TransformGroup();
- objRot.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
- objRoot.addChild(objTrans);
- objTrans.addChild(objRot);
-
- // Create a simple Shape3D node; add it to the scene graph.
- // issue 383: changed the cube to a text, so that any graphical problem related to Yup can be seen.
- Font3D f3d = new Font3D(new Font("dialog", Font.PLAIN, 1),
- new FontExtrusion());
- Text3D text = new Text3D(f3d, "JCanvas3D",
- new Point3f( -2.3f, -0.5f, 0.f));
-
- Shape3D sh = new Shape3D();
- Appearance app = new SimpleShaderAppearance(false,false);
- Material mm = new Material();
- mm.setLightingEnable(true);
- app.setMaterial(mm);
- sh.setGeometry(text);
- sh.setAppearance(app);
-
- objRot.addChild( sh );
-
- BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
- 100.0);
-
- // Set up the ambient light
- Color3f ambientColor = new Color3f(0.3f, 0.3f, 0.3f);
- AmbientLight ambientLightNode = new AmbientLight(ambientColor);
- ambientLightNode.setInfluencingBounds(bounds);
- objRoot.addChild(ambientLightNode);
-
- // Set up the directional lights
- Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
- Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
- Color3f light2Color = new Color3f(1.0f, 1.0f, 0.9f);
- Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
-
- DirectionalLight light1
- = new DirectionalLight(light1Color, light1Direction);
- light1.setInfluencingBounds(bounds);
- objRoot.addChild(light1);
-
- DirectionalLight light2
- = new DirectionalLight(light2Color, light2Direction);
- light2.setInfluencingBounds(bounds);
- objRoot.addChild(light2);
-
-
- if (true == isInteractive) {
- MouseRotate mr = new MouseRotate(comp, objRot);
- mr.setSchedulingBounds(bounds);
- mr.setSchedulingInterval(1);
- objRoot.addChild(mr);
- } else {
- // Create a new Behavior object that will perform the
- // desired operation on the specified transform and add
- // it into the scene graph.
- Transform3D yAxis = new Transform3D();
-
- // rotation speed is randomized a bit so that it does not go at the same speed on every canvases,
- // which will make it more natural and express the differences between every present universes
- Alpha rotationAlpha = null;
-
- if (true == isRandom) {
- int duration = Math.max(2000, (int) (Math.random() * 8000.));
- rotationAlpha = new Alpha(-1,
- (int) ((double) duration * Math.random()), 0, duration,
- 0, 0);
- } else {
- rotationAlpha = new Alpha(-1, 4000);
- }
-
- RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,
- objRot, yAxis, 0.0f, (float) Math.PI * 2.0f);
-
- rotator.setSchedulingBounds(bounds);
- objRoot.addChild(rotator);
- }
-
- return objRoot;
- }
-
-}