From 229591ca0bd8fed49893540205a1a16b32103745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Sim=C3=A3o?= Date: Thu, 4 Feb 2010 22:10:24 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@1167 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../siprp/higiene/gestao/AdicionarPanel.java | 1 - .../src/leaf/ui/TreeInserterDialog.java | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java index e34e208c..d82dce3e 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java @@ -8,7 +8,6 @@ import java.awt.event.ActionListener; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JTree; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; diff --git a/trunk/common/src/leaf/ui/TreeInserterDialog.java b/trunk/common/src/leaf/ui/TreeInserterDialog.java index 9aed6145..a65fce8d 100644 --- a/trunk/common/src/leaf/ui/TreeInserterDialog.java +++ b/trunk/common/src/leaf/ui/TreeInserterDialog.java @@ -6,6 +6,7 @@ import info.clearthought.layout.TableLayoutConstraints; import java.awt.Component; import java.awt.Dimension; import java.awt.Insets; +import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -30,9 +31,7 @@ public class TreeInserterDialog extends JDialog private static final long serialVersionUID = 1L; - private static final Dimension ALL_DIMENSION = new Dimension(300,500); - - private static final Dimension NEW_DIMENSION = new Dimension(300,400); + private static final Dimension DIALOG_DEFAULT_DIMENSIONS = new Dimension(800,500); private static final String ICON_NAME_ADD = "leaf/ui/icons/add.png"; @@ -83,7 +82,15 @@ public class TreeInserterDialog extends JDialog startupListeners(); TreeTools.refreshTree(allTree, allRoot, true); setEnabled(); - this.setSize( 680, 400 ); + Toolkit tk = Toolkit.getDefaultToolkit(); + if( tk != null ) + { + this.setSize( tk.getScreenSize().width, DIALOG_DEFAULT_DIMENSIONS.height ); + } + else + { + this.setSize( DIALOG_DEFAULT_DIMENSIONS ); + } this.setLocationRelativeTo( null ); this.setModal( true ); this.setVisible( true ); @@ -99,8 +106,8 @@ public class TreeInserterDialog extends JDialog allScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); newScroll.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ); newScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); - allScroll.setPreferredSize( ALL_DIMENSION ); - newScroll.setPreferredSize( NEW_DIMENSION ); +// allScroll.setPreferredSize( ALL_DIMENSION ); +// newScroll.setPreferredSize( NEW_DIMENSION ); buttonAdd.setToolTipText( "Adicionar" ); buttonRemove.setToolTipText( "Remover" ); buttonAdd.setMargin( new Insets(0,0,0,0) ); @@ -110,7 +117,7 @@ public class TreeInserterDialog extends JDialog private void setupLayout() { TableLayout layout = new TableLayout( - new double[]{ TableLayout.FILL, TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.MINIMUM, TableLayout.MINIMUM }, + new double[]{ TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM }, new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM } ); layout.setHGap( 5 );