use of org.openide.explorer.propertysheet.PropertySheet in project gephi by gephi.
the class EditToolTopComponent method initComponents.
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
propertySheet = new PropertySheet();
setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(propertySheet, gridBagConstraints);
}
use of org.openide.explorer.propertysheet.PropertySheet in project gephi by gephi.
the class LayoutPanel method initComponents.
/**
* 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")
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
layoutCombobox = new javax.swing.JComboBox();
infoLabel = new javax.swing.JLabel();
runButton = new javax.swing.JButton();
layoutToolbar = new javax.swing.JToolBar();
presetsButton = new javax.swing.JButton();
resetButton = new javax.swing.JButton();
layoutProvidedPanel = new javax.swing.JPanel();
propertySheet = new PropertySheet();
setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.ipady = 10;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(layoutCombobox, gridBagConstraints);
infoLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
// NOI18N
infoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/layout/resources/layoutInfo.png")));
// NOI18N
infoLabel.setText(org.openide.util.NbBundle.getMessage(LayoutPanel.class, "LayoutPanel.infoLabel.text"));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(2, 7, 0, 0);
add(infoLabel, gridBagConstraints);
// NOI18N
runButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/layout/resources/run.gif")));
// NOI18N
runButton.setText(org.openide.util.NbBundle.getMessage(LayoutPanel.class, "LayoutPanel.runButton.text"));
runButton.setIconTextGap(5);
runButton.setMargin(new java.awt.Insets(2, 7, 2, 14));
runButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
runButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 5);
add(runButton, gridBagConstraints);
layoutToolbar.setFloatable(false);
layoutToolbar.setRollover(true);
layoutToolbar.setOpaque(false);
// NOI18N
presetsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/layout/resources/preset.png")));
// NOI18N
presetsButton.setText(org.openide.util.NbBundle.getMessage(LayoutPanel.class, "LayoutPanel.presetsButton.text"));
presetsButton.setFocusable(false);
presetsButton.setIconTextGap(0);
layoutToolbar.add(presetsButton);
// NOI18N
resetButton.setText(org.openide.util.NbBundle.getMessage(LayoutPanel.class, "LayoutPanel.resetButton.text"));
resetButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
resetButtonActionPerformed(evt);
}
});
layoutToolbar.add(resetButton);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
add(layoutToolbar, gridBagConstraints);
layoutProvidedPanel.setOpaque(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(layoutProvidedPanel, gridBagConstraints);
propertySheet.setOpaque(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(propertySheet, gridBagConstraints);
}
use of org.openide.explorer.propertysheet.PropertySheet in project gephi by gephi.
the class LayoutPanel method refreshProperties.
private void refreshProperties() {
if (model == null || model.getSelectedLayout() == null) {
((PropertySheet) propertySheet).setNodes(new Node[0]);
layoutProvidedPanel.setVisible(false);
propertySheet.setVisible(true);
layoutProvidedPanel.removeAll();
} else {
LayoutNode layoutNode = new LayoutNode(model.getSelectedLayout());
JPanel simplePanel = null;
try {
simplePanel = layoutNode.getLayout().getBuilder().getUI().getSimplePanel(layoutNode.getLayout());
} catch (Exception ex) {
// Tried and failed to getSimplePanel
}
if (null != simplePanel) {
propertySheet.setVisible(false);
layoutProvidedPanel.setVisible(true);
layoutProvidedPanel.removeAll();
layoutProvidedPanel.add(simplePanel);
} else {
layoutProvidedPanel.setVisible(false);
propertySheet.setVisible(true);
layoutProvidedPanel.removeAll();
}
((PropertySheet) propertySheet).setNodes(new Node[] { layoutNode });
}
}
Aggregations