From 7959a0bdc17cf65ec8cc374e03adf64c383dd8bf Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 28 Nov 2006 09:14:58 +0000 Subject: [PATCH] * Fixed resize bug --- .../org/adempiere/plaf/PLAFEditorPanel.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/looks/src/org/adempiere/plaf/PLAFEditorPanel.java b/looks/src/org/adempiere/plaf/PLAFEditorPanel.java index acbf0cd4d2..5cd595bac3 100644 --- a/looks/src/org/adempiere/plaf/PLAFEditorPanel.java +++ b/looks/src/org/adempiere/plaf/PLAFEditorPanel.java @@ -99,6 +99,7 @@ public class PLAFEditorPanel extends CPanel { private CTextField mandatory = new CTextField(s_res.getString("Mandatory")); CButton button = new CButton("Button"); CPanel tabPage1 = new CPanel(); + private JSplitPane splitPane = new JSplitPane(); public PLAFEditorPanel() { init(); @@ -117,7 +118,6 @@ public class PLAFEditorPanel extends CPanel { this.setLayout(new BorderLayout()); //splitpane for the selection and preview panel - JSplitPane splitPane = new JSplitPane(); splitPane.setBorder(BorderFactory.createEmptyBorder()); splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); add(splitPane, BorderLayout.CENTER); @@ -151,13 +151,13 @@ public class PLAFEditorPanel extends CPanel { lookList.setVisibleRowCount(12); JScrollPane scrollPane = new JScrollPane(lookList); scrollPane.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1)); - selectionPanel.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, + selectionPanel.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.VERTICAL, new Insets(0, 5, 2, 2), 100, 0)); themeList.setVisibleRowCount(12); scrollPane = new JScrollPane(themeList); scrollPane.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1)); - selectionPanel.add(scrollPane, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, + selectionPanel.add(scrollPane, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 2, 2, 5), 0, 0)); previewPart.setBorder(BorderFactory.createEmptyBorder()); @@ -184,6 +184,10 @@ public class PLAFEditorPanel extends CPanel { }); } + /** + * Handle theme selection changed + * @param e + */ protected void themeSelectionChanged(ListSelectionEvent e) { if (m_setting) return; setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); @@ -383,6 +387,12 @@ public class PLAFEditorPanel extends CPanel { public ValueNamePair getSelectedTheme() { return (ValueNamePair)themeList.getSelectedValue(); } + + @Override + public void paint(Graphics g) { + splitPane.setDividerLocation(0.50); + super.paint(g); + } } /** @@ -425,7 +435,7 @@ class PreviewPanel extends CPanel { } } } else { - //draw preview image + //draw captured preview image if (image != null) g.drawImage(image, 0, 0, null); }