001: /*
002: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/J3dNodesToolbar.java,v 1.1 2005/04/20 22:20:45 paulby Exp $
003: *
004: * Sun Public License Notice
005: *
006: * The contents of this file are subject to the Sun Public License Version
007: * 1.0 (the "License"). You may not use this file except in compliance with
008: * the License. A copy of the License is available at http://www.sun.com/
009: *
010: * The Original Code is the Java 3D(tm) Scene Graph Editor.
011: * The Initial Developer of the Original Code is Paul Byrne.
012: * Portions created by Paul Byrne are Copyright (C) 2002.
013: * All Rights Reserved.
014: *
015: * Contributor(s): Paul Byrne.
016: *
017: **/
018: package org.jdesktop.j3dedit.scenegrapheditor;
019:
020: import javax.swing.JPanel;
021: import java.awt.Component;
022: import java.awt.Container;
023:
024: /**
025: * @author Paul Byrne
026: * @version 1.6, 01/18/02
027: */
028: public class J3dNodesToolbar extends javax.swing.JPanel implements
029: GroupSelectionListener {
030:
031: /** Creates new form J3dNodesToolbar */
032: public J3dNodesToolbar() {
033: initComponents();
034: groupSelected(false); // Initial state has no selection
035: }
036:
037: public javax.swing.JTabbedPane getTabPane() {
038: return jTabbedPane1;
039: }
040:
041: /**
042: * GroupSelectionListener method
043: *
044: * Called with true when the user selects a group Node
045: * Called with false when a leaf node or no node is selected
046: */
047: public void groupSelected(boolean selected) {
048: jTabbedPane1.setEnabled(selected);
049:
050: Container comp = (Container) jTabbedPane1
051: .getComponentAt(jTabbedPane1.getModel()
052: .getSelectedIndex());
053: for (int i = 0; i < comp.getComponentCount(); i++)
054: comp.getComponent(i).setEnabled(selected);
055: }
056:
057: /** This method is called from within the constructor to
058: * initialize the form.
059: * WARNING: Do NOT modify this code. The content of this method is
060: * always regenerated by the FormEditor.
061: */
062: private void initComponents() {//GEN-BEGIN:initComponents
063: jTabbedPane1 = new javax.swing.JTabbedPane();
064: groupPanel = new javax.swing.JPanel();
065: behaviorPanel = new javax.swing.JPanel();
066: lightPanel = new javax.swing.JPanel();
067: geometryPanel = new javax.swing.JPanel();
068: soundPanel = new javax.swing.JPanel();
069: setLayout(new java.awt.BorderLayout());
070: setMinimumSize(new java.awt.Dimension(0, 0));
071:
072: groupPanel.setLayout(new java.awt.FlowLayout(0, 5, 5));
073: jTabbedPane1.addTab("Group", groupPanel);
074:
075: behaviorPanel.setLayout(new java.awt.FlowLayout(0, 5, 5));
076: jTabbedPane1.addTab("Behavior", behaviorPanel);
077:
078: lightPanel.setLayout(new java.awt.FlowLayout(0, 5, 5));
079: jTabbedPane1.addTab("Light", lightPanel);
080:
081: geometryPanel.setLayout(new java.awt.FlowLayout(0, 5, 5));
082: jTabbedPane1.addTab("Geometry", geometryPanel);
083:
084: soundPanel.setLayout(new java.awt.FlowLayout(0, 5, 5));
085: jTabbedPane1.addTab("Sound", soundPanel);
086:
087: add(jTabbedPane1, java.awt.BorderLayout.CENTER);
088:
089: }//GEN-END:initComponents
090:
091: // Variables declaration - do not modify//GEN-BEGIN:variables
092: private javax.swing.JTabbedPane jTabbedPane1;
093: private javax.swing.JPanel groupPanel;
094: private javax.swing.JPanel behaviorPanel;
095: private javax.swing.JPanel lightPanel;
096: private javax.swing.JPanel geometryPanel;
097: private javax.swing.JPanel soundPanel;
098: // End of variables declaration//GEN-END:variables
099:
100: }
|