~keheliya-gallaba/gephi/maven-build

« back to all changes in this revision

Viewing changes to ExportPluginUI/src/main/java/org/gephi/ui/exporter/plugin/UIExporterGEXFPanel.java

  • Committer: Keheliya Gallaba
  • Date: 2011-08-01 13:01:30 UTC
  • Revision ID: keheliya.gallaba@gmail.com-20110801130130-0u2qgcufi8bvqwxv
Adding Export Plugin, Export Plugin UI, Filters Impl

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2008-2010 Gephi
 
3
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
 
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 Affero General Public License as
 
10
published by the Free Software Foundation, either version 3 of the
 
11
License, or (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 Affero General Public License for more details.
 
17
 
 
18
You should have received a copy of the GNU Affero General Public License
 
19
along with Gephi.  If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
package org.gephi.ui.exporter.plugin;
 
22
 
 
23
import org.gephi.graph.api.GraphController;
 
24
import org.gephi.graph.api.GraphModel;
 
25
import org.gephi.io.exporter.plugin.ExporterGEXF;
 
26
import org.openide.util.Lookup;
 
27
 
 
28
/**
 
29
 *
 
30
 * @author Mathieu Bastian
 
31
 */
 
32
public class UIExporterGEXFPanel extends javax.swing.JPanel {
 
33
 
 
34
    /** Creates new form UIExporterGEXFPanel */
 
35
    public UIExporterGEXFPanel() {
 
36
        initComponents();
 
37
    }
 
38
 
 
39
    public void setup(ExporterGEXF exporterGEXF) {
 
40
        colorsExportCheckbox.setSelected(exporterGEXF.isExportColors());
 
41
        positionExportCheckbox.setSelected(exporterGEXF.isExportPosition());
 
42
        sizeExportCheckbox.setSelected(exporterGEXF.isExportSize());
 
43
        attributesExportCheckbox.setSelected(exporterGEXF.isExportAttributes());
 
44
        normalizeCheckbox.setSelected(exporterGEXF.isNormalize());
 
45
        dynamicExportCheckbox.setSelected(exporterGEXF.isExportDynamic());
 
46
        hierarchyCheckbox.setSelected(exporterGEXF.isExportHierarchy());
 
47
 
 
48
        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
 
49
        hierarchyCheckbox.setEnabled(graphModel.isHierarchical());
 
50
    }
 
51
 
 
52
    public void unsetup(ExporterGEXF exporterGEXF) {
 
53
        exporterGEXF.setExportAttributes(attributesExportCheckbox.isSelected());
 
54
        exporterGEXF.setExportColors(colorsExportCheckbox.isSelected());
 
55
        exporterGEXF.setExportSize(sizeExportCheckbox.isSelected());
 
56
        exporterGEXF.setExportPosition(positionExportCheckbox.isSelected());
 
57
        exporterGEXF.setNormalize(normalizeCheckbox.isSelected());
 
58
        exporterGEXF.setExportDynamic(dynamicExportCheckbox.isSelected());
 
59
        exporterGEXF.setExportHierarchy(hierarchyCheckbox.isSelected());
 
60
    }
 
61
 
 
62
    /** This method is called from within the constructor to
 
63
     * initialize the form.
 
64
     * WARNING: Do NOT modify this code. The content of this method is
 
65
     * always regenerated by the Form Editor.
 
66
     */
 
67
    @SuppressWarnings("unchecked")
 
68
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 
69
    private void initComponents() {
 
70
 
 
71
        labelExport = new javax.swing.JLabel();
 
72
        positionExportCheckbox = new javax.swing.JCheckBox();
 
73
        colorsExportCheckbox = new javax.swing.JCheckBox();
 
74
        attributesExportCheckbox = new javax.swing.JCheckBox();
 
75
        sizeExportCheckbox = new javax.swing.JCheckBox();
 
76
        labelNormalize = new javax.swing.JLabel();
 
77
        normalizeCheckbox = new javax.swing.JCheckBox();
 
78
        dynamicExportCheckbox = new javax.swing.JCheckBox();
 
79
        hierarchyCheckbox = new javax.swing.JCheckBox();
 
80
        labelNormalize1 = new javax.swing.JLabel();
 
81
 
 
82
        labelExport.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.labelExport.text")); // NOI18N
 
83
 
 
84
        positionExportCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.positionExportCheckbox.text")); // NOI18N
 
85
 
 
86
        colorsExportCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.colorsExportCheckbox.text")); // NOI18N
 
87
 
 
88
        attributesExportCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.attributesExportCheckbox.text")); // NOI18N
 
89
 
 
90
        sizeExportCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.sizeExportCheckbox.text")); // NOI18N
 
91
 
 
92
        labelNormalize.setFont(new java.awt.Font("Tahoma", 0, 10));
 
93
        labelNormalize.setForeground(new java.awt.Color(102, 102, 102));
 
94
        labelNormalize.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.labelNormalize.text")); // NOI18N
 
95
 
 
96
        normalizeCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.normalizeCheckbox.text")); // NOI18N
 
97
 
 
98
        dynamicExportCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.dynamicExportCheckbox.text")); // NOI18N
 
99
 
 
100
        hierarchyCheckbox.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.hierarchyCheckbox.text")); // NOI18N
 
101
 
 
102
        labelNormalize1.setFont(new java.awt.Font("Tahoma", 0, 10));
 
103
        labelNormalize1.setForeground(new java.awt.Color(102, 102, 102));
 
104
        labelNormalize1.setText(org.openide.util.NbBundle.getMessage(UIExporterGEXFPanel.class, "UIExporterGEXFPanel.labelNormalize1.text")); // NOI18N
 
105
 
 
106
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
 
107
        this.setLayout(layout);
 
108
        layout.setHorizontalGroup(
 
109
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
110
            .addGroup(layout.createSequentialGroup()
 
111
                .addContainerGap()
 
112
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
113
                    .addGroup(layout.createSequentialGroup()
 
114
                        .addComponent(hierarchyCheckbox)
 
115
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
116
                        .addComponent(labelNormalize1, javax.swing.GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE))
 
117
                    .addGroup(layout.createSequentialGroup()
 
118
                        .addComponent(labelExport)
 
119
                        .addGap(18, 18, 18)
 
120
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
121
                            .addComponent(attributesExportCheckbox)
 
122
                            .addComponent(sizeExportCheckbox)
 
123
                            .addComponent(colorsExportCheckbox)
 
124
                            .addComponent(positionExportCheckbox)
 
125
                            .addComponent(dynamicExportCheckbox)))
 
126
                    .addGroup(layout.createSequentialGroup()
 
127
                        .addComponent(normalizeCheckbox)
 
128
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
129
                        .addComponent(labelNormalize, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)))
 
130
                .addContainerGap())
 
131
        );
 
132
        layout.setVerticalGroup(
 
133
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
134
            .addGroup(layout.createSequentialGroup()
 
135
                .addContainerGap()
 
136
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 
137
                    .addComponent(labelExport)
 
138
                    .addComponent(positionExportCheckbox))
 
139
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
140
                .addComponent(colorsExportCheckbox)
 
141
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
142
                .addComponent(sizeExportCheckbox)
 
143
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
144
                .addComponent(attributesExportCheckbox)
 
145
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
146
                .addComponent(dynamicExportCheckbox)
 
147
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
148
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 
149
                    .addComponent(normalizeCheckbox)
 
150
                    .addComponent(labelNormalize))
 
151
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 
152
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 
153
                    .addComponent(hierarchyCheckbox)
 
154
                    .addComponent(labelNormalize1))
 
155
                .addContainerGap(43, Short.MAX_VALUE))
 
156
        );
 
157
    }// </editor-fold>//GEN-END:initComponents
 
158
    // Variables declaration - do not modify//GEN-BEGIN:variables
 
159
    private javax.swing.JCheckBox attributesExportCheckbox;
 
160
    private javax.swing.JCheckBox colorsExportCheckbox;
 
161
    private javax.swing.JCheckBox dynamicExportCheckbox;
 
162
    private javax.swing.JCheckBox hierarchyCheckbox;
 
163
    private javax.swing.JLabel labelExport;
 
164
    private javax.swing.JLabel labelNormalize;
 
165
    private javax.swing.JLabel labelNormalize1;
 
166
    private javax.swing.JCheckBox normalizeCheckbox;
 
167
    private javax.swing.JCheckBox positionExportCheckbox;
 
168
    private javax.swing.JCheckBox sizeExportCheckbox;
 
169
    // End of variables declaration//GEN-END:variables
 
170
}