japi-cvs Mailing List for JAPI (Page 56)
Status: Beta
Brought to you by:
christianhujer
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(115) |
May
(11) |
Jun
(5) |
Jul
(2) |
Aug
(10) |
Sep
(35) |
Oct
(14) |
Nov
(49) |
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(57) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(25) |
Jun
(134) |
Jul
(76) |
Aug
(34) |
Sep
(27) |
Oct
(5) |
Nov
|
Dec
(1) |
2008 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(63) |
Nov
(30) |
Dec
(43) |
2009 |
Jan
(10) |
Feb
(420) |
Mar
(67) |
Apr
(3) |
May
(61) |
Jun
(21) |
Jul
(19) |
Aug
|
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
(7) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <chr...@us...> - 2006-04-10 21:29:08
|
Revision: 33 Author: christianhujer Date: 2006-04-10 14:28:57 -0700 (Mon, 10 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=33&view=rev Log Message: ----------- Fixed package statement Modified Paths: -------------- trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java Modified: trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java =================================================================== --- trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java 2006-04-10 21:21:05 UTC (rev 32) +++ trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java 2006-04-10 21:28:57 UTC (rev 33) @@ -1,10 +1,31 @@ -package net.sf.japi.util.finance; +/* JAPI - (Yet another (hopefully) useful) Java API + * + * Copyright (C) 2004-2006 Christian Hujer + * + * This program 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 2 of the + * License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + + +package test.net.sf.japi.util.finance; /** Tests the capital finance class. * Date: 09.04.2006 - * + * */ -import junit.framework.*; +import junit.framework.TestCase; import net.sf.japi.util.finance.InterestCalculator; public class InterestCalculatorTest extends TestCase { @@ -15,7 +36,7 @@ } /** Tests capital after 0, 1, 2 , 3 years. - * + * * @throws Exception */ public void testCalculateCapital() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z0...@us...> - 2006-04-10 21:21:14
|
Revision: 32 Author: z0ra Date: 2006-04-10 14:21:05 -0700 (Mon, 10 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=32&view=rev Log Message: ----------- Changed directory of test finance Added Paths: ----------- trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java Added: trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java =================================================================== --- trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java (rev 0) +++ trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java 2006-04-10 21:21:05 UTC (rev 32) @@ -0,0 +1,68 @@ +package net.sf.japi.util.finance; +/** Tests the capital finance class. + * Date: 09.04.2006 + * + */ + +import junit.framework.*; +import net.sf.japi.util.finance.InterestCalculator; + +public class InterestCalculatorTest extends TestCase { + InterestCalculator ic = new InterestCalculator(100, 15); + + public void testInterestCalculator() throws Exception { + //ic = new InterestCalculator(100, 15); + } + + /** Tests capital after 0, 1, 2 , 3 years. + * + * @throws Exception + */ + public void testCalculateCapital() throws Exception { + //ic = new InterestCalculator(100, 15); + + + /* first try it with invalid argument */ + try { + ic.calculateCapital(-1); + fail("Expected IllegalArgumentException."); + } catch (final IllegalArgumentException ignore) { + /* ignore */ + } + /* then use some different periods */ + assertEquals( (float)100.0 , ic.calculateCapital( 0 ) ); + assertEquals( (float)115.0 , ic.calculateCapital( 1 ) ); + assertEquals( (float)132.25 , ic.calculateCapital( 2 ) ); + assertEquals( (float)152.0875, ic.calculateCapital( 3 ) ); + } + + public void testGetCurrentCapital() throws Exception { + assertEquals( (float)100.00, ic.getCurrentCapital() ); + ic.calculateCapital(1); + assertEquals( (float)115.00, ic.getCurrentCapital() ); + } + + public void testSetCurrentCapital() throws Exception { + assertEquals( (float)100.00, ic.getCurrentCapital() ); + ic.calculateCapital(1); + assertEquals( (float)115.00, ic.getCurrentCapital() ); + ic.setCurrentCapital((float)100.00); + assertEquals( (float)100.00, ic.getCurrentCapital() ); + } + + public void testGetInterestRate() throws Exception { + assertEquals( (float)15, ic.getInterestRate() ); + } + + public void testSetInterestRate() throws Exception { + ic.setInterestRate(16); + assertEquals( (float)16, ic.getInterestRate() ); + } + + public void testResetCapital() throws Exception { + ic.calculateCapital(1); + assertEquals( (float)115, ic.getCurrentCapital() ); + ic.resetCapital(); + assertEquals( (float)100, ic.getCurrentCapital() ); + } +} \ No newline at end of file Property changes on: trunk/src/test/net/sf/japi/util/finance/InterestCalculatorTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z0...@us...> - 2006-04-10 21:16:21
|
Revision: 31 Author: z0ra Date: 2006-04-10 14:16:03 -0700 (Mon, 10 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=31&view=rev Log Message: ----------- Changed directory of test finance Added Paths: ----------- trunk/src/test/net/sf/japi/util/finance/ Removed Paths: ------------- trunk/src/app/net/sf/japi/util/finance/test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z0...@us...> - 2006-04-10 20:09:42
|
Revision: 30 Author: z0ra Date: 2006-04-10 13:09:26 -0700 (Mon, 10 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=30&view=rev Log Message: ----------- Added new class for some more or less usefull financial calculation. Added Paths: ----------- trunk/src/app/net/sf/japi/util/finance/ trunk/src/app/net/sf/japi/util/finance/InterestCalculator.java trunk/src/app/net/sf/japi/util/finance/test/ trunk/src/app/net/sf/japi/util/finance/test/InterestCalculatorTest.java Added: trunk/src/app/net/sf/japi/util/finance/InterestCalculator.java =================================================================== --- trunk/src/app/net/sf/japi/util/finance/InterestCalculator.java (rev 0) +++ trunk/src/app/net/sf/japi/util/finance/InterestCalculator.java 2006-04-10 20:09:26 UTC (rev 30) @@ -0,0 +1,75 @@ +package net.sf.japi.util.finance; + +/** Class contains some functionality for calculating capital after some periods of time. + * + * @author <a href=mailto:miz...@we...>A. Heim</a> + * + */ +public class InterestCalculator { + + private final float initialCapital; + private float interestRate; + private float currentCapital; + + public InterestCalculator(final float initialCapital, final float interestRate) { + this.initialCapital = initialCapital; + this.interestRate = interestRate; + this.currentCapital = this.initialCapital; + } + + /** Calculates the overall capital after some periods beginnig with given initial capital and interest rate. + * <br />The formula is: <code>capital_after_n_periods = start_captial * ( 1 + p/100 )^n</code> + * (with p as interest rate) + * @param numberOfPeriods + * @return the overall capital after numberOfPeriods periods + */ + public float calculateCapital( int numberOfPeriods ) { + if ( numberOfPeriods < 0 ) throw new IllegalArgumentException("Number of periods has to be at least 1!"); + if ( numberOfPeriods == 0 ) + return initialCapital; + if( numberOfPeriods == 1 ) { + currentCapital = currentCapital *(1 + interestRate/100); + } else { + currentCapital = calculateCapital( numberOfPeriods - 1 ); + } + return currentCapital; + } + + /** Returns the current capital. + * + * @return current capital + */ + public float getCurrentCapital() { + return currentCapital; + } + + /** Sets new current capital. + * + * @param currentCapital + */ + public void setCurrentCapital(float currentCapital) { + this.currentCapital = currentCapital; + } + /** Sets new interest rate. + * + * @param interestRate + */ + public void setInterestRate(float interestRate) { + this.interestRate = interestRate; + } + + /** Returns the current interest rate. + * + * @return the current interest rate + */ + public float getInterestRate() { + return interestRate; + } + + /** Resets the current capital to initial capital. + * + */ + public void resetCapital() { + this.currentCapital = this.initialCapital; + } +} Property changes on: trunk/src/app/net/sf/japi/util/finance/InterestCalculator.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/japi/util/finance/test/InterestCalculatorTest.java =================================================================== --- trunk/src/app/net/sf/japi/util/finance/test/InterestCalculatorTest.java (rev 0) +++ trunk/src/app/net/sf/japi/util/finance/test/InterestCalculatorTest.java 2006-04-10 20:09:26 UTC (rev 30) @@ -0,0 +1,68 @@ +package net.sf.japi.util.finance.test; +/** Tests the capital finance class. + * Date: 09.04.2006 + * + */ + +import junit.framework.*; +import net.sf.japi.util.finance.InterestCalculator; + +public class InterestCalculatorTest extends TestCase { + InterestCalculator ic = new InterestCalculator(100, 15); + + public void testInterestCalculator() throws Exception { + //ic = new InterestCalculator(100, 15); + } + + /** Tests capital after 0, 1, 2 , 3 years. + * + * @throws Exception + */ + public void testCalculateCapital() throws Exception { + //ic = new InterestCalculator(100, 15); + + + /* first try it with invalid argument */ + try { + ic.calculateCapital(-1); + fail("Expected IllegalArgumentException."); + } catch (final IllegalArgumentException ignore) { + /* ignore */ + } + /* then use some different periods */ + assertEquals( (float)100.0 , ic.calculateCapital( 0 ) ); + assertEquals( (float)115.0 , ic.calculateCapital( 1 ) ); + assertEquals( (float)132.25 , ic.calculateCapital( 2 ) ); + assertEquals( (float)152.0875, ic.calculateCapital( 3 ) ); + } + + public void testGetCurrentCapital() throws Exception { + assertEquals( (float)100.00, ic.getCurrentCapital() ); + ic.calculateCapital(1); + assertEquals( (float)115.00, ic.getCurrentCapital() ); + } + + public void testSetCurrentCapital() throws Exception { + assertEquals( (float)100.00, ic.getCurrentCapital() ); + ic.calculateCapital(1); + assertEquals( (float)115.00, ic.getCurrentCapital() ); + ic.setCurrentCapital((float)100.00); + assertEquals( (float)100.00, ic.getCurrentCapital() ); + } + + public void testGetInterestRate() throws Exception { + assertEquals( (float)15, ic.getInterestRate() ); + } + + public void testSetInterestRate() throws Exception { + ic.setInterestRate(16); + assertEquals( (float)16, ic.getInterestRate() ); + } + + public void testResetCapital() throws Exception { + ic.calculateCapital(1); + assertEquals( (float)115, ic.getCurrentCapital() ); + ic.resetCapital(); + assertEquals( (float)100, ic.getCurrentCapital() ); + } +} \ No newline at end of file Property changes on: trunk/src/app/net/sf/japi/util/finance/test/InterestCalculatorTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-09 00:33:52
|
Revision: 29 Author: christianhujer Date: 2006-04-08 17:33:45 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=29&view=rev Log Message: ----------- Added little wget utility. Added Paths: ----------- trunk/tools/jwget/ trunk/tools/jwget/JWGet.java Added: trunk/tools/jwget/JWGet.java =================================================================== --- trunk/tools/jwget/JWGet.java (rev 0) +++ trunk/tools/jwget/JWGet.java 2006-04-09 00:33:45 UTC (rev 29) @@ -0,0 +1,53 @@ + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +/** WGet implementation in Java. + */ +public class JWGet { + + /** Main program. + * @param args command line arguments + */ + public static void main(final String... args) { + int returnCode = 0; + if (args.length == 0) { + System.err.println("Usage: JWGet url..."); + returnCode++; + } + final byte[] buf = new byte[8192]; + for (final String arg : args) { + try { + final URL url = new URL(arg); + OutputStream out = null; + InputStream in = null; + try { + final URLConnection con = url.openConnection(); + in = con.getInputStream(); + final String location = con.getHeaderField("Content-Location"); + final String outputFilename = new File((location != null ? new URL(url, location) : url).getFile()).getName(); + System.err.println(outputFilename); + out = new FileOutputStream(outputFilename); + for (int bytesRead; (bytesRead = in.read(buf)) != -1; out.write(buf, 0, bytesRead)); + } catch (final IOException e) { + System.err.println(e); + returnCode++; + } finally { + try { in.close(); } catch (final Exception ignore) { /* ignore */ } + try { out.close(); } catch (final Exception ignore) { /* ignore */ } + } + } catch (final MalformedURLException e) { + System.err.println(e); + returnCode++; + } + } + System.exit(returnCode); + } + +} // class JWGet Property changes on: trunk/tools/jwget/JWGet.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-08 19:31:46
|
Revision: 28 Author: christianhujer Date: 2006-04-08 12:31:37 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=28&view=rev Log Message: ----------- Removed unused property. Modified Paths: -------------- trunk/project.properties Modified: trunk/project.properties =================================================================== --- trunk/project.properties 2006-04-08 19:27:12 UTC (rev 27) +++ trunk/project.properties 2006-04-08 19:31:37 UTC (rev 28) @@ -2,5 +2,4 @@ project.version.minor=9 project.version.patch=0 project.version=${project.version.major}.${project.version.minor}.${project.version.patch} -project.tag=${project.version.major}_${project.version.minor}_${project.version.patch} project.focus=majorEnhancements This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-08 19:27:27
|
Revision: 27 Author: christianhujer Date: 2006-04-08 12:27:12 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=27&view=rev Log Message: ----------- Fixed bogus property. Modified Paths: -------------- trunk/src/doc/releasePlan.xhtml Property Changed: ---------------- trunk/src/doc/releasePlan.xhtml Modified: trunk/src/doc/releasePlan.xhtml =================================================================== --- trunk/src/doc/releasePlan.xhtml 2006-04-08 19:25:08 UTC (rev 26) +++ trunk/src/doc/releasePlan.xhtml 2006-04-08 19:27:12 UTC (rev 27) @@ -94,7 +94,7 @@ </ul> <h2>Misc</h2> <p> - To see older versions of this release plan, look at <a href="http://svn.sourceforge.net/viewcvs.cgi/japi/trunk/src/doc/releasePlan.xhtml">$Source$ in the svn repository</a>. + To see older versions of this release plan, look at <a href="http://svn.sourceforge.net/viewcvs.cgi/japi/trunk/src/doc/releasePlan.xhtml">$HeadURL$ in the svn repository</a>. </p> </body> </html> Property changes on: trunk/src/doc/releasePlan.xhtml ___________________________________________________________________ Name: svn:keywords - Date Source + Date HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-08 19:25:15
|
Revision: 26 Author: christianhujer Date: 2006-04-08 12:25:08 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=26&view=rev Log Message: ----------- Minor updates to the release plan. Modified Paths: -------------- trunk/src/doc/releasePlan.xhtml Property Changed: ---------------- trunk/src/doc/releasePlan.xhtml Modified: trunk/src/doc/releasePlan.xhtml =================================================================== --- trunk/src/doc/releasePlan.xhtml 2006-04-08 19:24:34 UTC (rev 25) +++ trunk/src/doc/releasePlan.xhtml 2006-04-08 19:25:08 UTC (rev 26) @@ -43,7 +43,6 @@ Complete rework of ActionFactory to support finer configuration and control and grouping of actions without increasing the usage effort or even decreasing it. The requirements are: <ul> <li>It must be possible to group actions under a name. This is required for the keystroke preferences.</li> - <li>(It should be possible to configure default exception handlers for ActionMethod in ReflectionAction displaying a configurable message parametrized with exception properties. For this it must be possible to associate a parent component with an action with only very little effort.) (pushed forward to JAPI 0.8 instead)</li> <li>The API should become smaller, simpler and eventually more modular.</li> </ul> </li> @@ -86,6 +85,7 @@ </dd> </dl> <h2>Unplanned features</h2> + <p>These features are planned but without time schedule.</p> <ul> <li>Bookmark handler</li> <li>Font Chooser</li> @@ -94,7 +94,7 @@ </ul> <h2>Misc</h2> <p> - To see older versions of this release plan, look at <a href="http://cvs.sourceforge.net/viewcvs.py/japi/japi/src/doc/releasePlan.xhtml">$Source: /cvsroot/japi/japi/src/doc/releasePlan.xhtml,v $ in the cvs repository</a>. + To see older versions of this release plan, look at <a href="http://svn.sourceforge.net/viewcvs.cgi/japi/trunk/src/doc/releasePlan.xhtml">$Source$ in the svn repository</a>. </p> </body> </html> Property changes on: trunk/src/doc/releasePlan.xhtml ___________________________________________________________________ Name: svn:keywords - Date + Date Source This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-08 19:24:52
|
Revision: 25 Author: christianhujer Date: 2006-04-08 12:24:34 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=25&view=rev Log Message: ----------- Implemented methods to read strings from bundles or preferences only. Modified Paths: -------------- trunk/src/app/net/sf/japi/swing/ActionFactory.java Modified: trunk/src/app/net/sf/japi/swing/ActionFactory.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-08 19:22:23 UTC (rev 24) +++ trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-08 19:24:34 UTC (rev 25) @@ -429,7 +429,7 @@ * @return the first value found or <code>null</code> if no value could be found * @throws NullPointerException if <var>key</var> is <code>null</code> */ - @Nullable public String getString(final String key) throws NullPointerException { + @Nullable public String getString(@NotNull final String key) throws NullPointerException { if (key == null) { throw new NullPointerException("null key not allowed"); } @@ -457,6 +457,57 @@ return null; } + /** Get a String from the preferences, ignoring the resource bundles. + * @param key Key to get String for + * @return the first value found or <code>null</code> if no value could be found + * @throws NullPointerException if <var>key</var> is <code>null</code> + */ + @Nullable public String getStringFromPrefs(@NotNull final String key) throws NullPointerException { + if (key == null) { + throw new NullPointerException("null key not allowed"); + } + String value = null; + for (final Preferences pref : prefs) { + value = pref.get(key, value); + if (value != null) { + return value; + } + } + for (final ActionFactory parent : parents) { + value = parent.getStringFromPrefs(key); + if (value != null) { + return value; + } + } + return null; + } + + /** Get a String from the resource bundles, ignoring the preferences. + * @param key Key to get String for + * @return the first value found or <code>null</code> if no value could be found + * @throws NullPointerException if <var>key</var> is <code>null</code> + */ + @Nullable public String getStringFromBundles(@NotNull final String key) throws NullPointerException { + if (key == null) { + throw new NullPointerException("null key not allowed"); + } + String value = null; + for (final ResourceBundle bundle : bundles) { + try { + value = bundle.getString(key); + return value; + } catch (final MissingResourceException e) { /* ignore */ + } catch (final ClassCastException e) { /* ignore */ + } // ignore exceptions because they don't mean errors just there's no resource, so parents are checked or null is returned. + } + for (final ActionFactory parent : parents) { + value = parent.getStringFromBundles(key); + if (value != null) { + return value; + } + } + return null; + } /** Creates actions. * This is a loop variant of {@link #createAction(boolean,String,Object)}. * The actions created can be retrieved using {@link #getAction(String)} or via the ActionMap returned by {@link #getActionMap()}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-08 19:22:34
|
Revision: 24 Author: christianhujer Date: 2006-04-08 12:22:23 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=24&view=rev Log Message: ----------- Slightly better handling of null. Modified Paths: -------------- trunk/src/app/net/sf/japi/swing/ColumnLayout.java Modified: trunk/src/app/net/sf/japi/swing/ColumnLayout.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ColumnLayout.java 2006-04-08 19:21:49 UTC (rev 23) +++ trunk/src/app/net/sf/japi/swing/ColumnLayout.java 2006-04-08 19:22:23 UTC (rev 24) @@ -26,6 +26,7 @@ import java.awt.Container; import java.awt.LayoutManager; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** Layout similar to FlowLayout, but using columns (vertical layout) instead of rows (horizontal layout). * @author <a href="mailto:ch...@it...">Christian Hujer</a> @@ -81,17 +82,17 @@ } /** {@inheritDoc} */ - public void addLayoutComponent(final String name, final Component comp) { + public void addLayoutComponent(@Nullable final String name, @Nullable final Component comp) { // Superfluous } /** {@inheritDoc} */ - public void removeLayoutComponent(final Component comp) { + public void removeLayoutComponent(@Nullable final Component comp) { // Superfluous } /** {@inheritDoc} */ - public Dimension preferredLayoutSize(@NotNull final Container parent) { + @NotNull public Dimension preferredLayoutSize(@NotNull final Container parent) { synchronized (parent.getTreeLock()) { final Dimension preferredLayoutSize = new Dimension(); final int nmembers = parent.getComponentCount(); @@ -114,7 +115,7 @@ } /** {@inheritDoc} */ - public Dimension minimumLayoutSize(@NotNull final Container parent) { + @NotNull public Dimension minimumLayoutSize(@NotNull final Container parent) { synchronized (parent.getTreeLock()) { final Dimension minimumLayoutSize = new Dimension(); final int nmembers = parent.getComponentCount(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-08 19:21:55
|
Revision: 23 Author: christianhujer Date: 2006-04-08 12:21:49 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=23&view=rev Log Message: ----------- Slightly better handling of null. Modified Paths: -------------- trunk/src/app/net/sf/japi/io/ARGV.java Modified: trunk/src/app/net/sf/japi/io/ARGV.java =================================================================== --- trunk/src/app/net/sf/japi/io/ARGV.java 2006-04-06 23:41:06 UTC (rev 22) +++ trunk/src/app/net/sf/japi/io/ARGV.java 2006-04-08 19:21:49 UTC (rev 23) @@ -20,9 +20,11 @@ package net.sf.japi.io; +import java.io.IOException; import java.util.Iterator; import java.util.NoSuchElementException; -import java.io.IOException; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** A special delegate of ARGV Reader supplying lines via an Iterator. * @author <a href="mailto:Chr...@it...">Christian Hujer</a> @@ -30,16 +32,16 @@ public class ARGV implements Iterable<String>, Iterator<String> { /** ARGVReader. */ - private ARGVReader argvReader; + @Nullable private ARGVReader argvReader; /** Next line. */ - private String nextLine; + @Nullable private String nextLine; /** Create an ARGV. * @param args Command line arguments or some other String array containing 0 or more file names. */ @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) - public ARGV(final String... args) { + public ARGV(@NotNull final String... args) { argvReader = new ARGVReader(args); try { nextLine = argvReader.readLine(); @@ -52,6 +54,7 @@ private void close() { nextLine = null; try { + assert argvReader != null; argvReader.close(); } catch (final IOException e) { // ignore @@ -71,7 +74,7 @@ } /** {@inheritDoc} */ - public String next() { + @NotNull public String next() { if (nextLine == null) { throw new NoSuchElementException(); } @@ -79,6 +82,7 @@ return nextLine; } finally { try { + assert argvReader != null; nextLine = argvReader.readLine(); } catch (final IOException e) { close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-06 23:41:21
|
Revision: 22 Author: christianhujer Date: 2006-04-06 16:41:06 -0700 (Thu, 06 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=22&view=rev Log Message: ----------- Improved svn target descriptions. Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-04-06 23:39:01 UTC (rev 21) +++ trunk/build.xml 2006-04-06 23:41:06 UTC (rev 22) @@ -451,7 +451,7 @@ <target name = "svnCreateBranch" - description = "Creates a release branch. This target shouldn't be invoked directly." + description = "Creates a release branch for a new major or minor revision. This target shouldn't be invoked directly." if = "svnCreateBranch" > <svn javahl="${user.svn.javahl}"> @@ -461,7 +461,7 @@ <target name = "svnCreateTag" - description = "Creates a release tag. This target shouldn't be invoked directly." + description = "Creates a release tag for a new patch revision. This target shouldn't be invoked directly." > <svn javahl="${user.svn.javahl}"> <copy srcUrl="${svn.tag.sourceUrl}" desturl="${svn.tag.targetUrl}" message="${svn.tag.message}" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-06 23:39:08
|
Revision: 21 Author: christianhujer Date: 2006-04-06 16:39:01 -0700 (Thu, 06 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=21&view=rev Log Message: ----------- Removed unused changelogTest target. Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-04-06 23:37:26 UTC (rev 20) +++ trunk/build.xml 2006-04-06 23:39:01 UTC (rev 21) @@ -450,15 +450,6 @@ </target> <target - name = "changelogTest" - description = "Test task to try out CvsChangeLog" - > - <cvschangelog destfile="changelog.xml" tag="japi_${project.version}"> - <user displayname="Christian Hujer" userid="christianhujer" /> - </cvschangelog> - </target> - - <target name = "svnCreateBranch" description = "Creates a release branch. This target shouldn't be invoked directly." if = "svnCreateBranch" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-06 23:37:34
|
Revision: 20 Author: christianhujer Date: 2006-04-06 16:37:26 -0700 (Thu, 06 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=20&view=rev Log Message: ----------- Updated version information. In future, this should be done right after a release. Modified Paths: -------------- trunk/project.properties Modified: trunk/project.properties =================================================================== --- trunk/project.properties 2006-04-06 22:53:59 UTC (rev 19) +++ trunk/project.properties 2006-04-06 23:37:26 UTC (rev 20) @@ -1,5 +1,5 @@ project.version.major=0 -project.version.minor=8 +project.version.minor=9 project.version.patch=0 project.version=${project.version.major}.${project.version.minor}.${project.version.patch} project.tag=${project.version.major}_${project.version.minor}_${project.version.patch} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-06 22:54:24
|
Revision: 19 Author: christianhujer Date: 2006-04-06 15:53:59 -0700 (Thu, 06 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=19&view=rev Log Message: ----------- Changed build.xml to support subversion instead of cvs. Modified Paths: -------------- trunk/build.xml Added Paths: ----------- trunk/lib/LICENSE-svnClientAdapter.jar trunk/lib/LICENSE-svnant.jar trunk/lib/svnClientAdapter.jar trunk/lib/svnant.jar Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-04-06 00:04:52 UTC (rev 18) +++ trunk/build.xml 2006-04-06 22:53:59 UTC (rev 19) @@ -18,7 +18,25 @@ <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial" /> <property name="user.javadoc.link" value="http://java.sun.com/j2se/1.5.0/docs/api/" /> <property name="user.javadoc.javasrc" value="${user.javadoc.javahome}/src" /> + <property name="user.svn.javahl" value="false" /> + <property name="svn.baseUrl" value="https://svn.sourceforge.net/svnroot/japi" /> + <condition property="svnCreateBranch" value="true"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <condition property="svn.branch.sourceUrl" value="${svn.baseUrl}/trunk"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <condition property="svn.branch.targetUrl" value="${svn.baseUrl}/branches/${project.version.major}.${project.version.minor}"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <condition property="svn.branch.message" value="Creating branch for version ${project.version.major}.${project.version.minor}"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <property name="svn.tag.sourceUrl" value="${svn.baseUrl}/branches/${project.version.major}.${project.version.minor}" /> + <property name="svn.tag.targetUrl" value="${svn.baseUrl}/tags/${project.version.major}.${project.version.minor}.${project.version.patch}" /> + <property name="svn.tag.message" value="Creating release tag for version ${project.version.major}.${project.version.minor}.${project.version.patch}" /> + <taskdef name="megaxslt" classpath="lib/megaxslt.jar" classname="com.hujer.ant.tasks.megaxslt.MegaXsltTask" /> <taskdef name="rgzip" classpath="lib/megaxslt.jar" classname="com.hujer.ant.tasks.rgzip.RGZipTask" /> <taskdef name="pack200" classpath="lib/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" /> @@ -28,6 +46,11 @@ <pathelement path="lib/commons-codec-1.3.jar" /> </classpath> </taskdef> + <taskdef name="svn" classpath="lib/svnant.jar" classname="org.tigris.subversion.svnant.SvnTask"> + <classpath> + <pathelement path="lib/svnClientAdapter.jar" /> + </classpath> + </taskdef> &catalogForAnt; @@ -35,7 +58,9 @@ name = "update" if = "dev.autoupdate" > - <cvs command = "update" /> + <svn javahl="${user.svn.javahl}"> + <update dir="."/> + </svn> </target> <target @@ -344,7 +369,9 @@ <parameter name="project.version" value="${project.version}" /> <transformation stylesheet="src/doc/api/release.xslt" /> </megaxslt> - <cvs command="commit -m '' src/doc/api/start.xhtml" /> + <svn javahl="${user.svn.javahl}"> + <commit file="src/doc/api/start.xhtml" message="Updating API link to include ${project.version}." /> + </svn> <exec executable="rsync"> <arg line="-auzv -e ssh dest/doc/api/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/api/" /> </exec> @@ -363,7 +390,8 @@ > <fileset dir="dist" /> </ftp> - <cvs command="tag -c japi_${project.tag}" failonerror="true"/> + <antcall target="svnCreateBranch" /> + <antcall target="svnCreateTag" /> <antcall target="uploadDoc" /> </target> @@ -430,4 +458,22 @@ </cvschangelog> </target> + <target + name = "svnCreateBranch" + description = "Creates a release branch. This target shouldn't be invoked directly." + if = "svnCreateBranch" + > + <svn javahl="${user.svn.javahl}"> + <copy srcUrl="${svn.branch.sourceUrl}" desturl="${svn.branch.targetUrl}" message="${svn.branch.message}" /> + </svn> + </target> + + <target + name = "svnCreateTag" + description = "Creates a release tag. This target shouldn't be invoked directly." + > + <svn javahl="${user.svn.javahl}"> + <copy srcUrl="${svn.tag.sourceUrl}" desturl="${svn.tag.targetUrl}" message="${svn.tag.message}" /> + </svn> + </target> </project> Added: trunk/lib/LICENSE-svnClientAdapter.jar =================================================================== --- trunk/lib/LICENSE-svnClientAdapter.jar (rev 0) +++ trunk/lib/LICENSE-svnClientAdapter.jar 2006-04-06 22:53:59 UTC (rev 19) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: trunk/lib/LICENSE-svnClientAdapter.jar ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/lib/LICENSE-svnant.jar =================================================================== --- trunk/lib/LICENSE-svnant.jar (rev 0) +++ trunk/lib/LICENSE-svnant.jar 2006-04-06 22:53:59 UTC (rev 19) @@ -0,0 +1,58 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact ap...@ap.... + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + Property changes on: trunk/lib/LICENSE-svnant.jar ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/lib/svnClientAdapter.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/svnClientAdapter.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/svnant.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/svnant.jar ___________________________________________________________________ Name: 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: <chr...@us...> - 2006-04-06 00:05:07
|
Revision: 18 Author: christianhujer Date: 2006-04-05 17:04:52 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=18&view=rev Log Message: ----------- Fixed property encoding handling for editor example. Added task for property encoding handling. Modified Paths: -------------- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties trunk/src/doc/guide/swing/action/fromScratch/start.xhtml trunk/src/doc/tasks.xhtml Modified: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties 2006-04-05 23:51:41 UTC (rev 17) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties 2006-04-06 00:04:52 UTC (rev 18) @@ -1,3 +1,5 @@ +# Action properties for Editor, non-localizable information. +# This file MUST be ISO-8859-1 ActionFactory.additionalBundles=net.sf.japi.examples.editor.messages editor.menubar=file edit Modified: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties 2006-04-05 23:51:41 UTC (rev 17) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties 2006-04-06 00:04:52 UTC (rev 18) @@ -1,3 +1,6 @@ +# Action properties for Editor, localizable information. +# This file MUST be ISO-8859-1 +# frame.title=Text Editor (JAPI usage example) file.text=File Modified: trunk/src/doc/guide/swing/action/fromScratch/start.xhtml =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/start.xhtml 2006-04-05 23:51:41 UTC (rev 17) +++ trunk/src/doc/guide/swing/action/fromScratch/start.xhtml 2006-04-06 00:04:52 UTC (rev 18) @@ -217,8 +217,8 @@ <h3>Java Source: <code>net/sf/japi/examples/editor/Editor.java</code></h3> <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/Editor.java.xhtml" xpointer="/1/2/1/1" /></pre> <h3>Action Properties: <code>net/sf/japi/examples/editor/action.properties</code></h3> - <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/action.properties" parse="text" /></pre> - <h3>Message Properties: <code>net/sf/japi/examples/editor/message.properties</code></h3> - <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/message.properties" parse="text" /></pre> + <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/action.properties" parse="text" encoding="iso-8859-1" /></pre> + <h3>Message Properties: <code>net/sf/japi/examples/editor/messages.properties</code></h3> + <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/messages.properties" parse="text" encoding="iso-8859-1" /></pre> </body> </html> Modified: trunk/src/doc/tasks.xhtml =================================================================== --- trunk/src/doc/tasks.xhtml 2006-04-05 23:51:41 UTC (rev 17) +++ trunk/src/doc/tasks.xhtml 2006-04-06 00:04:52 UTC (rev 18) @@ -103,6 +103,15 @@ All possible NullPointerException warnings should be removed except in acceptable cases. This task also includes the definition of a list of acceptable cases of possible NullPointerExceptions. </dd> + <dt>Properties handling</dt> + <dd> + Make sure all property files are iso-8859-1 and not any other encoding. + Also make sure that in xi:include elements, property files are included as iso-8859-1. + </dd> + <dt>Add syntax highlighting for property files</dt> + <dd> + Add a syntax highlighting for property files. + </dd> </dl> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-05 23:51:47
|
Revision: 17 Author: christianhujer Date: 2006-04-05 16:51:41 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=17&view=rev Log Message: ----------- Added missing keyword substitution. Property Changed: ---------------- trunk/src/doc/tasks.xhtml Property changes on: trunk/src/doc/tasks.xhtml ___________________________________________________________________ Name: svn:keywords + Date This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-05 23:39:29
|
Revision: 16 Author: christianhujer Date: 2006-04-05 16:39:02 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=16&view=rev Log Message: ----------- Added automatic handling of custom Action types to ActionFactory. Improved Editor example to use editorkit actions and provide an edit menu. Modified Paths: -------------- trunk/src/app/net/sf/japi/swing/ActionFactory.java trunk/src/app/net/sf/japi/swing/ReflectionAction.java trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties Added Paths: ----------- trunk/src/app/net/sf/japi/swing/ActionProvider.java Modified: trunk/src/app/net/sf/japi/swing/ActionFactory.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-05 21:53:34 UTC (rev 15) +++ trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-05 23:39:02 UTC (rev 16) @@ -31,6 +31,7 @@ import java.util.ResourceBundle; import static java.util.ResourceBundle.getBundle; import java.util.WeakHashMap; +import java.util.ArrayList; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.AbstractAction; @@ -187,6 +188,8 @@ /** The ActionMap to which created Actions are automatically added. */ @NotNull private final ActionMap actionMap = new NamedActionMap(); + private List<ActionProvider> actionProviders = new ArrayList<ActionProvider>(); + /** Get an ActionFactory. * If there is no ActionFactory with name <var>key</var>, a new ActionFactory is created and stored. * Future invocations of this method will constantly return that ActionFactory unless the key is garbage collected. @@ -536,7 +539,17 @@ * This method does the same as <code>getActionMap().get(key)</code>. */ public Action getAction(final String key) { - return actionMap.get(key); + Action action = actionMap.get(key); + if (action == null) { + for (final ActionProvider actionProvider : actionProviders) { + action = actionProvider.getAction(key); + if (action != null) { + actionMap.put(key, action); + break; + } + } + } + return action; } /** Method for creating a menubar. @@ -723,7 +736,11 @@ if (key == null || "-".equals(key)) { toolBar.addSeparator(); } else { - toolBar.add(createAction(false, key, object)); + Action action = getAction(key); + if (action == null) { + action = createAction(false, key, object); + } + toolBar.add(action); } } return toolBar; @@ -949,4 +966,11 @@ return label; } + /** Registers an ActionProvider with this ActionFactory. + * @param actionProvider ActionProvider to register + */ + public void addActionProvider(final ActionProvider actionProvider) { + actionProviders.add(actionProvider); + } + } // class ActionFactory Added: trunk/src/app/net/sf/japi/swing/ActionProvider.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ActionProvider.java (rev 0) +++ trunk/src/app/net/sf/japi/swing/ActionProvider.java 2006-04-05 23:39:02 UTC (rev 16) @@ -0,0 +1,38 @@ +/* JAPI - (Yet another (hopefully) useful) Java API + * + * Copyright (C) 2004-2006 Christian Hujer + * + * This program 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 2 of the + * License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + + +package net.sf.japi.swing; + +import javax.swing.Action; +import org.jetbrains.annotations.Nullable; + +/** Interface for classes that provide actions. + * @author <a href="mailto:ch...@it...">Christian Hujer</a> + */ +public interface ActionProvider { + + /** Get an action that matches a specific key or <code>null</code> if no such action was found. + * @param key Key to find + * @return Action for <var>key</var> or <code>null</code> + */ + @Nullable Action getAction(final String key); + +} // interface ActionProvider Property changes on: trunk/src/app/net/sf/japi/swing/ActionProvider.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/japi/swing/ReflectionAction.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ReflectionAction.java 2006-04-05 21:53:34 UTC (rev 15) +++ trunk/src/app/net/sf/japi/swing/ReflectionAction.java 2006-04-05 23:39:02 UTC (rev 16) @@ -48,6 +48,7 @@ * Note that because of Reflection this Action is slightly slower than implementing your own Action instance, but in most cases this really does not matter at all. * Usually you won't use ReflectionAction yourself. Instead you'll let {@link ActionFactory} create an instance for you. * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @todo ReflectionAction should be able to invoke methods with parameters, three variants: Object..., ActionEvent or void */ public final class ReflectionAction extends AbstractAction { @@ -181,7 +182,8 @@ return null; } try { - method = instance.getClass().getMethod(methodName); + final Class<? extends Object> clazz = instance.getClass(); + method = clazz.getMethod(methodName); putValue(REFLECTION_METHOD, method); } catch (final NoSuchMethodException ex) { assert false : "Action Method not found: " + ex; Modified: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java 2006-04-05 21:53:34 UTC (rev 15) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java 2006-04-05 23:39:02 UTC (rev 16) @@ -6,21 +6,37 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.util.Map; +import java.util.HashMap; +import javax.swing.Action; import javax.swing.JFileChooser; import static javax.swing.JFileChooser.APPROVE_OPTION; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; +import javax.swing.text.DefaultEditorKit; +import org.jetbrains.annotations.Nullable; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; +import net.sf.japi.swing.ActionProvider; -public class Editor { +public class Editor implements ActionProvider { /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = getFactory("net.sf.japi.examples.editor"); + /** The supported editor action names and their corresponding kit action names. */ + private static final Map<String, String> editorActionNames = new HashMap<String, String>(); + static { + + editorActionNames.put("editCut", DefaultEditorKit.cutAction); + editorActionNames.put("editCopy", DefaultEditorKit.copyAction); + editorActionNames.put("editPaste", DefaultEditorKit.pasteAction); + editorActionNames.put("editSelectAll", DefaultEditorKit.selectAllAction); + }; + /** Application frame. */ private JFrame frame = new JFrame(ACTION_FACTORY.getString("frame.title")); @@ -37,14 +53,27 @@ /** Create the Editor. */ public Editor() { + ACTION_FACTORY.addActionProvider(this); frame.setJMenuBar(ACTION_FACTORY.createMenuBar(true, "editor", this)); frame.add(ACTION_FACTORY.createToolBar(this, "editor"), NORTH); frame.add(new JScrollPane(textPane)); + frame.pack(); frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE); - frame.pack(); frame.setVisible(true); } + /** {@inheritDoc} */ + @Nullable public Action getAction(final String key) { + for (final Action action : textPane.getActions()) { + final String realKey = editorActionNames.get(key); + if (realKey != null && realKey.equals(action.getValue(Action.NAME))) { + ACTION_FACTORY.initAction(true, action, key); + return action; + } + } + return null; + } + /** Action method. * @used */ Modified: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties 2006-04-05 21:53:34 UTC (rev 15) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties 2006-04-05 23:39:02 UTC (rev 16) @@ -1,6 +1,19 @@ ActionFactory.additionalBundles=net.sf.japi.examples.editor.messages -editor.menubar=file -editor.toolbar=fileNew fileOpen fileSave fileSaveAs +editor.menubar=file edit +editor.toolbar=fileNew fileOpen fileSave fileSaveAs - editCut editCopy editPaste file.menu=fileNew fileOpen fileSave fileSaveAs fileQuit +edit.menu=editCut editCopy editPaste + +fileNew.icon=general/New16 +fileOpen.icon=general/Open16 +fileOpen.exception.java.io.FileNotFoundException.messagetype=ERROR_MESSAGE +fileOpen.exception.java.io.IOException.messagetype=ERROR_MESSAGE +fileSave.icon=general/Save16 +fileSave.exception.java.io.IOException.messagetype=ERROR_MESSAGE +fileSaveAs.icon=general/SaveAs16 +fileSaveAs.exception.java.io.IOException.messagetype=ERROR_MESSAGE +editCut.icon=general/Cut16 +editCopy.icon=general/Copy16 +editPaste.icon=general/Paste16 Modified: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties 2006-04-05 21:53:34 UTC (rev 15) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties 2006-04-05 23:39:02 UTC (rev 16) @@ -7,26 +7,21 @@ fileNew.mnemonic=N fileNew.accel=ctrl pressed N fileNew.shortdescription=Creates a new empty text document. -fileNew.icon=general/New16 fileOpen.text=Open... fileOpen.mnemonic=O fileOpen.accel=ctrl pressed O fileOpen.shortdescription=Opens an existing text document. -fileOpen.icon=general/Open16 fileOpen.exception.java.io.FileNotFoundException.title=File not found fileOpen.exception.java.io.FileNotFoundException.message=<html>The file couldn''t be opened. Reason:<br>{0} -fileOpen.exception.java.io.FileNotFoundException.messagetype=ERROR_MESSAGE fileOpen.exception.java.io.IOException.title=I/O error fileOpen.exception.java.io.IOException.message=<html>I/O error while reading. Reason:<br>{0} -fileOpen.exception.java.io.IOException.messagetype=ERROR_MESSAGE fileSave.text=Save fileSave.mnemonic=S fileSave.accel=ctrl pressed S fileSave.shortdescription=Saves the current document. -fileSave.icon=general/Save16 fileSave.exception.java.io.IOException.title=I/O error fileSave.exception.java.io.IOException.message=<html>I/O error while writing. Reason:<br>{0} @@ -34,7 +29,6 @@ fileSaveAs.mnemonic=A fileSaveAs.accel=ctrl shift pressed S fileSaveAs.shortdescription=Saves the current document in a new filename. -fileSaveAs.icon=general/SaveAs16 fileSaveAs.exception.java.io.IOException.title=I/O error fileSaveAs.exception.java.io.IOException.message=<html>I/O error while writing. Reason:<br>{0} @@ -43,6 +37,29 @@ fileQuit.accel=ctrl pressed Q fileQuit.shortdescription=Quits the text editor. +edit.text=Edit +edit.mnemonic=E + +editCut.text=Cut +editCut.mnemonic=C +editCut.accel=ctrl pressed X +editCut.shortdescription=Cuts the current selection to the clipboard + +editCopy.text=Copy +editCopy.mnemonic=O +editCopy.accel=ctrl pressed C +editCopy.shortdescription=Copies the current selection to the clipboard + +editPaste.text=Paste +editPaste.mnemonic=P +editPaste.accel=ctrl pressed V +editPaste.shortdescription=Pastes over the current selection from the clipboard + +editSelectAll.text=Select All +editSelectAll.mnemonic=A +editSelectAll.accel=ctrl pressed A +editSelectAll.shortdescription=Selects the entire editor content + reallyQuit.title=Really Quit? reallyQuit=Do you really want to quit the editor? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-05 21:53:42
|
Revision: 15 Author: christianhujer Date: 2006-04-05 14:53:34 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=15&view=rev Log Message: ----------- Removed solved task from tasks list. Modified Paths: -------------- trunk/src/doc/tasks.xhtml Modified: trunk/src/doc/tasks.xhtml =================================================================== --- trunk/src/doc/tasks.xhtml 2006-04-05 21:29:55 UTC (rev 14) +++ trunk/src/doc/tasks.xhtml 2006-04-05 21:53:34 UTC (rev 15) @@ -19,13 +19,6 @@ The build.xml for Ant still uses the old cvs tasks. The subversion ant task provided by tigris should be used instead. </dd> - <dt>ActionFactory automatic bundle configuration</dt> - <dd> - It should be possible to configure additional bundles inside a bundle. - This allows spreading information accross mutlible bundles. - The main purpose is separating technical information that is not supposed to be l10n from information that must or should or might - change in a translation. - </dd> <dt>Add Changelog Facility</dt> <dd> There should be an automatic changelog facility in build.xml that displays all changes made since the last release. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-05 21:30:15
|
Revision: 14 Author: christianhujer Date: 2006-04-05 14:29:55 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=14&view=rev Log Message: ----------- Improved ActionFactory to allow additional bundles specified in a bundle. Modified Paths: -------------- trunk/src/app/net/sf/japi/swing/ActionFactory.java trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties trunk/src/doc/guide/swing/action/fromScratch/start.xhtml Added Paths: ----------- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties Modified: trunk/src/app/net/sf/japi/swing/ActionFactory.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-05 20:13:38 UTC (rev 13) +++ trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-05 21:29:55 UTC (rev 14) @@ -22,8 +22,9 @@ import java.awt.Component; import java.awt.event.ActionEvent; +import java.lang.reflect.Field; import java.text.MessageFormat; -import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.MissingResourceException; @@ -32,7 +33,7 @@ import java.util.WeakHashMap; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; -import java.lang.reflect.Field; +import javax.swing.AbstractAction; import javax.swing.Action; import static javax.swing.Action.ACCELERATOR_KEY; import static javax.swing.Action.LONG_DESCRIPTION; @@ -43,17 +44,16 @@ import javax.swing.ActionMap; import javax.swing.Icon; import javax.swing.JCheckBox; +import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JToolBar; -import javax.swing.AbstractAction; -import javax.swing.JLabel; import static javax.swing.KeyStroke.getKeyStroke; +import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NonNls; import static net.sf.japi.swing.IconManager.getDefaultIconManager; import static net.sf.japi.swing.ReflectionAction.REFLECTION_MESSAGE_PROVIDER; import static net.sf.japi.swing.ReflectionAction.REFLECTION_TARGET; @@ -172,17 +172,17 @@ @NotNull private static final Map<String, ActionFactory> FACTORIES = new WeakHashMap<String, ActionFactory>(); /** The parent ActionFactories. */ - @NotNull private final List<ActionFactory> parents = new ArrayList<ActionFactory>(); + @NotNull private final List<ActionFactory> parents = new LinkedList<ActionFactory>(); /** The ResourceBundles to look for. * Type: ResourceBundle */ - @NotNull private final List<ResourceBundle> bundles = new ArrayList<ResourceBundle>(); + @NotNull private final List<ResourceBundle> bundles = new LinkedList<ResourceBundle>(); /** The Preferences to look for. * Type: Preferences */ - @NotNull private final List<Preferences> prefs = new ArrayList<Preferences>(); + @NotNull private final List<Preferences> prefs = new LinkedList<Preferences>(); /** The ActionMap to which created Actions are automatically added. */ @NotNull private final ActionMap actionMap = new NamedActionMap(); @@ -221,7 +221,14 @@ if (baseName == null) { throw new NullPointerException("null bundle name not allowed"); } - addBundle(getBundle(baseName)); + @NotNull final ResourceBundle newBundle = getBundle(baseName); + addBundle(newBundle); + @Nullable final String additionalBundles = newBundle.getString("ActionFactory.additionalBundles"); + if (additionalBundles != null) { + for (final String additionalBundle : additionalBundles.split("\\s+")) { + addBundle(additionalBundle); + } + } } /** Method to find the JMenuItem for a specific Action. @@ -300,7 +307,8 @@ throw new NullPointerException("null ResourceBundle not allowed"); } if (!bundles.contains(bundle)) { - bundles.add(bundle); + // insert first because new bundles override old bundles + bundles.add(0, bundle); } } Modified: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties 2006-04-05 20:13:38 UTC (rev 13) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties 2006-04-05 21:29:55 UTC (rev 14) @@ -1,51 +1,6 @@ -frame.title=Text Editor (JAPI usage example) +ActionFactory.additionalBundles=net.sf.japi.examples.editor.messages editor.menubar=file editor.toolbar=fileNew fileOpen fileSave fileSaveAs file.menu=fileNew fileOpen fileSave fileSaveAs fileQuit -file.text=File -file.mnemonic=F - -fileNew.text=New -fileNew.mnemonic=N -fileNew.accel=ctrl pressed N -fileNew.shortdescription=Creates a new empty text document. -fileNew.icon=general/New16 - -fileOpen.text=Open... -fileOpen.mnemonic=O -fileOpen.accel=ctrl pressed O -fileOpen.shortdescription=Opens an existing text document. -fileOpen.icon=general/Open16 -fileOpen.exception.java.io.FileNotFoundException.title=File not found -fileOpen.exception.java.io.FileNotFoundException.message=<html>The file couldn''t be opened. Reason:<br>{0} -fileOpen.exception.java.io.FileNotFoundException.messagetype=ERROR_MESSAGE -fileOpen.exception.java.io.IOException.title=I/O error -fileOpen.exception.java.io.IOException.message=<html>I/O error while reading. Reason:<br>{0} -fileOpen.exception.java.io.IOException.messagetype=ERROR_MESSAGE - - -fileSave.text=Save -fileSave.mnemonic=S -fileSave.accel=ctrl pressed S -fileSave.shortdescription=Saves the current document. -fileSave.icon=general/Save16 -fileSave.exception.java.io.IOException.title=I/O error -fileSave.exception.java.io.IOException.message=<html>I/O error while writing. Reason:<br>{0} - -fileSaveAs.text=Save As... -fileSaveAs.mnemonic=A -fileSaveAs.accel=ctrl shift pressed S -fileSaveAs.shortdescription=Saves the current document in a new filename. -fileSaveAs.icon=general/SaveAs16 -fileSaveAs.exception.java.io.IOException.title=I/O error -fileSaveAs.exception.java.io.IOException.message=<html>I/O error while writing. Reason:<br>{0} - -fileQuit.text=Quit -fileQuit.mnemonic=Q -fileQuit.accel=ctrl pressed Q -fileQuit.shortdescription=Quits the text editor. - -reallyQuit.title=Really Quit? -reallyQuit=Do you really want to quit the editor? Added: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties (rev 0) +++ trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties 2006-04-05 21:29:55 UTC (rev 14) @@ -0,0 +1,48 @@ +frame.title=Text Editor (JAPI usage example) + +file.text=File +file.mnemonic=F + +fileNew.text=New +fileNew.mnemonic=N +fileNew.accel=ctrl pressed N +fileNew.shortdescription=Creates a new empty text document. +fileNew.icon=general/New16 + +fileOpen.text=Open... +fileOpen.mnemonic=O +fileOpen.accel=ctrl pressed O +fileOpen.shortdescription=Opens an existing text document. +fileOpen.icon=general/Open16 +fileOpen.exception.java.io.FileNotFoundException.title=File not found +fileOpen.exception.java.io.FileNotFoundException.message=<html>The file couldn''t be opened. Reason:<br>{0} +fileOpen.exception.java.io.FileNotFoundException.messagetype=ERROR_MESSAGE +fileOpen.exception.java.io.IOException.title=I/O error +fileOpen.exception.java.io.IOException.message=<html>I/O error while reading. Reason:<br>{0} +fileOpen.exception.java.io.IOException.messagetype=ERROR_MESSAGE + + +fileSave.text=Save +fileSave.mnemonic=S +fileSave.accel=ctrl pressed S +fileSave.shortdescription=Saves the current document. +fileSave.icon=general/Save16 +fileSave.exception.java.io.IOException.title=I/O error +fileSave.exception.java.io.IOException.message=<html>I/O error while writing. Reason:<br>{0} + +fileSaveAs.text=Save As... +fileSaveAs.mnemonic=A +fileSaveAs.accel=ctrl shift pressed S +fileSaveAs.shortdescription=Saves the current document in a new filename. +fileSaveAs.icon=general/SaveAs16 +fileSaveAs.exception.java.io.IOException.title=I/O error +fileSaveAs.exception.java.io.IOException.message=<html>I/O error while writing. Reason:<br>{0} + +fileQuit.text=Quit +fileQuit.mnemonic=Q +fileQuit.accel=ctrl pressed Q +fileQuit.shortdescription=Quits the text editor. + +reallyQuit.title=Really Quit? +reallyQuit=Do you really want to quit the editor? + Property changes on: trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/messages.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/doc/guide/swing/action/fromScratch/start.xhtml =================================================================== --- trunk/src/doc/guide/swing/action/fromScratch/start.xhtml 2006-04-05 20:13:38 UTC (rev 13) +++ trunk/src/doc/guide/swing/action/fromScratch/start.xhtml 2006-04-05 21:29:55 UTC (rev 14) @@ -214,7 +214,11 @@ } }</pre> <h2>Complete source</h2> + <h3>Java Source: <code>net/sf/japi/examples/editor/Editor.java</code></h3> <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/Editor.java.xhtml" xpointer="/1/2/1/1" /></pre> + <h3>Action Properties: <code>net/sf/japi/examples/editor/action.properties</code></h3> <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/action.properties" parse="text" /></pre> + <h3>Message Properties: <code>net/sf/japi/examples/editor/message.properties</code></h3> + <pre class="listing"><xi:include href="src/net/sf/japi/examples/editor/message.properties" parse="text" /></pre> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-05 20:13:44
|
Revision: 13 Author: christianhujer Date: 2006-04-05 13:13:38 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=13&view=rev Log Message: ----------- Added separation task. Modified Paths: -------------- trunk/src/doc/tasks.xhtml Modified: trunk/src/doc/tasks.xhtml =================================================================== --- trunk/src/doc/tasks.xhtml 2006-04-05 07:35:24 UTC (rev 12) +++ trunk/src/doc/tasks.xhtml 2006-04-05 20:13:38 UTC (rev 13) @@ -19,6 +19,13 @@ The build.xml for Ant still uses the old cvs tasks. The subversion ant task provided by tigris should be used instead. </dd> + <dt>ActionFactory automatic bundle configuration</dt> + <dd> + It should be possible to configure additional bundles inside a bundle. + This allows spreading information accross mutlible bundles. + The main purpose is separating technical information that is not supposed to be l10n from information that must or should or might + change in a translation. + </dd> <dt>Add Changelog Facility</dt> <dd> There should be an automatic changelog facility in build.xml that displays all changes made since the last release. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-05 07:35:30
|
Revision: 12 Author: christianhujer Date: 2006-04-05 00:35:24 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=12&view=rev Log Message: ----------- Fixed typo, added NPE avoidance task. Modified Paths: -------------- trunk/src/doc/tasks.xhtml Modified: trunk/src/doc/tasks.xhtml =================================================================== --- trunk/src/doc/tasks.xhtml 2006-04-04 23:35:14 UTC (rev 11) +++ trunk/src/doc/tasks.xhtml 2006-04-05 07:35:24 UTC (rev 12) @@ -11,6 +11,7 @@ <p> This is a scratch board for pending tasks that need to be done with JAPI. The tasks are not in any particular order, just random. + They are here for public discussion before they become BUG / RFE entries in the bug tracker. </p> <dl> <dt>Integration Subversion with Ant</dt> @@ -23,7 +24,7 @@ There should be an automatic changelog facility in build.xml that displays all changes made since the last release. Because we use subversion now, this should be easy to do once subversion is integrated in Ant. </dd> - <dt>Create miissing package descriptions</dt> + <dt>Create missing package descriptions</dt> <dd> Some packages lack package descriptions. </dd> @@ -95,6 +96,13 @@ Some directories like tools/fonts should have settings for svn:ignore. All sub project directories with their own build.xml should, for instance, set svn:ignore to exclude their <code>classes</code> directory. </dd> + <dt>NPE avoidance</dt> + <dd> + There's much code, especially in ActionFactory, which will throw little useful NullPointerExceptions. + This code should be reworked by using <code>@Nullable</code> and <code>@NotNull</code> annotations. + All possible NullPointerException warnings should be removed except in acceptable cases. + This task also includes the definition of a list of acceptable cases of possible NullPointerExceptions. + </dd> </dl> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-04 23:35:27
|
Revision: 11 Author: christianhujer Date: 2006-04-04 16:35:14 -0700 (Tue, 04 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=11&view=rev Log Message: ----------- Added tasks document. Modified Paths: -------------- trunk/src/doc/releasePlan.xhtml trunk/src/doc/start.xhtml Added Paths: ----------- trunk/src/doc/tasks.xhtml Modified: trunk/src/doc/releasePlan.xhtml =================================================================== --- trunk/src/doc/releasePlan.xhtml 2006-04-04 23:33:36 UTC (rev 10) +++ trunk/src/doc/releasePlan.xhtml 2006-04-04 23:35:14 UTC (rev 11) @@ -25,7 +25,7 @@ <dd> <ul> <li>Final implementation of proxy preferences.</li> - <li>Final implementation of the C Preprocessor. Note: This will eventually become a project of its own.</li> + <li>Final implementation of the C Preprocessor. Note: This will quite likely become a project of its own.</li> <li>Provide treetable usage example.</li> </ul> </dd> Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-04-04 23:33:36 UTC (rev 10) +++ trunk/src/doc/start.xhtml 2006-04-04 23:35:14 UTC (rev 11) @@ -38,6 +38,7 @@ <li><a href="releasePlan">Release Plan</a></li> <li><a href="wontFixes">Known flaws that won't be fixed</a></li> <li><a href="subversion">Accessing JAPI's Subversion Repository</a></li> + <li><a href="tasks">Open Tasks</a> (for JAPI developers)</li> </ul> <h2>Contact the developers</h2> <ul> Added: trunk/src/doc/tasks.xhtml =================================================================== --- trunk/src/doc/tasks.xhtml (rev 0) +++ trunk/src/doc/tasks.xhtml 2006-04-04 23:35:14 UTC (rev 11) @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id$ --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> + <title>JAPI Pending Tasks</title> + </head> + <body> + <p> + This is a scratch board for pending tasks that need to be done with JAPI. + The tasks are not in any particular order, just random. + </p> + <dl> + <dt>Integration Subversion with Ant</dt> + <dd> + The build.xml for Ant still uses the old cvs tasks. + The subversion ant task provided by tigris should be used instead. + </dd> + <dt>Add Changelog Facility</dt> + <dd> + There should be an automatic changelog facility in build.xml that displays all changes made since the last release. + Because we use subversion now, this should be easy to do once subversion is integrated in Ant. + </dd> + <dt>Create miissing package descriptions</dt> + <dd> + Some packages lack package descriptions. + </dd> + <dt>Review package descriptions</dt> + <dd> + Some package descriptions might be inaccurate or not good enough. + </dd> + <dt>Improve java2html</dt> + <dd> + java2html needs some improvement to create XHTML 1.1 with properly identifiable lines. + E.g. <code><![CDATA[<span id="line10" class="even line">...</span>]]></code>. + The stylesheet should allow for alternating background of odd and even lines. + </dd> + <dt>Finnish JTreeTable</dt> + <dd> + The class JTreeTable needs to be finnished. + </dd> + <dt>Finnish preferences modules</dt> + <dd> + The preferences modules for keyboard, menu, toolbar, dialogs (bringing onetime dialogs back again) and proxy need to be finnished resp. created. + </dd> + <dt>Increase JAPI</dt> + <dd> + Cher has some old JAPI versions from the time of JAPI before SF, which might contain some useful classes that should go into JAPI. + </dd> + <dt>Add Cursor Handling to ActionFactory</dt> + <dd> + ActionFactory should be able to automatically set the cursors for components it creates. + </dd> + <dt>Improve ToolbarLayout</dt> + <dd> + ToolbarLayout needs an improvement to allow toolbars to be placed next to each other. + </dd> + <dt>Create Checkstyle Configuration</dt> + <dd> + JAPI needs a Checkstyle configuration. + An Ant Target running Checkstyle should also be added. + </dd> + <dt>Create font browser tool</dt> + <dd> + This goes in tools/font + </dd> + <dt>Create a jar browser tool</dt> + <dd> + This goes in tools/jar + </dd> + <dt>Rework guide on XInclude</dt> + <dd> + Some source code in the guide is not yet included using java2html and XInclude. + This should be changed to let all source code look consistently. + </dd> + <dt>Website Layout improvement</dt> + <dd> + JAPI needs a logo and a better website. + </dd> + <dt>IDE project files</dt> + <dd> + Think about a concept of how to put IDE project files in the JAPI repository in a way that when users change them, they'll be working on their copies without creating new versions when they do commits. + For a start, IntelliJ IDEA, NetBeans and Eclipse should be supported. + Perhaps applying the UCM stream concept of ClearCase might also be a possible solution to this. + Question: How to checkout a trunk directory from a branch instead. + </dd> + <dt>Unit Tests</dt> + <dd> + JAPI needs a unit test suite. + </dd> + <dt>Set svn:ignore properties properly</dt> + <dd> + Some directories like tools/fonts should have settings for svn:ignore. + All sub project directories with their own build.xml should, for instance, set svn:ignore to exclude their <code>classes</code> directory. + </dd> + </dl> + </body> +</html> Property changes on: trunk/src/doc/tasks.xhtml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-04 23:33:41
|
Revision: 10 Author: christianhujer Date: 2006-04-04 16:33:36 -0700 (Tue, 04 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=10&view=rev Log Message: ----------- Added NPE avoid in one case. Modified Paths: -------------- trunk/src/app/net/sf/japi/swing/ActionFactory.java Modified: trunk/src/app/net/sf/japi/swing/ActionFactory.java =================================================================== --- trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-04 22:23:49 UTC (rev 9) +++ trunk/src/app/net/sf/japi/swing/ActionFactory.java 2006-04-04 23:33:36 UTC (rev 10) @@ -53,6 +53,7 @@ import static javax.swing.KeyStroke.getKeyStroke; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NonNls; import static net.sf.japi.swing.IconManager.getDefaultIconManager; import static net.sf.japi.swing.ReflectionAction.REFLECTION_MESSAGE_PROVIDER; import static net.sf.japi.swing.ReflectionAction.REFLECTION_TARGET; @@ -583,7 +584,11 @@ */ public JMenuBar createMenuBar(final boolean store, final String barKey, final Object target) { final JMenuBar menuBar = new JMenuBar(); - for (final String key : getString(barKey + ".menubar").split("\\s+")) { + final String menuBarSpec = getString(barKey + ".menubar"); + if (menuBarSpec == null) { + throw new RuntimeException("Missing Resource for " + barKey + ".menubar"); + } + for (final String key : menuBarSpec.split("\\s+")) { menuBar.add(createMenu(store, key, target)); } return menuBar; @@ -827,7 +832,7 @@ * @throws IllegalStateException if no preferences are associated */ public int showOnetimeConfirmDialog(final Component parentComponent, final int optionType, final int messageType, final String key, final Object... args) throws IllegalStateException { - String showString = getString(key + ".show"); + @NonNls String showString = getString(key + ".show"); if (showString == null) { showString = getString(key + ".showDefault"); } @@ -838,7 +843,7 @@ if (!show) { try { return Integer.parseInt(getString(key + ".choice")); - } catch (final Exception e) { + } catch (final Exception ignore) { /* ignore, continue with dialog then. */ } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-04 22:24:01
|
Revision: 9 Author: christianhujer Date: 2006-04-04 15:23:49 -0700 (Tue, 04 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=9&view=rev Log Message: ----------- Set svn:ignore property. Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + classes dest developer.properties dist make This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |