[Japi-cvs] SF.net SVN: japi:[707] tools/fontbrowser/trunk
Status: Beta
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2008-11-30 15:57:20
|
Revision: 707
http://japi.svn.sourceforge.net/japi/?rev=707&view=rev
Author: christianhujer
Date: 2008-11-30 15:57:11 +0000 (Sun, 30 Nov 2008)
Log Message:
-----------
Improved font browser.
Modified Paths:
--------------
tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/FontBrowser.java
tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/action.properties
Added Paths:
-----------
tools/fontbrowser/trunk/build.xml
Added: tools/fontbrowser/trunk/build.xml
===================================================================
--- tools/fontbrowser/trunk/build.xml (rev 0)
+++ tools/fontbrowser/trunk/build.xml 2008-11-30 15:57:11 UTC (rev 707)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ DirCount is a program for converting Strings into byte arrays.
+ ~ Copyright (C) 2007 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.,
+ ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ -->
+
+<project name="dircount" default="compile">
+
+ <property name="module.version" value="0.1" />
+ <property name="module.name" value="dircount" />
+ <property name="module.shortname" value="dircount" />
+ <property name="module.title" value="DirCount" />
+ <property name="main.class" value="net.sf.japi.dircount.DirCount" />
+
+ <taskdef name="pack200" classpath="common/antlib/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" />
+
+ <target
+ name = "clean"
+ description = "Cleans Sandbox"
+ >
+ <delete dir="classes" />
+ <delete dir="docs" />
+ </target>
+
+ <target
+ name = "compile"
+ description = "Compiles production classes"
+ >
+ <mkdir dir="classes/production/${module.shortname}" />
+ <mkdir dir="classes/test/${module.shortname}" />
+ <javac
+ srcdir="src/prj"
+ destdir="classes/production/${module.shortname}"
+ encoding="utf-8"
+ source="1.5"
+ target="1.5"
+ >
+ <classpath>
+ <fileset dir="lib" includes="*.jar" excludes="LICENSE-*.jar" />
+ <fileset dir="common/lib" includes="*.jar" excludes="LICENSE-*.jar" />
+ </classpath>
+ <exclude name="test/**/*.java" />
+ </javac>
+ <copy
+ todir="classes/production/${module.shortname}"
+ >
+ <fileset dir="src/prj" includes="**/*.properties" excludes="test/**/*.properties" />
+ <fileset dir="src/prj" includes="META-INF/services/**" />
+ </copy>
+ <copy
+ todir="classes/production/${module.shortname}"
+ >
+ <fileset dir="lib" includes="LICENSE-*" />
+ <fileset dir="." includes="COPYING" />
+ </copy>
+ </target>
+
+ <target
+ name = "dist"
+ description = "Packs distribution archives."
+ depends = "clean, compile"
+ >
+ <!--depends = "clean, compile, doc"
+ -->
+ <delete dir="dist" />
+ <mkdir dir="dist" />
+ <property name="distName" value="dist/${module.name}-${module.version}" />
+ <parallel>
+ <tar tarfile="${distName}.src.tar">
+ <tarfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="src/**" />
+ <include name="build.xml" />
+ </tarfileset>
+ </tar>
+ <zip destfile="${distName}.src.zip">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="src/**" />
+ <include name="build.xml" />
+ </zipfileset>
+ </zip>
+ <jar destfile="${distName}.src.jar">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="src/**" />
+ <include name="build.xml" />
+ </zipfileset>
+ </jar>
+ <jar destfile="${distName}.jar">
+ <zipfileset dir="classes/production/${module.shortname}"/>
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ <attribute name="Class-Path" value="lib/annotations.jar lib/japi-lib-lang-0.1.jar lib/japi-lib-swing-about-0.1.jar lib/japi-lib-swing-action-0.1.jar" />
+ <attribute name="Implementation-Title" value="${module.name}" />
+ <attribute name="Implementation-Vendor" value="Christian Hujer + the JAPI Developers" />
+ <attribute name="Implementation-Version" value="${module.version}" />
+ <attribute name="Implementation-URL" value="http://sourceforge.net/projects/japi/" />
+ </manifest>
+ </jar>
+ <tar tarfile="${distName}.doc.tar">
+ <tarfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="docs/**" />
+ <include name="build.xml" />
+ </tarfileset>
+ </tar>
+ <zip destfile="${distName}.doc.zip">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="docs/**" />
+ <include name="build.xml" />
+ </zipfileset>
+ </zip>
+ <jar destfile="${distName}.doc.jar">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="docs/**" />
+ </zipfileset>
+ </jar>
+ </parallel>
+ <parallel>
+ <gzip src="${distName}.src.tar" destfile="${distName}.src.tar.gz" />
+ <bzip2 src="${distName}.src.tar" destfile="${distName}.src.tar.bz2" />
+ <gzip src="${distName}.doc.tar" destfile="${distName}.doc.tar.gz" />
+ <bzip2 src="${distName}.doc.tar" destfile="${distName}.doc.tar.bz2" />
+ <pack200
+ src="${distName}.jar"
+ destfile="${distName}.pack.gz"
+ gzipoutput="true"
+ stripdebug="true"
+ effort="9"
+ keepfileorder="false"
+ modificationtime="latest"
+ deflatehint="false"
+ />
+ </parallel>
+ <delete file="${distName}.src.tar" />
+ <delete file="${distName}.doc.tar" />
+ </target>
+
+ <target
+ name = "doc"
+ description = "Creates public javadoc documentation."
+ >
+ <mkdir dir="docs/api" />
+ <!--copy todir="docs/api" file="src/doc/api/public/copyright.html" />
+ <copy todir="docs/api" file="src/doc/api/public/.htaccess" /-->
+ <javadoc
+ destdir = "docs/api"
+ access = "protected"
+ author = "yes"
+ version = "yes"
+ locale = "en_US"
+ use = "yes"
+ splitindex = "yes"
+ windowtitle = "JAPI Library ${module.title} ${module.version} API documentation"
+ doctitle = "JAPI<br />Yet another Java API<br />Library ${module.title} ${module.version} API documentation"
+ header = "JAPI Library ${module.title} ${module.version}<br />API Documentation"
+ footer = "JAPI<br />Yet another Java API<br />Library ${module.title} ${module.version} API documentation"
+ bottom = "<div style=" text-align:center;">© 2005-2006 Christian Hujer. All rights reserved. See <a href="{@docRoot}/copyright.html">copyright</a></div>"
+ serialwarn = "yes"
+ charset = "utf-8"
+ docencoding = "utf-8"
+ encoding = "utf-8"
+ source = "1.5"
+ linksource = "yes"
+ link = "${user.javadoc.link}"
+ >
+ <!--
+ overview = "src/overview.html"
+ -->
+ <classpath>
+ <fileset dir="lib" includes="annotations.jar" />
+ </classpath>
+ <sourcepath>
+ <pathelement path="${user.javadoc.javasrc}" />
+ <pathelement path="src/prj" />
+ </sourcepath>
+ <packageset
+ dir="src/prj"
+ defaultexcludes="yes"
+ >
+ <include name="net/**" />
+ </packageset>
+ <tag enabled="true" name="retval" description="Return Values:" scope="methods" />
+ <tag enabled="true" name="pre" description="Preconditions:" scope="methods,constructors" />
+ <tag enabled="true" name="post" description="Postconditions:" scope="methods" />
+ <tag enabled="true" name="invariant" description="Invariant:" scope="methods,fields" />
+ <tag enabled="true" name="note" description="Notes:" />
+ <tag enabled="true" name="warning" description="Warnings:" />
+ <!--tag enabled="true" name="todo" description="Todo:" /-->
+ <taglet name="com.sun.tools.doclets.ToDoTaglet" path="" />
+ <tag enabled="true" name="fixme" description="Fixme:" />
+ <tag enabled="true" name="xxx" description="XXX:" />
+ </javadoc>
+ </target>
+
+ <target
+ name = "buildapp"
+ description = "Creates executable jar"
+ >
+ <property name="appName" value="${module.name}-${module.version}-app" />
+ <jar destfile="${appName}.jar">
+ <zipfileset dir="classes/production/${module.shortname}"/>
+ <zipgroupfileset dir="lib" includes="*.jar" excludes="LICENSE-*.jar" />
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ <!--attribute name="Class-Path" value="lib/annotations.jar lib/japi-lib-lang-0.1.jar lib/japi-lib-swing-about-0.1.jar lib/japi-lib-swing-action-0.1.jar" /-->
+ <attribute name="Implementation-Title" value="${module.name}" />
+ <attribute name="Implementation-Vendor" value="Christian Hujer + the JAPI Developers" />
+ <attribute name="Implementation-Version" value="${module.version}" />
+ <attribute name="Implementation-URL" value="http://sourceforge.net/projects/japi/" />
+ </manifest>
+ </jar>
+ </target>
+
+</project>
Property changes on: tools/fontbrowser/trunk/build.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ LF
Modified: tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/FontBrowser.java
===================================================================
--- tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/FontBrowser.java 2008-11-30 15:55:51 UTC (rev 706)
+++ tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/FontBrowser.java 2008-11-30 15:57:11 UTC (rev 707)
@@ -25,6 +25,7 @@
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Toolkit;
+import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
@@ -46,18 +47,24 @@
/** Action Builder. */
@NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.tools.fontbrowser");
+ /** Number of rows for the sample text. */
+ private static final int SAMPLETEXT_ROWS = 16;
+
+ /** Number of columns for the sample text. */
+ private static final int SAMPLETEXT_COLUMNS = 64;
+
+ private static final int DEFAULT_FONT_SIZE = 14;
+
+ /** No instantiation needed. */
+ private FontBrowser() {
+ }
+
/** Main program.
* @param args command line arguments
*/
public static void main(@NotNull final String... args) {
- //noinspection ResultOfObjectAllocationIgnored
- new FontBrowser();
- }
-
- /** Create a font browser. */
- public FontBrowser() {
final JFrame frame = new JFrame(ACTION_BUILDER.getString("frame.title"));
- final JTabbedPane tabs = new JTabbedPane();
+ final Container tabs = new JTabbedPane();
frame.add(tabs);
tabs.add(ACTION_BUILDER.getString("names.title"), createNamesTab());
tabs.add(ACTION_BUILDER.getString("fonts.title"), createFontsTab());
@@ -75,15 +82,15 @@
*/
@NotNull private static Component createNamesTab() {
final JList fontNameList = new JList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
- final JTextArea fontExample = new JTextArea(64, 16);
+ final JTextArea fontExample = new JTextArea(SAMPLETEXT_ROWS, SAMPLETEXT_COLUMNS);
fontNameList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(final ListSelectionEvent e) {
final String value = (String) fontNameList.getSelectedValue();
- fontExample.setFont(new Font(value, Font.PLAIN, 14));
+ fontExample.setFont(new Font(value, Font.PLAIN, DEFAULT_FONT_SIZE));
System.err.println(value);
}
});
- fontExample.setText("Falsches Üben von Xylophonmusik quält jeden größeren Zwerg.");
+ fontExample.setText(ACTION_BUILDER.getString("font.example.text"));
return new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, new JScrollPane(fontNameList), new JScrollPane(fontExample));
}
Modified: tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/action.properties
===================================================================
--- tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/action.properties 2008-11-30 15:55:51 UTC (rev 706)
+++ tools/fontbrowser/trunk/src/prj/net/sf/japi/tools/fontbrowser/action.properties 2008-11-30 15:57:11 UTC (rev 707)
@@ -20,3 +20,4 @@
frame.title=Font Browser
names.title=Font Names
fonts.title=Fonts
+font.example.text=Falsches \xDCben von Xylophonmusik qu\xE4lt jeden gr\xF6\xDFeren Zwerg.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|