/* Copyright 2008-2010 Gephi Authors : Mathieu Bastian <mathieu.bastian@gephi.org> Website : http://www.gephi.org This file is part of Gephi. Gephi is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Gephi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Gephi. If not, see <http://www.gnu.org/licenses/>. */ package org.gephi.desktop.io.export; /** * * @author Mathieu Bastian */ public class GraphFileExporterUIPanel extends javax.swing.JPanel { /** Creates new form GraphFileExporterUIPanel */ public GraphFileExporterUIPanel() { initComponents(); } public void setVisibleOnlyGraph(boolean value) { graphButtonGroup.setSelected((value?visibleOnlyRadio.getModel():fullGraphRadio.getModel()), true); } public boolean isVisibleOnlyGraph() { return graphButtonGroup.isSelected(visibleOnlyRadio.getModel()); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { graphButtonGroup = new javax.swing.ButtonGroup(); labelGraph = new javax.swing.JLabel(); fullGraphRadio = new javax.swing.JRadioButton(); visibleOnlyRadio = new javax.swing.JRadioButton(); labelFullgraph = new javax.swing.JLabel(); labelVisibleOnly = new javax.swing.JLabel(); setBorder(javax.swing.BorderFactory.createEtchedBorder()); labelGraph.setText(org.openide.util.NbBundle.getMessage(GraphFileExporterUIPanel.class, "GraphFileExporterUIPanel.labelGraph.text")); // NOI18N graphButtonGroup.add(fullGraphRadio); fullGraphRadio.setSelected(true); fullGraphRadio.setText(org.openide.util.NbBundle.getMessage(GraphFileExporterUIPanel.class, "GraphFileExporterUIPanel.fullGraphRadio.text")); // NOI18N graphButtonGroup.add(visibleOnlyRadio); visibleOnlyRadio.setText(org.openide.util.NbBundle.getMessage(GraphFileExporterUIPanel.class, "GraphFileExporterUIPanel.visibleOnlyRadio.text")); // NOI18N labelFullgraph.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N labelFullgraph.setForeground(new java.awt.Color(102, 102, 102)); labelFullgraph.setText(org.openide.util.NbBundle.getMessage(GraphFileExporterUIPanel.class, "GraphFileExporterUIPanel.labelFullgraph.text")); // NOI18N labelVisibleOnly.setFont(new java.awt.Font("Tahoma", 0, 10)); labelVisibleOnly.setForeground(new java.awt.Color(102, 102, 102)); labelVisibleOnly.setText(org.openide.util.NbBundle.getMessage(GraphFileExporterUIPanel.class, "GraphFileExporterUIPanel.labelVisibleOnly.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(labelGraph) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(visibleOnlyRadio) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(labelVisibleOnly)) .addGroup(layout.createSequentialGroup() .addComponent(fullGraphRadio) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(labelFullgraph))) .addContainerGap(21, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(labelGraph) .addComponent(fullGraphRadio) .addComponent(labelFullgraph)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(visibleOnlyRadio) .addComponent(labelVisibleOnly)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JRadioButton fullGraphRadio; private javax.swing.ButtonGroup graphButtonGroup; private javax.swing.JLabel labelFullgraph; private javax.swing.JLabel labelGraph; private javax.swing.JLabel labelVisibleOnly; private javax.swing.JRadioButton visibleOnlyRadio; // End of variables declaration//GEN-END:variables }