[Imagetools-commit] SF.net SVN: imagetools:[29] trunk/imagetools/src/net/codebuilders/desktop/ imag
Status: Beta
Brought to you by:
cmarcum
From: <cm...@us...> - 2009-04-19 19:08:23
|
Revision: 29 http://imagetools.svn.sourceforge.net/imagetools/?rev=29&view=rev Author: cmarcum Date: 2009-04-19 19:08:11 +0000 (Sun, 19 Apr 2009) Log Message: ----------- Set preferred size, validate, and pack. Set isResizable false to fix override of size to last size saved by application. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-04-19 16:26:41 UTC (rev 28) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-04-19 19:08:11 UTC (rev 29) @@ -3,7 +3,9 @@ <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" resourceKey="Form.title"/> <Property name="name" type="java.lang.String" value="Form" noResource="true"/> + <Property name="resizable" type="boolean" value="false"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -26,10 +28,10 @@ <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="scrollPane" alignment="0" pref="376" max="32767" attributes="0"/> + <Component id="scrollPane" alignment="0" pref="296" max="32767" attributes="0"/> <Group type="102" alignment="1" attributes="0"> <Component id="okButton" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Component id="closeButton" min="-2" max="-2" attributes="0"/> </Group> </Group> @@ -41,11 +43,11 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="scrollPane" pref="160" max="32767" attributes="0"/> + <Component id="scrollPane" pref="99" max="32767" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> + <Component id="closeButton" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="closeButton" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-04-19 16:26:41 UTC (rev 28) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-04-19 19:08:11 UTC (rev 29) @@ -27,6 +27,7 @@ package net.codebuilders.desktop.imagetools; +import java.awt.Dimension; import org.jdesktop.application.Action; /** @@ -42,6 +43,14 @@ getRootPane().setDefaultButton(closeButton); // this.itModel = itModel; + + this.getRootPane().setPreferredSize(new Dimension(320,175)); + + // force a re-layout + this.getRootPane().validate(); + // fix size + this.pack(); + } @Action public void closeDrawTextBox() { @@ -63,7 +72,10 @@ closeButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getResourceMap(DrawTextBox.class); + setTitle(resourceMap.getString("Form.title")); // NOI18N setName("Form"); // NOI18N + setResizable(false); scrollPane.setName("scrollPane"); // NOI18N @@ -74,7 +86,6 @@ javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getActionMap(DrawTextBox.class, this); okButton.setAction(actionMap.get("setText")); // NOI18N - org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getResourceMap(DrawTextBox.class); okButton.setText(resourceMap.getString("okButton.text")); // NOI18N okButton.setName("okButton"); // NOI18N @@ -89,10 +100,10 @@ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(scrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE) + .addComponent(scrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(okButton) - .addGap(38, 38, 38) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(closeButton))) .addContainerGap()) ); @@ -100,11 +111,11 @@ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() - .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE) + .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(okButton) - .addComponent(closeButton)) + .addComponent(closeButton) + .addComponent(okButton)) .addContainerGap()) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |