Thread: [Imagetools-commit] SF.net SVN: imagetools:[7] trunk/imagetools/src/net/codebuilders/desktop/ image
Status: Beta
Brought to you by:
cmarcum
From: <cm...@us...> - 2009-04-08 00:33:06
|
Revision: 7 http://imagetools.svn.sourceforge.net/imagetools/?rev=7&view=rev Author: cmarcum Date: 2009-04-08 00:33:05 +0000 (Wed, 08 Apr 2009) Log Message: ----------- Added KeyPressed methods for draw buttons to unselect button and cancel mouse listeners to stop drawing on image. Set button focusable to capture KeyEvent. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-04-08 00:27:08 UTC (rev 6) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-04-08 00:33:05 UTC (rev 7) @@ -382,11 +382,13 @@ <ComponentRef name="drawButtonGroup"/> </Property> <Property name="text" type="java.lang.String" resourceKey="lineButton.text"/> - <Property name="focusable" type="boolean" value="false"/> <Property name="horizontalTextPosition" type="int" value="0"/> <Property name="name" type="java.lang.String" value="lineButton" noResource="true"/> <Property name="verticalTextPosition" type="int" value="3"/> </Properties> + <Events> + <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="lineButtonKeyPressed"/> + </Events> </Component> <Component class="javax.swing.JToggleButton" name="rectangleButton"> <Properties> @@ -397,11 +399,13 @@ <ComponentRef name="drawButtonGroup"/> </Property> <Property name="text" type="java.lang.String" resourceKey="rectangleButton.text"/> - <Property name="focusable" type="boolean" value="false"/> <Property name="horizontalTextPosition" type="int" value="0"/> <Property name="name" type="java.lang.String" value="rectangleButton" noResource="true"/> <Property name="verticalTextPosition" type="int" value="3"/> </Properties> + <Events> + <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="rectangleButtonKeyPressed"/> + </Events> </Component> <Component class="javax.swing.JToggleButton" name="textButton"> <Properties> @@ -412,11 +416,13 @@ <ComponentRef name="drawButtonGroup"/> </Property> <Property name="text" type="java.lang.String" resourceKey="textButton.text"/> - <Property name="focusable" type="boolean" value="false"/> <Property name="horizontalTextPosition" type="int" value="0"/> <Property name="name" type="java.lang.String" value="textButton" noResource="true"/> <Property name="verticalTextPosition" type="int" value="3"/> </Properties> + <Events> + <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="textButtonKeyPressed"/> + </Events> </Component> </SubComponents> </Container> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-08 00:27:08 UTC (rev 6) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-08 00:33:05 UTC (rev 7) @@ -24,6 +24,7 @@ */ package net.codebuilders.desktop.imagetools; +import java.awt.event.KeyListener; import org.jdesktop.application.Action; import org.jdesktop.application.ResourceMap; import org.jdesktop.application.SingleFrameApplication; @@ -31,6 +32,7 @@ import org.jdesktop.application.TaskMonitor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -53,7 +55,7 @@ /** * The application's main frame. */ -public class ImageToolsView extends FrameView { +public class ImageToolsView extends FrameView implements KeyListener { public ImageToolsView(SingleFrameApplication app) { super(app); @@ -186,9 +188,9 @@ } }); + - - + } // end constructor @Action @@ -464,36 +466,81 @@ lineButton.setAction(actionMap.get("drawLine")); // NOI18N drawButtonGroup.add(lineButton); lineButton.setText(resourceMap.getString("lineButton.text")); // NOI18N - lineButton.setFocusable(false); lineButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); lineButton.setName("lineButton"); // NOI18N lineButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + lineButton.addKeyListener(this); toolBar.add(lineButton); rectangleButton.setAction(actionMap.get("drawRectangle")); // NOI18N drawButtonGroup.add(rectangleButton); rectangleButton.setText(resourceMap.getString("rectangleButton.text")); // NOI18N - rectangleButton.setFocusable(false); rectangleButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); rectangleButton.setName("rectangleButton"); // NOI18N rectangleButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + rectangleButton.addKeyListener(this); toolBar.add(rectangleButton); textButton.setAction(actionMap.get("drawText")); // NOI18N drawButtonGroup.add(textButton); textButton.setText(resourceMap.getString("textButton.text")); // NOI18N - textButton.setFocusable(false); textButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); textButton.setName("textButton"); // NOI18N textButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + textButton.addKeyListener(this); toolBar.add(textButton); setComponent(mainPanel); setMenuBar(menuBar); setStatusBar(statusPanel); setToolBar(toolBar); + } + + // Code for dispatching events from components to event handlers. + + public void keyPressed(java.awt.event.KeyEvent evt) { + if (evt.getSource() == lineButton) { + ImageToolsView.this.lineButtonKeyPressed(evt); + } + else if (evt.getSource() == rectangleButton) { + ImageToolsView.this.rectangleButtonKeyPressed(evt); + } + else if (evt.getSource() == textButton) { + ImageToolsView.this.textButtonKeyPressed(evt); + } + } + + public void keyReleased(java.awt.event.KeyEvent evt) { + } + + public void keyTyped(java.awt.event.KeyEvent evt) { }// </editor-fold>//GEN-END:initComponents + private void lineButtonKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_lineButtonKeyPressed + // if ESC key, unselect button + if(evt.getKeyCode() == KeyEvent.VK_ESCAPE) { + drawButtonGroup.clearSelection(); + imageArea.tearDownMouseListeners(); + } + + }//GEN-LAST:event_lineButtonKeyPressed + + private void rectangleButtonKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_rectangleButtonKeyPressed + // if ESC key, unselect button + if(evt.getKeyCode() == KeyEvent.VK_ESCAPE) { + drawButtonGroup.clearSelection(); + imageArea.tearDownMouseListeners(); + } + }//GEN-LAST:event_rectangleButtonKeyPressed + + private void textButtonKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textButtonKeyPressed + // if ESC key, unselect button + if(evt.getKeyCode() == KeyEvent.VK_ESCAPE) { + drawButtonGroup.clearSelection(); + imageArea.tearDownMouseListeners(); + } + }//GEN-LAST:event_textButtonKeyPressed + @Action(enabledProperty = "captureEnabled", selectedProperty = "captureSelected") public void captureScreen() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-10 19:49:08
|
Revision: 15 http://imagetools.svn.sourceforge.net/imagetools/?rev=15&view=rev Author: cmarcum Date: 2009-04-10 19:48:49 +0000 (Fri, 10 Apr 2009) Log Message: ----------- Added body to fileClose method. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-04-10 19:10:50 UTC (rev 14) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-04-10 19:48:49 UTC (rev 15) @@ -24,8 +24,8 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" pref="338" max="-2" attributes="0"/> - <EmptySpace pref="13" max="32767" attributes="0"/> + <Component id="jLabel1" min="-2" pref="310" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -33,6 +33,7 @@ <SubComponents> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> <Property name="icon" type="javax.swing.Icon" resourceKey="splash.icon"/> <Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/> <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/> @@ -453,6 +454,6 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-62,0,0,1,-84"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-94,0,0,1,-84"/> </AuxValues> </Form> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-10 19:10:50 UTC (rev 14) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-10 19:48:49 UTC (rev 15) @@ -44,7 +44,6 @@ import java.util.Iterator; import javax.imageio.IIOImage; import javax.imageio.ImageIO; -import javax.imageio.ImageReader; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.stream.FileImageInputStream; @@ -260,6 +259,7 @@ mainPanel.setName("mainPanel"); // NOI18N mainPanel.setPreferredSize(new java.awt.Dimension(425, 350)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getResourceMap(ImageToolsView.class); jLabel1.setIcon(resourceMap.getIcon("splash.icon")); // NOI18N jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N @@ -278,8 +278,8 @@ mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addContainerGap() - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 338, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(13, Short.MAX_VALUE)) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); menuBar.setName("menuBar"); // NOI18N @@ -940,7 +940,32 @@ @Action(enabledProperty = "fileCloseEnabled", selectedProperty = "fileCloseSelected") public void fileClose() { - // TODO fileClose method + + // put the label back in + this.setComponent(jLabel1); + // empty the queues + itModel.undoQueue.clear(); + itModel.redoQueue.clear(); + + statusMessageLabel.setText("Open file or capture image."); + + // setup button enabled status after a capture + this.setFileOpenEnabled(true); + this.setFileSaveEnabled(false); + this.setFileCloseEnabled(false); + this.setCaptureEnabled(true); + this.setCropEnabled(false); + this.setDrawLineEnabled(false); + this.setDrawRectangleEnabled(false); + this.setDrawTextEnabled(false); + this.setUndoEnabled(!itModel.undoQueue.isEmpty()); + this.setRedoEnabled(!itModel.redoQueue.isEmpty()); + + // force a re-layout + this.getRootPane().validate(); + // resize the frame + this.getFrame().pack(); + } @Action This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-18 11:49:50
|
Revision: 18 http://imagetools.svn.sourceforge.net/imagetools/?rev=18&view=rev Author: cmarcum Date: 2009-04-18 11:49:48 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Added draw menu items to Annotate menu in the menu bar. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-04-10 21:07:07 UTC (rev 17) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-04-18 11:49:48 UTC (rev 18) @@ -166,6 +166,35 @@ <Property name="text" type="java.lang.String" resourceKey="drawMenu.text"/> <Property name="name" type="java.lang.String" value="drawMenu" noResource="true"/> </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="drawLineItem"> + <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="drawLine" methodName="drawLine"/> + </Property> + <Property name="text" type="java.lang.String" resourceKey="drawLineItem.text"/> + <Property name="name" type="java.lang.String" value="drawLineItem" noResource="true"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="drawRectangleItem"> + <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="drawRectangle" methodName="drawRectangle"/> + </Property> + <Property name="text" type="java.lang.String" resourceKey="drawRectangleItem.text"/> + <Property name="name" type="java.lang.String" value="drawRectangleItem" noResource="true"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="drawTextItem"> + <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="drawText" methodName="drawText"/> + </Property> + <Property name="text" type="java.lang.String" resourceKey="drawTextItem.text"/> + <Property name="name" type="java.lang.String" value="drawTextItem" noResource="true"/> + </Properties> + </MenuItem> + </SubComponents> </Menu> <Menu class="javax.swing.JMenu" name="helpMenu"> <Properties> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-10 21:07:07 UTC (rev 17) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-18 11:49:48 UTC (rev 18) @@ -232,6 +232,9 @@ imageCaptureItem = new javax.swing.JMenuItem(); imageCropItem = new javax.swing.JMenuItem(); drawMenu = new javax.swing.JMenu(); + drawLineItem = new javax.swing.JMenuItem(); + drawRectangleItem = new javax.swing.JMenuItem(); + drawTextItem = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); usingMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); @@ -345,6 +348,22 @@ drawMenu.setText(resourceMap.getString("drawMenu.text")); // NOI18N drawMenu.setName("drawMenu"); // NOI18N + + drawLineItem.setAction(actionMap.get("drawLine")); // NOI18N + drawLineItem.setText(resourceMap.getString("drawLineItem.text")); // NOI18N + drawLineItem.setName("drawLineItem"); // NOI18N + drawMenu.add(drawLineItem); + + drawRectangleItem.setAction(actionMap.get("drawRectangle")); // NOI18N + drawRectangleItem.setText(resourceMap.getString("drawRectangleItem.text")); // NOI18N + drawRectangleItem.setName("drawRectangleItem"); // NOI18N + drawMenu.add(drawRectangleItem); + + drawTextItem.setAction(actionMap.get("drawText")); // NOI18N + drawTextItem.setText(resourceMap.getString("drawTextItem.text")); // NOI18N + drawTextItem.setName("drawTextItem"); // NOI18N + drawMenu.add(drawTextItem); + menuBar.add(drawMenu); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N @@ -1224,7 +1243,10 @@ private javax.swing.JButton closeButton; private javax.swing.JButton cropButton; private javax.swing.ButtonGroup drawButtonGroup; + private javax.swing.JMenuItem drawLineItem; private javax.swing.JMenu drawMenu; + private javax.swing.JMenuItem drawRectangleItem; + private javax.swing.JMenuItem drawTextItem; private javax.swing.JMenu editMenu; private javax.swing.JMenuItem editRedoItem; private javax.swing.JMenuItem editUndoItem; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-18 12:32:40
|
Revision: 20 http://imagetools.svn.sourceforge.net/imagetools/?rev=20&view=rev Author: cmarcum Date: 2009-04-18 12:32:25 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Removed 'by CodeBuilders.net' from application title property. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsApp.properties trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form 2009-04-18 12:14:31 UTC (rev 19) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form 2009-04-18 12:32:25 UTC (rev 20) @@ -53,7 +53,7 @@ </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="imageLabel" min="-2" pref="177" max="32767" attributes="0"/> + <Component id="imageLabel" min="-2" pref="183" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="appTitleLabel" min="-2" max="-2" attributes="0"/> @@ -74,7 +74,7 @@ <Component id="homepageLabel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="appHomepageLabel" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="9" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> <Component id="closeButton" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java 2009-04-18 12:14:31 UTC (rev 19) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java 2009-04-18 12:32:25 UTC (rev 20) @@ -126,7 +126,7 @@ ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 177, Short.MAX_VALUE) + .addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(appTitleLabel) @@ -144,7 +144,7 @@ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(homepageLabel) .addComponent(appHomepageLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(closeButton) .addContainerGap()) ); Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsApp.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsApp.properties 2009-04-18 12:14:31 UTC (rev 19) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsApp.properties 2009-04-18 12:32:25 UTC (rev 20) @@ -1,10 +1,10 @@ # Application global resources Application.name = imagetools -Application.title = Image Tools by CodeBuilders.net +Application.title = Image Tools Application.version = 1.2.0 Application.vendor = CodeBuilders.net -Application.homepage = http://www.codebuilders.net +Application.homepage = http://imagetools.sourceforge.net Application.description = An application to capture an image of the display, \ crop if necessary, and save the image. Application.vendorId = CodeBuilders.net Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-04-18 12:14:31 UTC (rev 19) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-04-18 12:32:25 UTC (rev 20) @@ -4,10 +4,7 @@ fileMenu.text = File helpMenu.text = Help - -# @Action resources - -showAboutBox.Action.text = &About... +showAboutBox.Action.text = About... showAboutBox.Action.shortDescription = Show the application's information dialog # status bar resources @@ -121,3 +118,9 @@ rectangleButton.text= textButton.text= lineButton.text= +drawLineItem.text=Line +drawRectangleItem.text=Rectangle +drawTextItem.text=Text +showAboutBox.Action.largeIcon=/net/codebuilders/desktop/imagetools/resources/help24.png +showAboutBox.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/help16.png +showAboutBox.Action.icon=/net/codebuilders/desktop/imagetools/resources/help16.png This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-18 16:06:32
|
Revision: 21 http://imagetools.svn.sourceforge.net/imagetools/?rev=21&view=rev Author: cmarcum Date: 2009-04-18 16:06:28 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Remove copyright from ImageArea and documented where it and ImageFileFilter originated. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageFileFilter.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-04-18 12:32:25 UTC (rev 20) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-04-18 16:06:28 UTC (rev 21) @@ -1,31 +1,15 @@ /* - * Copyright (C) 2009 Carl B. Marcum - CodeBuilders.net - * Phone (937) 242-6519 - <http://www.codebuilders.net> + * ImageArea.java * - * This file is part of "Image Tools by CodeBuilders.net" - * hereafter referered to as "Image Tools". + * This is a heavily modified version of a file downloaded + * From JavaWorld jw-0424-funandgames.zip that accompanied + * an article by Jeff Friesen, JavaWorld.com, 04/24/06 + * http://www.javaworld.com/javaworld/jw-04-2006/jw-0424-funandgames.html * - * Image Tools is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Image Tools is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Image Tools. If not, see <http://www.gnu.org/licenses/>. + * + * Modified for use with Image Tools */ -// ImageArea.java -// started from code downloaded -// From JavaWorld jw-0424-funandgames.zip -// and article by Jeff Friesen, JavaWorld.com, 04/24/06 -// http://www.javaworld.com/javaworld/jw-04-2006/jw-0424-funandgames.html -// original was crop only -// added the paint lines, text etc. package net.codebuilders.desktop.imagetools; import java.awt.*; Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageFileFilter.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageFileFilter.java 2009-04-18 12:32:25 UTC (rev 20) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageFileFilter.java 2009-04-18 16:06:28 UTC (rev 21) @@ -1,6 +1,15 @@ -// ImageFileFilter.java -// From JavaWorld jw-0424-funandgames.zip -// and article by ??? +/* + * ImageFileFilter.java + * + * This is a file downloaded + * From JavaWorld jw-0424-funandgames.zip that accompanied + * an article by Jeff Friesen, JavaWorld.com, 04/24/06 + * http://www.javaworld.com/javaworld/jw-04-2006/jw-0424-funandgames.html + * + * + * Modified for use with Image Tools + * Copyright applies to modifications only. + */ package net.codebuilders.desktop.imagetools; import java.io.*; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-18 17:05:46
|
Revision: 22 http://imagetools.svn.sourceforge.net/imagetools/?rev=22&view=rev Author: cmarcum Date: 2009-04-18 17:05:40 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Added properties and variables for custom message icons Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-18 16:06:28 UTC (rev 21) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-04-18 17:05:40 UTC (rev 22) @@ -192,9 +192,10 @@ } }); + errorIcon = resourceMap.getIcon("message.error.icon"); + infoIcon = resourceMap.getIcon("message.info.icon"); + warningIcon = resourceMap.getIcon("message.warning.icon"); - - } // end constructor @Action @@ -789,8 +790,9 @@ * @param message the message to be presented */ public static void showError(String message) { + JOptionPane.showMessageDialog(null, message, "Image Tools", - JOptionPane.ERROR_MESSAGE); + JOptionPane.ERROR_MESSAGE, errorIcon); } /** @@ -800,9 +802,19 @@ */ public static void showInfo(String message) { JOptionPane.showMessageDialog(null, message, "Image Tools", - JOptionPane.INFORMATION_MESSAGE); + JOptionPane.INFORMATION_MESSAGE, infoIcon); } + /** + * Present an information message via a dialog box. + * + * @param message the message to be presented + */ + public static void showWarning(String message) { + JOptionPane.showMessageDialog(null, message, "Image Tools", + JOptionPane.WARNING_MESSAGE); + } + @Action public void showUsingBox() { if (usingBox == null) { @@ -1277,10 +1289,16 @@ private javax.swing.JButton undoButton; private javax.swing.JMenuItem usingMenuItem; // End of variables declaration//GEN-END:variables + + // more variables + private static Icon errorIcon; + private static Icon infoIcon; + private static Icon warningIcon; private final Timer messageTimer; private final Timer busyIconTimer; private final Icon idleIcon; private final Icon[] busyIcons = new Icon[15]; + private int busyIconIndex = 0; private JDialog aboutBox; private JDialog usingBox; @@ -1291,4 +1309,5 @@ private final JFileChooser imageChooser; // added to test new events 2009-03-20 private ImageToolsModel itModel; + } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-04-18 16:06:28 UTC (rev 21) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-04-18 17:05:40 UTC (rev 22) @@ -124,3 +124,9 @@ showAboutBox.Action.largeIcon=/net/codebuilders/desktop/imagetools/resources/help24.png showAboutBox.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/help16.png showAboutBox.Action.icon=/net/codebuilders/desktop/imagetools/resources/help16.png +#error icon for showError +message.error.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_critical24.png +#error icon for showInfo +message.info.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_info24.png +#error icon for showWarning +message.warning.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_warning24.png This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <cm...@us...> - 2009-04-19 19:26:48
|
Revision: 30 http://imagetools.svn.sourceforge.net/imagetools/?rev=30&view=rev Author: cmarcum Date: 2009-04-19 19:26:46 +0000 (Sun, 19 Apr 2009) Log Message: ----------- Removed preferred size, validate, and pack. Set isResizable back to true. Override of size saved by application has to be after application shows the dialog in ImageToolsView. 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 19:08:11 UTC (rev 29) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-04-19 19:26:46 UTC (rev 30) @@ -5,7 +5,6 @@ <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"/> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-04-19 19:08:11 UTC (rev 29) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-04-19 19:26:46 UTC (rev 30) @@ -41,16 +41,7 @@ super(parent); initComponents(); 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() { @@ -75,7 +66,6 @@ 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-19 16:24:29
|
Revision: 27 http://imagetools.svn.sourceforge.net/imagetools/?rev=27&view=rev Author: cmarcum Date: 2009-04-19 16:24:19 +0000 (Sun, 19 Apr 2009) Log Message: ----------- Updated the using box with scroll pane and absolute layout. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsUsingBox.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form 2009-04-19 14:25:15 UTC (rev 26) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form 2009-04-19 16:24:19 UTC (rev 27) @@ -26,52 +26,11 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> - <Component id="jLabel3" pref="364" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> - <Group type="102" attributes="0"> - <EmptySpace min="12" pref="12" max="12" attributes="0"/> - <Component id="jLabel7" pref="364" max="32767" attributes="1"/> - </Group> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="12" pref="12" max="12" attributes="0"/> - <Component id="jLabel5" min="-2" pref="364" max="-2" attributes="0"/> - </Group> - <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="12" pref="12" max="12" attributes="0"/> - <Component id="jLabel9" pref="364" max="32767" attributes="0"/> - </Group> - <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace pref="319" max="32767" attributes="0"/> - <Component id="closeButton" min="-2" max="-2" attributes="0"/> - </Group> + <Component id="jScrollPane1" alignment="1" pref="456" max="32767" attributes="0"/> + <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="closeButton" alignment="1" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -79,28 +38,14 @@ </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel3" min="-2" pref="49" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="jLabel4" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="275" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel6" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel7" min="-2" pref="50" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel8" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel9" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="71" max="32767" attributes="0"/> <Component id="closeButton" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -114,68 +59,6 @@ <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="jLabel2"> - <Properties> - <Property name="icon" type="javax.swing.Icon" resourceKey="jLabel2.icon"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/> - <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="font" type="java.awt.Font" resourceKey="jLabel3.font"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/> - <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[350, 50]"/> - </Property> - <Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/> - <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[350, 15]"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel4"> - <Properties> - <Property name="icon" type="javax.swing.Icon" resourceKey="jLabel4.icon"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/> - <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel5"> - <Properties> - <Property name="font" type="java.awt.Font" resourceKey="jLabel5.font"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel5.text"/> - <Property name="name" type="java.lang.String" value="jLabel5" noResource="true"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel6"> - <Properties> - <Property name="icon" type="javax.swing.Icon" resourceKey="jLabel6.icon"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel6.text"/> - <Property name="name" type="java.lang.String" value="jLabel6" noResource="true"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel7"> - <Properties> - <Property name="font" type="java.awt.Font" resourceKey="jLabel7.font"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel7.text"/> - <Property name="name" type="java.lang.String" value="jLabel7" noResource="true"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel8"> - <Properties> - <Property name="icon" type="javax.swing.Icon" resourceKey="jLabel8.icon"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel8.text"/> - <Property name="name" type="java.lang.String" value="jLabel8" noResource="true"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel9"> - <Properties> - <Property name="font" type="java.awt.Font" resourceKey="jLabel9.font"/> - <Property name="text" type="java.lang.String" resourceKey="jLabel9.text"/> - <Property name="name" type="java.lang.String" value="jLabel9" noResource="true"/> - </Properties> - </Component> <Component class="javax.swing.JButton" name="closeButton"> <Properties> <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> @@ -184,5 +67,277 @@ <Property name="name" type="java.lang.String" value="closeButton" noResource="true"/> </Properties> </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <Properties> + <Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[440, 800]"/> + </Property> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="name" type="java.lang.String" value="jPanel1" noResource="true"/> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[440, 800]"/> + </Property> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="fileSaveHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="fileSaveHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="fileSaveHeading.text"/> + <Property name="name" type="java.lang.String" value="fileSaveHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="20" y="80" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="fileSaveText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="fileSaveText.font"/> + <Property name="text" type="java.lang.String" resourceKey="fileSaveText.text"/> + <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[350, 50]"/> + </Property> + <Property name="name" type="java.lang.String" value="fileSaveText" noResource="true"/> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[350, 15]"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="100" width="400" height="40"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="fileExitHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="fileExitHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="fileExitHeading.text"/> + <Property name="name" type="java.lang.String" value="fileExitHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="140" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="fileExitText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="fileExitText.font"/> + <Property name="text" type="java.lang.String" resourceKey="fileExitText.text"/> + <Property name="name" type="java.lang.String" value="fileExitText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="170" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="imageCaptureHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="imageCaptureHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="imageCaptureHeading.text"/> + <Property name="name" type="java.lang.String" value="imageCaptureHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="190" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="imageCaptureText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="imageCaptureText.font"/> + <Property name="text" type="java.lang.String" resourceKey="imageCaptureText.text"/> + <Property name="name" type="java.lang.String" value="imageCaptureText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="220" width="400" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="imageCropHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="imageCropHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="imageCropHeading.text"/> + <Property name="name" type="java.lang.String" value="imageCropHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="270" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="imageCropText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="imageCropText.font"/> + <Property name="text" type="java.lang.String" resourceKey="imageCropText.text"/> + <Property name="name" type="java.lang.String" value="imageCropText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="300" width="400" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="fileOpenHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="fileOpenHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="fileOpenHeading.text"/> + <Property name="name" type="java.lang.String" value="fileOpenHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="10" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="fileOpenText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="fileOpenText.font"/> + <Property name="text" type="java.lang.String" resourceKey="fileOpenText.text"/> + <Property name="name" type="java.lang.String" value="fileOpenText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="30" width="400" height="40"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="drawLineHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="drawLineHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="drawLineHeading.text"/> + <Property name="name" type="java.lang.String" value="drawLineHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="370" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="drawLineText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="drawLineText.font"/> + <Property name="text" type="java.lang.String" resourceKey="drawLineText.text"/> + <Property name="name" type="java.lang.String" value="drawLineText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="400" width="400" height="40"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="drawRectangleHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="drawRectangleHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="drawRectangleHeading.text"/> + <Property name="name" type="java.lang.String" value="drawRectangleHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="440" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="drawRectangleText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="drawRectangleText.font"/> + <Property name="text" type="java.lang.String" resourceKey="drawRectangleText.text"/> + <Property name="name" type="java.lang.String" value="drawRectangleText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="470" width="400" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="drawTextHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="drawTextHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="drawTextHeading.text"/> + <Property name="name" type="java.lang.String" value="drawTextHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="510" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="drawTextText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="drawTextText.font"/> + <Property name="text" type="java.lang.String" resourceKey="drawTextText.text"/> + <Property name="name" type="java.lang.String" value="drawTextText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="540" width="400" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="editUndoHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="editUndoHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="editUndoHeading.text"/> + <Property name="name" type="java.lang.String" value="editUndoHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="580" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="editRedoHeading"> + <Properties> + <Property name="icon" type="javax.swing.Icon" resourceKey="editRedoHeading.icon"/> + <Property name="text" type="java.lang.String" resourceKey="editRedoHeading.text"/> + <Property name="name" type="java.lang.String" value="editRedoHeading" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="680" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="editUndoText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="editUndoText.font"/> + <Property name="text" type="java.lang.String" resourceKey="editUndoText.text"/> + <Property name="name" type="java.lang.String" value="editUndoText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="610" width="400" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="editRedoText"> + <Properties> + <Property name="font" type="java.awt.Font" resourceKey="editRedoText.font"/> + <Property name="text" type="java.lang.String" resourceKey="editRedoText.text"/> + <Property name="name" type="java.lang.String" value="editRedoText" noResource="true"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="710" width="400" height="-1"/> + </Constraint> + </Constraints> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> </SubComponents> </Form> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java 2009-04-19 14:25:15 UTC (rev 26) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java 2009-04-19 16:24:19 UTC (rev 27) @@ -49,15 +49,29 @@ private void initComponents() { jLabel1 = new javax.swing.JLabel(); - jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - jLabel7 = new javax.swing.JLabel(); - jLabel8 = new javax.swing.JLabel(); - jLabel9 = new javax.swing.JLabel(); closeButton = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + jPanel1 = new javax.swing.JPanel(); + fileSaveHeading = new javax.swing.JLabel(); + fileSaveText = new javax.swing.JLabel(); + fileExitHeading = new javax.swing.JLabel(); + fileExitText = new javax.swing.JLabel(); + imageCaptureHeading = new javax.swing.JLabel(); + imageCaptureText = new javax.swing.JLabel(); + imageCropHeading = new javax.swing.JLabel(); + imageCropText = new javax.swing.JLabel(); + fileOpenHeading = new javax.swing.JLabel(); + fileOpenText = new javax.swing.JLabel(); + drawLineHeading = new javax.swing.JLabel(); + drawLineText = new javax.swing.JLabel(); + drawRectangleHeading = new javax.swing.JLabel(); + drawRectangleText = new javax.swing.JLabel(); + drawTextHeading = new javax.swing.JLabel(); + drawTextText = new javax.swing.JLabel(); + editUndoHeading = new javax.swing.JLabel(); + editRedoHeading = new javax.swing.JLabel(); + editUndoText = new javax.swing.JLabel(); + editRedoText = new javax.swing.JLabel(); 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(ImageToolsUsingBox.class); @@ -70,82 +84,131 @@ jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N jLabel1.setName("jLabel1"); // NOI18N - jLabel2.setIcon(resourceMap.getIcon("jLabel2.icon")); // NOI18N - jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N - jLabel2.setName("jLabel2"); // NOI18N + javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getActionMap(ImageToolsUsingBox.class, this); + closeButton.setAction(actionMap.get("closeUsingBox")); // NOI18N + closeButton.setName("closeButton"); // NOI18N - jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N - jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N - jLabel3.setMaximumSize(new java.awt.Dimension(350, 50)); - jLabel3.setName("jLabel3"); // NOI18N - jLabel3.setPreferredSize(new java.awt.Dimension(350, 15)); + jScrollPane1.setName("jScrollPane1"); // NOI18N + jScrollPane1.setPreferredSize(new java.awt.Dimension(440, 800)); - jLabel4.setIcon(resourceMap.getIcon("jLabel4.icon")); // NOI18N - jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N - jLabel4.setName("jLabel4"); // NOI18N + jPanel1.setName("jPanel1"); // NOI18N + jPanel1.setPreferredSize(new java.awt.Dimension(440, 800)); + jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N - jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N - jLabel5.setName("jLabel5"); // NOI18N + fileSaveHeading.setIcon(resourceMap.getIcon("fileSaveHeading.icon")); // NOI18N + fileSaveHeading.setText(resourceMap.getString("fileSaveHeading.text")); // NOI18N + fileSaveHeading.setName("fileSaveHeading"); // NOI18N + jPanel1.add(fileSaveHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, -1, -1)); - jLabel6.setIcon(resourceMap.getIcon("jLabel6.icon")); // NOI18N - jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N - jLabel6.setName("jLabel6"); // NOI18N + fileSaveText.setFont(resourceMap.getFont("fileSaveText.font")); // NOI18N + fileSaveText.setText(resourceMap.getString("fileSaveText.text")); // NOI18N + fileSaveText.setMaximumSize(new java.awt.Dimension(350, 50)); + fileSaveText.setName("fileSaveText"); // NOI18N + fileSaveText.setPreferredSize(new java.awt.Dimension(350, 15)); + jPanel1.add(fileSaveText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 400, 40)); - jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N - jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N - jLabel7.setName("jLabel7"); // NOI18N + fileExitHeading.setIcon(resourceMap.getIcon("fileExitHeading.icon")); // NOI18N + fileExitHeading.setText(resourceMap.getString("fileExitHeading.text")); // NOI18N + fileExitHeading.setName("fileExitHeading"); // NOI18N + jPanel1.add(fileExitHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, -1)); - jLabel8.setIcon(resourceMap.getIcon("jLabel8.icon")); // NOI18N - jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N - jLabel8.setName("jLabel8"); // NOI18N + fileExitText.setFont(resourceMap.getFont("fileExitText.font")); // NOI18N + fileExitText.setText(resourceMap.getString("fileExitText.text")); // NOI18N + fileExitText.setName("fileExitText"); // NOI18N + jPanel1.add(fileExitText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, -1, -1)); - jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N - jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N - jLabel9.setName("jLabel9"); // NOI18N + imageCaptureHeading.setIcon(resourceMap.getIcon("imageCaptureHeading.icon")); // NOI18N + imageCaptureHeading.setText(resourceMap.getString("imageCaptureHeading.text")); // NOI18N + imageCaptureHeading.setName("imageCaptureHeading"); // NOI18N + jPanel1.add(imageCaptureHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, -1, -1)); - javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getActionMap(ImageToolsUsingBox.class, this); - closeButton.setAction(actionMap.get("closeUsingBox")); // NOI18N - closeButton.setName("closeButton"); // NOI18N + imageCaptureText.setFont(resourceMap.getFont("imageCaptureText.font")); // NOI18N + imageCaptureText.setText(resourceMap.getString("imageCaptureText.text")); // NOI18N + imageCaptureText.setName("imageCaptureText"); // NOI18N + jPanel1.add(imageCaptureText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 220, 400, -1)); + imageCropHeading.setIcon(resourceMap.getIcon("imageCropHeading.icon")); // NOI18N + imageCropHeading.setText(resourceMap.getString("imageCropHeading.text")); // NOI18N + imageCropHeading.setName("imageCropHeading"); // NOI18N + jPanel1.add(imageCropHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 270, -1, -1)); + + imageCropText.setFont(resourceMap.getFont("imageCropText.font")); // NOI18N + imageCropText.setText(resourceMap.getString("imageCropText.text")); // NOI18N + imageCropText.setName("imageCropText"); // NOI18N + jPanel1.add(imageCropText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 300, 400, -1)); + + fileOpenHeading.setIcon(resourceMap.getIcon("fileOpenHeading.icon")); // NOI18N + fileOpenHeading.setText(resourceMap.getString("fileOpenHeading.text")); // NOI18N + fileOpenHeading.setName("fileOpenHeading"); // NOI18N + jPanel1.add(fileOpenHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1)); + + fileOpenText.setFont(resourceMap.getFont("fileOpenText.font")); // NOI18N + fileOpenText.setText(resourceMap.getString("fileOpenText.text")); // NOI18N + fileOpenText.setName("fileOpenText"); // NOI18N + jPanel1.add(fileOpenText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, 400, 40)); + + drawLineHeading.setIcon(resourceMap.getIcon("drawLineHeading.icon")); // NOI18N + drawLineHeading.setText(resourceMap.getString("drawLineHeading.text")); // NOI18N + drawLineHeading.setName("drawLineHeading"); // NOI18N + jPanel1.add(drawLineHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 370, -1, -1)); + + drawLineText.setFont(resourceMap.getFont("drawLineText.font")); // NOI18N + drawLineText.setText(resourceMap.getString("drawLineText.text")); // NOI18N + drawLineText.setName("drawLineText"); // NOI18N + jPanel1.add(drawLineText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 400, 400, 40)); + + drawRectangleHeading.setIcon(resourceMap.getIcon("drawRectangleHeading.icon")); // NOI18N + drawRectangleHeading.setText(resourceMap.getString("drawRectangleHeading.text")); // NOI18N + drawRectangleHeading.setName("drawRectangleHeading"); // NOI18N + jPanel1.add(drawRectangleHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 440, -1, -1)); + + drawRectangleText.setFont(resourceMap.getFont("drawRectangleText.font")); // NOI18N + drawRectangleText.setText(resourceMap.getString("drawRectangleText.text")); // NOI18N + drawRectangleText.setName("drawRectangleText"); // NOI18N + jPanel1.add(drawRectangleText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 470, 400, -1)); + + drawTextHeading.setIcon(resourceMap.getIcon("drawTextHeading.icon")); // NOI18N + drawTextHeading.setText(resourceMap.getString("drawTextHeading.text")); // NOI18N + drawTextHeading.setName("drawTextHeading"); // NOI18N + jPanel1.add(drawTextHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 510, -1, -1)); + + drawTextText.setFont(resourceMap.getFont("drawTextText.font")); // NOI18N + drawTextText.setText(resourceMap.getString("drawTextText.text")); // NOI18N + drawTextText.setName("drawTextText"); // NOI18N + jPanel1.add(drawTextText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 540, 400, -1)); + + editUndoHeading.setIcon(resourceMap.getIcon("editUndoHeading.icon")); // NOI18N + editUndoHeading.setText(resourceMap.getString("editUndoHeading.text")); // NOI18N + editUndoHeading.setName("editUndoHeading"); // NOI18N + jPanel1.add(editUndoHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 580, -1, -1)); + + editRedoHeading.setIcon(resourceMap.getIcon("editRedoHeading.icon")); // NOI18N + editRedoHeading.setText(resourceMap.getString("editRedoHeading.text")); // NOI18N + editRedoHeading.setName("editRedoHeading"); // NOI18N + jPanel1.add(editRedoHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 680, -1, -1)); + + editUndoText.setFont(resourceMap.getFont("editUndoText.font")); // NOI18N + editUndoText.setText(resourceMap.getString("editUndoText.text")); // NOI18N + editUndoText.setName("editUndoText"); // NOI18N + jPanel1.add(editUndoText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 610, 400, -1)); + + editRedoText.setFont(resourceMap.getFont("editRedoText.font")); // NOI18N + editRedoText.setText(resourceMap.getString("editRedoText.text")); // NOI18N + editRedoText.setName("editRedoText"); // NOI18N + jPanel1.add(editRedoText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 710, 400, -1)); + + jScrollPane1.setViewportView(jPanel1); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() + .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(24, 24, 24) - .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(jLabel2))) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel6) - .addGroup(layout.createSequentialGroup() - .addGap(12, 12, 12) - .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)))) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(12, 12, 12) - .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jLabel4))) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(12, 12, 12) - .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)) - .addComponent(jLabel8))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(319, Short.MAX_VALUE) - .addComponent(closeButton))) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE) + .addComponent(jLabel1) + .addComponent(closeButton, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) ); layout.setVerticalGroup( @@ -153,25 +216,11 @@ .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) - .addGap(18, 18, 18) - .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel5) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) - .addComponent(jLabel6) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel8) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel9) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE) .addComponent(closeButton) - .addContainerGap()) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); @@ -181,15 +230,29 @@ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton closeButton; + private javax.swing.JLabel drawLineHeading; + private javax.swing.JLabel drawLineText; + private javax.swing.JLabel drawRectangleHeading; + private javax.swing.JLabel drawRectangleText; + private javax.swing.JLabel drawTextHeading; + private javax.swing.JLabel drawTextText; + private javax.swing.JLabel editRedoHeading; + private javax.swing.JLabel editRedoText; + private javax.swing.JLabel editUndoHeading; + private javax.swing.JLabel editUndoText; + private javax.swing.JLabel fileExitHeading; + private javax.swing.JLabel fileExitText; + private javax.swing.JLabel fileOpenHeading; + private javax.swing.JLabel fileOpenText; + private javax.swing.JLabel fileSaveHeading; + private javax.swing.JLabel fileSaveText; + private javax.swing.JLabel imageCaptureHeading; + private javax.swing.JLabel imageCaptureText; + private javax.swing.JLabel imageCropHeading; + private javax.swing.JLabel imageCropText; private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JLabel jLabel8; - private javax.swing.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane1; // End of variables declaration//GEN-END:variables } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsUsingBox.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsUsingBox.properties 2009-04-19 14:25:15 UTC (rev 26) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsUsingBox.properties 2009-04-19 16:24:19 UTC (rev 27) @@ -4,31 +4,71 @@ jLabel1.font=Dialog-Bold-16 #NOI18N jLabel1.foreground=83, 130, 161 -jLabel2.text=File > Save +jButton1.text=jButton1 +closeUsingBox.Action.shortDescription=Close dialog box +closeUsingBox.Action.text=Close +Form.title=Using Image Tools +Annotate\ >\ Text.text=jLabel16 +fileSaveHeading.text=File > Save #NOI18N -jLabel2.icon=filesave24.png -jLabel3.text=<html>Launches a File Chooser dialog to select directory and filename of image to save. Filename must include .jpg or .jpeg extension. +fileSaveHeading.icon=filesave24.png +fileOpenHeading.text=File > Open #NOI18N -jLabel3.font=Dialog-Plain-12 -jLabel4.text=File > Exit +fileOpenHeading.icon=fileopen24.png +fileSaveText.text=<html>Launches a File Chooser dialog to select directory and filename of image to save. File extension .jpg is added if missing. #NOI18N -jLabel4.icon=exit24.png -jLabel5.text=<html>Closes all windows without saving, and exits the application. +fileSaveText.font=Dialog-Plain-12 +fileOpenText.text=<html>Launches a File Chooser dialog to select directory and filename of image to open. Filename must include .jpg or .jpeg extension. #NOI18N -jLabel5.font=Dialog-Plain-12 -jLabel6.text=Image > Capture +fileOpenText.font=Dialog-Plain-12 +fileExitHeading.text=File > Exit #NOI18N -jLabel6.icon=camera_unmount24.png -jLabel7.text=<html>Hides the application frame, waits 4 seconds, then captures the display as an image. The image is returned in the application frame to be cropped and/or saved as necessary. +fileExitHeading.icon=exit24.png +drawLineText.text=<html>Click and hold LMB to start line and drag cursor to end location and release. #NOI18N -jLabel7.font=Dialog-Plain-12 -jLabel8.text=Image > Crop +drawLineText.font=Dialog-Plain-12 +drawTextText.text=<html>Click and hold LMB and drag preview to location and release to place text. #NOI18N -jLabel8.icon=editcut24.png -jLabel9.text=<html>Prepare to crop image by pre-selecting a rectangular area using LMB (left mouse button) - hold - drag motion. Unselect area by LMB click anywhere on image. Crop image to selection by command from menubar or toolbar. +drawTextText.font=Dialog-Plain-12 +fileExitText.text=<html>Closes all windows without saving, and exits the application. #NOI18N -jLabel9.font=Dialog-Plain-12 -jButton1.text=jButton1 -closeUsingBox.Action.shortDescription=Close dialog box -closeUsingBox.Action.text=Close -Form.title=Using Image Tools +fileExitText.font=Dialog-Plain-12 +drawRectangleHeading.text=Annotate > Rectangle +#NOI18N +drawRectangleHeading.icon=draw_rectangle24.png +imageCaptureHeading.text=Image > Capture +#NOI18N +imageCaptureHeading.icon=camera_unmount24.png +drawRectangleText.text=<html>Click and hold LMB to start rectangle and drag cursor to location of opposite corner and release. +#NOI18N +drawRectangleText.font=Dialog-Plain-12 +imageCaptureText.text=<html>Hides the application frame, waits 4 seconds, then captures the display as an image. The image is returned in the application frame to be cropped and/or saved as necessary. +#NOI18N +imageCaptureText.font=Dialog-Plain-12 +imageCropHeading.text=Image > Crop +#NOI18N +imageCropHeading.icon=editcut24.png +imageCropText.text=<html>Prepare to crop image by pre-selecting a rectangular area using LMB (left mouse button) - hold - drag motion. Unselect area by LMB click anywhere on image. Crop image to selection by command from menubar or toolbar. +#NOI18N +imageCropText.font=Dialog-Plain-12 +drawLineHeading.text=Annotate > Line +#NOI18N +drawLineHeading.icon=draw_line24.png +drawTextHeading.text=Annotate > Text +#NOI18N +drawTextHeading.icon=draw_text24.png +editUndoHeading.text=Edit > Undo +#NOI18N +editUndoHeading.icon=undo24.png +editUndoText.text=<html>Displays a previously stored image from the undo queue. Repeating undo will display succesive images going back to capture or open. Editing image from queue will empty the queue and set the edited image current. +#NOI18N +editUndoText.font=Dialog-Plain-12 +editRedoHeading.text=Edit > Redo +#NOI18N +editRedoHeading.icon=redo24.png +editRedoText.text=<html>Displays previously stored images from the redo queue. Images are added to this queue by the undo command. Repeating redo will display succesive images going forward until the current image. Editing image from queue will empty the queue and set the edited image current. +#NOI18N +editRedoText.font=Dialog-Plain-12 +closeUsingBox.Action.largeIcon=/net/codebuilders/desktop/imagetools/resources/fileclose24.png +closeUsingBox.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/fileclose16.png +closeUsingBox.Action.icon=/net/codebuilders/desktop/imagetools/resources/fileclose16.png This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-22 01:01:17
|
Revision: 35 http://imagetools.svn.sourceforge.net/imagetools/?rev=35&view=rev Author: cmarcum Date: 2009-04-22 01:01:15 +0000 (Wed, 22 Apr 2009) Log Message: ----------- Added license line to about box Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form 2009-04-19 20:03:13 UTC (rev 34) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.form 2009-04-22 01:01:15 UTC (rev 35) @@ -29,31 +29,33 @@ <Group type="102" alignment="0" attributes="0"> <Component id="imageLabel" min="-2" max="-2" attributes="0"/> <EmptySpace type="separate" min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="appTitleLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="appDescLabel" alignment="0" pref="340" max="32767" attributes="0"/> + <Component id="closeButton" alignment="1" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> <Component id="versionLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="vendorLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="homepageLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="licenseLabel" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> + <Component id="appLicenseLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="appVersionLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="appVendorLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="appHomepageLabel" alignment="0" min="-2" max="-2" attributes="0"/> </Group> </Group> - <Component id="appTitleLabel" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="appDescLabel" alignment="0" pref="340" max="32767" attributes="0"/> - <Component id="closeButton" alignment="1" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="imageLabel" min="-2" pref="183" max="32767" attributes="0"/> + <Component id="imageLabel" min="-2" pref="219" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="appTitleLabel" min="-2" max="-2" attributes="0"/> @@ -74,9 +76,16 @@ <Component id="homepageLabel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="appHomepageLabel" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> - <Component id="closeButton" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="appLicenseLabel" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="21" max="32767" attributes="0"/> + <Component id="closeButton" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="licenseLabel" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -201,5 +210,17 @@ <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/> </AuxValues> </Component> + <Component class="javax.swing.JLabel" name="licenseLabel"> + <Properties> + <Property name="text" type="java.lang.String" resourceKey="licenseLabel.text"/> + <Property name="name" type="java.lang.String" value="licenseLabel" noResource="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="appLicenseLabel"> + <Properties> + <Property name="text" type="java.lang.String" resourceKey="appLicenseLabel.text"/> + <Property name="name" type="java.lang.String" value="appLicenseLabel" noResource="true"/> + </Properties> + </Component> </SubComponents> </Form> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java 2009-04-19 20:03:13 UTC (rev 34) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsAboutBox.java 2009-04-22 01:01:15 UTC (rev 35) @@ -57,6 +57,8 @@ javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel(); javax.swing.JLabel appDescLabel = new javax.swing.JLabel(); javax.swing.JLabel imageLabel = new javax.swing.JLabel(); + licenseLabel = new javax.swing.JLabel(); + appLicenseLabel = new javax.swing.JLabel(); 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(ImageToolsAboutBox.class); @@ -101,6 +103,12 @@ imageLabel.setIcon(resourceMap.getIcon("camera_unmount128.icon")); // NOI18N imageLabel.setName("imageLabel"); // NOI18N + licenseLabel.setText(resourceMap.getString("licenseLabel.text")); // NOI18N + licenseLabel.setName("licenseLabel"); // NOI18N + + appLicenseLabel.setText(resourceMap.getString("appLicenseLabel.text")); // NOI18N + appLicenseLabel.setName("appLicenseLabel"); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -108,25 +116,27 @@ .addGroup(layout.createSequentialGroup() .addComponent(imageLabel) .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(appTitleLabel) + .addComponent(appDescLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) + .addComponent(closeButton, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(versionLabel) .addComponent(vendorLabel) - .addComponent(homepageLabel)) + .addComponent(homepageLabel) + .addComponent(licenseLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(appLicenseLabel) .addComponent(appVersionLabel) .addComponent(appVendorLabel) - .addComponent(appHomepageLabel))) - .addComponent(appTitleLabel, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(appDescLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) - .addComponent(closeButton)) + .addComponent(appHomepageLabel)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, Short.MAX_VALUE) + .addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 219, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(appTitleLabel) @@ -144,8 +154,13 @@ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(homepageLabel) .addComponent(appHomepageLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(closeButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(appLicenseLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE) + .addComponent(closeButton)) + .addComponent(licenseLabel)) .addContainerGap()) ); @@ -153,7 +168,9 @@ }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel appLicenseLabel; private javax.swing.JButton closeButton; + private javax.swing.JLabel licenseLabel; // End of variables declaration//GEN-END:variables } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-04-26 14:56:27
|
Revision: 37 http://imagetools.svn.sourceforge.net/imagetools/?rev=37&view=rev Author: cmarcum Date: 2009-04-26 14:56:25 +0000 (Sun, 26 Apr 2009) Log Message: ----------- changed AbsoluteLayout to null due to that library being GPL v2 only Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form 2009-04-25 16:57:32 UTC (rev 36) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form 2009-04-26 14:56:25 UTC (rev 37) @@ -20,35 +20,11 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-18,0,0,1,-3"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="1" pref="456" max="32767" attributes="0"/> - <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="closeButton" alignment="1" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane1" min="-2" pref="275" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="closeButton" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="true"/> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="jLabel1"> @@ -58,6 +34,11 @@ <Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/> <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="10" width="-1" height="-1"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JButton" name="closeButton"> <Properties> @@ -66,6 +47,11 @@ </Property> <Property name="name" type="java.lang.String" value="closeButton" noResource="true"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="390" y="440" width="-1" height="-1"/> + </Constraint> + </Constraints> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane1"> <Properties> @@ -74,6 +60,11 @@ <Dimension value="[440, 800]"/> </Property> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="20" y="50" width="470" height="370"/> + </Constraint> + </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> @@ -86,7 +77,7 @@ </Properties> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> - <Property name="useNullLayout" type="boolean" value="false"/> + <Property name="useNullLayout" type="boolean" value="true"/> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="fileSaveHeading"> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java 2009-04-25 16:57:32 UTC (rev 36) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java 2009-04-26 14:56:25 UTC (rev 37) @@ -78,150 +78,154 @@ setTitle(resourceMap.getString("Form.title")); // NOI18N setName("Form"); // NOI18N setResizable(false); + getContentPane().setLayout(null); jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N jLabel1.setName("jLabel1"); // NOI18N + getContentPane().add(jLabel1); + jLabel1.setBounds(10, 10, 153, 20); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getActionMap(ImageToolsUsingBox.class, this); closeButton.setAction(actionMap.get("closeUsingBox")); // NOI18N closeButton.setName("closeButton"); // NOI18N + getContentPane().add(closeButton); + closeButton.setBounds(390, 440, 97, 34); jScrollPane1.setName("jScrollPane1"); // NOI18N jScrollPane1.setPreferredSize(new java.awt.Dimension(440, 800)); jPanel1.setName("jPanel1"); // NOI18N jPanel1.setPreferredSize(new java.awt.Dimension(440, 800)); - jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + jPanel1.setLayout(null); fileSaveHeading.setIcon(resourceMap.getIcon("fileSaveHeading.icon")); // NOI18N fileSaveHeading.setText(resourceMap.getString("fileSaveHeading.text")); // NOI18N fileSaveHeading.setName("fileSaveHeading"); // NOI18N - jPanel1.add(fileSaveHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, -1, -1)); + jPanel1.add(fileSaveHeading); + fileSaveHeading.setBounds(20, 80, 96, 24); fileSaveText.setFont(resourceMap.getFont("fileSaveText.font")); // NOI18N fileSaveText.setText(resourceMap.getString("fileSaveText.text")); // NOI18N fileSaveText.setMaximumSize(new java.awt.Dimension(350, 50)); fileSaveText.setName("fileSaveText"); // NOI18N fileSaveText.setPreferredSize(new java.awt.Dimension(350, 15)); - jPanel1.add(fileSaveText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 400, 40)); + jPanel1.add(fileSaveText); + fileSaveText.setBounds(30, 100, 400, 40); fileExitHeading.setIcon(resourceMap.getIcon("fileExitHeading.icon")); // NOI18N fileExitHeading.setText(resourceMap.getString("fileExitHeading.text")); // NOI18N fileExitHeading.setName("fileExitHeading"); // NOI18N - jPanel1.add(fileExitHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, -1)); + jPanel1.add(fileExitHeading); + fileExitHeading.setBounds(10, 140, 91, 24); fileExitText.setFont(resourceMap.getFont("fileExitText.font")); // NOI18N fileExitText.setText(resourceMap.getString("fileExitText.text")); // NOI18N fileExitText.setName("fileExitText"); // NOI18N - jPanel1.add(fileExitText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, -1, -1)); + jPanel1.add(fileExitText); + fileExitText.setBounds(30, 170, 346, 15); imageCaptureHeading.setIcon(resourceMap.getIcon("imageCaptureHeading.icon")); // NOI18N imageCaptureHeading.setText(resourceMap.getString("imageCaptureHeading.text")); // NOI18N imageCaptureHeading.setName("imageCaptureHeading"); // NOI18N - jPanel1.add(imageCaptureHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, -1, -1)); + jPanel1.add(imageCaptureHeading); + imageCaptureHeading.setBounds(10, 190, 133, 24); imageCaptureText.setFont(resourceMap.getFont("imageCaptureText.font")); // NOI18N imageCaptureText.setText(resourceMap.getString("imageCaptureText.text")); // NOI18N imageCaptureText.setName("imageCaptureText"); // NOI18N - jPanel1.add(imageCaptureText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 220, 400, -1)); + jPanel1.add(imageCaptureText); + imageCaptureText.setBounds(30, 220, 400, 15); imageCropHeading.setIcon(resourceMap.getIcon("imageCropHeading.icon")); // NOI18N imageCropHeading.setText(resourceMap.getString("imageCropHeading.text")); // NOI18N imageCropHeading.setName("imageCropHeading"); // NOI18N - jPanel1.add(imageCropHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 270, -1, -1)); + jPanel1.add(imageCropHeading); + imageCropHeading.setBounds(10, 270, 114, 24); imageCropText.setFont(resourceMap.getFont("imageCropText.font")); // NOI18N imageCropText.setText(resourceMap.getString("imageCropText.text")); // NOI18N imageCropText.setName("imageCropText"); // NOI18N - jPanel1.add(imageCropText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 300, 400, -1)); + jPanel1.add(imageCropText); + imageCropText.setBounds(30, 300, 400, 15); fileOpenHeading.setIcon(resourceMap.getIcon("fileOpenHeading.icon")); // NOI18N fileOpenHeading.setText(resourceMap.getString("fileOpenHeading.text")); // NOI18N fileOpenHeading.setName("fileOpenHeading"); // NOI18N - jPanel1.add(fileOpenHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1)); + jPanel1.add(fileOpenHeading); + fileOpenHeading.setBounds(10, 10, 101, 24); fileOpenText.setFont(resourceMap.getFont("fileOpenText.font")); // NOI18N fileOpenText.setText(resourceMap.getString("fileOpenText.text")); // NOI18N fileOpenText.setName("fileOpenText"); // NOI18N - jPanel1.add(fileOpenText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, 400, 40)); + jPanel1.add(fileOpenText); + fileOpenText.setBounds(30, 30, 400, 40); drawLineHeading.setIcon(resourceMap.getIcon("drawLineHeading.icon")); // NOI18N drawLineHeading.setText(resourceMap.getString("drawLineHeading.text")); // NOI18N drawLineHeading.setName("drawLineHeading"); // NOI18N - jPanel1.add(drawLineHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 370, -1, -1)); + jPanel1.add(drawLineHeading); + drawLineHeading.setBounds(10, 370, 129, 24); drawLineText.setFont(resourceMap.getFont("drawLineText.font")); // NOI18N drawLineText.setText(resourceMap.getString("drawLineText.text")); // NOI18N drawLineText.setName("drawLineText"); // NOI18N - jPanel1.add(drawLineText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 400, 400, 40)); + jPanel1.add(drawLineText); + drawLineText.setBounds(30, 400, 400, 40); drawRectangleHeading.setIcon(resourceMap.getIcon("drawRectangleHeading.icon")); // NOI18N drawRectangleHeading.setText(resourceMap.getString("drawRectangleHeading.text")); // NOI18N drawRectangleHeading.setName("drawRectangleHeading"); // NOI18N - jPanel1.add(drawRectangleHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 440, -1, -1)); + jPanel1.add(drawRectangleHeading); + drawRectangleHeading.setBounds(10, 440, 163, 24); drawRectangleText.setFont(resourceMap.getFont("drawRectangleText.font")); // NOI18N drawRectangleText.setText(resourceMap.getString("drawRectangleText.text")); // NOI18N drawRectangleText.setName("drawRectangleText"); // NOI18N - jPanel1.add(drawRectangleText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 470, 400, -1)); + jPanel1.add(drawRectangleText); + drawRectangleText.setBounds(30, 470, 400, 15); drawTextHeading.setIcon(resourceMap.getIcon("drawTextHeading.icon")); // NOI18N drawTextHeading.setText(resourceMap.getString("drawTextHeading.text")); // NOI18N drawTextHeading.setName("drawTextHeading"); // NOI18N - jPanel1.add(drawTextHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 510, -1, -1)); + jPanel1.add(drawTextHeading); + drawTextHeading.setBounds(10, 510, 130, 24); drawTextText.setFont(resourceMap.getFont("drawTextText.font")); // NOI18N drawTextText.setText(resourceMap.getString("drawTextText.text")); // NOI18N drawTextText.setName("drawTextText"); // NOI18N - jPanel1.add(drawTextText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 540, 400, -1)); + jPanel1.add(drawTextText); + drawTextText.setBounds(30, 540, 400, 15); editUndoHeading.setIcon(resourceMap.getIcon("editUndoHeading.icon")); // NOI18N editUndoHeading.setText(resourceMap.getString("editUndoHeading.text")); // NOI18N editUndoHeading.setName("editUndoHeading"); // NOI18N - jPanel1.add(editUndoHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 580, -1, -1)); + jPanel1.add(editUndoHeading); + editUndoHeading.setBounds(10, 580, 103, 24); editRedoHeading.setIcon(resourceMap.getIcon("editRedoHeading.icon")); // NOI18N editRedoHeading.setText(resourceMap.getString("editRedoHeading.text")); // NOI18N editRedoHeading.setName("editRedoHeading"); // NOI18N - jPanel1.add(editRedoHeading, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 680, -1, -1)); + jPanel1.add(editRedoHeading); + editRedoHeading.setBounds(10, 680, 101, 24); editUndoText.setFont(resourceMap.getFont("editUndoText.font")); // NOI18N editUndoText.setText(resourceMap.getString("editUndoText.text")); // NOI18N editUndoText.setName("editUndoText"); // NOI18N - jPanel1.add(editUndoText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 610, 400, -1)); + jPanel1.add(editUndoText); + editUndoText.setBounds(30, 610, 400, 15); editRedoText.setFont(resourceMap.getFont("editRedoText.font")); // NOI18N editRedoText.setText(resourceMap.getString("editRedoText.text")); // NOI18N editRedoText.setName("editRedoText"); // NOI18N - jPanel1.add(editRedoText, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 710, 400, -1)); + jPanel1.add(editRedoText); + editRedoText.setBounds(30, 710, 400, 15); jScrollPane1.setViewportView(jPanel1); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE) - .addComponent(jLabel1) - .addComponent(closeButton, javax.swing.GroupLayout.Alignment.TRAILING)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(closeButton) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); + getContentPane().add(jScrollPane1); + jScrollPane1.setBounds(20, 50, 470, 370); pack(); }// </editor-fold>//GEN-END:initComponents This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-05-23 22:40:34
|
Revision: 43 http://imagetools.svn.sourceforge.net/imagetools/?rev=43&view=rev Author: cmarcum Date: 2009-05-23 22:40:24 +0000 (Sat, 23 May 2009) Log Message: ----------- comment cleanup Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-05-23 22:18:53 UTC (rev 42) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-05-23 22:40:24 UTC (rev 43) @@ -696,7 +696,7 @@ g2d.drawImage(biOld, null, 0, 0); } catch (RasterFormatException rfe) { - /// log error + // log error logger.log(Level.SEVERE, null, rfe); } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-05-23 22:18:53 UTC (rev 42) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-05-23 22:40:24 UTC (rev 43) @@ -41,7 +41,6 @@ private String fileName = ""; private String fileExt = ""; - // TODO add collection to queue images for undo/redo private String text = ""; private int fontSize = 10; Robot robot = null; @@ -145,12 +144,6 @@ // set the new image this.image = image; - - - - - - // TODO move current image into undo queue if it exists // if there is an image copy it to undo queue if (old != null) { // copy the current image into undoQueue Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-05-23 22:18:53 UTC (rev 42) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-05-23 22:40:24 UTC (rev 43) @@ -244,7 +244,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="statusMessageLabel" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="194" max="32767" attributes="0"/> + <EmptySpace pref="187" max="32767" attributes="0"/> <Component id="progressBar" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="statusAnimationLabel" min="-2" max="-2" attributes="0"/> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-05-23 22:18:53 UTC (rev 42) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-05-23 22:40:24 UTC (rev 43) @@ -835,11 +835,6 @@ @Action(enabledProperty = "drawLineEnabled", selectedProperty = "drawLineSelected") public void drawLine() { - - - // TODO we need to know when were done drawing to setImage - - imageArea.setMouseEvtType(ImageArea.DRAW_LINE); // imageArea.setupLineMouseListeners(); done in setMouseEvtType statusMessageLabel.setText("Draw Line - ESC to cancel."); @@ -886,7 +881,6 @@ // itModel.setImage((BufferedImage) imageArea.getImage()); itModel.undo(); - // TODO THIS MAYBE CAUSING DUPLICATION OF UNDO'S this.imageArea.setImage(itModel.getImage(), false); this.setUndoEnabled(!itModel.undoQueue.isEmpty()); @@ -941,7 +935,6 @@ // check if file exists and make sure it's an image(or .jpg) // if not show an error box - // TODO see if file is jpg - user can still type in a filename in chooser if (file.exists()) { // open it try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-05-30 13:22:44
|
Revision: 54 http://imagetools.svn.sourceforge.net/imagetools/?rev=54&view=rev Author: cmarcum Date: 2009-05-30 13:22:36 +0000 (Sat, 30 May 2009) Log Message: ----------- ticket:5 - changed layout from null to Free Design. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form 2009-05-29 22:33:57 UTC (rev 53) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.form 2009-05-30 13:22:36 UTC (rev 54) @@ -20,11 +20,38 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-18,0,0,1,-3"/> </AuxValues> - <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> - <Property name="useNullLayout" type="boolean" value="true"/> + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="10" pref="10" max="10" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="390" pref="390" max="390" attributes="0"/> + <Component id="closeButton" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="458" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="10" pref="10" max="10" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="2" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="370" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Component id="closeButton" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="jLabel1"> @@ -34,11 +61,6 @@ <Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/> <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="10" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="closeButton"> <Properties> @@ -47,11 +69,6 @@ </Property> <Property name="name" type="java.lang.String" value="closeButton" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="390" y="440" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane1"> <Properties> @@ -60,24 +77,151 @@ <Dimension value="[440, 800]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="20" y="50" width="470" height="370"/> - </Constraint> - </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> <Container class="javax.swing.JPanel" name="jPanel1"> <Properties> <Property name="name" type="java.lang.String" value="jPanel1" noResource="true"/> - <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[440, 800]"/> - </Property> </Properties> - <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> - <Property name="useNullLayout" type="boolean" value="true"/> + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileOpenHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileOpenText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileSaveHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileSaveText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileExitHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileExitText" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="imageCaptureHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="imageCropHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="imageCropText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawLineHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawLineText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawRectangleHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawRectangleText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawTextHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawTextText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="editUndoHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="editUndoText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="editRedoHeading" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="editRedoText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="imageCaptureText" min="-2" pref="400" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="38" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileOpenHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileOpenText" min="-2" pref="78" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileSaveHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileSaveText" min="-2" pref="65" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="fileExitHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="fileExitText" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="imageCaptureHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="imageCaptureText" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Component id="imageCropHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="imageCropText" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="drawLineHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawLineText" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="drawRectangleHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawRectangleText" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="drawTextHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="drawTextText" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="editUndoHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="editUndoText" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="editRedoHeading" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="editRedoText" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="462" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="fileSaveHeading"> @@ -86,11 +230,6 @@ <Property name="text" type="java.lang.String" resourceKey="fileSaveHeading.text"/> <Property name="name" type="java.lang.String" value="fileSaveHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="20" y="80" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="fileSaveText"> <Properties> @@ -104,11 +243,6 @@ <Dimension value="[350, 15]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="100" width="400" height="40"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="fileExitHeading"> <Properties> @@ -116,11 +250,6 @@ <Property name="text" type="java.lang.String" resourceKey="fileExitHeading.text"/> <Property name="name" type="java.lang.String" value="fileExitHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="140" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="fileExitText"> <Properties> @@ -128,11 +257,6 @@ <Property name="text" type="java.lang.String" resourceKey="fileExitText.text"/> <Property name="name" type="java.lang.String" value="fileExitText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="170" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="imageCaptureHeading"> <Properties> @@ -140,11 +264,6 @@ <Property name="text" type="java.lang.String" resourceKey="imageCaptureHeading.text"/> <Property name="name" type="java.lang.String" value="imageCaptureHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="190" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="imageCaptureText"> <Properties> @@ -152,11 +271,6 @@ <Property name="text" type="java.lang.String" resourceKey="imageCaptureText.text"/> <Property name="name" type="java.lang.String" value="imageCaptureText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="220" width="400" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="imageCropHeading"> <Properties> @@ -164,11 +278,6 @@ <Property name="text" type="java.lang.String" resourceKey="imageCropHeading.text"/> <Property name="name" type="java.lang.String" value="imageCropHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="270" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="imageCropText"> <Properties> @@ -176,11 +285,6 @@ <Property name="text" type="java.lang.String" resourceKey="imageCropText.text"/> <Property name="name" type="java.lang.String" value="imageCropText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="300" width="400" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="fileOpenHeading"> <Properties> @@ -188,11 +292,6 @@ <Property name="text" type="java.lang.String" resourceKey="fileOpenHeading.text"/> <Property name="name" type="java.lang.String" value="fileOpenHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="10" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="fileOpenText"> <Properties> @@ -200,11 +299,6 @@ <Property name="text" type="java.lang.String" resourceKey="fileOpenText.text"/> <Property name="name" type="java.lang.String" value="fileOpenText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="30" width="400" height="40"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="drawLineHeading"> <Properties> @@ -212,11 +306,6 @@ <Property name="text" type="java.lang.String" resourceKey="drawLineHeading.text"/> <Property name="name" type="java.lang.String" value="drawLineHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="370" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="drawLineText"> <Properties> @@ -224,11 +313,6 @@ <Property name="text" type="java.lang.String" resourceKey="drawLineText.text"/> <Property name="name" type="java.lang.String" value="drawLineText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="400" width="400" height="40"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="drawRectangleHeading"> <Properties> @@ -236,11 +320,6 @@ <Property name="text" type="java.lang.String" resourceKey="drawRectangleHeading.text"/> <Property name="name" type="java.lang.String" value="drawRectangleHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="440" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="drawRectangleText"> <Properties> @@ -248,11 +327,6 @@ <Property name="text" type="java.lang.String" resourceKey="drawRectangleText.text"/> <Property name="name" type="java.lang.String" value="drawRectangleText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="470" width="400" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="drawTextHeading"> <Properties> @@ -260,11 +334,6 @@ <Property name="text" type="java.lang.String" resourceKey="drawTextHeading.text"/> <Property name="name" type="java.lang.String" value="drawTextHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="510" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="drawTextText"> <Properties> @@ -272,11 +341,6 @@ <Property name="text" type="java.lang.String" resourceKey="drawTextText.text"/> <Property name="name" type="java.lang.String" value="drawTextText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="540" width="400" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="editUndoHeading"> <Properties> @@ -284,11 +348,6 @@ <Property name="text" type="java.lang.String" resourceKey="editUndoHeading.text"/> <Property name="name" type="java.lang.String" value="editUndoHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="580" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="editRedoHeading"> <Properties> @@ -296,11 +355,6 @@ <Property name="text" type="java.lang.String" resourceKey="editRedoHeading.text"/> <Property name="name" type="java.lang.String" value="editRedoHeading" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="10" y="680" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="editUndoText"> <Properties> @@ -308,11 +362,6 @@ <Property name="text" type="java.lang.String" resourceKey="editUndoText.text"/> <Property name="name" type="java.lang.String" value="editUndoText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="610" width="400" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="editRedoText"> <Properties> @@ -320,11 +369,6 @@ <Property name="text" type="java.lang.String" resourceKey="editRedoText.text"/> <Property name="name" type="java.lang.String" value="editRedoText" noResource="true"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="30" y="710" width="400" height="-1"/> - </Constraint> - </Constraints> </Component> </SubComponents> </Container> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java 2009-05-29 22:33:57 UTC (rev 53) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsUsingBox.java 2009-05-30 13:22:36 UTC (rev 54) @@ -78,154 +78,244 @@ setTitle(resourceMap.getString("Form.title")); // NOI18N setName("Form"); // NOI18N setResizable(false); - getContentPane().setLayout(null); jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N jLabel1.setName("jLabel1"); // NOI18N - getContentPane().add(jLabel1); - jLabel1.setBounds(10, 10, 153, 20); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getActionMap(ImageToolsUsingBox.class, this); closeButton.setAction(actionMap.get("closeUsingBox")); // NOI18N closeButton.setName("closeButton"); // NOI18N - getContentPane().add(closeButton); - closeButton.setBounds(390, 440, 97, 34); jScrollPane1.setName("jScrollPane1"); // NOI18N jScrollPane1.setPreferredSize(new java.awt.Dimension(440, 800)); jPanel1.setName("jPanel1"); // NOI18N - jPanel1.setPreferredSize(new java.awt.Dimension(440, 800)); - jPanel1.setLayout(null); fileSaveHeading.setIcon(resourceMap.getIcon("fileSaveHeading.icon")); // NOI18N fileSaveHeading.setText(resourceMap.getString("fileSaveHeading.text")); // NOI18N fileSaveHeading.setName("fileSaveHeading"); // NOI18N - jPanel1.add(fileSaveHeading); - fileSaveHeading.setBounds(20, 80, 96, 24); fileSaveText.setFont(resourceMap.getFont("fileSaveText.font")); // NOI18N fileSaveText.setText(resourceMap.getString("fileSaveText.text")); // NOI18N fileSaveText.setMaximumSize(new java.awt.Dimension(350, 50)); fileSaveText.setName("fileSaveText"); // NOI18N fileSaveText.setPreferredSize(new java.awt.Dimension(350, 15)); - jPanel1.add(fileSaveText); - fileSaveText.setBounds(30, 100, 400, 40); fileExitHeading.setIcon(resourceMap.getIcon("fileExitHeading.icon")); // NOI18N fileExitHeading.setText(resourceMap.getString("fileExitHeading.text")); // NOI18N fileExitHeading.setName("fileExitHeading"); // NOI18N - jPanel1.add(fileExitHeading); - fileExitHeading.setBounds(10, 140, 91, 24); fileExitText.setFont(resourceMap.getFont("fileExitText.font")); // NOI18N fileExitText.setText(resourceMap.getString("fileExitText.text")); // NOI18N fileExitText.setName("fileExitText"); // NOI18N - jPanel1.add(fileExitText); - fileExitText.setBounds(30, 170, 346, 15); imageCaptureHeading.setIcon(resourceMap.getIcon("imageCaptureHeading.icon")); // NOI18N imageCaptureHeading.setText(resourceMap.getString("imageCaptureHeading.text")); // NOI18N imageCaptureHeading.setName("imageCaptureHeading"); // NOI18N - jPanel1.add(imageCaptureHeading); - imageCaptureHeading.setBounds(10, 190, 133, 24); imageCaptureText.setFont(resourceMap.getFont("imageCaptureText.font")); // NOI18N imageCaptureText.setText(resourceMap.getString("imageCaptureText.text")); // NOI18N imageCaptureText.setName("imageCaptureText"); // NOI18N - jPanel1.add(imageCaptureText); - imageCaptureText.setBounds(30, 220, 400, 15); imageCropHeading.setIcon(resourceMap.getIcon("imageCropHeading.icon")); // NOI18N imageCropHeading.setText(resourceMap.getString("imageCropHeading.text")); // NOI18N imageCropHeading.setName("imageCropHeading"); // NOI18N - jPanel1.add(imageCropHeading); - imageCropHeading.setBounds(10, 270, 114, 24); imageCropText.setFont(resourceMap.getFont("imageCropText.font")); // NOI18N imageCropText.setText(resourceMap.getString("imageCropText.text")); // NOI18N imageCropText.setName("imageCropText"); // NOI18N - jPanel1.add(imageCropText); - imageCropText.setBounds(30, 300, 400, 15); fileOpenHeading.setIcon(resourceMap.getIcon("fileOpenHeading.icon")); // NOI18N fileOpenHeading.setText(resourceMap.getString("fileOpenHeading.text")); // NOI18N fileOpenHeading.setName("fileOpenHeading"); // NOI18N - jPanel1.add(fileOpenHeading); - fileOpenHeading.setBounds(10, 10, 101, 24); fileOpenText.setFont(resourceMap.getFont("fileOpenText.font")); // NOI18N fileOpenText.setText(resourceMap.getString("fileOpenText.text")); // NOI18N fileOpenText.setName("fileOpenText"); // NOI18N - jPanel1.add(fileOpenText); - fileOpenText.setBounds(30, 30, 400, 40); drawLineHeading.setIcon(resourceMap.getIcon("drawLineHeading.icon")); // NOI18N drawLineHeading.setText(resourceMap.getString("drawLineHeading.text")); // NOI18N drawLineHeading.setName("drawLineHeading"); // NOI18N - jPanel1.add(drawLineHeading); - drawLineHeading.setBounds(10, 370, 129, 24); drawLineText.setFont(resourceMap.getFont("drawLineText.font")); // NOI18N drawLineText.setText(resourceMap.getString("drawLineText.text")); // NOI18N drawLineText.setName("drawLineText"); // NOI18N - jPanel1.add(drawLineText); - drawLineText.setBounds(30, 400, 400, 40); drawRectangleHeading.setIcon(resourceMap.getIcon("drawRectangleHeading.icon")); // NOI18N drawRectangleHeading.setText(resourceMap.getString("drawRectangleHeading.text")); // NOI18N drawRectangleHeading.setName("drawRectangleHeading"); // NOI18N - jPanel1.add(drawRectangleHeading); - drawRectangleHeading.setBounds(10, 440, 163, 24); drawRectangleText.setFont(resourceMap.getFont("drawRectangleText.font")); // NOI18N drawRectangleText.setText(resourceMap.getString("drawRectangleText.text")); // NOI18N drawRectangleText.setName("drawRectangleText"); // NOI18N - jPanel1.add(drawRectangleText); - drawRectangleText.setBounds(30, 470, 400, 15); drawTextHeading.setIcon(resourceMap.getIcon("drawTextHeading.icon")); // NOI18N drawTextHeading.setText(resourceMap.getString("drawTextHeading.text")); // NOI18N drawTextHeading.setName("drawTextHeading"); // NOI18N - jPanel1.add(drawTextHeading); - drawTextHeading.setBounds(10, 510, 130, 24); drawTextText.setFont(resourceMap.getFont("drawTextText.font")); // NOI18N drawTextText.setText(resourceMap.getString("drawTextText.text")); // NOI18N drawTextText.setName("drawTextText"); // NOI18N - jPanel1.add(drawTextText); - drawTextText.setBounds(30, 540, 400, 15); editUndoHeading.setIcon(resourceMap.getIcon("editUndoHeading.icon")); // NOI18N editUndoHeading.setText(resourceMap.getString("editUndoHeading.text")); // NOI18N editUndoHeading.setName("editUndoHeading"); // NOI18N - jPanel1.add(editUndoHeading); - editUndoHeading.setBounds(10, 580, 103, 24); editRedoHeading.setIcon(resourceMap.getIcon("editRedoHeading.icon")); // NOI18N editRedoHeading.setText(resourceMap.getString("editRedoHeading.text")); // NOI18N editRedoHeading.setName("editRedoHeading"); // NOI18N - jPanel1.add(editRedoHeading); - editRedoHeading.setBounds(10, 680, 101, 24); editUndoText.setFont(resourceMap.getFont("editUndoText.font")); // NOI18N editUndoText.setText(resourceMap.getString("editUndoText.text")); // NOI18N editUndoText.setName("editUndoText"); // NOI18N - jPanel1.add(editUndoText); - editUndoText.setBounds(30, 610, 400, 15); editRedoText.setFont(resourceMap.getFont("editRedoText.font")); // NOI18N editRedoText.setText(resourceMap.getString("editRedoText.text")); // NOI18N editRedoText.setName("editRedoText"); // NOI18N - jPanel1.add(editRedoText); - editRedoText.setBounds(30, 710, 400, 15); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileOpenHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileOpenText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileSaveHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileSaveText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileExitHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileExitText)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(imageCaptureHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(imageCropHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(imageCropText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(drawLineHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(drawLineText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(drawRectangleHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(drawRectangleText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(drawTextHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(drawTextText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(editUndoHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(editUndoText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(editRedoHeading)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(editRedoText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(imageCaptureText, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(38, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(fileOpenHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(fileOpenText, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(fileSaveHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(fileSaveText, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(fileExitHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(fileExitText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(imageCaptureHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(imageCaptureText) + .addGap(18, 18, 18) + .addComponent(imageCropHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(imageCropText) + .addGap(18, 18, 18) + .addComponent(drawLineHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(drawLineText) + .addGap(18, 18, 18) + .addComponent(drawRectangleHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(drawRectangleText) + .addGap(18, 18, 18) + .addComponent(drawTextHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(drawTextText) + .addGap(18, 18, 18) + .addComponent(editUndoHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(editUndoText) + .addGap(18, 18, 18) + .addComponent(editRedoHeading) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(editRedoText) + .addGap(462, 462, 462)) + ); + jScrollPane1.setViewportView(jPanel1); - getContentPane().add(jScrollPane1); - jScrollPane1.setBounds(20, 50, 470, 370); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(jLabel1)) + .addGroup(layout.createSequentialGroup() + .addGap(390, 390, 390) + .addComponent(closeButton)) + .addGroup(layout.createSequentialGroup() + .addGap(20, 20, 20) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 458, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(jLabel1) + .addGap(2, 2, 2) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 370, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(20, 20, 20) + .addComponent(closeButton)) + ); pack(); }// </editor-fold>//GEN-END:initComponents This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-06-05 13:24:33
|
Revision: 58 http://imagetools.svn.sourceforge.net/imagetools/?rev=58&view=rev Author: cmarcum Date: 2009-06-05 13:24:19 +0000 (Fri, 05 Jun 2009) Log Message: ----------- ticket:6 - added multi-line text functionality Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-06-05 12:19:54 UTC (rev 57) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-06-05 13:24:19 UTC (rev 58) @@ -56,6 +56,7 @@ <SubComponents> <Container class="javax.swing.JScrollPane" name="scrollPane"> <Properties> + <Property name="horizontalScrollBarPolicy" type="int" value="31"/> <Property name="name" type="java.lang.String" value="scrollPane" noResource="true"/> </Properties> <AuxValues> @@ -67,8 +68,12 @@ <Component class="javax.swing.JTextArea" name="textArea"> <Properties> <Property name="columns" type="int" value="20"/> + <Property name="lineWrap" type="boolean" value="true"/> <Property name="rows" type="int" value="5"/> <Property name="name" type="java.lang.String" value="textArea" noResource="true"/> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[200, 75]"/> + </Property> </Properties> </Component> </SubComponents> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-06-05 12:19:54 UTC (rev 57) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-06-05 13:24:19 UTC (rev 58) @@ -67,11 +67,14 @@ setTitle(resourceMap.getString("Form.title")); // NOI18N setName("Form"); // NOI18N + scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setName("scrollPane"); // NOI18N textArea.setColumns(20); + textArea.setLineWrap(true); textArea.setRows(5); textArea.setName("textArea"); // NOI18N + textArea.setPreferredSize(new java.awt.Dimension(200, 75)); scrollPane.setViewportView(textArea); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getActionMap(DrawTextBox.class, this); @@ -120,6 +123,8 @@ ImageToolsModel itModel = ImageToolsApp.getApplication().getItModel(); // itModel.setText("text goes here"); itModel.setText(this.textArea.getText()); + // set the current width to the model + itModel.setTextBoxWidth((float)this.textArea.getWidth()); // dispose of box closeDrawTextBox(); } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-05 12:19:54 UTC (rev 57) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-05 13:24:19 UTC (rev 58) @@ -9,7 +9,6 @@ * * Modified for use with Image Tools */ - package net.codebuilders.desktop.imagetools; import java.awt.*; @@ -23,14 +22,24 @@ import java.util.logging.Level; import java.util.logging.Logger; + +import java.util.Hashtable; + +import java.awt.font.FontRenderContext; +import java.awt.font.LineBreakMeasurer; +import java.awt.font.TextAttribute; +import java.awt.font.TextLayout; +import java.text.AttributedCharacterIterator; +import java.text.AttributedString; + /** * This class defines a specialized panel for displaying a captured image. */ public class ImageArea extends JPanel { - // logger - Logger logger = null; - + ImageToolsModel itModel = null; + // logger + Logger logger = null; /** * Stroke-defined outline of selection rectangle. */ @@ -70,20 +79,16 @@ * for drawing a line */ private Line2D lineSelection; - /** * Location and extents of selection point. * for drawing text */ private Point2D pointSelection; - /** * Location and extents of selection point. * for drawing text */ private String drawText; - - /** * Ready to crop, usually after rectangle selection */ @@ -98,22 +103,34 @@ public static final int DRAW_RECTANGLE = 3; MouseListener ml; MouseMotionListener mml; + // The LineBreakMeasurer used to line-break the paragraph. + private LineBreakMeasurer lineMeasurer; + private float breakWidth = (float) 200.0; + // index of the first character in the paragraph. + private int paragraphStart; + // index of the first character after the end of the paragraph. + private int paragraphEnd; + private final Hashtable<TextAttribute, Object> map = + new Hashtable<TextAttribute, Object>(); + private AttributedString attStr; + /** * Construct an ImageArea component. */ public ImageArea() { + // get the model to get text from + itModel = ImageToolsApp.getApplication().getItModel(); + // setup logger + logger = Logger.getLogger(ImageArea.class.getName()); - // setup logger - logger = Logger.getLogger(ImageArea.class.getName()); - // Create a selection Rectangle. It's better to create one Rectangle // here than a Rectangle each time paintComponent() is called, to reduce // unnecessary object creation. rectSelection = new Rectangle(); lineSelection = new Line2D.Float(); - + pointSelection = new Point2D.Float(); @@ -139,6 +156,14 @@ // this.setupCropMouseListeners(); this.setMouseEvtType(ImageArea.DRAW_CROP_RECTANGLE); + + // TODO get font value from somewhere + map.put(TextAttribute.FAMILY, "Serif"); + // TODO get text height value from somewhere + map.put(TextAttribute.SIZE, new Float(12.0)); + + + } // end constructor /** @@ -327,9 +352,53 @@ // Draw selection line. Graphics2D g2d = (Graphics2D) g; + // save a local copy of the text + drawText = itModel.getText(); + attStr = new AttributedString(drawText, map); + // set the pre-placement color to light gray + g2d.setColor(Color.LIGHT_GRAY); - g2d.setColor(Color.DARK_GRAY); - g2d.drawString(drawText, destx, desty); + // Create a new LineBreakMeasurer from the paragraph. + // It will be cached and re-used. + if (lineMeasurer == null) { + AttributedCharacterIterator paragraph = attStr.getIterator(); + paragraphStart = paragraph.getBeginIndex(); + paragraphEnd = paragraph.getEndIndex(); + FontRenderContext frc = g2d.getFontRenderContext(); + lineMeasurer = new LineBreakMeasurer(paragraph, frc); + } + + // Set break width to width of Component. + breakWidth = itModel.getTextBoxWidth(); + float drawPosY = desty; + // Set position to the index of the first character in the paragraph. + lineMeasurer.setPosition(paragraphStart); + + // Get lines until the entire paragraph has been displayed. + while (lineMeasurer.getPosition() < paragraphEnd) { + + // Retrieve next layout. A cleverer program would also cache + // these layouts until the component is re-sized. + TextLayout layout = lineMeasurer.nextLayout(breakWidth); + + // Compute pen x position. If the paragraph is right-to-left we + // will align the TextLayouts to the right edge of the panel. + // Note: this won't occur for the English text in this sample. + // Note: drawPosX is always where the LEFT of the text is placed. + float drawPosX = layout.isLeftToRight() + ? (0 + destx) : breakWidth - layout.getAdvance(); + + // Move y-coordinate by the ascent of the layout. + drawPosY += layout.getAscent(); + + // Draw the TextLayout at (drawPosX, drawPosY). + layout.draw(g2d, drawPosX, drawPosY); + + + // Move y-coordinate in preparation for next layout. + drawPosY += layout.getDescent() + layout.getLeading(); + } + g2d.dispose(); } // end if @@ -463,7 +532,7 @@ } private void setupRectangleMouseListeners() { - + // remove existing mouse listeners this.tearDownMouseListeners(); @@ -485,7 +554,6 @@ repaint(); } - @Override public void mouseReleased(MouseEvent e) { @@ -592,7 +660,7 @@ g2d.drawImage(biOld, null, 0, 0); } catch (RasterFormatException rfe) { - + // log error logger.log(Level.SEVERE, null, rfe); @@ -604,7 +672,7 @@ // g2d.setPaint(gpAnnotate); g2d.setColor(Color.RED); g2d.draw(lineSelection); - setImage(biNew, true); + setImage(biNew, true); } }; @@ -650,7 +718,7 @@ if (image == null) { return; } - + // save a local copy of the text // get the model to get text from ImageToolsModel itModel = ImageToolsApp.getApplication().getItModel(); @@ -686,10 +754,54 @@ } g2d.setColor(Color.RED); - // TODO add font info - g2d.drawString(drawText, destx, desty); + // save a local copy of the text + drawText = itModel.getText(); + attStr = new AttributedString(drawText, map); + // Create a new LineBreakMeasurer from the paragraph. + // It will be cached and re-used. + if (lineMeasurer == null) { + AttributedCharacterIterator paragraph = attStr.getIterator(); + paragraphStart = paragraph.getBeginIndex(); + paragraphEnd = paragraph.getEndIndex(); + FontRenderContext frc = g2d.getFontRenderContext(); + lineMeasurer = new LineBreakMeasurer(paragraph, frc); + } + + // Set break width to width of Component. + breakWidth = itModel.getTextBoxWidth(); + float drawPosY = desty; + // Set position to the index of the first character in the paragraph. + lineMeasurer.setPosition(paragraphStart); + + // Get lines until the entire paragraph has been displayed. + while (lineMeasurer.getPosition() < paragraphEnd) { + + // Retrieve next layout. A cleverer program would also cache + // these layouts until the component is re-sized. + TextLayout layout = lineMeasurer.nextLayout(breakWidth); + + // Compute pen x position. If the paragraph is right-to-left we + // will align the TextLayouts to the right edge of the panel. + // Note: this won't occur for the English text in this sample. + // Note: drawPosX is always where the LEFT of the text is placed. + // TODO adjust the RightToLeft case with destx also + // LeftToRight has been fixed + float drawPosX = layout.isLeftToRight() + ? (0 + destx) : breakWidth - layout.getAdvance(); + + // Move y-coordinate by the ascent of the layout. + drawPosY += layout.getAscent(); + + // Draw the TextLayout at (drawPosX, drawPosY). + layout.draw(g2d, drawPosX, drawPosY); + + + // Move y-coordinate in preparation for next layout. + drawPosY += layout.getDescent() + layout.getLeading(); + } + setImage(biNew, true); - + g2d.dispose(); } }; this.addMouseListener(ml); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-06-07 13:13:04
|
Revision: 59 http://imagetools.svn.sourceforge.net/imagetools/?rev=59&view=rev Author: cmarcum Date: 2009-06-07 12:13:35 +0000 (Sun, 07 Jun 2009) Log Message: ----------- ticket:8 and ticket:11 - added Options menu with radio buttons for annotation color and font styles. No actions yet. Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-06-05 13:24:19 UTC (rev 58) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-06-07 12:13:35 UTC (rev 59) @@ -196,6 +196,59 @@ </MenuItem> </SubComponents> </Menu> + <Menu class="javax.swing.JMenu" name="optionsMenu"> + <Properties> + <Property name="text" type="java.lang.String" resourceKey="optionsMenu.text"/> + <Property name="name" type="java.lang.String" value="optionsMenu" noResource="true"/> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="colorRedItem"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="colorButtonGroup"/> + </Property> + <Property name="selected" type="boolean" value="true"/> + <Property name="text" type="java.lang.String" resourceKey="colorRedItem.text"/> + <Property name="name" type="java.lang.String" value="colorRedItem" noResource="true"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="colorBlueItem"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="colorButtonGroup"/> + </Property> + <Property name="text" type="java.lang.String" resourceKey="colorBlueItem.text"/> + <Property name="name" type="java.lang.String" value="colorBlueItem" noResource="true"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JSeparator" name="jSeparator4"> + <Properties> + <Property name="name" type="java.lang.String" value="jSeparator4" noResource="true"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="fontSerifItem"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="fontButtonGroup"/> + </Property> + <Property name="font" type="java.awt.Font" resourceKey="fontSerifItem.font"/> + <Property name="selected" type="boolean" value="true"/> + <Property name="text" type="java.lang.String" resourceKey="fontSerifItem.text"/> + <Property name="name" type="java.lang.String" value="fontSerifItem" noResource="true"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="fontSansSerifItem"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="fontButtonGroup"/> + </Property> + <Property name="font" type="java.awt.Font" resourceKey="fontSansSerifItem.font"/> + <Property name="text" type="java.lang.String" resourceKey="fontSansSerifItem.text"/> + <Property name="name" type="java.lang.String" value="fontSansSerifItem" noResource="true"/> + </Properties> + </MenuItem> + </SubComponents> + </Menu> <Menu class="javax.swing.JMenu" name="helpMenu"> <Properties> <Property name="text" type="java.lang.String" resourceKey="helpMenu.text"/> @@ -458,6 +511,10 @@ </Container> <Component class="javax.swing.ButtonGroup" name="drawButtonGroup"> </Component> + <Component class="javax.swing.ButtonGroup" name="colorButtonGroup"> + </Component> + <Component class="javax.swing.ButtonGroup" name="fontButtonGroup"> + </Component> </NonVisualComponents> <Properties> <Property name="component" type="javax.swing.JComponent" editor="org.netbeans.modules.form.ComponentChooserEditor"> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-05 13:24:19 UTC (rev 58) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-07 12:13:35 UTC (rev 59) @@ -237,6 +237,12 @@ drawLineItem = new javax.swing.JMenuItem(); drawRectangleItem = new javax.swing.JMenuItem(); drawTextItem = new javax.swing.JMenuItem(); + optionsMenu = new javax.swing.JMenu(); + colorRedItem = new javax.swing.JRadioButtonMenuItem(); + colorBlueItem = new javax.swing.JRadioButtonMenuItem(); + jSeparator4 = new javax.swing.JSeparator(); + fontSerifItem = new javax.swing.JRadioButtonMenuItem(); + fontSansSerifItem = new javax.swing.JRadioButtonMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); usingMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); @@ -260,6 +266,8 @@ rectangleButton = new javax.swing.JToggleButton(); textButton = new javax.swing.JToggleButton(); drawButtonGroup = new javax.swing.ButtonGroup(); + colorButtonGroup = new javax.swing.ButtonGroup(); + fontButtonGroup = new javax.swing.ButtonGroup(); mainPanel.setName("mainPanel"); // NOI18N mainPanel.setPreferredSize(new java.awt.Dimension(425, 350)); @@ -368,6 +376,38 @@ menuBar.add(drawMenu); + optionsMenu.setText(resourceMap.getString("optionsMenu.text")); // NOI18N + optionsMenu.setName("optionsMenu"); // NOI18N + + colorButtonGroup.add(colorRedItem); + colorRedItem.setSelected(true); + colorRedItem.setText(resourceMap.getString("colorRedItem.text")); // NOI18N + colorRedItem.setName("colorRedItem"); // NOI18N + optionsMenu.add(colorRedItem); + + colorButtonGroup.add(colorBlueItem); + colorBlueItem.setText(resourceMap.getString("colorBlueItem.text")); // NOI18N + colorBlueItem.setName("colorBlueItem"); // NOI18N + optionsMenu.add(colorBlueItem); + + jSeparator4.setName("jSeparator4"); // NOI18N + optionsMenu.add(jSeparator4); + + fontButtonGroup.add(fontSerifItem); + fontSerifItem.setFont(resourceMap.getFont("fontSerifItem.font")); // NOI18N + fontSerifItem.setSelected(true); + fontSerifItem.setText(resourceMap.getString("fontSerifItem.text")); // NOI18N + fontSerifItem.setName("fontSerifItem"); // NOI18N + optionsMenu.add(fontSerifItem); + + fontButtonGroup.add(fontSansSerifItem); + fontSansSerifItem.setFont(resourceMap.getFont("fontSansSerifItem.font")); // NOI18N + fontSansSerifItem.setText(resourceMap.getString("fontSansSerifItem.text")); // NOI18N + fontSansSerifItem.setName("fontSansSerifItem"); // NOI18N + optionsMenu.add(fontSansSerifItem); + + menuBar.add(optionsMenu); + helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N @@ -403,7 +443,7 @@ .addGroup(statusPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(statusMessageLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 194, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 187, Short.MAX_VALUE) .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(statusAnimationLabel) @@ -1274,6 +1314,9 @@ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton captureButton; private javax.swing.JButton closeButton; + private javax.swing.JRadioButtonMenuItem colorBlueItem; + private javax.swing.ButtonGroup colorButtonGroup; + private javax.swing.JRadioButtonMenuItem colorRedItem; private javax.swing.JButton cropButton; private javax.swing.ButtonGroup drawButtonGroup; private javax.swing.JMenuItem drawLineItem; @@ -1287,6 +1330,9 @@ private javax.swing.JMenuItem fileOpenItem; private javax.swing.JMenuItem filePrintItem; private javax.swing.JMenuItem fileSaveItem; + private javax.swing.ButtonGroup fontButtonGroup; + private javax.swing.JRadioButtonMenuItem fontSansSerifItem; + private javax.swing.JRadioButtonMenuItem fontSerifItem; private javax.swing.JMenuItem imageCaptureItem; private javax.swing.JMenuItem imageCropItem; private javax.swing.JMenu imageMenu; @@ -1294,10 +1340,12 @@ private javax.swing.JToolBar.Separator jSeparator1; private javax.swing.JToolBar.Separator jSeparator2; private javax.swing.JToolBar.Separator jSeparator3; + private javax.swing.JSeparator jSeparator4; private javax.swing.JToggleButton lineButton; private javax.swing.JPanel mainPanel; private javax.swing.JMenuBar menuBar; private javax.swing.JButton openButton; + private javax.swing.JMenu optionsMenu; private javax.swing.JProgressBar progressBar; private javax.swing.JToggleButton rectangleButton; private javax.swing.JButton redoButton; Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-06-05 13:24:19 UTC (rev 58) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-06-07 12:13:35 UTC (rev 59) @@ -130,3 +130,12 @@ message.info.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_info24.png #error icon for showWarning message.warning.icon=/net/codebuilders/desktop/imagetools/resources/messagebox_warning24.png +optionsMenu.text=Options +colorRedItem.text=Red +colorBlueItem.text=Blue +fontSerifItem.text=Serif +fontSansSerifItem.text=Sans Serif +#NOI18N +fontSerifItem.font=DejaVu Serif-Plain-13 +#NOI18N +fontSansSerifItem.font=DejaVu Sans-Plain-13 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-06-07 14:42:31
|
Revision: 60 http://imagetools.svn.sourceforge.net/imagetools/?rev=60&view=rev Author: cmarcum Date: 2009-06-07 14:42:24 +0000 (Sun, 07 Jun 2009) Log Message: ----------- ticket:8 - implemented red and blue annotation color selection Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Added Paths: ----------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/color_line_red16.png Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-07 12:13:35 UTC (rev 59) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-07 14:42:24 UTC (rev 60) @@ -584,9 +584,10 @@ // draw the real rectangle g2d.setStroke(bsAnnotate); // g2d.setPaint(gpAnnotate); - g2d.setColor(Color.RED); + // get the color from the model + g2d.setColor(itModel.getColor()); g2d.draw(rectSelection); - + g2d.dispose(); // set the image setImage(biNew, true); @@ -670,7 +671,8 @@ // draw the real line g2d.setStroke(bsAnnotate); // g2d.setPaint(gpAnnotate); - g2d.setColor(Color.RED); + // get the color from the model + g2d.setColor(itModel.getColor()); g2d.draw(lineSelection); setImage(biNew, true); @@ -753,7 +755,7 @@ } - g2d.setColor(Color.RED); + g2d.setColor(itModel.getColor()); // save a local copy of the text drawText = itModel.getText(); attStr = new AttributedString(drawText, map); Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-06-07 12:13:35 UTC (rev 59) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-06-07 14:42:24 UTC (rev 60) @@ -30,6 +30,7 @@ import java.awt.image.BufferedImage; import java.beans.PropertyChangeSupport; import java.util.LinkedList; +import java.awt.Color; /** * @@ -44,6 +45,7 @@ private String text = ""; private int fontSize = 10; private float textBoxWidth = (float)200.0; + private Color color = Color.RED; Robot robot = null; // current image between undo and redo queue @@ -250,4 +252,19 @@ public void setTextBoxWidth(float textBoxWidth) { this.textBoxWidth = textBoxWidth; } + + /** + * @return the color + */ + public Color getColor() { + return color; + } + + /** + * @param color the color to set + */ + public void setColor(Color color) { + this.color = color; + + } } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-06-07 12:13:35 UTC (rev 59) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-06-07 14:42:24 UTC (rev 60) @@ -204,6 +204,9 @@ <SubComponents> <MenuItem class="javax.swing.JRadioButtonMenuItem" name="colorRedItem"> <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="setColorRed" methodName="setColorRed"/> + </Property> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <ComponentRef name="colorButtonGroup"/> </Property> @@ -214,6 +217,9 @@ </MenuItem> <MenuItem class="javax.swing.JRadioButtonMenuItem" name="colorBlueItem"> <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="setColorBlue" methodName="setColorBlue"/> + </Property> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <ComponentRef name="colorButtonGroup"/> </Property> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-07 12:13:35 UTC (rev 59) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-07 14:42:24 UTC (rev 60) @@ -78,7 +78,7 @@ imageChooser.setAcceptAllFileFilterUsed(false); imageChooser.setFileFilter(new ImageFileFilter()); - itModel = new ImageToolsModel(); + itModel = ImageToolsApp.getApplication().getItModel(); initComponents(); @@ -91,6 +91,8 @@ this.setDrawLineEnabled(false); this.setDrawRectangleEnabled(false); this.setDrawTextEnabled(false); + this.setColorRedEnabled(true); + this.setColorBlueEnabled(true); // undo and redo depends on their collection status @@ -379,12 +381,14 @@ optionsMenu.setText(resourceMap.getString("optionsMenu.text")); // NOI18N optionsMenu.setName("optionsMenu"); // NOI18N + colorRedItem.setAction(actionMap.get("setColorRed")); // NOI18N colorButtonGroup.add(colorRedItem); colorRedItem.setSelected(true); colorRedItem.setText(resourceMap.getString("colorRedItem.text")); // NOI18N colorRedItem.setName("colorRedItem"); // NOI18N optionsMenu.add(colorRedItem); + colorBlueItem.setAction(actionMap.get("setColorBlue")); // NOI18N colorButtonGroup.add(colorBlueItem); colorBlueItem.setText(resourceMap.getString("colorBlueItem.text")); // NOI18N colorBlueItem.setName("colorBlueItem"); // NOI18N @@ -1311,6 +1315,60 @@ firePropertyChange("cropSelected", old, isCropSelected()); } + @Action(enabledProperty = "colorRedEnabled", selectedProperty = "colorRedSelected") + public void setColorRed() { + itModel.setColor(java.awt.Color.RED); + } + + @Action(enabledProperty = "colorBlueEnabled", selectedProperty = "colorBlueSelected") + public void setColorBlue() { + itModel.setColor(java.awt.Color.BLUE); + } + + private boolean colorBlueEnabled = false; + public boolean isColorBlueEnabled() { + return colorBlueEnabled; + } + + public void setColorBlueEnabled(boolean b) { + boolean old = isColorBlueEnabled(); + this.colorBlueEnabled = b; + firePropertyChange("colorBlueEnabled", old, isColorBlueEnabled()); + } + + private boolean colorBlueSelected = false; + public boolean isColorBlueSelected() { + return colorBlueSelected; + } + + public void setColorBlueSelected(boolean b) { + boolean old = isColorBlueSelected(); + this.colorBlueSelected = b; + firePropertyChange("colorBlueSelected", old, isColorBlueSelected()); + } + + private boolean colorRedEnabled = false; + public boolean isColorRedEnabled() { + return colorRedEnabled; + } + + public void setColorRedEnabled(boolean b) { + boolean old = isColorRedEnabled(); + this.colorRedEnabled = b; + firePropertyChange("colorRedEnabled", old, isColorRedEnabled()); + } + + private boolean colorRedSelected = false; + public boolean isColorRedSelected() { + return colorRedSelected; + } + + public void setColorRedSelected(boolean b) { + boolean old = isColorRedSelected(); + this.colorRedSelected = b; + firePropertyChange("colorRedSelected", old, isColorRedSelected()); + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton captureButton; private javax.swing.JButton closeButton; Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-06-07 12:13:35 UTC (rev 59) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-06-07 14:42:24 UTC (rev 60) @@ -139,3 +139,11 @@ fontSerifItem.font=DejaVu Serif-Plain-13 #NOI18N fontSansSerifItem.font=DejaVu Sans-Plain-13 +setColorRed.Action.text=Red +setColorRed.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/color_line_red16.png +setColorRed.Action.icon=/net/codebuilders/desktop/imagetools/resources/color_line_red16.png +setColorRed.Action.shortDescription=Set color to red +setColorBlue.Action.text=Blue +setColorBlue.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png +setColorBlue.Action.icon=/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png +setColorBlue.Action.shortDescription=Set color to Blue Added: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png =================================================================== (Binary files differ) Property changes on: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/color_line_red16.png =================================================================== (Binary files differ) Property changes on: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/color_line_red16.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-06-11 02:16:52
|
Revision: 61 http://imagetools.svn.sourceforge.net/imagetools/?rev=61&view=rev Author: cmarcum Date: 2009-06-11 02:16:36 +0000 (Thu, 11 Jun 2009) Log Message: ----------- ticket:11 - implemented Serif and SansSerif fonts settings Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-07 14:42:24 UTC (rev 60) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-11 02:16:36 UTC (rev 61) @@ -31,6 +31,8 @@ import java.awt.font.TextLayout; import java.text.AttributedCharacterIterator; import java.text.AttributedString; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; /** * This class defines a specialized panel for displaying a captured image. @@ -84,12 +86,8 @@ * for drawing text */ private Point2D pointSelection; + /** - * Location and extents of selection point. - * for drawing text - */ - private String drawText; - /** * Ready to crop, usually after rectangle selection */ private boolean readyToCrop; @@ -111,8 +109,7 @@ // index of the first character after the end of the paragraph. private int paragraphEnd; - private final Hashtable<TextAttribute, Object> map = - new Hashtable<TextAttribute, Object>(); + private Hashtable<TextAttribute, Object> map; private AttributedString attStr; /** @@ -156,14 +153,36 @@ // this.setupCropMouseListeners(); this.setMouseEvtType(ImageArea.DRAW_CROP_RECTANGLE); + map = new Hashtable<TextAttribute, Object>(); + // get textFont value from model + map.put(TextAttribute.FAMILY, itModel.getFont()); + // get text height value from model + map.put(TextAttribute.SIZE, new Float(itModel.getFontSize())); + // make a new attributed string + attStr = new AttributedString(itModel.getText(), map); - // TODO get font value from somewhere - map.put(TextAttribute.FAMILY, "Serif"); - // TODO get text height value from somewhere - map.put(TextAttribute.SIZE, new Float(12.0)); + // listen for ImageTools Model to update textFont + itModel.pcs.addPropertyChangeListener("font", new PropertyChangeListener() { - + @Override + public void propertyChange(PropertyChangeEvent propertyChangeEvent) { + // update map + map.put(TextAttribute.FAMILY, itModel.getFont()); + // make a new attributed string + attStr = new AttributedString(itModel.getText(), map); + } + }); + // listen for ImageTools Model to update Text + itModel.pcs.addPropertyChangeListener("text", new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent propertyChangeEvent) { + // make a new attributed string + attStr = new AttributedString(itModel.getText(), map); + } + }); + } // end constructor /** @@ -352,9 +371,7 @@ // Draw selection line. Graphics2D g2d = (Graphics2D) g; - // save a local copy of the text - drawText = itModel.getText(); - attStr = new AttributedString(drawText, map); + // set the pre-placement color to light gray g2d.setColor(Color.LIGHT_GRAY); @@ -400,6 +417,7 @@ } g2d.dispose(); + lineMeasurer = null; } // end if @@ -721,11 +739,6 @@ return; } - // save a local copy of the text - // get the model to get text from - ImageToolsModel itModel = ImageToolsApp.getApplication().getItModel(); - drawText = itModel.getText(); - destx = srcx = e.getX(); desty = srcy = e.getY(); @@ -756,9 +769,7 @@ } g2d.setColor(itModel.getColor()); - // save a local copy of the text - drawText = itModel.getText(); - attStr = new AttributedString(drawText, map); + // Create a new LineBreakMeasurer from the paragraph. // It will be cached and re-used. if (lineMeasurer == null) { @@ -804,6 +815,7 @@ setImage(biNew, true); g2d.dispose(); + lineMeasurer = null; } }; this.addMouseListener(ml); Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-06-07 14:42:24 UTC (rev 60) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-06-11 02:16:36 UTC (rev 61) @@ -31,6 +31,7 @@ import java.beans.PropertyChangeSupport; import java.util.LinkedList; import java.awt.Color; +import java.awt.Font; /** * @@ -42,8 +43,9 @@ private String fileName = ""; private String fileExt = ""; - private String text = ""; - private int fontSize = 10; + private String text = "XXX"; + private String font = Font.SANS_SERIF; + private int fontSize = 12; private float textBoxWidth = (float)200.0; private Color color = Color.RED; Robot robot = null; @@ -191,7 +193,9 @@ * @param text the text to set */ public void setText(String text) { + String oldText = getText(); this.text = text; + pcs.firePropertyChange("text", oldText, this.text); } /** @@ -267,4 +271,20 @@ this.color = color; } + + /** + * @return the font + */ + public String getFont() { + return font; + } + + /** + * @param font the font to set + */ + public void setFont(String font) { + String oldFont = this.getFont(); + this.font = font; + pcs.firePropertyChange("font", oldFont, this.font); + } } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-06-07 14:42:24 UTC (rev 60) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-06-11 02:16:36 UTC (rev 61) @@ -234,21 +234,27 @@ </MenuItem> <MenuItem class="javax.swing.JRadioButtonMenuItem" name="fontSerifItem"> <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="setFontSerif" methodName="setFontSerif"/> + </Property> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <ComponentRef name="fontButtonGroup"/> </Property> <Property name="font" type="java.awt.Font" resourceKey="fontSerifItem.font"/> - <Property name="selected" type="boolean" value="true"/> <Property name="text" type="java.lang.String" resourceKey="fontSerifItem.text"/> <Property name="name" type="java.lang.String" value="fontSerifItem" noResource="true"/> </Properties> </MenuItem> <MenuItem class="javax.swing.JRadioButtonMenuItem" name="fontSansSerifItem"> <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="setFontSansSerif" methodName="setFontSansSerif"/> + </Property> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <ComponentRef name="fontButtonGroup"/> </Property> <Property name="font" type="java.awt.Font" resourceKey="fontSansSerifItem.font"/> + <Property name="selected" type="boolean" value="true"/> <Property name="text" type="java.lang.String" resourceKey="fontSansSerifItem.text"/> <Property name="name" type="java.lang.String" value="fontSansSerifItem" noResource="true"/> </Properties> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-07 14:42:24 UTC (rev 60) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-11 02:16:36 UTC (rev 61) @@ -91,8 +91,8 @@ this.setDrawLineEnabled(false); this.setDrawRectangleEnabled(false); this.setDrawTextEnabled(false); - this.setColorRedEnabled(true); - this.setColorBlueEnabled(true); + // this.setColorRedEnabled(true); set with methods + // this.setColorBlueEnabled(true); set with methods // undo and redo depends on their collection status @@ -181,7 +181,7 @@ // listen for ImageTools Model to update - test 2009-03-20 itModel.pcs.addPropertyChangeListener("image", new PropertyChangeListener() { - + @Override public void propertyChange(PropertyChangeEvent propertyChangeEvent) { // DEBUG System.out.println("Model Event Caught..."); @@ -397,15 +397,17 @@ jSeparator4.setName("jSeparator4"); // NOI18N optionsMenu.add(jSeparator4); + fontSerifItem.setAction(actionMap.get("setFontSerif")); // NOI18N fontButtonGroup.add(fontSerifItem); fontSerifItem.setFont(resourceMap.getFont("fontSerifItem.font")); // NOI18N - fontSerifItem.setSelected(true); fontSerifItem.setText(resourceMap.getString("fontSerifItem.text")); // NOI18N fontSerifItem.setName("fontSerifItem"); // NOI18N optionsMenu.add(fontSerifItem); + fontSansSerifItem.setAction(actionMap.get("setFontSansSerif")); // NOI18N fontButtonGroup.add(fontSansSerifItem); fontSansSerifItem.setFont(resourceMap.getFont("fontSansSerifItem.font")); // NOI18N + fontSansSerifItem.setSelected(true); fontSansSerifItem.setText(resourceMap.getString("fontSansSerifItem.text")); // NOI18N fontSansSerifItem.setName("fontSansSerifItem"); // NOI18N optionsMenu.add(fontSansSerifItem); @@ -1325,7 +1327,7 @@ itModel.setColor(java.awt.Color.BLUE); } - private boolean colorBlueEnabled = false; + private boolean colorBlueEnabled = true; public boolean isColorBlueEnabled() { return colorBlueEnabled; } @@ -1347,7 +1349,7 @@ firePropertyChange("colorBlueSelected", old, isColorBlueSelected()); } - private boolean colorRedEnabled = false; + private boolean colorRedEnabled = true; public boolean isColorRedEnabled() { return colorRedEnabled; } @@ -1369,6 +1371,60 @@ firePropertyChange("colorRedSelected", old, isColorRedSelected()); } + @Action(enabledProperty = "fontSerifEnabled", selectedProperty = "fontSerifSelected") + public void setFontSerif() { + itModel.setFont(java.awt.Font.SERIF); + } + + private boolean fontSerifEnabled = true; + public boolean isFontSerifEnabled() { + return fontSerifEnabled; + } + + public void setFontSerifEnabled(boolean b) { + boolean old = isFontSerifEnabled(); + this.fontSerifEnabled = b; + firePropertyChange("fontSerifEnabled", old, isFontSerifEnabled()); + } + + private boolean fontSerifSelected = false; + public boolean isFontSerifSelected() { + return fontSerifSelected; + } + + public void setFontSerifSelected(boolean b) { + boolean old = isFontSerifSelected(); + this.fontSerifSelected = b; + firePropertyChange("fontSerifSelected", old, isFontSerifSelected()); + } + + @Action(enabledProperty = "fontSansSerifEnabled", selectedProperty = "fontSansSerifSelected") + public void setFontSansSerif() { + itModel.setFont(java.awt.Font.SANS_SERIF); + } + + private boolean fontSansSerifEnabled = true; + public boolean isFontSansSerifEnabled() { + return fontSansSerifEnabled; + } + + public void setFontSansSerifEnabled(boolean b) { + boolean old = isFontSansSerifEnabled(); + this.fontSansSerifEnabled = b; + firePropertyChange("fontSansSerifEnabled", old, isFontSansSerifEnabled()); + } + + private boolean fontSansSerifSelected = false; + public boolean isFontSansSerifSelected() { + return fontSansSerifSelected; + } + + public void setFontSansSerifSelected(boolean b) { + boolean old = isFontSansSerifSelected(); + this.fontSansSerifSelected = b; + firePropertyChange("fontSansSerifSelected", old, isFontSansSerifSelected()); + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton captureButton; private javax.swing.JButton closeButton; Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-06-07 14:42:24 UTC (rev 60) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-06-11 02:16:36 UTC (rev 61) @@ -147,3 +147,11 @@ setColorBlue.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png setColorBlue.Action.icon=/net/codebuilders/desktop/imagetools/resources/color_line_blue16.png setColorBlue.Action.shortDescription=Set color to Blue +fontSerif.Action.text=Serif +fontSerif.Action.shortDescription=Set font to Serif +fontSansSerif.Action.shortDescription=Set font to Sans Serif +fontSansSerif.Action.text=Sans Serif +setFontSerif.Action.text= +setFontSerif.Action.shortDescription= +setFontSansSerif.Action.shortDescription= +setFontSansSerif.Action.text= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-06-12 18:06:46
|
Revision: 62 http://imagetools.svn.sourceforge.net/imagetools/?rev=62&view=rev Author: cmarcum Date: 2009-06-12 18:06:40 +0000 (Fri, 12 Jun 2009) Log Message: ----------- ticket:7 - implemented font size changes in combo box in DrawTextBox Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/DrawTextBox.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-06-11 02:16:36 UTC (rev 61) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.form 2009-06-12 18:06:40 UTC (rev 62) @@ -33,6 +33,11 @@ <EmptySpace max="-2" attributes="0"/> <Component id="closeButton" min="-2" max="-2" attributes="0"/> </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="fontStyleBox" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="fontSizeBox" min="-2" max="-2" attributes="0"/> + </Group> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -42,9 +47,14 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="scrollPane" pref="99" max="32767" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="scrollPane" pref="83" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> + <Component id="fontSizeBox" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="fontStyleBox" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace 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"/> </Group> @@ -68,12 +78,12 @@ <Component class="javax.swing.JTextArea" name="textArea"> <Properties> <Property name="columns" type="int" value="20"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new java.awt.Font(itModel.getFontName(), java.awt.Font.PLAIN, itModel.getFontSize())" type="code"/> + </Property> <Property name="lineWrap" type="boolean" value="true"/> <Property name="rows" type="int" value="5"/> <Property name="name" type="java.lang.String" value="textArea" noResource="true"/> - <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[200, 75]"/> - </Property> </Properties> </Component> </SubComponents> @@ -84,6 +94,7 @@ <action class="net.codebuilders.desktop.imagetools.DrawTextBox" id="setText" methodName="setText"/> </Property> <Property name="text" type="java.lang.String" resourceKey="okButton.text"/> + <Property name="toolTipText" type="java.lang.String" resourceKey="okButton.toolTipText"/> <Property name="name" type="java.lang.String" value="okButton" noResource="true"/> </Properties> </Component> @@ -93,8 +104,43 @@ <action class="net.codebuilders.desktop.imagetools.DrawTextBox" id="closeDrawTextBox" methodName="closeDrawTextBox"/> </Property> <Property name="text" type="java.lang.String" resourceKey="closeButton.text"/> + <Property name="toolTipText" type="java.lang.String" resourceKey="closeButton.toolTipText"/> <Property name="name" type="java.lang.String" value="closeButton" noResource="true"/> </Properties> </Component> + <Component class="javax.swing.JComboBox" name="fontSizeBox"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="4"> + <StringItem index="0" value="10"/> + <StringItem index="1" value="12"/> + <StringItem index="2" value="14"/> + <StringItem index="3" value="16"/> + </StringArray> + </Property> + <Property name="toolTipText" type="java.lang.String" resourceKey="fontSizeBox.toolTipText"/> + <Property name="name" type="java.lang.String" value="fontSizeBox" noResource="true"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fontSizeBoxActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JComboBox" name="fontStyleBox"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="2"> + <StringItem index="0" value="SansSerif"/> + <StringItem index="1" value="Serif"/> + </StringArray> + </Property> + <Property name="toolTipText" type="java.lang.String" resourceKey="fontStyleBox.toolTipText"/> + <Property name="name" type="java.lang.String" value="fontStyleBox" noResource="true"/> + </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="fontStyleBoxItemStateChanged"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fontStyleBoxActionPerformed"/> + <EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="fontStyleBoxPropertyChange"/> + </Events> + </Component> </SubComponents> </Form> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-06-11 02:16:36 UTC (rev 61) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/DrawTextBox.java 2009-06-12 18:06:40 UTC (rev 62) @@ -24,27 +24,36 @@ * * Created on Mar 2, 2009, 5:38:07 PM */ - package net.codebuilders.desktop.imagetools; -import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionListener; +import java.awt.event.ItemListener; +import java.beans.PropertyChangeListener; import org.jdesktop.application.Action; /** * * @author carl */ -public class DrawTextBox extends javax.swing.JDialog { +public class DrawTextBox extends javax.swing.JDialog implements ItemListener, ActionListener, PropertyChangeListener { /** Creates new form DrawTextBox */ public DrawTextBox(java.awt.Frame parent) { super(parent); + itModel = ImageToolsApp.getApplication().getItModel(); initComponents(); getRootPane().setDefaultButton(closeButton); + // itModel = ImageToolsApp.getApplication().getItModel(); + // set from model + this.fontStyleBox.setSelectedItem(itModel.getFontName()); + // set from model + this.fontSizeBox.setSelectedItem(Integer.toString(itModel.getFontSize())); } - @Action public void closeDrawTextBox() { + @Action + public void closeDrawTextBox() { dispose(); } @@ -61,6 +70,8 @@ textArea = new javax.swing.JTextArea(); okButton = new javax.swing.JButton(); closeButton = new javax.swing.JButton(); + fontSizeBox = new javax.swing.JComboBox(); + fontStyleBox = new javax.swing.JComboBox(); 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); @@ -71,21 +82,35 @@ scrollPane.setName("scrollPane"); // NOI18N textArea.setColumns(20); + textArea.setFont(new java.awt.Font(itModel.getFontName(), java.awt.Font.PLAIN, itModel.getFontSize())); textArea.setLineWrap(true); textArea.setRows(5); textArea.setName("textArea"); // NOI18N - textArea.setPreferredSize(new java.awt.Dimension(200, 75)); scrollPane.setViewportView(textArea); 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 okButton.setText(resourceMap.getString("okButton.text")); // NOI18N + okButton.setToolTipText(resourceMap.getString("okButton.toolTipText")); // NOI18N okButton.setName("okButton"); // NOI18N closeButton.setAction(actionMap.get("closeDrawTextBox")); // NOI18N closeButton.setText(resourceMap.getString("closeButton.text")); // NOI18N + closeButton.setToolTipText(resourceMap.getString("closeButton.toolTipText")); // NOI18N closeButton.setName("closeButton"); // NOI18N + fontSizeBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "10", "12", "14", "16" })); + fontSizeBox.setToolTipText(resourceMap.getString("fontSizeBox.toolTipText")); // NOI18N + fontSizeBox.setName("fontSizeBox"); // NOI18N + fontSizeBox.addActionListener(this); + + fontStyleBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SansSerif", "Serif" })); + fontStyleBox.setToolTipText(resourceMap.getString("fontStyleBox.toolTipText")); // NOI18N + fontStyleBox.setName("fontStyleBox"); // NOI18N + fontStyleBox.addItemListener(this); + fontStyleBox.addActionListener(this); + fontStyleBox.addPropertyChangeListener(this); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -97,45 +122,100 @@ .addGroup(layout.createSequentialGroup() .addComponent(okButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(closeButton))) + .addComponent(closeButton)) + .addGroup(layout.createSequentialGroup() + .addComponent(fontStyleBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(fontSizeBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() - .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) - .addGap(18, 18, 18) + .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(fontSizeBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(fontStyleBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(closeButton) .addComponent(okButton)) .addContainerGap()) ); pack(); + } + + // Code for dispatching events from components to event handlers. + + public void actionPerformed(java.awt.event.ActionEvent evt) { + if (evt.getSource() == fontSizeBox) { + DrawTextBox.this.fontSizeBoxActionPerformed(evt); + } + else if (evt.getSource() == fontStyleBox) { + DrawTextBox.this.fontStyleBoxActionPerformed(evt); + } + } + + public void itemStateChanged(java.awt.event.ItemEvent evt) { + if (evt.getSource() == fontStyleBox) { + DrawTextBox.this.fontStyleBoxItemStateChanged(evt); + } + } + + public void propertyChange(java.beans.PropertyChangeEvent evt) { + if (evt.getSource() == fontStyleBox) { + DrawTextBox.this.fontStyleBoxPropertyChange(evt); + } }// </editor-fold>//GEN-END:initComponents + private void fontStyleBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_fontStyleBoxItemStateChanged + // TODO delete this method + }//GEN-LAST:event_fontStyleBoxItemStateChanged + private void fontStyleBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fontStyleBoxActionPerformed + javax.swing.JComboBox cb = (javax.swing.JComboBox) evt.getSource(); + String style = (String)cb.getSelectedItem(); + itModel.setFontName(style); + textArea.setFont(new Font(itModel.getFontName(), Font.PLAIN, itModel.getFontSize())); + }//GEN-LAST:event_fontStyleBoxActionPerformed + + private void fontSizeBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fontSizeBoxActionPerformed + + javax.swing.JComboBox cb = (javax.swing.JComboBox) evt.getSource(); + String height = (String)cb.getSelectedItem(); + itModel.setFontSize(Integer.parseInt(height)); + textArea.setFont(new Font(itModel.getFontName(), Font.PLAIN, itModel.getFontSize())); + }//GEN-LAST:event_fontSizeBoxActionPerformed + + private void fontStyleBoxPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_fontStyleBoxPropertyChange + // TODO delete this method + }//GEN-LAST:event_fontStyleBoxPropertyChange + @Action public void setText() { - ImageToolsModel itModel = ImageToolsApp.getApplication().getItModel(); + itModel = ImageToolsApp.getApplication().getItModel(); // itModel.setText("text goes here"); itModel.setText(this.textArea.getText()); // set the current width to the model - itModel.setTextBoxWidth((float)this.textArea.getWidth()); + itModel.setTextBoxWidth((float) this.textArea.getWidth()); // dispose of box closeDrawTextBox(); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton closeButton; + private javax.swing.JComboBox fontSizeBox; + private javax.swing.JComboBox fontStyleBox; private javax.swing.JButton okButton; private javax.swing.JScrollPane scrollPane; private javax.swing.JTextArea textArea; // End of variables declaration//GEN-END:variables + + ImageToolsModel itModel; - // ImageToolsModel itModel; - } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-11 02:16:36 UTC (rev 61) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageArea.java 2009-06-12 18:06:40 UTC (rev 62) @@ -155,25 +155,37 @@ map = new Hashtable<TextAttribute, Object>(); // get textFont value from model - map.put(TextAttribute.FAMILY, itModel.getFont()); + map.put(TextAttribute.FAMILY, itModel.getFontName()); // get text height value from model map.put(TextAttribute.SIZE, new Float(itModel.getFontSize())); // make a new attributed string attStr = new AttributedString(itModel.getText(), map); - // listen for ImageTools Model to update textFont - itModel.pcs.addPropertyChangeListener("font", new PropertyChangeListener() { + // listen for ImageTools Model to update fontName + itModel.pcs.addPropertyChangeListener("fontName", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent propertyChangeEvent) { // update map - map.put(TextAttribute.FAMILY, itModel.getFont()); + map.put(TextAttribute.FAMILY, itModel.getFontName()); // make a new attributed string attStr = new AttributedString(itModel.getText(), map); } }); - // listen for ImageTools Model to update Text + // listen for ImageTools Model to update fontSize + itModel.pcs.addPropertyChangeListener("fontSize", new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent propertyChangeEvent) { + // update map + map.put(TextAttribute.SIZE, itModel.getFontSize()); + // make a new attributed string + attStr = new AttributedString(itModel.getText(), map); + } + }); + + // listen for ImageTools Model to update text itModel.pcs.addPropertyChangeListener("text", new PropertyChangeListener() { @Override Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-06-11 02:16:36 UTC (rev 61) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsModel.java 2009-06-12 18:06:40 UTC (rev 62) @@ -44,8 +44,8 @@ private String fileExt = ""; private String text = "XXX"; - private String font = Font.SANS_SERIF; - private int fontSize = 12; + private String fontName = Font.SANS_SERIF; // "SansSerif" + private int fontSize = 14; private float textBoxWidth = (float)200.0; private Color color = Color.RED; Robot robot = null; @@ -209,7 +209,9 @@ * @param fontSize the fontSize to set */ public void setFontSize(int fontSize) { + int oldSize = this.getFontSize(); this.fontSize = fontSize; + pcs.firePropertyChange("fontSize", oldSize, fontSize); } public void undo() { @@ -273,18 +275,18 @@ } /** - * @return the font + * @return the fontName */ - public String getFont() { - return font; + public String getFontName() { + return fontName; } /** - * @param font the font to set + * @param fontName the fontName to set */ - public void setFont(String font) { - String oldFont = this.getFont(); - this.font = font; - pcs.firePropertyChange("font", oldFont, this.font); + public void setFontName(String fontName) { + String oldFontName = this.getFontName(); + this.fontName = fontName; + pcs.firePropertyChange("fontName", oldFontName, this.fontName); } } Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-11 02:16:36 UTC (rev 61) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-06-12 18:06:40 UTC (rev 62) @@ -1373,7 +1373,7 @@ @Action(enabledProperty = "fontSerifEnabled", selectedProperty = "fontSerifSelected") public void setFontSerif() { - itModel.setFont(java.awt.Font.SERIF); + itModel.setFontName(java.awt.Font.SERIF); } private boolean fontSerifEnabled = true; @@ -1400,7 +1400,7 @@ @Action(enabledProperty = "fontSansSerifEnabled", selectedProperty = "fontSansSerifSelected") public void setFontSansSerif() { - itModel.setFont(java.awt.Font.SANS_SERIF); + itModel.setFontName(java.awt.Font.SANS_SERIF); } private boolean fontSansSerifEnabled = true; Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/DrawTextBox.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/DrawTextBox.properties 2009-06-11 02:16:36 UTC (rev 61) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/DrawTextBox.properties 2009-06-12 18:06:40 UTC (rev 62) @@ -11,3 +11,7 @@ closeDrawTextBox.Action.icon=/net/codebuilders/desktop/imagetools/resources/button_cancel16.png closeDrawTextBox.Action.shortDescription= closeDrawTextBox.Action.text= +fontStyleBox.toolTipText=Font style +fontSizeBox.toolTipText=Font size +okButton.toolTipText=Continue to place text +closeButton.toolTipText=Cancel text This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-07-26 13:09:13
|
Revision: 75 http://imagetools.svn.sourceforge.net/imagetools/?rev=75&view=rev Author: cmarcum Date: 2009-07-26 13:09:04 +0000 (Sun, 26 Jul 2009) Log Message: ----------- ticket:12 - implemented printing Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java Added Paths: ----------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ComponentPrintable.java Added: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ComponentPrintable.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ComponentPrintable.java (rev 0) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ComponentPrintable.java 2009-07-26 13:09:04 UTC (rev 75) @@ -0,0 +1,55 @@ +/* + * Code from: + * http://www.java2s.com/Code/Java/2D-Graphics-GUI/PrintSwingcomponents.htm + */ + +package net.codebuilders.desktop.imagetools; + +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import javax.swing.JComponent; + +/** + * + * @author carl + */ +class ComponentPrintable implements Printable { + + private Component mComponent; + + public ComponentPrintable(Component c) { + mComponent = c; + } + + @Override + public int print(Graphics g, PageFormat pageFormat, int pageIndex) { + if (pageIndex > 0) { + return NO_SUCH_PAGE; + } + Graphics2D g2 = (Graphics2D) g; + g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); + boolean wasBuffered = disableDoubleBuffering(mComponent); + mComponent.paint(g2); + restoreDoubleBuffering(mComponent, wasBuffered); + return PAGE_EXISTS; + } + + private boolean disableDoubleBuffering(Component c) { + if (c instanceof JComponent == false) { + return false; + } + JComponent jc = (JComponent) c; + boolean wasBuffered = jc.isDoubleBuffered(); + jc.setDoubleBuffered(false); + return wasBuffered; + } + + private void restoreDoubleBuffering(Component c, boolean wasBuffered) { + if (c instanceof JComponent) { + ((JComponent) c).setDoubleBuffered(wasBuffered); + } + } +} \ No newline at end of file Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-07-25 14:21:26 UTC (rev 74) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-07-26 13:09:04 UTC (rev 75) @@ -38,6 +38,9 @@ import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; +import java.awt.print.PageFormat; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; @@ -49,6 +52,7 @@ import javax.imageio.ImageWriter; import javax.imageio.stream.FileImageInputStream; import javax.imageio.stream.ImageOutputStream; +import javax.print.attribute.HashPrintRequestAttributeSet; import javax.swing.Timer; import javax.swing.Icon; import javax.swing.JDialog; @@ -181,6 +185,7 @@ // listen for ImageTools Model to update - test 2009-03-20 itModel.pcs.addPropertyChangeListener("image", new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent propertyChangeEvent) { // DEBUG @@ -1067,8 +1072,36 @@ } @Action - public void filePrint() { - // TODO filePrint method + public void filePrint() throws PrinterException { + + + + ComponentPrintable cp = new ComponentPrintable(imageArea); + + // Graphics g = this.imageArea.getGraphics(); + PageFormat pf = new PageFormat(); + + HashPrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet(); + + PrinterJob job = PrinterJob.getPrinterJob(); + + // pf = job.pageDialog(pf); + + boolean ok = job.printDialog(attributes); + + pf = job.getPageFormat(attributes); + + if (ok) { + try { + job.setPrintable(cp, pf); + job.print(attributes); + } catch (PrinterException ex) { + /* The job did not successfully complete */ + Logger logger = Logger.getLogger(ImageToolsView.class.getName()); + logger.log(Level.SEVERE, null, ex); + showError("The print job did not complete " + ex); + } + } } @Action(enabledProperty = "testActionEnabled", selectedProperty = "testActionSelected") @@ -1317,17 +1350,18 @@ firePropertyChange("cropSelected", old, isCropSelected()); } - @Action(enabledProperty = "colorRedEnabled", selectedProperty = "colorRedSelected") + @Action(enabledProperty = "colorRedEnabled", selectedProperty = "colorRedSelected") public void setColorRed() { - itModel.setColor(java.awt.Color.RED); + itModel.setColor(java.awt.Color.RED); } @Action(enabledProperty = "colorBlueEnabled", selectedProperty = "colorBlueSelected") public void setColorBlue() { - itModel.setColor(java.awt.Color.BLUE); + itModel.setColor(java.awt.Color.BLUE); } private boolean colorBlueEnabled = true; + public boolean isColorBlueEnabled() { return colorBlueEnabled; } @@ -1339,6 +1373,7 @@ } private boolean colorBlueSelected = false; + public boolean isColorBlueSelected() { return colorBlueSelected; } @@ -1350,6 +1385,7 @@ } private boolean colorRedEnabled = true; + public boolean isColorRedEnabled() { return colorRedEnabled; } @@ -1361,6 +1397,7 @@ } private boolean colorRedSelected = false; + public boolean isColorRedSelected() { return colorRedSelected; } @@ -1371,12 +1408,13 @@ firePropertyChange("colorRedSelected", old, isColorRedSelected()); } - @Action(enabledProperty = "fontSerifEnabled", selectedProperty = "fontSerifSelected") + @Action(enabledProperty = "fontSerifEnabled", selectedProperty = "fontSerifSelected") public void setFontSerif() { itModel.setFontName(java.awt.Font.SERIF); } private boolean fontSerifEnabled = true; + public boolean isFontSerifEnabled() { return fontSerifEnabled; } @@ -1388,6 +1426,7 @@ } private boolean fontSerifSelected = false; + public boolean isFontSerifSelected() { return fontSerifSelected; } @@ -1398,12 +1437,13 @@ firePropertyChange("fontSerifSelected", old, isFontSerifSelected()); } - @Action(enabledProperty = "fontSansSerifEnabled", selectedProperty = "fontSansSerifSelected") + @Action(enabledProperty = "fontSansSerifEnabled", selectedProperty = "fontSansSerifSelected") public void setFontSansSerif() { itModel.setFontName(java.awt.Font.SANS_SERIF); } private boolean fontSansSerifEnabled = true; + public boolean isFontSansSerifEnabled() { return fontSansSerifEnabled; } @@ -1415,6 +1455,7 @@ } private boolean fontSansSerifSelected = false; + public boolean isFontSansSerifSelected() { return fontSansSerifSelected; } @@ -1424,7 +1465,7 @@ this.fontSansSerifSelected = b; firePropertyChange("fontSansSerifSelected", old, isFontSansSerifSelected()); } - + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton captureButton; private javax.swing.JButton closeButton; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-07-30 20:25:38
|
Revision: 83 http://imagetools.svn.sourceforge.net/imagetools/?rev=83&view=rev Author: cmarcum Date: 2009-07-30 20:25:21 +0000 (Thu, 30 Jul 2009) Log Message: ----------- added print button to toolbar and enabled status to methods Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-07-29 02:34:18 UTC (rev 82) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-07-30 20:25:21 UTC (rev 83) @@ -16,7 +16,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="28" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -305,11 +305,11 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="statusPanelSeparator" alignment="0" pref="428" max="32767" attributes="0"/> + <Component id="statusPanelSeparator" alignment="0" pref="444" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="statusMessageLabel" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="187" max="32767" attributes="0"/> + <EmptySpace pref="203" max="32767" attributes="0"/> <Component id="progressBar" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="statusAnimationLabel" min="-2" max="-2" attributes="0"/> @@ -405,6 +405,18 @@ <Property name="verticalTextPosition" type="int" value="3"/> </Properties> </Component> + <Component class="javax.swing.JButton" name="printButton"> + <Properties> + <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor"> + <action class="net.codebuilders.desktop.imagetools.ImageToolsView" id="filePrint" methodName="filePrint"/> + </Property> + <Property name="text" type="java.lang.String" resourceKey="printButton.text"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="horizontalTextPosition" type="int" value="0"/> + <Property name="name" type="java.lang.String" value="printButton" noResource="true"/> + <Property name="verticalTextPosition" type="int" value="3"/> + </Properties> + </Component> <Component class="javax.swing.JToolBar$Separator" name="jSeparator1"> <Properties> <Property name="name" type="java.lang.String" value="jSeparator1" noResource="true"/> @@ -552,6 +564,6 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-94,0,0,1,-84"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-104,0,0,1,-68"/> </AuxValues> </Form> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-07-29 02:34:18 UTC (rev 82) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-07-30 20:25:21 UTC (rev 83) @@ -262,6 +262,7 @@ openButton = new javax.swing.JButton(); saveButton = new javax.swing.JButton(); closeButton = new javax.swing.JButton(); + printButton = new javax.swing.JButton(); jSeparator1 = new javax.swing.JToolBar.Separator(); undoButton = new javax.swing.JButton(); redoButton = new javax.swing.JButton(); @@ -292,7 +293,7 @@ .addGroup(mainPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(28, Short.MAX_VALUE)) ); mainPanelLayout.setVerticalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -450,11 +451,11 @@ statusPanel.setLayout(statusPanelLayout); statusPanelLayout.setHorizontalGroup( statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE) + .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 444, Short.MAX_VALUE) .addGroup(statusPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(statusMessageLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 187, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 203, Short.MAX_VALUE) .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(statusAnimationLabel) @@ -499,6 +500,14 @@ closeButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); toolBar.add(closeButton); + printButton.setAction(actionMap.get("filePrint")); // NOI18N + printButton.setText(resourceMap.getString("printButton.text")); // NOI18N + printButton.setFocusable(false); + printButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + printButton.setName("printButton"); // NOI18N + printButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + toolBar.add(printButton); + jSeparator1.setName("jSeparator1"); // NOI18N toolBar.add(jSeparator1); @@ -648,6 +657,7 @@ this.setFileOpenEnabled(false); this.setFileSaveEnabled(true); this.setFileCloseEnabled(true); + this.setFilePrintEnabled(true); this.setCaptureEnabled(false); this.setCropEnabled(true); this.setDrawLineEnabled(true); @@ -1020,6 +1030,7 @@ this.setFileOpenEnabled(false); this.setFileSaveEnabled(true); this.setFileCloseEnabled(true); + this.setFilePrintEnabled(true); this.setCaptureEnabled(false); this.setCropEnabled(true); this.setDrawLineEnabled(true); @@ -1056,6 +1067,7 @@ this.setFileOpenEnabled(true); this.setFileSaveEnabled(false); this.setFileCloseEnabled(false); + this.setFilePrintEnabled(false); this.setCaptureEnabled(true); this.setCropEnabled(false); this.setDrawLineEnabled(false); @@ -1071,7 +1083,7 @@ } - @Action + @Action(enabledProperty = "filePrintEnabled", selectedProperty = "filePrintSelected") public void filePrint() throws PrinterException { @@ -1466,6 +1478,28 @@ firePropertyChange("fontSansSerifSelected", old, isFontSansSerifSelected()); } + private boolean filePrintEnabled = false; + public boolean isFilePrintEnabled() { + return filePrintEnabled; + } + + public void setFilePrintEnabled(boolean b) { + boolean old = isFilePrintEnabled(); + this.filePrintEnabled = b; + firePropertyChange("filePrintEnabled", old, isFilePrintEnabled()); + } + + private boolean filePrintSelected = false; + public boolean isFilePrintSelected() { + return filePrintSelected; + } + + public void setFilePrintSelected(boolean b) { + boolean old = isFilePrintSelected(); + this.filePrintSelected = b; + firePropertyChange("filePrintSelected", old, isFilePrintSelected()); + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton captureButton; private javax.swing.JButton closeButton; @@ -1501,6 +1535,7 @@ private javax.swing.JMenuBar menuBar; private javax.swing.JButton openButton; private javax.swing.JMenu optionsMenu; + private javax.swing.JButton printButton; private javax.swing.JProgressBar progressBar; private javax.swing.JToggleButton rectangleButton; private javax.swing.JButton redoButton; Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-07-29 02:34:18 UTC (rev 82) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/resources/ImageToolsView.properties 2009-07-30 20:25:21 UTC (rev 83) @@ -112,7 +112,6 @@ showUsingBox.Action.icon=/net/codebuilders/desktop/imagetools/resources/help16.png showUsingBox.Action.largeIcon=/net/codebuilders/desktop/imagetools/resources/help24.png showUsingBox.Action.smallIcon=/net/codebuilders/desktop/imagetools/resources/help16.png -jButton1.text=jButton1 testAction.Action.shortDescription= testAction.Action.text= rectangleButton.text= @@ -155,3 +154,5 @@ setFontSerif.Action.shortDescription= setFontSansSerif.Action.shortDescription= setFontSansSerif.Action.text= +filePrint.Action.accelerator=ctrl pressed P +printButton.text= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cm...@us...> - 2009-07-30 20:39:17
|
Revision: 84 http://imagetools.svn.sourceforge.net/imagetools/?rev=84&view=rev Author: cmarcum Date: 2009-07-30 20:39:11 +0000 (Thu, 30 Jul 2009) Log Message: ----------- reduced prefered size of main panel to 300 in Y direction because it was starting off tob big Modified Paths: -------------- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-07-30 20:25:21 UTC (rev 83) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.form 2009-07-30 20:39:11 UTC (rev 84) @@ -6,7 +6,7 @@ <Properties> <Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[425, 350]"/> + <Dimension value="[425, 300]"/> </Property> </Properties> @@ -14,17 +14,16 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="28" max="32767" attributes="0"/> + <EmptySpace pref="20" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" pref="310" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/> </Group> </Group> @@ -564,6 +563,6 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-104,0,0,1,-68"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-117,0,0,1,-68"/> </AuxValues> </Form> Modified: trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java =================================================================== --- trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-07-30 20:25:21 UTC (rev 83) +++ trunk/imagetools/src/net/codebuilders/desktop/imagetools/ImageToolsView.java 2009-07-30 20:39:11 UTC (rev 84) @@ -278,7 +278,7 @@ fontButtonGroup = new javax.swing.ButtonGroup(); mainPanel.setName("mainPanel"); // NOI18N - mainPanel.setPreferredSize(new java.awt.Dimension(425, 350)); + mainPanel.setPreferredSize(new java.awt.Dimension(425, 300)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(net.codebuilders.desktop.imagetools.ImageToolsApp.class).getContext().getResourceMap(ImageToolsView.class); @@ -291,15 +291,14 @@ mainPanelLayout.setHorizontalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() - .addContainerGap() + .addGap(20, 20, 20) .addComponent(jLabel1) - .addContainerGap(28, Short.MAX_VALUE)) + .addContainerGap(20, Short.MAX_VALUE)) ); mainPanelLayout.setVerticalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |