Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Commit

Permalink
Apply patch for bug 880601
Browse files Browse the repository at this point in the history
  • Loading branch information
mbastian committed Oct 26, 2011
1 parent ad9c1ce commit bd33968
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DesktopLayout/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AutoUpdate-Essential-Module: true
OpenIDE-Module: org.gephi.desktop.layout
OpenIDE-Module-Layer: org/gephi/desktop/layout/layer.xml
OpenIDE-Module-Localizing-Bundle: org/gephi/desktop/layout/Bundle.properties
OpenIDE-Module-Specification-Version: 0.8.0.2
OpenIDE-Module-Specification-Version: 0.8.0.3
12 changes: 12 additions & 0 deletions DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.form
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="layoutProvidedPanel">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="5" insetsRight="5" anchor="10" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
</Container>
<Container class="javax.swing.JPanel" name="propertySheet">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
Expand Down
37 changes: 37 additions & 0 deletions DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Development and Distribution License("CDDL") (collectively, the
package org.gephi.desktop.layout;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
Expand All @@ -59,6 +60,7 @@ Development and Distribution License("CDDL") (collectively, the
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
import org.gephi.layout.api.LayoutController;
Expand Down Expand Up @@ -248,8 +250,30 @@ public int compare(Object o1, Object o2) {
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});
}
}
Expand Down Expand Up @@ -298,6 +322,7 @@ private void initComponents() {
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());
Expand Down Expand Up @@ -365,6 +390,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
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;
Expand All @@ -391,6 +427,7 @@ private void runButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel infoLabel;
private javax.swing.JComboBox layoutCombobox;
private javax.swing.JPanel layoutProvidedPanel;
private javax.swing.JToolBar layoutToolbar;
private javax.swing.JButton presetsButton;
private javax.swing.JPanel propertySheet;
Expand Down

0 comments on commit bd33968

Please sign in to comment.