From: <jm...@us...> - 2010-03-16 10:20:38
|
Revision: 1321 http://eulergui.svn.sourceforge.net/eulergui/?rev=1321&view=rev Author: jmvanel Date: 2010-03-16 10:20:31 +0000 (Tue, 16 Mar 2010) Log Message: ----------- GUI enhancement: re-established (the regression is gone) glue together the components between the button bar and the bottom text panel, so that the bottom text panel can grow in size. Modified Paths: -------------- trunk/eulergui/src/main/java/n3_project/SourceFilesView.java Modified: trunk/eulergui/src/main/java/n3_project/SourceFilesView.java =================================================================== --- trunk/eulergui/src/main/java/n3_project/SourceFilesView.java 2010-03-15 18:37:08 UTC (rev 1320) +++ trunk/eulergui/src/main/java/n3_project/SourceFilesView.java 2010-03-16 10:20:31 UTC (rev 1321) @@ -1,6 +1,7 @@ package n3_project; import java.awt.Color; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.Collection; @@ -48,33 +49,36 @@ getButtonsPanel().removeAll(); getButtonsPanel().setLayout(new BoxLayout(getButtonsPanel(), BoxLayout.Y_AXIS)); - + int buttonCount = 0; + Dimension buttonSize = new Dimension(); // copy sources to avoid ConcurrentModificationException Collection<N3Source> sources_ = new ArrayList<N3Source>( getProject().getSources().values() ); for (N3Source n3Source : sources_) { - addButtonForFile( n3Source ); + buttonSize = addButtonForFile( n3Source ).getSize(); + buttonCount++; } N3Source n3 = getProject().getN3Query(); if (n3 != null) { - doAddButtonForFile( n3, true ); + doAddButtonForFile( n3, true ); // TODO buttonSize + buttonCount++; } fireEventsToUpdateN3SourceComponents(); // glue together the buttons for N3 sources -// getButtonsPanel().setMaximumSize( getButtonsPanel().getPreferredSize() ); -// TODO: commented out (was added in revision 1301), because of regression - // (see revision 1310 ) - - System.out.println("SourceFilesView.makeButtonsPanel(): " + - "getButtonsPanel().getPreferredSize(): " - + getButtonsPanel().getPreferredSize() ); - + getButtonsPanel().setMaximumSize( new Dimension( + Short.MAX_VALUE, + buttonCount * buttonSize.height ) ); + getCenterPanel().validate(); +// System.out.println("AFTER getCenterPanel().validate();" ); +// System.out.println("SourceFilesView.makeButtonsPanel(): " +// + " getButtonsPanel().getSize(): " +// + getButtonsPanel().getSize() ); getCenterPanel().invalidate(); getProjectGUI().updateWindowTitle(); @@ -104,7 +108,7 @@ /** add a row of Buttons for any N3 source, non-query * TODO add argument isQuery and unify with other method addButtonForFile */ - void addButtonForFile( N3Source n3 ) { + JPanel addButtonForFile( N3Source n3 ) { String otherFile = ""; if( n3 instanceof N3SourceFromOtherFormat ) { @@ -120,6 +124,7 @@ } visualizeErrorOnN3Source(n3, panel); + return panel; } static void visualizeErrorOnN3Source(N3Source n3, JPanel panel) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |