~mathieu-jacomy/gephi/forceatlas2-multithread

« back to all changes in this revision

Viewing changes to StatisticsPluginUI/src/org/gephi/ui/statistics/plugin/GraphDensityPanel.java

  • Committer: Mathieu Bastian
  • Date: 2010-01-20 20:37:57 UTC
  • Revision ID: mathieu.bastian@gmail.com-20100120203757-zl0qb0b37obd7vaf
Rename Statistics module, create spi package. Split Standard in Plugin and Plugin UI.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2008 WebAtlas
 
3
Authors : Patrick J. McSweeney (pjmcswee@syr.edu)
 
4
Website : http://www.gephi.org
 
5
 
 
6
This file is part of Gephi.
 
7
 
 
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.
 
12
 
 
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.
 
17
 
 
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/>.
 
20
 */
 
21
package org.gephi.ui.statistics.plugin;
 
22
 
 
23
/**
 
24
 *
 
25
 * @author pjmcswee
 
26
 */
 
27
public class GraphDensityPanel extends javax.swing.JPanel {
 
28
 
 
29
    public GraphDensityPanel() {
 
30
        initComponents();
 
31
    }
 
32
 
 
33
    public boolean isDirected() {
 
34
        return directedRadioButton.isSelected();
 
35
    }
 
36
 
 
37
    public void setDirected(boolean directed) {
 
38
        directedButtonGroup.setSelected(directed ? directedRadioButton.getModel() : undirectedRadioButton.getModel(), true);
 
39
    }
 
40
 
 
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.
 
45
     */
 
46
    @SuppressWarnings("unchecked")
 
47
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 
48
    private void initComponents() {
 
49
 
 
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();
 
56
 
 
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
 
59
 
 
60
        directedButtonGroup.add(directedRadioButton);
 
61
        directedRadioButton.setText(org.openide.util.NbBundle.getMessage(GraphDensityPanel.class, "GraphDensityPanel.directedRadioButton.text")); // NOI18N
 
62
 
 
63
        directedButtonGroup.add(undirectedRadioButton);
 
64
        undirectedRadioButton.setText(org.openide.util.NbBundle.getMessage(GraphDensityPanel.class, "GraphDensityPanel.undirectedRadioButton.text")); // NOI18N
 
65
 
 
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);
 
69
 
 
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()
 
75
                .addContainerGap()
 
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))
 
82
                .addContainerGap())
 
83
        );
 
84
        layout.setVerticalGroup(
 
85
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
86
            .addGroup(layout.createSequentialGroup()
 
87
                .addContainerGap()
 
88
                .addComponent(labelTitle)
 
89
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 
90
                .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
 
91
                .addGap(18, 18, 18)
 
92
                .addComponent(directedRadioButton)
 
93
                .addGap(18, 18, 18)
 
94
                .addComponent(undirectedRadioButton)
 
95
                .addGap(18, 18, 18)
 
96
                .addComponent(descriptionLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
 
97
                .addContainerGap())
 
98
        );
 
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
 
108
}