2
Copyright 2008 WebAtlas
3
Authors : Patrick J. McSweeney (pjmcswee@syr.edu)
4
Website : http://www.gephi.org
6
This file is part of Gephi.
8
Gephi is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
13
Gephi is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
21
package org.gephi.ui.statistics.plugin;
27
public class GraphDensityPanel extends javax.swing.JPanel {
29
public GraphDensityPanel() {
33
public boolean isDirected() {
34
return directedRadioButton.isSelected();
37
public void setDirected(boolean directed) {
38
directedButtonGroup.setSelected(directed ? directedRadioButton.getModel() : undirectedRadioButton.getModel(), true);
41
/** This method is called from within the constructor to
42
* initialize the form.
43
* WARNING: Do NOT modify this code. The content of this method is
44
* always regenerated by the Form Editor.
46
@SuppressWarnings("unchecked")
47
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
48
private void initComponents() {
50
directedButtonGroup = new javax.swing.ButtonGroup();
51
labelTitle = new javax.swing.JLabel();
52
directedRadioButton = new javax.swing.JRadioButton();
53
undirectedRadioButton = new javax.swing.JRadioButton();
54
separator = new javax.swing.JSeparator();
55
descriptionLabel = new org.jdesktop.swingx.JXLabel();
57
labelTitle.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
58
labelTitle.setText(org.openide.util.NbBundle.getMessage(GraphDensityPanel.class, "GraphDensityPanel.labelTitle.text")); // NOI18N
60
directedButtonGroup.add(directedRadioButton);
61
directedRadioButton.setText(org.openide.util.NbBundle.getMessage(GraphDensityPanel.class, "GraphDensityPanel.directedRadioButton.text")); // NOI18N
63
directedButtonGroup.add(undirectedRadioButton);
64
undirectedRadioButton.setText(org.openide.util.NbBundle.getMessage(GraphDensityPanel.class, "GraphDensityPanel.undirectedRadioButton.text")); // NOI18N
66
descriptionLabel.setLineWrap(true);
67
descriptionLabel.setText(org.openide.util.NbBundle.getMessage(GraphDensityPanel.class, "GraphDensityPanel.descriptionLabel.text")); // NOI18N
68
descriptionLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
70
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
71
this.setLayout(layout);
72
layout.setHorizontalGroup(
73
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
74
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
76
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
77
.addComponent(descriptionLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
78
.addComponent(undirectedRadioButton, javax.swing.GroupLayout.Alignment.LEADING)
79
.addComponent(directedRadioButton, javax.swing.GroupLayout.Alignment.LEADING)
80
.addComponent(labelTitle, javax.swing.GroupLayout.Alignment.LEADING)
81
.addComponent(separator, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE))
84
layout.setVerticalGroup(
85
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
86
.addGroup(layout.createSequentialGroup()
88
.addComponent(labelTitle)
89
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
90
.addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
92
.addComponent(directedRadioButton)
94
.addComponent(undirectedRadioButton)
96
.addComponent(descriptionLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
99
}// </editor-fold>//GEN-END:initComponents
100
// Variables declaration - do not modify//GEN-BEGIN:variables
101
private org.jdesktop.swingx.JXLabel descriptionLabel;
102
private javax.swing.ButtonGroup directedButtonGroup;
103
protected javax.swing.JRadioButton directedRadioButton;
104
private javax.swing.JLabel labelTitle;
105
private javax.swing.JSeparator separator;
106
protected javax.swing.JRadioButton undirectedRadioButton;
107
// End of variables declaration//GEN-END:variables