=== modified file 'DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.form' --- DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.form 2010-12-20 02:14:08 +0000 +++ DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.form 2011-10-26 03:33:14 +0000 @@ -104,6 +104,21 @@ + + + + + + + + + + + + + + + === modified file 'DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.java' --- DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.java 2011-10-02 22:06:35 +0000 +++ DesktopLayout/src/org/gephi/desktop/layout/LayoutPanel.java 2011-10-26 03:33:14 +0000 @@ -59,6 +59,7 @@ 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; @@ -248,8 +249,29 @@ 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.add(simplePanel); + } else { + layoutProvidedPanel.setVisible(false); + propertySheet.setVisible(true); + layoutProvidedPanel.removeAll(); + } + ((PropertySheet) propertySheet).setNodes(new Node[]{layoutNode}); } } @@ -298,6 +320,7 @@ layoutToolbar = new javax.swing.JToolBar(); presetsButton = new javax.swing.JButton(); resetButton = new javax.swing.JButton(); + layoutProvidedPanel = new PropertySheet(); propertySheet = new PropertySheet(); setLayout(new java.awt.GridBagLayout()); @@ -365,6 +388,17 @@ 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; @@ -391,6 +425,7 @@ // 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;