001: /*
002: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/nodeeditors/panels/CommonNodeComponentPanel.java,v 1.1 2005/04/20 22:21:04 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.nodeeditors.panels;
019:
020: import org.jdesktop.j3dedit.scenegraph.SGNodeComponent;
021:
022: /**
023: * Panel for displaying data common for all NodeComponents.
024: * Currently this is the ReferencedBy count
025: *
026: * @author Paul Byrne
027: */
028: public class CommonNodeComponentPanel extends javax.swing.JPanel {
029:
030: /** Creates new form commonNodeComponentPanel */
031: public CommonNodeComponentPanel() {
032: initComponents();
033: }
034:
035: /**
036: * Actually the user can't edit the data displayed here, but this method
037: * should always be called from the startEdit method of the NodeComponent
038: */
039: public void startEdit(SGNodeComponent node) {
040: if (node == null)
041: refCountTF.setText("");
042: else
043: refCountTF.setText(Integer.toString(node
044: .getReferencedByCount()));
045: }
046:
047: /** This method is called from within the constructor to
048: * initialize the form.
049: * WARNING: Do NOT modify this code. The content of this method is
050: * always regenerated by the Form Editor.
051: */
052: private void initComponents() {//GEN-BEGIN:initComponents
053: java.awt.GridBagConstraints gridBagConstraints;
054: javax.swing.JLabel nameL;
055: javax.swing.JLabel refCountL;
056:
057: refCountL = new javax.swing.JLabel();
058: refCountTF = new javax.swing.JTextField();
059: nameL = new javax.swing.JLabel();
060: nameTF = new javax.swing.JTextField();
061:
062: setLayout(new java.awt.GridBagLayout());
063:
064: refCountL.setFont(new java.awt.Font("Dialog", 0, 10));
065: refCountL.setText("Reference Count");
066: gridBagConstraints = new java.awt.GridBagConstraints();
067: gridBagConstraints.gridx = 2;
068: gridBagConstraints.gridy = 0;
069: gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
070: add(refCountL, gridBagConstraints);
071:
072: refCountTF.setColumns(4);
073: refCountTF.setEditable(false);
074: refCountTF.setFont(new java.awt.Font("Dialog", 0, 10));
075: refCountTF.setText("0");
076: refCountTF
077: .setToolTipText("The number of Objects that reference this Node Component");
078: gridBagConstraints = new java.awt.GridBagConstraints();
079: gridBagConstraints.gridx = 3;
080: gridBagConstraints.gridy = 0;
081: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
082: add(refCountTF, gridBagConstraints);
083:
084: nameL.setFont(new java.awt.Font("Dialog", 0, 10));
085: nameL.setText("Name");
086: gridBagConstraints = new java.awt.GridBagConstraints();
087: gridBagConstraints.gridx = 0;
088: gridBagConstraints.gridy = 0;
089: gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
090: add(nameL, gridBagConstraints);
091:
092: nameTF.setColumns(8);
093: nameTF.setFont(new java.awt.Font("Dialog", 0, 10));
094: nameTF.setToolTipText("The name of this Node Component");
095: gridBagConstraints = new java.awt.GridBagConstraints();
096: gridBagConstraints.gridx = 1;
097: gridBagConstraints.gridy = 0;
098: gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);
099: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
100: add(nameTF, gridBagConstraints);
101:
102: }//GEN-END:initComponents
103:
104: // Variables declaration - do not modify//GEN-BEGIN:variables
105: private javax.swing.JTextField nameTF;
106: private javax.swing.JTextField refCountTF;
107: // End of variables declaration//GEN-END:variables
108:
109: }
|