mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 00:01:19 +08:00
Imported GNU Classpath 0.92
2006-08-14 Mark Wielaard <mark@klomp.org> Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. From-SVN: r116139
This commit is contained in:
parent
abab460491
commit
ac1ed908de
@ -1,3 +1,41 @@
|
||||
2006-08-14 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
Imported GNU Classpath 0.92
|
||||
* HACKING: Add more importing hints. Update automake version
|
||||
requirement.
|
||||
|
||||
* configure.ac (gconf-peer): New enable AC argument.
|
||||
Add --disable-gconf-peer and --enable-default-preferences-peer
|
||||
to classpath configure when gconf is disabled.
|
||||
* scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and
|
||||
gnu/java/awt/dnd/peer/gtk to bc. Classify
|
||||
gnu/java/security/Configuration.java as generated source file.
|
||||
|
||||
* gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMClassLoadingMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMRuntimeMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMThreadMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMMemoryMXBeanImpl.java,
|
||||
gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub
|
||||
classes.
|
||||
* java/lang/management/VMManagementFactory.java: Likewise.
|
||||
* java/net/VMURLConnection.java: Likewise.
|
||||
* gnu/java/nio/VMChannel.java: Likewise.
|
||||
|
||||
* java/lang/Thread.java (getState): Add stub implementation.
|
||||
* java/lang/Class.java (isEnum): Likewise.
|
||||
* java/lang/Class.h (isEnum): Likewise.
|
||||
|
||||
* gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed.
|
||||
|
||||
* javax/naming/spi/NamingManager.java: New override for StackWalker
|
||||
functionality.
|
||||
|
||||
* configure, sources.am, Makefile.in, gcj/Makefile.in,
|
||||
include/Makefile.in, testsuite/Makefile.in: Regenerated.
|
||||
|
||||
2006-08-14 Gary Benson <gbenson@redhat.com>
|
||||
|
||||
* java/lang/Thread.java (accessControlState): New field.
|
||||
|
@ -17,18 +17,23 @@ To import a new release:
|
||||
- Check out a classpath snapshot or take a release tar.gz file.
|
||||
I use 'cvs export' for this. Make a tag to ensure future hackers
|
||||
know exactly what revision was checked out; tags are of the form
|
||||
'libgcj-import-DATE'.
|
||||
'libgcj-import-DATE' (when using a tagged checkout do:
|
||||
- ./autogen.sh && ./configure && make dist
|
||||
to get a proper .tar.gz for importing below).
|
||||
- Get a svn checkout of
|
||||
svn+ssh://gcc.gnu.org/svn/gcc/branches/CLASSPATH/libjava/classpath
|
||||
this contains "pure" GNU Classpath inside the GCC tree.
|
||||
- Clean it up and get the files from a new version:
|
||||
- find classpath -type f | grep -v /\.svn | grep -v /\.cvs
|
||||
- find classpath -type f | grep -v /\.svn | grep -v /\.cvs | xargs rm
|
||||
- tar zxf classpath-x.tar.gz
|
||||
- cp -r classpath-x/* classpath
|
||||
- Add/Remove files:
|
||||
- svn status classpath | grep ^\! | cut -c8- | xargs svn remove
|
||||
- svn status classpath | grep ^\? | cut -c8- | xargs svn add
|
||||
- If there are any empty directories now they can be removed.
|
||||
- If there are any empty directories now they can be removed. You can find
|
||||
candidates (dirs with files removed) with:
|
||||
- for i in `svn status classpath | grep ^D | cut -c8-`; \
|
||||
do ls -d `dirname $i`; done | uniq
|
||||
- Update vendor branch
|
||||
- svn commit classpath
|
||||
- Note the new revision number (Xrev)
|
||||
@ -43,7 +48,7 @@ To import a new release:
|
||||
in the classpath/ChangeLog.gcj file.
|
||||
(Don't forget to svn resolved files.)
|
||||
- Use auto* to create configure, Makefile.in, etc
|
||||
Make sure you have Automake 1.9.3 installed. Exactly that version!
|
||||
Make sure you have Automake 1.9.6 installed. Exactly that version!
|
||||
You have to make sure to use the gcc libtool.m4 and gcc lt* scripts
|
||||
cd .../classpath
|
||||
cp ../../lt* .
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -46,19 +46,24 @@ Suggested Software
|
||||
are required unless --disable-gtk-peer is used as an argument to
|
||||
configure.
|
||||
|
||||
- GTK+ 2.4.x (or higher)
|
||||
- GTK+ 2.8.x (or higher)
|
||||
- gdk-pixbuf
|
||||
|
||||
- XTest Extension (libXtst) for GdkRobot support in java.awt.
|
||||
|
||||
For building the Cairo GdkGraphics2D backend you need at least
|
||||
Cairo 0.5.0.
|
||||
For building gcjwebplugin you'll need the Mozilla plugin
|
||||
support headers and libraries.
|
||||
|
||||
For building the Qt AWT peer JNI native libraries you have to
|
||||
specify --enable-qt-peer and need the following library:
|
||||
|
||||
- Qt 4.0.1
|
||||
|
||||
For building the X AWT peers see information below
|
||||
(Building and running with the X AWT peers). You will need
|
||||
the Escher 0.2.3 library:
|
||||
http://escher.sourceforge.net
|
||||
|
||||
Please note that at the moment most operating systems do not
|
||||
ship Qt4 by default. We recommend using GNU Classpath' Qt4
|
||||
support only for its developers and bug reporters. See
|
||||
@ -113,17 +118,22 @@ gives a complete list.
|
||||
--enable-java compile Java source default=yes
|
||||
--enable-jni compile JNI source default=yes
|
||||
--enable-gtk-peer compile GTK native peers default=yes
|
||||
--enable-gtk-cairo compile cairo based Graphics2D default=no
|
||||
--enable-qt-peer compile Qt4 native peers default=no
|
||||
--enable-default-toolkit
|
||||
fully qualified class name of default AWT toolkit
|
||||
default=no
|
||||
--enable-xmlj compile native libxml/xslt library default=no
|
||||
--enable-load-library enable to use JNI native methods default=yes
|
||||
--enable-local-sockets enable build of local Unix sockets
|
||||
--with-jikes to compile the class library using jikes
|
||||
the default is to use gcj
|
||||
--with-glibj define what to install (zip|flat|both|none)
|
||||
default=zip
|
||||
--with-escher=/path/to/escher
|
||||
enable build of the X/Escher peers, with
|
||||
the escher library at /path/to/escher, either
|
||||
in the form of a JAR file, or a directory
|
||||
containing the .class files of Escher.
|
||||
--enable-Werror whether to compile C code with -Werror which turns
|
||||
any compiler warning into a compilation failure
|
||||
default=no
|
||||
@ -164,6 +174,25 @@ export LD_LIBRARY_PATH CLASSPATH
|
||||
More information about the VMs that use GNU Classpath can be found in the
|
||||
README file.
|
||||
|
||||
------------------------------------------------------------------
|
||||
Building and running with the X AWT peers
|
||||
------------------------------------------------------------------
|
||||
|
||||
In order build the X peers you need the Escher library version 0.2.3
|
||||
from http://escher.sourceforge.net . Unpack (and optionally build) the
|
||||
Escher library following the instructions in the downloaded
|
||||
package. Enable the build of the X peers by passing
|
||||
--with-escher=/path/to/escher to ./configure where /path/to/escher
|
||||
either points to a directory structure or JAR file containing the
|
||||
Escher classes. For Unix systems it is preferable to also build local
|
||||
socket support by passing --enable-local-sockets, which accelerates
|
||||
the network communication to the X server significantly.
|
||||
|
||||
In this release you have to enable the X peers at runtime by
|
||||
setting the system property awt.toolkit=gnu.java.awt.peer.x.XToolkit
|
||||
by passing -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit to the java
|
||||
command when running an application.
|
||||
|
||||
------------------------------------------------------------------
|
||||
Misc. Notes
|
||||
------------------------------------------------------------------
|
||||
|
@ -38,8 +38,10 @@ host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(top_srcdir)/configure \
|
||||
$(top_srcdir)/gnu/classpath/Configuration.java.in AUTHORS \
|
||||
COPYING ChangeLog INSTALL NEWS TODO compile config.guess \
|
||||
$(top_srcdir)/gnu/classpath/Configuration.java.in \
|
||||
$(top_srcdir)/gnu/java/security/Configuration.java.in \
|
||||
$(top_srcdir)/resource/META-INF/services/java.util.prefs.PreferencesFactory.in \
|
||||
AUTHORS COPYING ChangeLog INSTALL NEWS TODO config.guess \
|
||||
config.sub depcomp install-sh ltcf-c.sh ltcf-cxx.sh \
|
||||
ltcf-gcj.sh ltconfig ltmain.sh missing mkinstalldirs
|
||||
subdir = .
|
||||
@ -57,7 +59,9 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = gnu/classpath/Configuration.java
|
||||
CONFIG_CLEAN_FILES = gnu/classpath/Configuration.java \
|
||||
gnu/java/security/Configuration.java \
|
||||
resource/META-INF/services/java.util.prefs.PreferencesFactory
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
@ -109,6 +113,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -129,6 +135,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -159,6 +166,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -209,6 +220,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -229,6 +241,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
@ -341,6 +355,10 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
gnu/classpath/Configuration.java: $(top_builddir)/config.status $(top_srcdir)/gnu/classpath/Configuration.java.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
gnu/java/security/Configuration.java: $(top_builddir)/config.status $(top_srcdir)/gnu/java/security/Configuration.java.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
resource/META-INF/services/java.util.prefs.PreferencesFactory: $(top_builddir)/config.status $(top_srcdir)/resource/META-INF/services/java.util.prefs.PreferencesFactory.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
@ -487,7 +505,7 @@ distclean-tags:
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/../.. $(distdir)/examples $(distdir)/gnu/classpath $(distdir)/lib $(distdir)/m4 $(distdir)/scripts $(distdir)/tools
|
||||
$(mkdir_p) $(distdir)/../.. $(distdir)/examples $(distdir)/gnu/classpath $(distdir)/gnu/java/security $(distdir)/lib $(distdir)/m4 $(distdir)/resource/META-INF/services $(distdir)/scripts $(distdir)/tools
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
|
@ -1,3 +1,101 @@
|
||||
New in release 0.92 (Aug 9, 2006)
|
||||
|
||||
* libjawtgnu.so has been renamed libjawt.so for binary compatibility.
|
||||
libjawt.so should be installed in a VM-specific directory rather
|
||||
than directly in /usr/lib. Proprietary VMs put their libjawt.so
|
||||
implementations in VM-specific directories but search /usr/lib first.
|
||||
If GNU Classpath's libjawt.so is installed in /usr/lib it will create
|
||||
problems for people who use a proprietary VM to run AWT Native
|
||||
Interface applications.
|
||||
* The GdkGraphics2D backend has been made the default. There is no
|
||||
longer an explicit dependency on Cairo, the --enable-gtk-cairo
|
||||
configure option is gone, and GTK 2.8 or higher is now required to
|
||||
build the GTK peers.
|
||||
* A Mozilla plugin, 'gcjwebplugin', is now included. It introduces a
|
||||
dependency on the Mozilla plugin support headers and libraries.
|
||||
* New java implementations of png and gif imageio readers and writers.
|
||||
* A tools.texinfo document has been created and now includes
|
||||
documentation about:
|
||||
* appletviewer
|
||||
* gcjwebplugin
|
||||
* jarsigner
|
||||
* keytool
|
||||
* Several new tools are now included:
|
||||
* appletviewer
|
||||
* jar
|
||||
* native2ascii
|
||||
* serialver
|
||||
* keytool
|
||||
* jarsigner
|
||||
A new configure option --enable-tool-wrappers causes wrapper
|
||||
binaries to be built for VMs that support the JNI Invocation API.
|
||||
* javax.sound.midi providers have been added to read and
|
||||
write standard MIDI files.
|
||||
* A javax.sound.sampled .au and .wav file readers have been added.
|
||||
* New Java Virtual Machine Tool Interface header, jvmti.h.
|
||||
* AWT peers for X Windows based on Escher (a pure java X protocol
|
||||
implementation) have been added. So far it supports AWT 1.1 style
|
||||
Graphics, image loading via ImageIO (PNG, GIF and BMP images in this
|
||||
release), top level components as well as mouse and keyboard input.
|
||||
It is capable of running many Swing applications. Graphics2D and
|
||||
AWT widgets are not yet supported with this peer set.
|
||||
* GConf based util.peers backend (see the --enable-gconf-peer and
|
||||
--enable-default-preferences-peer configure options).
|
||||
* Support for batch importing trusted certificates for use with ssl
|
||||
connections (see script/import-cacerts.sh).
|
||||
* NIO scatter-gather channel support.
|
||||
|
||||
Runtime interface changes:
|
||||
|
||||
* A new class, VMURLConnection, is used to implement
|
||||
URLConnection.guessContentTypeFromStream. The reference
|
||||
implementation uses libmagic (and falls back to doing nothing if
|
||||
libmagic is not available).
|
||||
* The method gnu.java.io.PlatformHelper.toCanonicalForm() has been
|
||||
replaced with a JNI implementation of VMFile.toCanonicalForm() for
|
||||
GNU/Posix systems.
|
||||
* A new class, VMRuntimeMXBeanImpl, is used to implement
|
||||
the low-level support of the runtime management bean.
|
||||
VMs should use it to supply the input arguments and start
|
||||
time of the VM. In addition, one of sun.boot.class.path
|
||||
or java.boot.class.path should be defined by the VM to
|
||||
support the optional boot class path access functionality.
|
||||
* The Unsafe class was moved back to the place expected by the JSR 166
|
||||
reference implementation. We've also added a couple other new VM
|
||||
classes to support the JSR 166 code -- sun.reflect.Reflection and
|
||||
sun.reflect.misc.ReflectUtil.
|
||||
* Another new class, VMClassLoadingMXBeanImpl, is used to implement
|
||||
the low-level support of the class loading management bean.
|
||||
VMs need to supply it with information about how many classes
|
||||
are currently loaded, how many have been unloaded and whether
|
||||
verbose class loading output is on or off. Provision should also
|
||||
be made for the latter to be toggled at runtime.
|
||||
* VMThreadMXBeanImpl is used to implement the low-level support
|
||||
of the thread management bean. Providing this interface requires
|
||||
providing a fair amount of information about threads, including
|
||||
optional time and contention monitoring, and instances of the
|
||||
new ThreadInfo class in java.lang.management. getState() has also
|
||||
been added to the VMThread interface; this is required by the bean
|
||||
as well as java.lang.Thread.
|
||||
* VMMemoryMXBeanImpl is used to implement the low-level support
|
||||
of the memory management bean. Providing this interface requires
|
||||
providing information about the levels of heap and non-heap memory,
|
||||
and the number of objects eligible for garbage collection.
|
||||
* VMCompilationMXBeanImpl is used to allow for optional compilation
|
||||
time support for Just-In-Time compilers.
|
||||
* VMMemoryPoolMXBeanImpl is used to implement the low-level support
|
||||
of the memory pool beans. Providing this interface requires
|
||||
providing memory usage statistics for each supported bean.
|
||||
* VMManagementFactory provides the names of the memory pools,
|
||||
memory managers and garbage collectors maintained by the virtual
|
||||
machine. These are used to create the beans by the ManagementFactory.
|
||||
* VMMemoryManagerMXBeanImpl and VMGarbageCollectorMXBeanImpl provide
|
||||
low-level support for memory managers (including the specific subclass
|
||||
of garbage collecting memory managers). The interfaces for these
|
||||
require no more than enumerating the number of collections and the
|
||||
time spent (for garbage collectors) and a relationship to the memory
|
||||
pools (for all), along with a validity check.
|
||||
|
||||
New in release 0.91 (May 15, 2006)
|
||||
|
||||
* Experimental activation (java.rmi.activation) support, including RMI
|
||||
|
@ -1,21 +1,21 @@
|
||||
GNU Classpath README - Last updated: May 15, 2006
|
||||
GNU Classpath README - Last updated: August 6, 2006 (for release 0.92)
|
||||
|
||||
GNU Classpath, Essential Libraries for Java is a project to create a
|
||||
free software implementation of the core class libraries for the java
|
||||
programming language.
|
||||
|
||||
Additionally GNU Classpath includes a sub-project called GNU Classpath
|
||||
Tools whose goal is to provide a number of free replacements for
|
||||
standard Java development tools like javadoc, javap, javah, and
|
||||
others. And a sub-project called GNU Inetlib, an extension library to
|
||||
provide extra network protocol support (ftp, finger, gopher) for GNU
|
||||
Classpath, but it can also standalone to ease adding http, imap, pop3
|
||||
and smtp client support to applictions. These subprojects are normally
|
||||
released independent from the core libraries.
|
||||
Additionally, GNU Classpath includes a sub-project called GNU Classpath
|
||||
Tools whose goal is to provide a number of free replacements for standard
|
||||
Java development tools like javadoc, javap, and others. A sub-project
|
||||
called GNU Inetlib, can be used as an extension library to provide extra
|
||||
network protocol support (ftp, finger, gopher) for GNU Classpath. It can
|
||||
also be used as a standalone to ease adding http, imap, pop3 and smtp
|
||||
client support to applictions. These subprojects are normally released
|
||||
independently from the core libraries.
|
||||
|
||||
This is a development snapshot release only and is not for general
|
||||
purpose use. GNU Classpath needs to be combine with a proper
|
||||
development environments to be useable for end users. Eventually,
|
||||
purpose use. GNU Classpath needs to be combined with a proper
|
||||
development environment to be useable for end users. Eventually,
|
||||
these essential libraries for java will work with as many free
|
||||
compilers and runtimes as possible.
|
||||
|
||||
@ -31,24 +31,22 @@ with this GNU Classpath releases include
|
||||
|
||||
* CACAO (http://www.cacaojvm.org/)
|
||||
* JamVM (http://jamvm.sourceforge.net/)
|
||||
* Jikes RVM (http://www.ibm.com/developerworks/oss/jikesrvm/)
|
||||
* Kissme (http://kissme.sourceforge.net/)
|
||||
* Jikes RVM (http://jikesrvm.sourceforge.net/)
|
||||
|
||||
In general the latest releases of the above VMs will work out of the box
|
||||
with the latest GNU Classpath release (and in most cases directly with the
|
||||
development sources from CVS).
|
||||
|
||||
Besides combining GNU Classpath with the runtimes and compilers above
|
||||
you might want to add support for encryption libraries as provided by
|
||||
GNU Crypto (http://www.gnu.org/software/gnu-crypto/).
|
||||
And for additional extension libraries (mail, xml, activation, infobus,
|
||||
servlet) check out GNU ClasspathX (http://www.gnu.org/software/classpathx).
|
||||
you might want to add support for additional extension libraries (mail,
|
||||
activation, infobus, servlet) check out the GNU ClasspathX project
|
||||
(http://www.gnu.org/software/classpathx/).
|
||||
|
||||
Some tools come with their own customized version of GNU Classpath.
|
||||
Please check if there is a customised version available for the tool you
|
||||
use before trying the bare bones GNU Classpath release. We are working with
|
||||
Please check if there is a customized version available for the tool you
|
||||
use before trying the bare bones GNU Classpath release. We are working with
|
||||
the tool creators to keep the differences between the core classes as small
|
||||
as possible. Please tell us if you make GNU Classpath work with a new tool.
|
||||
as possible. Please tell us if you make GNU Classpath work with a new tool.
|
||||
|
||||
Active projects which use modified versions of the Classpath libraries
|
||||
some of which synchronizes with the Classpath CVS head every couple of weeks:
|
||||
@ -57,9 +55,9 @@ some of which synchronizes with the Classpath CVS head every couple of weeks:
|
||||
* JC (http://jcvm.sourceforge.net/)
|
||||
* JNode (http://jnode.sourceforge.net/)
|
||||
* MysaifuVM (http://www2s.biglobe.ne.jp/~dat/java/project/jvm/)
|
||||
* SableVM (http://www.sablevm.org)
|
||||
* SableVM (http://www.sablevm.org/)
|
||||
|
||||
See for a more complete list of GNU Classpath based projects the
|
||||
For a more complete list of GNU Classpath based projects, see the
|
||||
GNU Classpath website: http://www.gnu.org/software/classpath/stories.html
|
||||
|
||||
See the file INSTALL for details on installing GNU Classpath.
|
||||
@ -69,23 +67,25 @@ See the file HACKING for working on (non-released) CVS development versions.
|
||||
|
||||
Homepage: http://www.gnu.org/software/classpath/
|
||||
|
||||
Bugs should be reported via bugzilla, available from the GNU Classpath
|
||||
website: http://www.gnu.org/software/classpath/bugs.html
|
||||
|
||||
General Mailing List: classpath@gnu.org
|
||||
--> Bugs and patches can be reported via Savannah if you have a browser
|
||||
or via this address otherwise.
|
||||
--> To subscribe send email to classpath-request@gnu.org with a
|
||||
subject and body of "subscribe". To unsubscribe do the same,
|
||||
only with a body and subject of "unsubscribe". This is a
|
||||
smartlist managed mailing list.
|
||||
|
||||
CVS Commit, Bugs and Patches List: commit-classpath@gnu.org
|
||||
--> To subscribe send email to commit-classpath-request@gnu.org with a
|
||||
Patches Mailing List: classpath-patches@gnu.org
|
||||
--> Proposed patches should be sent to the GNU Classpath patches list
|
||||
--> To subscribe send email to classpath-patches-request@gnu.org with a
|
||||
subject and body of "subscribe". To unsubscribe do the same,
|
||||
only with a body and subject of "unsubscribe". This is a
|
||||
smartlist managed mailing list.
|
||||
|
||||
Anonymous CVS:
|
||||
--> export CVS_RSH="ssh"
|
||||
--> cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/classpath co classpath
|
||||
--> "cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath
|
||||
co classpath"
|
||||
--> More detailed instructions available on the Savannah project website.
|
||||
http://savannah.gnu.org/projects/classpath/
|
||||
|
||||
|
@ -27,6 +27,7 @@ Steven Hugg (hugg@pobox.com)
|
||||
jockey@aromasoft.com
|
||||
Isaac Jones (ijones@cis.ohio-state.edu)
|
||||
Oskar Liljeblad (osk@hem.passagen.se)
|
||||
Trevor Linton (tlinton@xmission.com)
|
||||
Casey Marshall (rsdio@metastatic.org)
|
||||
Steve Mayer (SMayer@dynamicsoft.com)
|
||||
Matt Mucklo (mmucklo@jumpsmart.com)
|
||||
|
23
libjava/classpath/aclocal.m4
vendored
23
libjava/classpath/aclocal.m4
vendored
@ -468,6 +468,27 @@ AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
||||
# From Jim Meyering
|
||||
|
||||
@ -873,8 +894,6 @@ AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([../../config/depstand.m4])
|
||||
m4_include([../../config/lead-dot.m4])
|
||||
m4_include([../../libtool.m4])
|
||||
m4_include([m4/acattribute.m4])
|
||||
m4_include([m4/accross.m4])
|
||||
|
@ -41,11 +41,14 @@ if autoconf --version < /dev/null > /dev/null 2>&1 ; then
|
||||
2.59*)
|
||||
have_autoconf=true
|
||||
;;
|
||||
2.60*)
|
||||
have_autoconf=true
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if $have_autoconf ; then : ; else
|
||||
echo
|
||||
echo "You must have autoconf 2.59 installed to compile $PROJECT."
|
||||
echo "You must have autoconf 2.59 or 2.60 installed for $PROJECT."
|
||||
echo "Install the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
|
||||
DIE=1
|
||||
|
50
libjava/classpath/config.guess
vendored
50
libjava/classpath/config.guess
vendored
@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2005-11-11'
|
||||
timestamp='2006-05-13'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -106,7 +107,7 @@ set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
@ -206,6 +207,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:ekkoBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:SolidBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -764,7 +768,14 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
@ -780,7 +791,10 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[345]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T:Interix*:[345]*)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
@ -851,7 +865,11 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
@ -870,7 +888,11 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
@ -919,6 +941,9 @@ EOF
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
@ -964,7 +989,7 @@ EOF
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#ifdef __INTEL_COMPILER
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
@ -974,7 +999,11 @@ EOF
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
@ -1263,6 +1292,9 @@ EOF
|
||||
i*86:skyos:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
|
||||
exit ;;
|
||||
i*86:rdos:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-rdos
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
|
73
libjava/classpath/config.sub
vendored
73
libjava/classpath/config.sub
vendored
@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2005-12-06'
|
||||
timestamp='2006-05-13'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@ -119,8 +120,9 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
|
||||
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@ -247,7 +249,8 @@ case $basic_machine in
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@ -267,16 +270,17 @@ case $basic_machine in
|
||||
| mn10200 | mn10300 \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
@ -284,9 +288,6 @@ case $basic_machine in
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m32c)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
@ -294,10 +295,10 @@ case $basic_machine in
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||
;;
|
||||
ms1)
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
ms1)
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@ -327,7 +328,7 @@ case $basic_machine in
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
@ -349,17 +350,18 @@ case $basic_machine in
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
@ -370,8 +372,6 @@ case $basic_machine in
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
m32c-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
386bsd)
|
||||
@ -708,7 +708,7 @@ case $basic_machine in
|
||||
os=-msdos
|
||||
;;
|
||||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
@ -817,6 +817,12 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pc98)
|
||||
basic_machine=i386-pc
|
||||
;;
|
||||
pc98-*)
|
||||
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
@ -873,6 +879,10 @@ case $basic_machine in
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
@ -1115,7 +1125,7 @@ case $basic_machine in
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@ -1188,21 +1198,23 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku*)
|
||||
| -skyos* | -haiku* | -rdos*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1354,6 +1366,9 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
@ -1363,9 +1378,9 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
|
532
libjava/classpath/configure
vendored
532
libjava/classpath/configure
vendored
@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.59 for GNU Classpath 0.92-pre.
|
||||
# Generated by GNU Autoconf 2.59 for GNU Classpath 0.92.
|
||||
#
|
||||
# Report bugs to <classpath@gnu.org>.
|
||||
#
|
||||
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='GNU Classpath'
|
||||
PACKAGE_TARNAME='classpath'
|
||||
PACKAGE_VERSION='0.92-pre'
|
||||
PACKAGE_STRING='GNU Classpath 0.92-pre'
|
||||
PACKAGE_VERSION='0.92'
|
||||
PACKAGE_STRING='GNU Classpath 0.92'
|
||||
PACKAGE_BUGREPORT='classpath@gnu.org'
|
||||
|
||||
ac_unique_file="java/lang/System.java"
|
||||
@ -312,7 +312,7 @@ ac_includes_default="\
|
||||
# include <unistd.h>
|
||||
#endif"
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LIBVERSION CLASSPATH_MODULE CLASSPATH_CONVENIENCE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CREATE_COLLECTIONS_TRUE CREATE_COLLECTIONS_FALSE CREATE_JNI_LIBRARIES_TRUE CREATE_JNI_LIBRARIES_FALSE CREATE_CORE_JNI_LIBRARIES_TRUE CREATE_CORE_JNI_LIBRARIES_FALSE default_toolkit CREATE_XMLJ_LIBRARY_TRUE CREATE_XMLJ_LIBRARY_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP CREATE_ALSA_LIBRARIES_TRUE CREATE_ALSA_LIBRARIES_FALSE CREATE_DSSI_LIBRARIES_TRUE CREATE_DSSI_LIBRARIES_FALSE CREATE_GTK_PEER_LIBRARIES_TRUE CREATE_GTK_PEER_LIBRARIES_FALSE CREATE_QT_PEER_LIBRARIES_TRUE CREATE_QT_PEER_LIBRARIES_FALSE CREATE_PLUGIN_TRUE CREATE_PLUGIN_FALSE nativeexeclibdir glibjdir VM_BINARY FOUND_CACAO_TRUE FOUND_CACAO_FALSE CREATE_JNI_HEADERS_TRUE CREATE_JNI_HEADERS_FALSE CREATE_WRAPPERS_TRUE CREATE_WRAPPERS_FALSE LN_S CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB LIBTOOL CXXCPP PERL COLLECTIONS_PREFIX LIBMAGIC LIBICONV LTLIBICONV WARNING_CFLAGS STRICT_WARNING_CFLAGS ERROR_CFLAGS PKG_CONFIG XML_CFLAGS XML_LIBS XSLT_CFLAGS XSLT_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CFLAGS GTK_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS XTEST_LIBS QT_CFLAGS QT_LIBS MOC MOZILLA_CFLAGS MOZILLA_LIBS GLIB_CFLAGS GLIB_LIBS PLUGIN_DIR USER_JAVAH USER_SPECIFIED_JAVAH_TRUE USER_SPECIFIED_JAVAH_FALSE CLASSPATH_INCLUDES GCJ JIKES JIKESENCODING JIKESWARNINGS KJC GCJX ECJ FOUND_GCJ_TRUE FOUND_GCJ_FALSE FOUND_JIKES_TRUE FOUND_JIKES_FALSE FOUND_ECJ_TRUE FOUND_ECJ_FALSE FOUND_KJC_TRUE FOUND_KJC_FALSE FOUND_GCJX_TRUE FOUND_GCJX_FALSE USER_CLASSLIB USER_SPECIFIED_CLASSLIB_TRUE USER_SPECIFIED_CLASSLIB_FALSE vm_classes MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBDEBUG INIT_LOAD_LIBRARY JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION REMOVE MKDIR CP DATE FIND ZIP FASTJAR INSTALL_GLIBJ_ZIP_TRUE INSTALL_GLIBJ_ZIP_FALSE INSTALL_CLASS_FILES_TRUE INSTALL_CLASS_FILES_FALSE BUILD_CLASS_FILES_TRUE BUILD_CLASS_FILES_FALSE EXAMPLESDIR GJDOC CREATE_API_DOCS_TRUE CREATE_API_DOCS_FALSE JAY JAY_SKELETON REGEN_PARSERS_TRUE REGEN_PARSERS_FALSE USE_PREBUILT_GLIBJ_ZIP_TRUE USE_PREBUILT_GLIBJ_ZIP_FALSE PATH_TO_GLIBJ_ZIP ENABLE_LOCAL_SOCKETS_TRUE ENABLE_LOCAL_SOCKETS_FALSE LIBOBJS LTLIBOBJS'
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LIBVERSION CLASSPATH_MODULE CLASSPATH_CONVENIENCE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CREATE_COLLECTIONS_TRUE CREATE_COLLECTIONS_FALSE CREATE_JNI_LIBRARIES_TRUE CREATE_JNI_LIBRARIES_FALSE CREATE_CORE_JNI_LIBRARIES_TRUE CREATE_CORE_JNI_LIBRARIES_FALSE CREATE_GCONF_PEER_LIBRARIES_TRUE CREATE_GCONF_PEER_LIBRARIES_FALSE default_toolkit CREATE_XMLJ_LIBRARY_TRUE CREATE_XMLJ_LIBRARY_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP CREATE_ALSA_LIBRARIES_TRUE CREATE_ALSA_LIBRARIES_FALSE CREATE_DSSI_LIBRARIES_TRUE CREATE_DSSI_LIBRARIES_FALSE CREATE_GTK_PEER_LIBRARIES_TRUE CREATE_GTK_PEER_LIBRARIES_FALSE CREATE_QT_PEER_LIBRARIES_TRUE CREATE_QT_PEER_LIBRARIES_FALSE CREATE_PLUGIN_TRUE CREATE_PLUGIN_FALSE nativeexeclibdir glibjdir VM_BINARY FOUND_CACAO_TRUE FOUND_CACAO_FALSE CREATE_JNI_HEADERS_TRUE CREATE_JNI_HEADERS_FALSE CREATE_WRAPPERS_TRUE CREATE_WRAPPERS_FALSE LN_S CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB LIBTOOL CXXCPP PERL COLLECTIONS_PREFIX LIBMAGIC LIBICONV LTLIBICONV WARNING_CFLAGS STRICT_WARNING_CFLAGS ERROR_CFLAGS PKG_CONFIG XML_CFLAGS XML_LIBS XSLT_CFLAGS XSLT_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CFLAGS GTK_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS XTEST_LIBS GCONF_CFLAGS GCONF_LIBS GDK_CFLAGS GDK_LIBS QT_CFLAGS QT_LIBS MOC MOZILLA_CFLAGS MOZILLA_LIBS GLIB_CFLAGS GLIB_LIBS PLUGIN_DIR USER_JAVAH USER_SPECIFIED_JAVAH_TRUE USER_SPECIFIED_JAVAH_FALSE CLASSPATH_INCLUDES GCJ JIKES JIKESENCODING JIKESWARNINGS KJC GCJX ECJ FOUND_GCJ_TRUE FOUND_GCJ_FALSE FOUND_JIKES_TRUE FOUND_JIKES_FALSE FOUND_ECJ_TRUE FOUND_ECJ_FALSE FOUND_KJC_TRUE FOUND_KJC_FALSE FOUND_GCJX_TRUE FOUND_GCJX_FALSE USER_CLASSLIB USER_SPECIFIED_CLASSLIB_TRUE USER_SPECIFIED_CLASSLIB_FALSE vm_classes MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBDEBUG INIT_LOAD_LIBRARY JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION REMOVE MKDIR CP DATE FIND ZIP FASTJAR INSTALL_GLIBJ_ZIP_TRUE INSTALL_GLIBJ_ZIP_FALSE INSTALL_CLASS_FILES_TRUE INSTALL_CLASS_FILES_FALSE BUILD_CLASS_FILES_TRUE BUILD_CLASS_FILES_FALSE EXAMPLESDIR GJDOC CREATE_API_DOCS_TRUE CREATE_API_DOCS_FALSE JAY JAY_SKELETON REGEN_PARSERS_TRUE REGEN_PARSERS_FALSE USE_PREBUILT_GLIBJ_ZIP_TRUE USE_PREBUILT_GLIBJ_ZIP_FALSE PATH_TO_GLIBJ_ZIP USE_ESCHER_TRUE USE_ESCHER_FALSE PATH_TO_ESCHER ENABLE_LOCAL_SOCKETS_TRUE ENABLE_LOCAL_SOCKETS_FALSE DEFAULT_PREFS_PEER LIBOBJS LTLIBOBJS'
|
||||
ac_subst_files=''
|
||||
|
||||
# Initialize some variables set by options.
|
||||
@ -793,7 +793,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures GNU Classpath 0.92-pre to adapt to many kinds of systems.
|
||||
\`configure' configures GNU Classpath 0.92 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@ -864,7 +864,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of GNU Classpath 0.92-pre:";;
|
||||
short | recursive ) echo "Configuration of GNU Classpath 0.92:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@ -874,6 +874,12 @@ Optional Features:
|
||||
--enable-collections create collections.jar default=no
|
||||
--enable-jni compile JNI source default=yes
|
||||
--enable-core-jni compile JNI sources for core default=yes
|
||||
--enable-default-preferences-peer
|
||||
fully qualified class name of default Preferences
|
||||
API Backend
|
||||
--disable-gconf-peer compile GConf native peers (disabled by
|
||||
--disable-jni) default=yes
|
||||
|
||||
--enable-Werror whether to compile C code with -Werror which turns
|
||||
any compiler warning into a compilation failure
|
||||
default=no
|
||||
@ -888,7 +894,6 @@ Optional Features:
|
||||
default=yes
|
||||
--disable-gtk-peer compile GTK native peers (disabled by --disable-jni)
|
||||
default=yes
|
||||
|
||||
--enable-qt-peer compile Qt4 native peers (disabled by --disable-jni)
|
||||
default=no
|
||||
--disable-plugin compile gcjwebplugin (disabled by --disable-plugin)
|
||||
@ -944,6 +949,7 @@ Optional Packages:
|
||||
path to the jay executable
|
||||
--with-glibj-zip=ABS.PATH
|
||||
use prebuilt glibj.zip class library
|
||||
--with-escher=ABS.PATH specify path to escher dir or JAR for X peers
|
||||
|
||||
Some influential environment variables:
|
||||
CC C compiler command
|
||||
@ -1056,7 +1062,7 @@ fi
|
||||
test -n "$ac_init_help" && exit 0
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
GNU Classpath configure 0.92-pre
|
||||
GNU Classpath configure 0.92
|
||||
generated by GNU Autoconf 2.59
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
@ -1070,7 +1076,7 @@ cat >&5 <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by GNU Classpath $as_me 0.92-pre, which was
|
||||
It was created by GNU Classpath $as_me 0.92, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@ -1818,7 +1824,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='classpath'
|
||||
VERSION='0.92-pre'
|
||||
VERSION='0.92'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@ -2100,6 +2106,46 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-default-preferences-peer or --disable-default-preferences-peer was given.
|
||||
if test "${enable_default_preferences_peer+set}" = set; then
|
||||
enableval="$enable_default_preferences_peer"
|
||||
|
||||
fi;
|
||||
DEFAULT_PREFS_PEER=$enable_default_preferences_peer
|
||||
if test "$DEFAULT_PREFS_PEER" = ""; then
|
||||
DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
|
||||
fi
|
||||
|
||||
# Check whether --enable-gconf-peer or --disable-gconf-peer was given.
|
||||
if test "${enable_gconf_peer+set}" = set; then
|
||||
enableval="$enable_gconf_peer"
|
||||
case "${enableval}" in
|
||||
yes) COMPILE_GCONF_PEER=yes ;;
|
||||
no) COMPILE_GCONF_PEER=no ;;
|
||||
*) COMPILE_GCONF_PEER=yes ;;
|
||||
esac
|
||||
else
|
||||
COMPILE_GCONF_PEER=yes
|
||||
fi;
|
||||
|
||||
|
||||
if test "x${COMPILE_GCONF_PEER}" = xyes; then
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE=
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE='#'
|
||||
else
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE='#'
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-gconf-peers or --disable-gconf-peers was given.
|
||||
if test "${enable_gconf_peers+set}" = set; then
|
||||
enableval="$enable_gconf_peers"
|
||||
{ { echo "$as_me:$LINENO: error: No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer" >&5
|
||||
echo "$as_me: error: No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi;
|
||||
|
||||
# Check whether --enable-Werror or --disable-Werror was given.
|
||||
if test "${enable_Werror+set}" = set; then
|
||||
enableval="$enable_Werror"
|
||||
@ -5666,7 +5712,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
|
||||
case $host in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 5669 "configure"' > conftest.$ac_ext
|
||||
echo '#line 5715 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@ -10007,7 +10053,7 @@ ac_x_header_dirs='
|
||||
/usr/openwin/share/include'
|
||||
|
||||
if test "$ac_x_includes" = no; then
|
||||
# Guess where to find include files, by looking for Intrinsic.h.
|
||||
# Guess where to find include files, by looking for Xlib.h.
|
||||
# First, try using that file with no special directory specified.
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
@ -10015,7 +10061,7 @@ _ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Xlib.h>
|
||||
_ACEOF
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
|
||||
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
|
||||
@ -10042,7 +10088,7 @@ else
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
for ac_dir in $ac_x_header_dirs; do
|
||||
if test -r "$ac_dir/X11/Intrinsic.h"; then
|
||||
if test -r "$ac_dir/X11/Xlib.h"; then
|
||||
ac_x_includes=$ac_dir
|
||||
break
|
||||
fi
|
||||
@ -10063,11 +10109,11 @@ _ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Xlib.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
XtMalloc (0)
|
||||
XrmInitialize ()
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
@ -11829,6 +11875,213 @@ fi
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if test "x${COMPILE_GCONF_PEER}" = xyes; then
|
||||
|
||||
succeeded=no
|
||||
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
# Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
set dummy pkg-config; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
case $PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
|
||||
echo "${ECHO_T}$PKG_CONFIG" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** The pkg-config script could not be found. Make sure it is"
|
||||
echo "*** in your path, or set the PKG_CONFIG environment variable"
|
||||
echo "*** to the full path to pkg-config."
|
||||
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
|
||||
else
|
||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
||||
echo "$as_me:$LINENO: checking for gconf-2.0 >= 2.11.2" >&5
|
||||
echo $ECHO_N "checking for gconf-2.0 >= 2.11.2... $ECHO_C" >&6
|
||||
|
||||
if $PKG_CONFIG --exists "gconf-2.0 >= 2.11.2" ; then
|
||||
echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6
|
||||
succeeded=yes
|
||||
|
||||
echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5
|
||||
echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6
|
||||
GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= 2.11.2"`
|
||||
echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5
|
||||
echo "${ECHO_T}$GCONF_CFLAGS" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking GCONF_LIBS" >&5
|
||||
echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6
|
||||
GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 >= 2.11.2"`
|
||||
echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5
|
||||
echo "${ECHO_T}$GCONF_LIBS" >&6
|
||||
else
|
||||
GCONF_CFLAGS=""
|
||||
GCONF_LIBS=""
|
||||
## If we have a custom action on failure, don't print errors, but
|
||||
## do set a variable so people can do so.
|
||||
GCONF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gconf-2.0 >= 2.11.2"`
|
||||
echo $GCONF_PKG_ERRORS
|
||||
fi
|
||||
|
||||
|
||||
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $succeeded = yes; then
|
||||
:
|
||||
else
|
||||
{ { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 >= 2.11.2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
|
||||
echo "$as_me: error: Library requirements (gconf-2.0 >= 2.11.2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
succeeded=no
|
||||
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
# Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
set dummy pkg-config; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
case $PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
|
||||
echo "${ECHO_T}$PKG_CONFIG" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** The pkg-config script could not be found. Make sure it is"
|
||||
echo "*** in your path, or set the PKG_CONFIG environment variable"
|
||||
echo "*** to the full path to pkg-config."
|
||||
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
|
||||
else
|
||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
||||
echo "$as_me:$LINENO: checking for gdk-2.0 >= 2.8" >&5
|
||||
echo $ECHO_N "checking for gdk-2.0 >= 2.8... $ECHO_C" >&6
|
||||
|
||||
if $PKG_CONFIG --exists "gdk-2.0 >= 2.8" ; then
|
||||
echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6
|
||||
succeeded=yes
|
||||
|
||||
echo "$as_me:$LINENO: checking GDK_CFLAGS" >&5
|
||||
echo $ECHO_N "checking GDK_CFLAGS... $ECHO_C" >&6
|
||||
GDK_CFLAGS=`$PKG_CONFIG --cflags "gdk-2.0 >= 2.8"`
|
||||
echo "$as_me:$LINENO: result: $GDK_CFLAGS" >&5
|
||||
echo "${ECHO_T}$GDK_CFLAGS" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking GDK_LIBS" >&5
|
||||
echo $ECHO_N "checking GDK_LIBS... $ECHO_C" >&6
|
||||
GDK_LIBS=`$PKG_CONFIG --libs "gdk-2.0 >= 2.8"`
|
||||
echo "$as_me:$LINENO: result: $GDK_LIBS" >&5
|
||||
echo "${ECHO_T}$GDK_LIBS" >&6
|
||||
else
|
||||
GDK_CFLAGS=""
|
||||
GDK_LIBS=""
|
||||
## If we have a custom action on failure, don't print errors, but
|
||||
## do set a variable so people can do so.
|
||||
GDK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gdk-2.0 >= 2.8"`
|
||||
echo $GDK_PKG_ERRORS
|
||||
fi
|
||||
|
||||
|
||||
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $succeeded = yes; then
|
||||
:
|
||||
else
|
||||
{ { echo "$as_me:$LINENO: error: Library requirements (gdk-2.0 >= 2.8) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
|
||||
echo "$as_me: error: Library requirements (gdk-2.0 >= 2.8) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
|
||||
|
||||
USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
|
||||
if test "$USE_GCONF_PREFS_PEER" = ""; then
|
||||
DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x${COMPILE_QT_PEER}" = xyes; then
|
||||
@ -12004,6 +12257,41 @@ do
|
||||
done
|
||||
done
|
||||
|
||||
fi
|
||||
fi
|
||||
MOC=$ac_cv_prog_MOC
|
||||
if test -n "$MOC"; then
|
||||
echo "$as_me:$LINENO: result: $MOC" >&5
|
||||
echo "${ECHO_T}$MOC" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
# Extract the first word of "moc-qt4", so it can be a program name with args.
|
||||
set dummy moc-qt4; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_MOC+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
if test -n "$MOC"; then
|
||||
ac_cv_prog_MOC="$MOC" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_prog_MOC="moc-qt4"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
fi
|
||||
fi
|
||||
MOC=$ac_cv_prog_MOC
|
||||
@ -12375,6 +12663,104 @@ echo "${ECHO_T}$MOZILLA_LIBS" >&6
|
||||
|
||||
|
||||
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $succeeded = yes; then
|
||||
MOZILLA_FOUND=yes
|
||||
else
|
||||
MOZILLA_FOUND=no
|
||||
fi
|
||||
|
||||
fi
|
||||
if test "x${MOZILLA_FOUND}" = xno; then
|
||||
|
||||
succeeded=no
|
||||
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
# Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
set dummy pkg-config; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
case $PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
|
||||
echo "${ECHO_T}$PKG_CONFIG" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** The pkg-config script could not be found. Make sure it is"
|
||||
echo "*** in your path, or set the PKG_CONFIG environment variable"
|
||||
echo "*** to the full path to pkg-config."
|
||||
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
|
||||
else
|
||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
||||
echo "$as_me:$LINENO: checking for mozilla-firefox-plugin" >&5
|
||||
echo $ECHO_N "checking for mozilla-firefox-plugin... $ECHO_C" >&6
|
||||
|
||||
if $PKG_CONFIG --exists "mozilla-firefox-plugin" ; then
|
||||
echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6
|
||||
succeeded=yes
|
||||
|
||||
echo "$as_me:$LINENO: checking MOZILLA_CFLAGS" >&5
|
||||
echo $ECHO_N "checking MOZILLA_CFLAGS... $ECHO_C" >&6
|
||||
MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "mozilla-firefox-plugin"`
|
||||
echo "$as_me:$LINENO: result: $MOZILLA_CFLAGS" >&5
|
||||
echo "${ECHO_T}$MOZILLA_CFLAGS" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking MOZILLA_LIBS" >&5
|
||||
echo $ECHO_N "checking MOZILLA_LIBS... $ECHO_C" >&6
|
||||
MOZILLA_LIBS=`$PKG_CONFIG --libs "mozilla-firefox-plugin"`
|
||||
echo "$as_me:$LINENO: result: $MOZILLA_LIBS" >&5
|
||||
echo "${ECHO_T}$MOZILLA_LIBS" >&6
|
||||
else
|
||||
MOZILLA_CFLAGS=""
|
||||
MOZILLA_LIBS=""
|
||||
## If we have a custom action on failure, don't print errors, but
|
||||
## do set a variable so people can do so.
|
||||
MOZILLA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "mozilla-firefox-plugin"`
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
@ -18128,6 +18514,41 @@ fi
|
||||
|
||||
|
||||
|
||||
# Check whether --with-escher or --without-escher was given.
|
||||
if test "${with_escher+set}" = set; then
|
||||
withval="$with_escher"
|
||||
|
||||
fi;
|
||||
case "$with_escher" in
|
||||
"")
|
||||
use_escher=false
|
||||
;;
|
||||
"no")
|
||||
use_escher=false
|
||||
;;
|
||||
"yes")
|
||||
{ { echo "$as_me:$LINENO: error: Please suply an absolute path to Escher library" >&5
|
||||
echo "$as_me: error: Please suply an absolute path to Escher library" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
;;
|
||||
*)
|
||||
use_escher=true
|
||||
PATH_TO_ESCHER=$with_escher
|
||||
;;
|
||||
esac;
|
||||
|
||||
|
||||
|
||||
if test x$use_escher = xtrue; then
|
||||
USE_ESCHER_TRUE=
|
||||
USE_ESCHER_FALSE='#'
|
||||
else
|
||||
USE_ESCHER_TRUE='#'
|
||||
USE_ESCHER_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-local-sockets or --disable-local-sockets was given.
|
||||
if test "${enable_local_sockets+set}" = set; then
|
||||
enableval="$enable_local_sockets"
|
||||
@ -18410,7 +18831,27 @@ fi
|
||||
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files Makefile doc/Makefile doc/api/Makefile external/Makefile external/sax/Makefile external/w3c_dom/Makefile external/relaxngDatatype/Makefile gnu/classpath/Configuration.java include/Makefile native/Makefile native/fdlibm/Makefile native/jawt/Makefile native/jni/Makefile native/jni/classpath/Makefile native/jni/java-io/Makefile native/jni/java-lang/Makefile native/jni/java-net/Makefile native/jni/java-nio/Makefile native/jni/java-util/Makefile native/jni/gtk-peer/Makefile native/jni/qt-peer/Makefile native/jni/xmlj/Makefile native/jni/midi-alsa/Makefile native/jni/midi-dssi/Makefile native/plugin/Makefile native/target/Makefile native/target/Linux/Makefile native/target/generic/Makefile resource/Makefile scripts/Makefile scripts/classpath.spec lib/Makefile lib/gen-classlist.sh lib/copy-vmresources.sh tools/Makefile examples/Makefile examples/Makefile.jawt"
|
||||
|
||||
ac_config_files="$ac_config_files Makefile doc/Makefile doc/api/Makefile external/Makefile external/sax/Makefile external/w3c_dom/Makefile external/relaxngDatatype/Makefile gnu/classpath/Configuration.java gnu/java/security/Configuration.java include/Makefile native/Makefile native/fdlibm/Makefile native/jawt/Makefile native/jni/Makefile native/jni/classpath/Makefile native/jni/java-io/Makefile native/jni/java-lang/Makefile native/jni/java-net/Makefile native/jni/java-nio/Makefile native/jni/java-util/Makefile native/jni/gtk-peer/Makefile native/jni/gconf-peer/Makefile native/jni/qt-peer/Makefile native/jni/xmlj/Makefile native/jni/midi-alsa/Makefile native/jni/midi-dssi/Makefile native/plugin/Makefile native/target/Makefile native/target/Linux/Makefile native/target/generic/Makefile resource/Makefile resource/META-INF/services/java.util.prefs.PreferencesFactory scripts/Makefile scripts/classpath.spec lib/Makefile lib/gen-classlist.sh lib/copy-vmresources.sh tools/Makefile examples/Makefile examples/Makefile.jawt examples/Makefile.java2d"
|
||||
|
||||
|
||||
if test "x${COMPILE_WRAPPERS}" = xno
|
||||
then
|
||||
ac_config_files="$ac_config_files tools/gappletviewer tools/gjarsigner tools/gkeytool tools/gjar tools/gnative2ascii tools/gserialver"
|
||||
|
||||
ac_config_commands="$ac_config_commands gappletviewer"
|
||||
|
||||
ac_config_commands="$ac_config_commands gjarsigner"
|
||||
|
||||
ac_config_commands="$ac_config_commands gkeytool"
|
||||
|
||||
ac_config_commands="$ac_config_commands gjar"
|
||||
|
||||
ac_config_commands="$ac_config_commands gnative2ascii"
|
||||
|
||||
ac_config_commands="$ac_config_commands gserialver"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test "x${COMPILE_WRAPPERS}" = xno
|
||||
@ -18541,6 +18982,13 @@ echo "$as_me: error: conditional \"CREATE_CORE_JNI_LIBRARIES\" was never defined
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${CREATE_GCONF_PEER_LIBRARIES_TRUE}" && test -z "${CREATE_GCONF_PEER_LIBRARIES_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"CREATE_GCONF_PEER_LIBRARIES\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
echo "$as_me: error: conditional \"CREATE_GCONF_PEER_LIBRARIES\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${CREATE_XMLJ_LIBRARY_TRUE}" && test -z "${CREATE_XMLJ_LIBRARY_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"CREATE_XMLJ_LIBRARY\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
@ -18751,6 +19199,13 @@ echo "$as_me: error: conditional \"USE_PREBUILT_GLIBJ_ZIP\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${USE_ESCHER_TRUE}" && test -z "${USE_ESCHER_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"USE_ESCHER\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
echo "$as_me: error: conditional \"USE_ESCHER\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${ENABLE_LOCAL_SOCKETS_TRUE}" && test -z "${ENABLE_LOCAL_SOCKETS_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"ENABLE_LOCAL_SOCKETS\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
@ -19029,7 +19484,7 @@ _ASBOX
|
||||
} >&5
|
||||
cat >&5 <<_CSEOF
|
||||
|
||||
This file was extended by GNU Classpath $as_me 0.92-pre, which was
|
||||
This file was extended by GNU Classpath $as_me 0.92, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@ -19095,7 +19550,7 @@ _ACEOF
|
||||
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
GNU Classpath config.status 0.92-pre
|
||||
GNU Classpath config.status 0.92
|
||||
configured by $0, generated by GNU Autoconf 2.59,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
@ -19232,6 +19687,7 @@ do
|
||||
"external/w3c_dom/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/w3c_dom/Makefile" ;;
|
||||
"external/relaxngDatatype/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/relaxngDatatype/Makefile" ;;
|
||||
"gnu/classpath/Configuration.java" ) CONFIG_FILES="$CONFIG_FILES gnu/classpath/Configuration.java" ;;
|
||||
"gnu/java/security/Configuration.java" ) CONFIG_FILES="$CONFIG_FILES gnu/java/security/Configuration.java" ;;
|
||||
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
|
||||
"native/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/Makefile" ;;
|
||||
"native/fdlibm/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/fdlibm/Makefile" ;;
|
||||
@ -19244,6 +19700,7 @@ do
|
||||
"native/jni/java-nio/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/java-nio/Makefile" ;;
|
||||
"native/jni/java-util/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/java-util/Makefile" ;;
|
||||
"native/jni/gtk-peer/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/gtk-peer/Makefile" ;;
|
||||
"native/jni/gconf-peer/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/gconf-peer/Makefile" ;;
|
||||
"native/jni/qt-peer/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/qt-peer/Makefile" ;;
|
||||
"native/jni/xmlj/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/xmlj/Makefile" ;;
|
||||
"native/jni/midi-alsa/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/midi-alsa/Makefile" ;;
|
||||
@ -19253,6 +19710,7 @@ do
|
||||
"native/target/Linux/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/target/Linux/Makefile" ;;
|
||||
"native/target/generic/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/target/generic/Makefile" ;;
|
||||
"resource/Makefile" ) CONFIG_FILES="$CONFIG_FILES resource/Makefile" ;;
|
||||
"resource/META-INF/services/java.util.prefs.PreferencesFactory" ) CONFIG_FILES="$CONFIG_FILES resource/META-INF/services/java.util.prefs.PreferencesFactory" ;;
|
||||
"scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
|
||||
"scripts/classpath.spec" ) CONFIG_FILES="$CONFIG_FILES scripts/classpath.spec" ;;
|
||||
"lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
|
||||
@ -19261,6 +19719,13 @@ do
|
||||
"tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
|
||||
"examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
|
||||
"examples/Makefile.jawt" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile.jawt" ;;
|
||||
"examples/Makefile.java2d" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile.java2d" ;;
|
||||
"tools/gappletviewer" ) CONFIG_FILES="$CONFIG_FILES tools/gappletviewer" ;;
|
||||
"tools/gjarsigner" ) CONFIG_FILES="$CONFIG_FILES tools/gjarsigner" ;;
|
||||
"tools/gkeytool" ) CONFIG_FILES="$CONFIG_FILES tools/gkeytool" ;;
|
||||
"tools/gjar" ) CONFIG_FILES="$CONFIG_FILES tools/gjar" ;;
|
||||
"tools/gnative2ascii" ) CONFIG_FILES="$CONFIG_FILES tools/gnative2ascii" ;;
|
||||
"tools/gserialver" ) CONFIG_FILES="$CONFIG_FILES tools/gserialver" ;;
|
||||
"tools/appletviewer" ) CONFIG_FILES="$CONFIG_FILES tools/appletviewer" ;;
|
||||
"tools/jarsigner" ) CONFIG_FILES="$CONFIG_FILES tools/jarsigner" ;;
|
||||
"tools/keytool" ) CONFIG_FILES="$CONFIG_FILES tools/keytool" ;;
|
||||
@ -19268,6 +19733,12 @@ do
|
||||
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
||||
"mkcollections.pl" ) CONFIG_COMMANDS="$CONFIG_COMMANDS mkcollections.pl" ;;
|
||||
"$ac_stdint_h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;;
|
||||
"gappletviewer" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gappletviewer" ;;
|
||||
"gjarsigner" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gjarsigner" ;;
|
||||
"gkeytool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gkeytool" ;;
|
||||
"gjar" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gjar" ;;
|
||||
"gnative2ascii" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gnative2ascii" ;;
|
||||
"gserialver" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gserialver" ;;
|
||||
"appletviewer" ) CONFIG_COMMANDS="$CONFIG_COMMANDS appletviewer" ;;
|
||||
"jarsigner" ) CONFIG_COMMANDS="$CONFIG_COMMANDS jarsigner" ;;
|
||||
"keytool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS keytool" ;;
|
||||
@ -19403,6 +19874,8 @@ s,@CREATE_JNI_LIBRARIES_TRUE@,$CREATE_JNI_LIBRARIES_TRUE,;t t
|
||||
s,@CREATE_JNI_LIBRARIES_FALSE@,$CREATE_JNI_LIBRARIES_FALSE,;t t
|
||||
s,@CREATE_CORE_JNI_LIBRARIES_TRUE@,$CREATE_CORE_JNI_LIBRARIES_TRUE,;t t
|
||||
s,@CREATE_CORE_JNI_LIBRARIES_FALSE@,$CREATE_CORE_JNI_LIBRARIES_FALSE,;t t
|
||||
s,@CREATE_GCONF_PEER_LIBRARIES_TRUE@,$CREATE_GCONF_PEER_LIBRARIES_TRUE,;t t
|
||||
s,@CREATE_GCONF_PEER_LIBRARIES_FALSE@,$CREATE_GCONF_PEER_LIBRARIES_FALSE,;t t
|
||||
s,@default_toolkit@,$default_toolkit,;t t
|
||||
s,@CREATE_XMLJ_LIBRARY_TRUE@,$CREATE_XMLJ_LIBRARY_TRUE,;t t
|
||||
s,@CREATE_XMLJ_LIBRARY_FALSE@,$CREATE_XMLJ_LIBRARY_FALSE,;t t
|
||||
@ -19478,6 +19951,10 @@ s,@FREETYPE2_LIBS@,$FREETYPE2_LIBS,;t t
|
||||
s,@PANGOFT2_CFLAGS@,$PANGOFT2_CFLAGS,;t t
|
||||
s,@PANGOFT2_LIBS@,$PANGOFT2_LIBS,;t t
|
||||
s,@XTEST_LIBS@,$XTEST_LIBS,;t t
|
||||
s,@GCONF_CFLAGS@,$GCONF_CFLAGS,;t t
|
||||
s,@GCONF_LIBS@,$GCONF_LIBS,;t t
|
||||
s,@GDK_CFLAGS@,$GDK_CFLAGS,;t t
|
||||
s,@GDK_LIBS@,$GDK_LIBS,;t t
|
||||
s,@QT_CFLAGS@,$QT_CFLAGS,;t t
|
||||
s,@QT_LIBS@,$QT_LIBS,;t t
|
||||
s,@MOC@,$MOC,;t t
|
||||
@ -19541,8 +20018,12 @@ s,@REGEN_PARSERS_FALSE@,$REGEN_PARSERS_FALSE,;t t
|
||||
s,@USE_PREBUILT_GLIBJ_ZIP_TRUE@,$USE_PREBUILT_GLIBJ_ZIP_TRUE,;t t
|
||||
s,@USE_PREBUILT_GLIBJ_ZIP_FALSE@,$USE_PREBUILT_GLIBJ_ZIP_FALSE,;t t
|
||||
s,@PATH_TO_GLIBJ_ZIP@,$PATH_TO_GLIBJ_ZIP,;t t
|
||||
s,@USE_ESCHER_TRUE@,$USE_ESCHER_TRUE,;t t
|
||||
s,@USE_ESCHER_FALSE@,$USE_ESCHER_FALSE,;t t
|
||||
s,@PATH_TO_ESCHER@,$PATH_TO_ESCHER,;t t
|
||||
s,@ENABLE_LOCAL_SOCKETS_TRUE@,$ENABLE_LOCAL_SOCKETS_TRUE,;t t
|
||||
s,@ENABLE_LOCAL_SOCKETS_FALSE@,$ENABLE_LOCAL_SOCKETS_FALSE,;t t
|
||||
s,@DEFAULT_PREFS_PEER@,$DEFAULT_PREFS_PEER,;t t
|
||||
s,@LIBOBJS@,$LIBOBJS,;t t
|
||||
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
|
||||
CEOF
|
||||
@ -20843,6 +21324,12 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
|
||||
mv $ac_stdint $ac_stdint_h
|
||||
fi
|
||||
;;
|
||||
gappletviewer ) chmod 755 tools/gappletviewer ;;
|
||||
gjarsigner ) chmod 755 tools/gjarsigner ;;
|
||||
gkeytool ) chmod 755 tools/gkeytool ;;
|
||||
gjar ) chmod 755 tools/gjar ;;
|
||||
gnative2ascii ) chmod 755 tools/gnative2ascii ;;
|
||||
gserialver ) chmod 755 tools/gserialver ;;
|
||||
appletviewer ) chmod 755 tools/appletviewer ;;
|
||||
jarsigner ) chmod 755 tools/jarsigner ;;
|
||||
keytool ) chmod 755 tools/keytool ;;
|
||||
@ -20881,3 +21368,10 @@ if test "$no_create" != yes; then
|
||||
$ac_cs_success || { (exit 1); exit 1; }
|
||||
fi
|
||||
|
||||
|
||||
# Create standard.omit based on decisions we just made.
|
||||
cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
|
||||
if test x$use_escher != xtrue; then
|
||||
echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
|
||||
fi
|
||||
|
||||
|
@ -6,7 +6,7 @@ dnl -----------------------------------------------------------
|
||||
dnl define([AC_CACHE_LOAD], )dnl
|
||||
dnl define([AC_CACHE_SAVE], )dnl
|
||||
|
||||
AC_INIT([GNU Classpath],[0.92-pre],[classpath@gnu.org],[classpath])
|
||||
AC_INIT([GNU Classpath],[0.92],[classpath@gnu.org],[classpath])
|
||||
AC_CONFIG_SRCDIR(java/lang/System.java)
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
@ -82,6 +82,36 @@ AC_ARG_ENABLE([core-jni],
|
||||
[COMPILE_CORE_JNI=yes])
|
||||
AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Default Preference Backend
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_ENABLE(default-preferences-peer,
|
||||
AS_HELP_STRING([--enable-default-preferences-peer],
|
||||
[fully qualified class name of default Preferences API Backend]))
|
||||
DEFAULT_PREFS_PEER=$enable_default_preferences_peer
|
||||
if test "$DEFAULT_PREFS_PEER" = ""; then
|
||||
DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
|
||||
fi
|
||||
dnl AC_SUBST(DEFAULT_PREFS_PEER)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl GConf native peer (enabled by default)
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_ENABLE([gconf-peer],
|
||||
[AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
|
||||
[case "${enableval}" in
|
||||
yes) COMPILE_GCONF_PEER=yes ;;
|
||||
no) COMPILE_GCONF_PEER=no ;;
|
||||
*) COMPILE_GCONF_PEER=yes ;;
|
||||
esac],
|
||||
[COMPILE_GCONF_PEER=yes])
|
||||
AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl GTK native peer error checking
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
|
||||
|
||||
dnl ------------------------------------------------------------
|
||||
dnl Whether to compile with -Werror or not (disabled by default)
|
||||
dnl ------------------------------------------------------------
|
||||
@ -432,6 +462,24 @@ if test "x${COMPILE_JNI}" = xyes; then
|
||||
AC_SUBST(XTEST_LIBS)
|
||||
fi
|
||||
|
||||
dnl gconf-peer
|
||||
if test "x${COMPILE_GCONF_PEER}" = xyes; then
|
||||
PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
|
||||
AC_SUBST(GCONF_CFLAGS)
|
||||
AC_SUBST(GCONF_LIBS)
|
||||
dnl we also need gdk for locking
|
||||
PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
|
||||
AC_SUBST(GDK_CFLAGS)
|
||||
AC_SUBST(GDK_LIBS)
|
||||
dnl check if the config value was given form the command line,
|
||||
dnl if not, overwrite the default if we have the gconf backend
|
||||
dnl compiled in
|
||||
USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
|
||||
if test "$USE_GCONF_PREFS_PEER" = ""; then
|
||||
DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check for AWT related Qt4
|
||||
if test "x${COMPILE_QT_PEER}" = xyes; then
|
||||
PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
|
||||
@ -446,6 +494,7 @@ if test "x${COMPILE_JNI}" = xyes; then
|
||||
QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
|
||||
AC_MSG_WARN([QWidget not found])))
|
||||
AC_CHECK_PROG(MOC, [moc], [moc])
|
||||
AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
|
||||
fi
|
||||
if test "x$HAVE_QT4" = "xno"; then
|
||||
AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
|
||||
@ -490,6 +539,9 @@ if test "x${COMPILE_JNI}" = xyes; then
|
||||
if test "x${MOZILLA_FOUND}" = xno; then
|
||||
PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
|
||||
fi
|
||||
if test "x${MOZILLA_FOUND}" = xno; then
|
||||
PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
|
||||
fi
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0)
|
||||
|
||||
AC_SUBST(MOZILLA_CFLAGS)
|
||||
@ -671,6 +723,30 @@ esac;
|
||||
AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
|
||||
AC_SUBST(PATH_TO_GLIBJ_ZIP)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Build with Escher based X peers.
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_WITH([escher],
|
||||
AS_HELP_STRING([--with-escher=ABS.PATH],
|
||||
[specify path to escher dir or JAR for X peers]))
|
||||
case "$with_escher" in
|
||||
"")
|
||||
use_escher=false
|
||||
;;
|
||||
"no")
|
||||
use_escher=false
|
||||
;;
|
||||
"yes")
|
||||
AC_MSG_ERROR([Please suply an absolute path to Escher library])
|
||||
;;
|
||||
*)
|
||||
use_escher=true
|
||||
PATH_TO_ESCHER=$with_escher
|
||||
;;
|
||||
esac;
|
||||
|
||||
AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
|
||||
AC_SUBST(PATH_TO_ESCHER)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Check if local socket support should be included.
|
||||
@ -695,6 +771,10 @@ then
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Add the default preference peer
|
||||
dnl -----------------------------------------------------------
|
||||
AC_SUBST(DEFAULT_PREFS_PEER)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl output files
|
||||
@ -707,6 +787,7 @@ external/sax/Makefile
|
||||
external/w3c_dom/Makefile
|
||||
external/relaxngDatatype/Makefile
|
||||
gnu/classpath/Configuration.java
|
||||
gnu/java/security/Configuration.java
|
||||
include/Makefile
|
||||
native/Makefile
|
||||
native/fdlibm/Makefile
|
||||
@ -719,6 +800,7 @@ native/jni/java-net/Makefile
|
||||
native/jni/java-nio/Makefile
|
||||
native/jni/java-util/Makefile
|
||||
native/jni/gtk-peer/Makefile
|
||||
native/jni/gconf-peer/Makefile
|
||||
native/jni/qt-peer/Makefile
|
||||
native/jni/xmlj/Makefile
|
||||
native/jni/midi-alsa/Makefile
|
||||
@ -728,6 +810,7 @@ native/target/Makefile
|
||||
native/target/Linux/Makefile
|
||||
native/target/generic/Makefile
|
||||
resource/Makefile
|
||||
resource/META-INF/services/java.util.prefs.PreferencesFactory
|
||||
scripts/Makefile
|
||||
scripts/classpath.spec
|
||||
lib/Makefile
|
||||
@ -735,7 +818,25 @@ lib/gen-classlist.sh
|
||||
lib/copy-vmresources.sh
|
||||
tools/Makefile
|
||||
examples/Makefile
|
||||
examples/Makefile.jawt])
|
||||
examples/Makefile.jawt
|
||||
examples/Makefile.java2d])
|
||||
|
||||
if test "x${COMPILE_WRAPPERS}" = xno
|
||||
then
|
||||
AC_CONFIG_FILES([tools/gappletviewer
|
||||
tools/gjarsigner
|
||||
tools/gkeytool
|
||||
tools/gjar
|
||||
tools/gnative2ascii
|
||||
tools/gserialver])
|
||||
AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
|
||||
AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
|
||||
AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
|
||||
AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
|
||||
AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
|
||||
AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
|
||||
fi
|
||||
|
||||
|
||||
if test "x${COMPILE_WRAPPERS}" = xno
|
||||
then
|
||||
@ -750,3 +851,10 @@ fi
|
||||
AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
|
||||
AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
|
||||
AC_OUTPUT
|
||||
|
||||
# Create standard.omit based on decisions we just made.
|
||||
cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
|
||||
if test x$use_escher != xtrue; then
|
||||
echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
|
||||
fi
|
||||
|
||||
|
@ -93,6 +93,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -113,6 +115,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -143,6 +146,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -193,6 +200,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -213,6 +221,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
|
@ -86,6 +86,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -106,6 +108,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -136,6 +139,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -186,6 +193,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -206,6 +214,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
|
@ -5,7 +5,7 @@
|
||||
@settitle GNU Classpath Tools Guide
|
||||
@c %**end of header
|
||||
|
||||
@setchapternewpage off
|
||||
@setchapternewpage on
|
||||
|
||||
@ifinfo
|
||||
This file documents the Tools included in a standard distribution of the GNU
|
||||
@ -23,7 +23,7 @@ Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
@titlepage
|
||||
@title GNU Classpath Tools Guide
|
||||
@author Raif S. Naffah
|
||||
@author The GNU Classpath Team
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
@ -37,8 +37,10 @@ Permission is granted to copy and distribute translations of this manual into an
|
||||
|
||||
@end titlepage
|
||||
|
||||
@contents
|
||||
|
||||
@ifinfo
|
||||
@node Top, Security Tools, (dir), (dir)
|
||||
@node Top, Applet Tools, (dir), (dir)
|
||||
@top GNU Classpath Tools Guide
|
||||
|
||||
This document contains important information you need to know in order to use
|
||||
@ -51,17 +53,64 @@ Software Development Kit (SDK).
|
||||
@end ifinfo
|
||||
|
||||
@menu
|
||||
* Applet Tools:: Work with applets
|
||||
* Security Tools:: Work securely with Java applications
|
||||
* I18N Issues:: How to add support for non-English languages
|
||||
|
||||
@detailmenu
|
||||
--- The Detailed Node Listing ---
|
||||
|
||||
Applet Tools
|
||||
|
||||
* appletviewer Tool:: Load applets
|
||||
* gcjwebplugin:: Load applets in a web browser
|
||||
|
||||
Security Tools
|
||||
|
||||
* jarsigner Tool:: Sign and verify .JAR files
|
||||
* keytool Tool:: Manage private keys and public certificates
|
||||
|
||||
jarsigner Tool
|
||||
|
||||
* Common jarsigner Options:: Options used when signing or verifying a file
|
||||
* Signing Options:: Options only used when signing a .JAR file
|
||||
* Verification Options:: Options only used when verifying a .JAR file
|
||||
|
||||
keytool Tool
|
||||
|
||||
* Getting Help:: How to get help with keytool commands
|
||||
* Common keytool Options:: Options used in more than one command
|
||||
* Distinguished Names:: X.500 Distinguished Names used in certificates
|
||||
* Add/Update Commands:: Commands for adding data to a Key Store
|
||||
* Export Commands:: Commands for exporting data from a Key Store
|
||||
* Display Commands:: Commands for displaying data in a Key Store
|
||||
* Management Commands:: Commands for managing a Key Store
|
||||
|
||||
Add/Update Commands
|
||||
|
||||
* Command -genkey:: Generate private key and self-signed certificate
|
||||
* Command -import:: Import certificates and certificate replies
|
||||
* Command -selfcert:: Generate self-signed certificate
|
||||
* Command -cacert:: Import a CA Trusted Certificate
|
||||
* Command -identitydb:: Import JDK-1 style identities
|
||||
|
||||
Export Commands
|
||||
|
||||
* Command -certreq:: Generate Certificate Signing Requests (CSR)
|
||||
* Command -export:: Export a certificate in a Key Store
|
||||
|
||||
Display Commands
|
||||
|
||||
* Command -list:: Display information about one or all Aliases
|
||||
* Command -printcert:: Print a certificate or a certificate fingerprint
|
||||
|
||||
Management Commands
|
||||
|
||||
* Command -keyclone:: Clone a Key Entry in a Key Store
|
||||
* Command -storepasswd:: Change the password protecting a Key Store
|
||||
* Command -keypasswd:: Change the password protecting a Key Entry
|
||||
* Command -delete:: Remove an entry in a Key Store
|
||||
|
||||
I18N Issues
|
||||
|
||||
* Language Resources:: Where resources are located
|
||||
@ -72,11 +121,161 @@ I18N Issues
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Security Tools, I18N Issues, Top, Top
|
||||
@node Applet Tools, Security Tools, Top, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Applet Tools
|
||||
|
||||
Two Applet Tools are available with GNU Classpath: @b{appletviewer}
|
||||
and @b{gcjwebplugin}.
|
||||
|
||||
To avoid conflicts with other implementations, the appletviewer
|
||||
executable is called ``gappletviewer''.
|
||||
|
||||
@menu
|
||||
* appletviewer Tool:: Load applets
|
||||
* gcjwebplugin:: Load applets in a web browser
|
||||
@end menu
|
||||
|
||||
If while using these tools you think you found a bug, then please report it at @uref{http://www.gnu.org/software/classpath/bugs.html,classpath-bugs}.
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node appletviewer Tool, gcjwebplugin, Applet Tools, Applet Tools
|
||||
@comment node-name, next, previous, up
|
||||
@section The @code{appletviewer} Tool
|
||||
|
||||
@table @b
|
||||
|
||||
@item SYNOPSIS
|
||||
@code{appletviewer [OPTION]... URL...}@*
|
||||
@code{appletviewer [OPTION]... -code CODE}@*
|
||||
@code{appletviewer [OPTION]... -plugin INPUT,OUTPUT}
|
||||
|
||||
@item DESCRIPTION
|
||||
The @code{appletviewer} tool loads and runs an applet.
|
||||
|
||||
Use the first form to test applets specified by tag. The URL should
|
||||
resolve to an HTML document from which the @code{appletviewer} will
|
||||
extract applet tags. The APPLET, EMBED and OBJECT tags are supported.
|
||||
If a given document contains multiple applet tags, all the applets
|
||||
will be loaded, with each applet appearing in its own window.
|
||||
Likewise, when multiple URLs are specified, each applet tag instance
|
||||
is given its own window. If a given document contains no recognized
|
||||
tags the @code{appletviewer} does nothing.
|
||||
|
||||
@example
|
||||
@code{appletviewer http://www.gnu.org/software/classpath/}
|
||||
@end example
|
||||
|
||||
Use the second form to test an applet in development. This form
|
||||
allows applet tag attributes to be supplied on the command line. Only
|
||||
one applet may be specified using the @code{-code} option. The
|
||||
@code{-code} option overrides the URL form -- any URLs specified will
|
||||
be ignored.
|
||||
|
||||
@example
|
||||
@code{appletviewer -code Test.class -param datafile,data.txt}
|
||||
@end example
|
||||
|
||||
@code{gcjwebplugin} uses the third form to communicate with the
|
||||
@code{appletviewer} through named pipes.
|
||||
|
||||
@item URL OPTIONS
|
||||
@table @b
|
||||
@item -debug
|
||||
This option is not yet implemented but is provided for compatibility.
|
||||
|
||||
@item -encoding CHARSET
|
||||
Use this option to specify an alternate character encoding for the
|
||||
specified HTML page.
|
||||
|
||||
@end table
|
||||
|
||||
@item APPLET TAG OPTIONS
|
||||
@table @b
|
||||
@item -code CODE
|
||||
Use the @code{-code} option to specify the value of the applet tag
|
||||
CODE attribute.
|
||||
|
||||
@item -codebase CODEBASE
|
||||
Use the @code{-codebase} option to specify the value of the applet tag
|
||||
CODEBASE attribute.
|
||||
|
||||
@item -archive ARCHIVE
|
||||
Use the @code{-archive} option to specify the value of the applet tag
|
||||
ARCHIVE attribute.
|
||||
|
||||
@item -width WIDTH
|
||||
Use the @code{-width} option to specify the value of the applet tag
|
||||
WIDTH attribute.
|
||||
|
||||
@item -height HEIGHT
|
||||
Use the @code{-height} option to specify the value of the applet tag
|
||||
HEIGHT attribute.
|
||||
|
||||
@item -param NAME,VALUE
|
||||
Use the @code{-param} option to specify values for the NAME and VALUE
|
||||
attributes of an applet PARAM tag.
|
||||
|
||||
@end table
|
||||
|
||||
@item PLUGIN OPTION
|
||||
@table @b
|
||||
@item -plugin INPUT,OUTPUT
|
||||
@code{gcjwebplugin} uses the @code{-plugin} option to specify the
|
||||
named pipe the @code{appletviewer} should use for receiving commands
|
||||
(INPUT) and the one it should use for sending commands to
|
||||
@code{gcjwebplugin} (OUTPUT).
|
||||
|
||||
@end table
|
||||
|
||||
@item DEBUGGING OPTION
|
||||
@table @b
|
||||
@item -verbose
|
||||
Use the @code{-verbose} option to have the @code{appletviewer} print
|
||||
debugging messages.
|
||||
|
||||
@end table
|
||||
|
||||
@item STANDARD OPTIONS
|
||||
@table @b
|
||||
@item -help
|
||||
Use the @code{-help} option to have the @code{appletviewer} print a
|
||||
usage message, then exit.
|
||||
|
||||
@item -version
|
||||
Use the @code{-version} option to have the @code{appletviewer} print
|
||||
its version, then exit.
|
||||
|
||||
@item -JOPTION
|
||||
Use the @code{-J} option to pass OPTION to the virtual machine that
|
||||
will run the @code{appletviewer}. Unlike other options, there must
|
||||
not be a space between the -J and OPTION.
|
||||
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node gcjwebplugin, , appletviewer Tool, Applet Tools
|
||||
@comment node-name, next, previous, up
|
||||
@section The @code{gcjwebplugin} Tool
|
||||
|
||||
@code{gcjwebplugin} is a plugin that adds applet support to web
|
||||
browsers. Currently @code{gcjwebplugin} only supports Mozilla-based
|
||||
browsers (e.g., Firefox, Galeon, Mozilla).
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Security Tools, I18N Issues, Applet Tools, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Security Tools
|
||||
|
||||
Two Security Tools are available with GNU Classpath: @b{jarsugner} and @b{keytool}.
|
||||
Two Security Tools are available with GNU Classpath: @b{jarsigner} and @b{keytool}.
|
||||
|
||||
To avoid conflicts with other implementations, the jarsigner
|
||||
executable is called ``gjarsigner'' and the keytool executable is
|
||||
called ``gkeytool''.
|
||||
|
||||
@menu
|
||||
* jarsigner Tool:: Sign and verify .JAR files
|
||||
@ -91,22 +290,59 @@ If while using these tools you think you found a bug, then please report it at @
|
||||
@comment node-name, next, previous, up
|
||||
@section The @code{jarsigner} Tool
|
||||
|
||||
@table @b
|
||||
The @b{jarsigner} tool is invoked from the command line, in one of two forms, as follows:
|
||||
|
||||
@item SYNOPSIS
|
||||
@code{jarsigner [OPTION]... FILE ALIAS}@*
|
||||
@example
|
||||
@code{jarsigner [OPTION]... FILE ALIAS}
|
||||
@code{jarsigner -verify [OPTION]... FILE}
|
||||
@end example
|
||||
|
||||
@item DESCRIPTION
|
||||
When the first form is used, the tool signs the designated JAR file.
|
||||
|
||||
The second form, on the other hand, is used to verify a previously signed JAR file.
|
||||
When the first form is used, the tool signs the designated JAR file. The second form, on the other hand, is used to verify a previously signed JAR file.
|
||||
|
||||
@code{FILE} is the .JAR file to process; i.e. to sign if the first syntax form is used, or to verify if the second syntax form is used instead.
|
||||
|
||||
@code{ALIAS} must be a known @i{Alias} of a @i{Key Entry} in the designated key store. The private key material associated with this @i{Alias} is then used for signing the designated .JAR file.
|
||||
@code{ALIAS} must be a known @i{Alias} of a @i{Key Entry} in the designated @i{Key Store}. The private key material associated with this @i{Alias} is then used for signing the designated .JAR file.
|
||||
|
||||
@menu
|
||||
* Common jarsigner Options:: Options used when signing or verifying a file
|
||||
* Signing Options:: Options only used when signing a .JAR file
|
||||
* Verification Options:: Options only used when verifying a .JAR file
|
||||
@end menu
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Common jarsigner Options, Signing Options, jarsigner Tool, jarsigner Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Common options
|
||||
|
||||
The following options may be used when the tool is used for either signing, or verifying, a .JAR file.
|
||||
|
||||
@table @b
|
||||
@item -verbose
|
||||
Use this option to force the tool to generate more verbose messages, during its processing.
|
||||
|
||||
@item -internalsf
|
||||
When present, the tool will include --which otherwise it does not-- the @code{.SF} file in the @code{.DSA} generated file.
|
||||
|
||||
@item -sectionsonly
|
||||
When present, the tool will include in the @code{.SF} generated file --which otherwise it does not-- a header containing a hash of the whole manifest file. When that header is included, the tool can quickly check, during verification, if the hash (in the header) matches or not the manifest file.
|
||||
|
||||
@item -provider PROVIDER_CLASS_NAME
|
||||
A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e. it was not already installed-- then the tool will attempt to remove this @i{Security Provider} before exiting.
|
||||
|
||||
@item -help
|
||||
Prints a help text similar to this one.
|
||||
|
||||
@end table
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Signing Options, Verification Options, Common jarsigner Options, jarsigner Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Signing options
|
||||
|
||||
The following options may be specified when using the tool for signing purposes.
|
||||
|
||||
@item SIGNING OPTIONS
|
||||
@table @b
|
||||
@item -keystore URL
|
||||
Use this option to specify the location of the key store to use. The default value is a file URL referencing the file named @file{.keystore} located in the path returned by the call to @code{java.lang.System#getProperty(String)} using @code{user.home} as argument.
|
||||
@ -129,12 +365,19 @@ Use this option to designate a literal that will be used to construct file names
|
||||
|
||||
If this option is missing, the first eight characters of the @code{ALIAS} argument will be used. When this is the case, any character in @code{ALIAS} that is outside the permissible range of characters will be replaced by an underscore.
|
||||
|
||||
@item -signedjar FILE_NAME
|
||||
@item -signedjar FILE
|
||||
Use this option to specify the file name of the signed JAR. If this option is omitted, then the signed JAR will be named the same as @code{FILE}; i.e. the input JAR file will be replaced with the signed copy.
|
||||
|
||||
@end table
|
||||
|
||||
@item VERIFICATION OPTIONS
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Verification Options, , Signing Options, jarsigner Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Verification options
|
||||
|
||||
The following options may be specified when using the tool for verification purposes.
|
||||
|
||||
@table @b
|
||||
@item -verify
|
||||
Use this option to indicate that the tool is to be used for verification purposes.
|
||||
@ -144,44 +387,37 @@ This option is used in conjunction with the @code{-verbose} option. When present
|
||||
|
||||
@end table
|
||||
|
||||
@item COMMON OPTIONS
|
||||
@table @b
|
||||
@item -verbose
|
||||
Use this option to force the tool to generate more verbose messages, during its processing.
|
||||
|
||||
@item -internalsf
|
||||
When present, the tool will include --which otherwise it does not-- the @code{.SF} file in the @code{.DSA} generated file.
|
||||
|
||||
@item -sectionsonly
|
||||
When present, the tool will include in the @code{.SF} generated file --which otherwise it does not-- a header containing a hash of the whole manifest file. When that header is included, the tool can quickly check, during verification, if the hash (in the header) matches or not the manifest file.
|
||||
|
||||
@item -provider PROVIDER_CLASS_NAME
|
||||
A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e. it was not already installed-- then the tool will attempt to remove this @i{Security Provider} before exiting.
|
||||
|
||||
@item -help
|
||||
Prints a help text similar to this one.
|
||||
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node keytool Tool, , jarsigner Tool, Security Tools
|
||||
@comment node-name, next, previous, up
|
||||
@section The @code{keytool} Tool
|
||||
|
||||
@table @b
|
||||
@item SYNOPSIS
|
||||
Cryptographic credentials, in a Java environment, are usually stored in a @i{Key Store}. The Java SDK specifies a @i{Key Store} as a persistent container of two types of objects: @i{Key Entries} and @i{Trusted Certificates}. The security tool @b{keytool} is a Java-based application for managing those types of objects.
|
||||
|
||||
A @i{Key Entry} represents the private key part of a key-pair used in Public-Key Cryptography, and a signed X.509 certificate which authenticates the public key part for a known entity; i.e. the owner of the key-pair. The X.509 certificate itself contains the public key part of the key-pair.
|
||||
|
||||
A @i{Trusted Certificate} is a signed X.509 certificate issued by a trusted entity. The @i{Trust} in this context is relative to the User of the @b{keytool}. In other words, the existence of a @i{Trusted Certificate} in the @i{Key Store} processed by a @b{keytool} command implies that the User trusts the @i{Issuer} of that @i{Trusted Certificate} to also sign, and hence authenticates, other @i{Subjects} the tool may process.
|
||||
|
||||
@i{Trusted Certificates} are important because they allow the tool to mechanically construct @i{Chains of Trust} starting from one of the @i{Trusted Certificates} in a @i{Key Store} and ending with a certificate whose @i{Issuer} is potentially unknown. A valid chain is an ordered list, starting with a @i{Trusted Certificate} (also called the @i{anchor}), ending with the target certificate, and satisfying the condition that the @i{Subject} of certificate @code{#i} is the @i{Issuer} of certificate @code{#i + 1}.
|
||||
|
||||
The @b{keytool} is invoked from the command line as follows:
|
||||
|
||||
@example
|
||||
@code{keytool [COMMAND]...}
|
||||
@end example
|
||||
|
||||
@item DESCRIPTION
|
||||
A Java-based tool for managing both @i{Key Entries} as well as @i{Trusted Certificates}.
|
||||
Multiple @code{COMMAND}s may be specified at once, each complete with its own options. @b{keytool} will parse all the arguments, before processing, and executing, each @code{COMMAND}. If an exception occurs while executing one @code{COMMAND} @b{keytool} will abort. Note however that because the implementation of the tool uses code to parse command line options that also supports GNU-style options, you have to separate each command group with a double-hyphen; e.g
|
||||
|
||||
Multiple @code{COMMAND}s may be specified at once, each complete with its own options. @b{keytool} will parse all the arguments, before processing, and executing, each @code{COMMAND}. If an exception occurs while executing one @code{COMMAND} @b{keytool} will abort.
|
||||
@example
|
||||
@code{keytool -list -- -printcert -alias mykey}
|
||||
@end example
|
||||
|
||||
A @code{COMMAND} can be one of the followings:
|
||||
Here is a summary of the commands supported by the tool:
|
||||
|
||||
@table @b
|
||||
@enumerate
|
||||
@item Add/Update commands
|
||||
@itemize @bullet
|
||||
@item -genkey [OPTION]@dots{}
|
||||
Generate a new @i{Key Entry}, eventually creating a new key store.
|
||||
|
||||
@ -191,22 +427,34 @@ Add, to a key store, @i{Key Entries} (private keys and certificate chains authen
|
||||
@item -selfcert [OPTION]@dots{}
|
||||
Generate a new self-signed @i{Trusted Certificate}.
|
||||
|
||||
@item -cacert [OPTION]@dots{}
|
||||
Import a CA @i{Trusted Certificate}.
|
||||
|
||||
@item -identitydb [OPTION]@dots{}
|
||||
@b{NOT IMPLEMENTED YET}.@*
|
||||
Import a JDK 1.1 style Identity Database.
|
||||
@end itemize
|
||||
|
||||
@item Export commands
|
||||
@itemize @bullet
|
||||
@item -certreq [OPTION]@dots{}
|
||||
Issue a @i{Certificate Signing Request} (CSR) which can be then sent to a @i{Certification Authority} (CA) to issue a certificate signed (by the CA) and authenticating the @i{Subject} of the request.
|
||||
|
||||
@item -export [OPTION]@dots{}
|
||||
Export a certificate from a key store.
|
||||
@end itemize
|
||||
|
||||
@item Display commands
|
||||
@itemize @bullet
|
||||
@item -list [OPTION]@dots{}
|
||||
Print one or all certificates in a key store to @code{STDOUT}.
|
||||
|
||||
@item -printcert [OPTION]@dots{}
|
||||
Print a human-readable form of a certificate, in a designated file, to @code{STDOUT}.
|
||||
@end itemize
|
||||
|
||||
@item Management commands
|
||||
@itemize @bullet
|
||||
@item -keyclone [OPTION]@dots{}
|
||||
Clone a @i{Key Entry} in a key store.
|
||||
|
||||
@ -218,13 +466,48 @@ Change the password protecting a @i{Key Entry} in a key store.
|
||||
|
||||
@item -delete [OPTION]@dots{}
|
||||
Delete a @i{Key Entry} or a @i{Trusted Certificate} from a key store.
|
||||
@end itemize
|
||||
|
||||
@item -help
|
||||
Prints a help text similar to this one.
|
||||
@end enumerate
|
||||
|
||||
@end table
|
||||
@menu
|
||||
* Getting Help:: How to get help with keytool commands
|
||||
* Common keytool Options:: Options used in more than one command
|
||||
* Distinguished Names:: X.500 Distinguished Names used in certificates
|
||||
* Add/Update Commands:: Commands for adding data to a Key Store
|
||||
* Export Commands:: Commands for exporting data from a Key Store
|
||||
* Display Commands:: Commands for displaying data in a Key Store
|
||||
* Management Commands:: Commands for managing a Key Store
|
||||
@end menu
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Getting Help, Common keytool Options, keytool Tool, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Getting help
|
||||
|
||||
To get a general help text about the tool, use the @code{-help} option; e.g.
|
||||
|
||||
@example
|
||||
@code{keytool -help}
|
||||
@end example
|
||||
|
||||
To get more specific help text about one of the tool's command use the @code{-help} option for that command; e.g.
|
||||
|
||||
@example
|
||||
@code{keytool -genkey -help}
|
||||
@end example
|
||||
|
||||
In both instances, the tool will print a help text and then will exit the running JVM.
|
||||
|
||||
It is worth noting here that the help messages printed by the tool are I18N-ready. This means that if/when the contents of the tool's @i{Message Bundle} properties file are available in languages other than English, you may see those messages in that language.
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Common keytool Options, Distinguished Names, Getting Help, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Common options
|
||||
|
||||
@item OPTIONS COMMON TO MORE THAN ONE COMMAND
|
||||
The following @code{OPTION}s are used in more than one @code{COMMAND}. They are described here to reduce redundancy.
|
||||
|
||||
@table @b
|
||||
@ -263,7 +546,7 @@ If a URL was specified, but was found to be malformed --e.g. missing protocol el
|
||||
A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e. it was not already installed-- then the tool will attempt to removed this @i{Security Provider} before exiting.
|
||||
|
||||
@anchor{file}
|
||||
@item -file FILE_NAME
|
||||
@item -file FILE
|
||||
Use this option to designate a file to use with a command. When specified with this option, the value is expected to be the fully qualified path of a file accessible by the File System. Depending on the command, the file may be used as input or as output. When this option is omitted from the command line, @code{STDIN} will be used instead, as the source of input, and @code{STDOUT} will be used instead as the output destination.
|
||||
|
||||
@anchor{verbose}
|
||||
@ -272,8 +555,13 @@ Unless specified otherwise, use this option to enable more verbose output.
|
||||
|
||||
@end table
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Distinguished Names, Add/Update Commands, Common keytool Options, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection X.500 Distinguished Names
|
||||
|
||||
@anchor{dn}
|
||||
@item X.500 DISTINGUISHED NAME
|
||||
A @i{Distinguished Name} (or DN) MUST be supplied with some of the @code{COMMAND}s using a @code{-dname} option. The syntax of a valid value for this option MUST follow RFC-2253 specifications. Namely the following components (with their accepted meaning) will be recognized. Note that the component name is case-insensitive:
|
||||
|
||||
@ftable @var
|
||||
@ -299,8 +587,27 @@ CN=host.domain.com, O=The Sample Company, L=Sydney, ST=NSW, C=AU
|
||||
@*
|
||||
If the @i{Distinguished Name} is required, and no valid default value can be used, the tool will prompt you to enter the information through the console.
|
||||
|
||||
@item -genkey COMMAND
|
||||
Generate a new key-pair (both private and public keys), and save these credentials in the key store as a @i{Key Entry}, associated with the designated (if was specified in the @code{-alias} option) or default (if the @code{-alias} option is omitted) @i{Alias}.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Add/Update Commands, Export Commands, Distinguished Names, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Add/Update commands
|
||||
|
||||
@menu
|
||||
* Command -genkey:: Generate private key and self-signed certificate
|
||||
* Command -import:: Import certificates and certificate replies
|
||||
* Command -selfcert:: Generate self-signed certificate
|
||||
* Command -cacert:: Import a CA Trusted Certificate
|
||||
* Command -identitydb:: Import JDK-1 style identities
|
||||
@end menu
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -genkey, Command -import, Add/Update Commands, Add/Update Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-genkey} command
|
||||
|
||||
Use this command to generate a new key-pair (both private and public keys), and save these credentials in the key store as a @i{Key Entry}, associated with the designated (if was specified with the @code{-alias} option) or default (if the @code{-alias} option is omitted) @i{Alias}.
|
||||
|
||||
The private key material will be protected with a user-defined password (see @code{-keypass} option). The public key on the other hand will be part of a self-signed X.509 certificate, which will form a 1-element chain and will be saved in the key store.
|
||||
|
||||
@ -347,8 +654,13 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -import COMMAND
|
||||
Read an X.509 certificate, or a PKCS#7 @i{Certificate Reply} from a designated input source and incorporate the certificates into the key store.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -import, Command -selfcert, Command -genkey, Add/Update Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-import} command
|
||||
|
||||
Use this command to read an X.509 certificate, or a PKCS#7 @i{Certificate Reply} from a designated input source and incorporate the certificates into the key store.
|
||||
|
||||
If the @i{Alias} does not already exist in the key store, the tool treats the certificate read from the input source as a new @i{Trusted Certificate}. It then attempts to discover a chain-of-trust, starting from that certificate and ending at another @i{Trusted Certificate}, already stored in the key store. If the @code{-trustcacerts} option is present, an additional key store, of type @code{JKS} named @file{cacerts}, and assumed to be present in @file{$@{JAVA_HOME@}/lib/security} will also be consulted if found --@code{$@{JAVA_HOME@}} refers to the location of an installed @i{Java Runtime Environment} (JRE). If no chain-of-trust can be established, and unless the @code{-noprompt} option has been specified, the certificate is printed to @code{STDOUT} and the user is prompted for a confirmation.
|
||||
|
||||
@ -358,8 +670,8 @@ If @i{Alias} exists in the key store, the tool will treat the certificate(s) rea
|
||||
@item -alias ALIAS
|
||||
For more details @pxref{alias,, ALIAS}.
|
||||
|
||||
@item -file FILE_NAME
|
||||
For more details @pxref{file,, FILE_NAME}.
|
||||
@item -file FILE
|
||||
For more details @pxref{file,, FILE}.
|
||||
|
||||
@item -keypass PASSWORD
|
||||
Use this option to specify the password which the tool will use to protect the @i{Key Entry} associated with the designated @i{Alias}, when replacing this @i{Alias}' chain of certificates with that found in the certificate reply.
|
||||
@ -389,8 +701,13 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -selfcert COMMAND
|
||||
Generate a self-signed X.509 version 1 certificate. The newly generated certificate will form a chain of one element which will replace the previous chain associated with the designated @i{Alias} (if @code{-alias} option was specified), or the default @i{Alias} (if @code{-alias} option was omitted).
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -selfcert, Command -cacert, Command -import, Add/Update Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-selfcert} command
|
||||
|
||||
Use this command to generate a self-signed X.509 version 1 certificate. The newly generated certificate will form a chain of one element which will replace the previous chain associated with the designated @i{Alias} (if @code{-alias} option was specified), or the default @i{Alias} (if @code{-alias} option was omitted).
|
||||
|
||||
@table @b
|
||||
@item -alias ALIAS
|
||||
@ -429,14 +746,19 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -identitydb COMMAND
|
||||
@b{NOT IMPLEMENTED YET}.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
Import a JDK 1.1 style Identity Database.
|
||||
@node Command -cacert, Command -identitydb, Command -selfcert, Add/Update Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-cacert} command
|
||||
|
||||
Use this command to import, a CA certificate and add it to the key store as a @i{Trusted Certificate}. The @i{Alias} for this new entry will be constructed from the FILE's base-name after replacing hyphens and dots with underscores.
|
||||
|
||||
This command is useful when used in a script that recursively visits a directory of CA certificates to populate a @code{cacerts.gkr} @i{Key Store} of trusted certificates which can then be used commands that specify the @code{-trustcacerts} option.
|
||||
|
||||
@table @b
|
||||
@item -file FILE_NAME
|
||||
For more details @pxref{file,, FILE_NAME}.
|
||||
@item -file FILE
|
||||
For more details @pxref{file,, FILE}.
|
||||
|
||||
@item -storetype STORE_TYPE
|
||||
For more details @pxref{storetype,, STORE_TYPE}.
|
||||
@ -455,8 +777,55 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -certreq COMMAND
|
||||
Generate a PKCS#10 @i{Certificate Signing Request} (CSR) and writes it to a designated output destination. The contents of the destination should look something like the following:
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -identitydb, , Command -cacert, Add/Update Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-identitydb} command
|
||||
|
||||
@b{NOT IMPLEMENTED YET}.
|
||||
|
||||
Use this command to import a JDK 1.1 style Identity Database.
|
||||
|
||||
@table @b
|
||||
@item -file FILE
|
||||
For more details @pxref{file,, FILE}.
|
||||
|
||||
@item -storetype STORE_TYPE
|
||||
For more details @pxref{storetype,, STORE_TYPE}.
|
||||
|
||||
@item -keystore URL
|
||||
For more details @pxref{keystore,, URL}.
|
||||
|
||||
@item -storepass PASSWORD
|
||||
For more details @pxref{storepass,, PASSWORD}.
|
||||
|
||||
@item -provider PROVIDER_CLASS_NAME
|
||||
For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
|
||||
|
||||
@item -v
|
||||
For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Export Commands, Display Commands, Add/Update Commands, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Export commands
|
||||
|
||||
@menu
|
||||
* Command -certreq:: Generate Certificate Signing Requests (CSR)
|
||||
* Command -export:: Export a certificate in a Key Store
|
||||
@end menu
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -certreq, Command -export, Export Commands, Export Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-certreq} command
|
||||
|
||||
Use this command to generate a PKCS#10 @i{Certificate Signing Request} (CSR) and write it to a designated output destination. The contents of the destination should look something like the following:
|
||||
|
||||
@example
|
||||
-----BEGIN NEW CERTIFICATE REQUEST-----
|
||||
@ -476,8 +845,8 @@ For more details @pxref{alias,, ALIAS}.
|
||||
@item -sigalg ALGORITHM
|
||||
The canonical name of the digital signature algorithm to use for signing the certificate. If this option is omitted, a default value will be chosen based on the type of the private key associated with the designated @i{Alias}. If the private key is a @code{DSA} one, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the private key is an @code{RSA} one, then the tool will use @code{MD5withRSA} as the signature algorithm.
|
||||
|
||||
@item -file FILE_NAME
|
||||
For more details @pxref{file,, FILE_NAME}.
|
||||
@item -file FILE
|
||||
For more details @pxref{file,, FILE}.
|
||||
|
||||
@item -keypass PASSWORD
|
||||
Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
|
||||
@ -504,16 +873,20 @@ Use this option to force the tool to encode a @code{NULL} DER value in the CSR a
|
||||
|
||||
@end table
|
||||
|
||||
@item -export COMMAND
|
||||
Export a certificate stored in the key store to a designated output destination, either in binary format (if the @code{-v} option is specified), or in RFC-1421 compliant encoding (if the @code{-rfc} option is specified
|
||||
instead).
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -export, , Command -certreq, Export Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-export} command
|
||||
|
||||
Use this command to export a certificate stored in a key store to a designated output destination, either in binary format (if the @code{-v} option is specified), or in RFC-1421 compliant encoding (if the @code{-rfc} option is specified instead).
|
||||
|
||||
@table @b
|
||||
@item -alias ALIAS
|
||||
For more details @pxref{alias,, ALIAS}.
|
||||
|
||||
@item -file FILE_NAME
|
||||
For more details @pxref{file,, FILE_NAME}.
|
||||
@item -file FILE
|
||||
For more details @pxref{file,, FILE}.
|
||||
|
||||
@item -storetype STORE_TYPE
|
||||
For more details @pxref{storetype,, STORE_TYPE}.
|
||||
@ -535,8 +908,24 @@ Output the certificate in binary DER encoding. This is the default output format
|
||||
|
||||
@end table
|
||||
|
||||
@item -list COMMAND
|
||||
Print one or all of the key store entries to @code{STDOUT}. Usually this command will only print a @i{fingerprint} of the certificate, unless either the @code{-rfc} or the @code{-v} option is specified.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Display Commands, Management Commands, Export Commands, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Display commands
|
||||
|
||||
@menu
|
||||
* Command -list:: Display information about one or all Aliases
|
||||
* Command -printcert:: Print a certificate or a certificate fingerprint
|
||||
@end menu
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -list, Command -printcert, Display Commands, Display Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-list} command
|
||||
|
||||
Use this command to print one or all of a key store entries to @code{STDOUT}. Usually this command will only print a @i{fingerprint} of the certificate, unless either the @code{-rfc} or the @code{-v} option is specified.
|
||||
|
||||
@table @b
|
||||
@item -alias ALIAS
|
||||
@ -564,20 +953,43 @@ Output the certificate in human-readable format. If both this option and the @co
|
||||
|
||||
@end table
|
||||
|
||||
@item -printcert COMMAND
|
||||
Read a certificate from a designated input source and print it to @code{STDOUT} in a human-readable form.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -printcert, , Command -list, Display Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-printcert} command
|
||||
|
||||
Use this command to read a certificate from a designated input source and print it to @code{STDOUT} in a human-readable form.
|
||||
|
||||
@table @b
|
||||
@item -file FILE_NAME
|
||||
For more details @pxref{file,, FILE_NAME}.
|
||||
@item -file FILE
|
||||
For more details @pxref{file,, FILE}.
|
||||
|
||||
@item -v
|
||||
For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -keyclone COMMAND
|
||||
Clone an existing @i{Key Entry} and store it under a new (different) @i{Alias} protecting, its private key material with possibly a new password.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Management Commands, , Display Commands, keytool Tool
|
||||
@comment node-name, next, previous, up
|
||||
@subsection Management commands
|
||||
|
||||
@menu
|
||||
* Command -keyclone:: Clone a Key Entry in a Key Store
|
||||
* Command -storepasswd:: Change the password protecting a Key Store
|
||||
* Command -keypasswd:: Change the password protecting a Key Entry
|
||||
* Command -delete:: Remove an entry in a Key Store
|
||||
@end menu
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -keyclone, Command -storepasswd, Management Commands, Management Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-keyclone} command
|
||||
|
||||
Use this command to clone an existing @i{Key Entry} and store it under a new (different) @i{Alias} protecting, its private key material with possibly a new password.
|
||||
|
||||
@table @b
|
||||
@item -alias ALIAS
|
||||
@ -611,8 +1023,13 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -storepasswd COMMAND
|
||||
Change the password protecting a key store.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -storepasswd, Command -keypasswd, Command -keyclone, Management Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-storepasswd} command
|
||||
|
||||
Use this command to change the password protecting a key store.
|
||||
|
||||
@table @b
|
||||
@item -new PASSWORD
|
||||
@ -635,14 +1052,18 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -keypasswd COMMAND
|
||||
Change the password protecting the private key material of a designated @i{Key Entry}.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -keypasswd, Command -delete, Command -storepasswd, Management Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-keypasswd} command
|
||||
|
||||
Use this command to change the password protecting the private key material of a designated @i{Key Entry}.
|
||||
|
||||
@table @b
|
||||
@item -alias ALIAS
|
||||
For more details @pxref{alias,, ALIAS}.
|
||||
|
||||
@item -keypass PASSWORD
|
||||
Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
|
||||
|
||||
If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
|
||||
@ -667,8 +1088,13 @@ For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
|
||||
@item -delete COMMAND
|
||||
Delete a designated key store entry.
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Command -delete, , Command -keypasswd, Management Commands
|
||||
@comment node-name, next, previous, up
|
||||
@subsubsection @code{-delete} command
|
||||
|
||||
Use this command to delete a designated key store entry.
|
||||
|
||||
@table @b
|
||||
@item -alias ALIAS
|
||||
@ -689,7 +1115,6 @@ For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
|
||||
@item -v
|
||||
For more details @pxref{verbose}.
|
||||
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
@ -709,7 +1134,7 @@ Some tools --@pxref{Security Tools}-- allow using other than the English languag
|
||||
|
||||
@node Language Resources, Message Formats, I18N Issues, I18N Issues
|
||||
@comment node-name, next, previous, up
|
||||
@section Language-Specific Resources
|
||||
@section Language-specific resources
|
||||
|
||||
The Tools use Java @code{ResourceBundle}s to store messages, and message templates they use at runtime to generate the message text itself, depending on the locale in use at the time.
|
||||
|
||||
@ -721,7 +1146,7 @@ Command.23=A correct key password MUST be provided
|
||||
|
||||
When the tool needs to signal a mandatory but missing key password, it would reference the property named @code{Command.23} and the message "@kbd{A correct key password MUST be provided}" will be used instead. This indirect referencing of "resources" permits replacing, as late as possible, the English strings with strings in other languages, provided of course @i{Resource Bundles} in those languages are provided.
|
||||
|
||||
For the GNU Classpath Tools described in this Guide, the @i{Resource Bundles} are files named @file{MessageBundle[_ll[_CC[_VV]]].properties} where:
|
||||
For the GNU Classpath Tools described in this Guide, the @i{Resource Bundles} are files named @file{messages[_ll[_CC[_VV]]].properties} where:
|
||||
|
||||
@ftable @var
|
||||
@item ll
|
||||
@ -746,24 +1171,24 @@ The location of the @i{Resource Bundles} for the GNU Classpath Tools is specific
|
||||
The collection of @i{Resource Bundles} in a location act as an inverted tree with a parent-child relationship. For example suppose in the @file{gnu/classpath/tools/keytool} there are 3 message bundles named:
|
||||
|
||||
@enumerate
|
||||
@item @code{MessageBundle.properties}
|
||||
@item @code{MessageBundle_fr.properties}
|
||||
@item @code{MessageBundle_fr_FR.properties}
|
||||
@item @code{messages.properties}
|
||||
@item @code{messages_fr.properties}
|
||||
@item @code{messages_fr_FR.properties}
|
||||
@end enumerate
|
||||
|
||||
In the above example, bundle #1 will act as the parent of bundle #2, which in turn will act as the parent for bundle #3. This ordering is used by the Java runtime to choose which file to load based on the set Locale. For example if the Locale is @code{fr_CH}, @code{MessageBundle_fr.properties} will be used because (a) @code{MessageBundle_fr_CH.properties} does not exist, but (b) @code{MessageBundle_fr.properties} is the parent for the required bundle, and it exists. As another example, suppose the Locale was set to @code{en_AU}; then the tool will end up using @code{MessageBundle.properties} because (a) @code{MessageBundle_en_AU.properties} does not exist, (b) @code{MessageBundle_en.properties} which is the parent for the required bundle does not exist, but (c) @code{MessageBundle.properties} exists and is the root of the hierarchy.
|
||||
In the above example, bundle #1 will act as the parent of bundle #2, which in turn will act as the parent for bundle #3. This ordering is used by the Java runtime to choose which file to load based on the set Locale. For example if the Locale is @code{fr_CH}, @code{messages_fr.properties} will be used because (a) @code{messages_fr_CH.properties} does not exist, but (b) @code{messages_fr.properties} is the parent for the required bundle, and it exists. As another example, suppose the Locale was set to @code{en_AU}; then the tool will end up using @code{messages.properties} because (a) @code{messages_en_AU.properties} does not exist, (b) @code{messages_en.properties} which is the parent for the required bundle does not exist, but (c) @code{messages.properties} exists and is the root of the hierarchy.
|
||||
|
||||
You can see from the examples above that @file{MessageBundle.properties} is the safety net that the Java runtime falls back to when failing to find a specific bunlde and its parent(s). This file is always provided with the Tool. In time, more localized versions will be included to cater for other languages.
|
||||
You can see from the examples above that @file{messages.properties} is the safety net that the Java runtime falls back to when failing to find a specific bunlde and its parent(s). This file is always provided with the Tool. In time, more localized versions will be included to cater for other languages.
|
||||
|
||||
In the meantime, if you are willing to contribute localized versions of these resources, grab the @file{MessageBundle.properties} for a specific tool; translate it; save it with the appropriate language and region suffix and mail it to @code{classpath@@gnu.org}.
|
||||
In the meantime, if you are willing to contribute localized versions of these resources, grab the @file{messages.properties} for a specific tool; translate it; save it with the appropriate language and region suffix and mail it to @code{classpath@@gnu.org}.
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
@node Message Formats, , Language Resources, I18N Issues
|
||||
@comment node-name, next, previous, up
|
||||
@section Message Formats
|
||||
@section Message formats
|
||||
|
||||
If you open any of the @file{MessageBundle.properties} described in the previous section, you may see properties that look like so:
|
||||
If you open any of the @file{messages.properties} described in the previous section, you may see properties that look like so:
|
||||
|
||||
@example
|
||||
Command.67=Issuer: @{0@}
|
||||
@ -774,7 +1199,7 @@ Command.70=\ \ \ \ \ until: @{0,date,full@} - @{0,time,full@}
|
||||
|
||||
These are @i{Message Formats} used by the tools to customize a text string that will then be used either as a prompt for User input or as output.
|
||||
|
||||
If you are translating a @file{MessageBundle.properties} be careful not to alter text between curly braces.
|
||||
If you are translating a @file{messages.properties} be careful not to alter text between curly braces.
|
||||
|
||||
@comment ----------------------------------------------------------------------
|
||||
|
||||
|
@ -12,7 +12,7 @@ This file contains important information you will need to know if you
|
||||
are going to write an interface between GNU Classpath and a Virtual
|
||||
Machine.
|
||||
|
||||
Copyright (C) 1998-2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
@ifnotplaintext
|
||||
@dircategory GNU Libraries
|
||||
@ -66,6 +66,7 @@ This document is incomplete, as we are still in alpha with the interface.
|
||||
* Classpath Hooks:: Hooks from Classpath to the VM
|
||||
* VM Hooks:: Hooks from the underlying VM to Classpath
|
||||
* JNI Implementation:: Hooking the VM to jni.h
|
||||
* JVMTI Implementation:: Hooking the VM to jvmti.h
|
||||
* Miscellaneous VM Requirements::
|
||||
@end menu
|
||||
|
||||
@ -202,6 +203,8 @@ implementation.
|
||||
* gnu.java.nio::
|
||||
* java.lang.reflect::
|
||||
* gnu.java.lang::
|
||||
* gnu.java.lang.management::
|
||||
* java.lang.management::
|
||||
* Classpath Callbacks::
|
||||
@end menu
|
||||
|
||||
@ -704,6 +707,9 @@ to allow the setting to flow down to the native thread.
|
||||
@item @code{nativeStop(Throwable)} -- The VM should stop the thread abnormally
|
||||
and throw the specified exception. This is clearly deprecated, due to the
|
||||
ambiguous state an abruptly-stopped thread may leave.
|
||||
@item @code{getState()} -- Returns the VM's impression of the current state
|
||||
of the thread. The applicable states are supplied by the @code{State}
|
||||
enumeration in @code{java.lang.Thread}.
|
||||
@end itemize
|
||||
@item Mandatory Class Methods
|
||||
@itemize @bullet
|
||||
@ -1206,7 +1212,7 @@ which the VM uses to generate a new non-primitive array of a
|
||||
particular class and size. The default implementation simply passes
|
||||
the job down to the standard JNI function, @code{NewObjectArray}.
|
||||
|
||||
@node gnu.java.lang, Classpath Callbacks, java.lang.reflect, Classpath Hooks
|
||||
@node gnu.java.lang, gnu.java.lang.management, java.lang.reflect, Classpath Hooks
|
||||
@section @code{gnu.java.lang}
|
||||
|
||||
@code{gnu.java.lang} provides VM interfaces for the GNU
|
||||
@ -1258,7 +1264,384 @@ method calls the @code{VMInstrumentationImpl.redefineClasses} native method
|
||||
which must be implemented by the VM. The implementation should call the
|
||||
@code{InstrumentationImpl.callTransformers} method.
|
||||
|
||||
@node Classpath Callbacks, , gnu.java.lang, Classpath Hooks
|
||||
@node gnu.java.lang.management, java.lang.management, gnu.java.lang, Classpath Hooks
|
||||
@section @code{gnu.java.lang.management}
|
||||
|
||||
@code{gnu.java.lang.management} provides the VM interfaces for the GNU
|
||||
implementations of the management beans.
|
||||
|
||||
@menu
|
||||
* gnu.java.lang.management.VMRuntimeMXBeanImpl::
|
||||
* gnu.java.lang.management.VMClassLoadingMXBeanImpl::
|
||||
* gnu.java.lang.management.VMThreadMXBeanImpl::
|
||||
* gnu.java.lang.management.VMMemoryMXBeanImpl::
|
||||
* gnu.java.lang.management.VMCompilationMXBeanImpl::
|
||||
* gnu.java.lang.management.VMMemoryPoolMXBeanImpl::
|
||||
* gnu.java.lang.management.VMMemoryManagerMXBeanImpl::
|
||||
* gnu.java.lang.management.VMGarbageCollectorMXBeanImpl::
|
||||
@end menu
|
||||
|
||||
@node gnu.java.lang.management.VMRuntimeMXBeanImpl,gnu.java.lang.management.VMClassLoadingMXBeanImpl,,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMRuntimeMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.RuntimeMXBeanImpl} provides an
|
||||
implementation of the @code{java.lang.management.RuntimeMXBean} interface,
|
||||
and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMRuntimeMXBeanImpl}. This provides a
|
||||
series of methods, which should be implemented by the virtual machine
|
||||
in order to provide the required information for the bean. The VM
|
||||
methods are generally representative of information that is only
|
||||
available from the virtual machine, such as the command-line arguments
|
||||
it was given at startup.
|
||||
|
||||
The methods are as follows:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getInputArguments())} -- The VM should supply
|
||||
a @code{String} array containing each of the command-line
|
||||
arguments, excluding those that are directed at the
|
||||
@code{main()} method. The reference implementation expects
|
||||
this to be a native method.
|
||||
@item @code{(getName())} -- The VM developer should choose
|
||||
an appropriate name for the virtual machine. This name can
|
||||
be instance-specific e.g. it can include things like the
|
||||
process identifier or host name of the machine, which only
|
||||
apply to the current running instance. Thus, the intention is
|
||||
that this name refers to the entity that the other information
|
||||
refers to, rather than the VM in general. The reference
|
||||
implementation supplies a default concatenation of the VM
|
||||
name and version.
|
||||
@item @code{(getStartTime())} -- This should return the number
|
||||
of milliseconds at which the virtual machine was started.
|
||||
The uptime property of the bean is provided relative to this
|
||||
value. Again, the reference implementation also expects
|
||||
this method to be native.
|
||||
@end itemize
|
||||
|
||||
The virtual machine also needs to provide either the
|
||||
@code{sun.boot.class.path} or @code{java.boot.class.path}
|
||||
property in order to support the optional boot class path
|
||||
retrieval functionality.
|
||||
|
||||
@node gnu.java.lang.management.VMClassLoadingMXBeanImpl,gnu.java.lang.management.VMThreadMXBeanImpl,gnu.java.lang.management.VMRuntimeMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMClassLoadingMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.ClassLoadingMXBeanImpl} provides an
|
||||
implementation of the @code{java.lang.management.ClassLoadingMXBean} interface,
|
||||
and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMClassLoadingMXBeanImpl}. This provides a
|
||||
series of methods, which should be implemented by the virtual machine
|
||||
in order to provide the required information for the bean. Implementing
|
||||
this bean requires the VM to monitor when classes are loaded and unloaded,
|
||||
and provide the option of verbose class loading output.
|
||||
|
||||
The methods are as follows:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getLoadedClassCount())} -- This should return
|
||||
the number of classes that are currently loaded by the VM.
|
||||
@item @code{(getUnloadedClassCount())} -- This should return
|
||||
the number of classes that have been loaded by the VM, but
|
||||
have since been unloaded.
|
||||
@item @code{(isVerbose())} -- This should return @code{true}
|
||||
or @code{false}, depending on whether verbose class loading
|
||||
output is turned or not, respectively.
|
||||
@item @code{(setVerbose(boolean))} -- This should allow the
|
||||
verbose class loading output to be turned on and off.
|
||||
@end itemize
|
||||
|
||||
@node gnu.java.lang.management.VMThreadMXBeanImpl,gnu.java.lang.management.VMMemoryMXBeanImpl,gnu.java.lang.management.VMClassLoadingMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMThreadMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.ThreadMXBeanImpl} provides an
|
||||
implementation of the @code{java.lang.management.ThreadMXBean} interface,
|
||||
and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMThreadMXBeanImpl}. This provides a
|
||||
series of methods, which should be implemented by the virtual machine
|
||||
in order to provide the required information for the bean. Implementing
|
||||
this bean requires the VM to monitor thread-related statistics such as
|
||||
how often the blocked and waiting states have been entered, as well as
|
||||
additional optional support for time and contention monitoring.
|
||||
|
||||
Optional support is determined by the following properties:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{gnu.java.lang.management.CurrentThreadTimeSupport} --
|
||||
This property should be present if the VM supports monitoring the
|
||||
time used by the current thread. If time monitoring for all threads
|
||||
is supported, this need not be provided.
|
||||
@item @code{gnu.java.lang.management.ThreadTimeSupport} --
|
||||
This property should be present if the VM supports monitoring the
|
||||
time used by all threads.
|
||||
@item @code{gnu.java.lang.management.ThreadContentionSupport} --
|
||||
This property should be present if the VM supports thread contention
|
||||
monitoring.
|
||||
@end itemize
|
||||
|
||||
In addition, the property
|
||||
@code{gnu.java.lang.management.ThreadTimeInitallyEnabled} may be
|
||||
set to the @code{String} value, @code{"true"}, if time monitoring
|
||||
is enabled at startup.
|
||||
|
||||
The methods are as follows:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(findMonitorDeadlockedThreads())} -- This should return
|
||||
an array of thread identifiers which match threads involved in
|
||||
deadlock cycles (where each thread is waiting to obtain a lock
|
||||
held by one of the others). This is specified as a native method
|
||||
in the reference implementation.
|
||||
@item @code{(getAllThreads())} -- This should return an array of
|
||||
all live threads and set the @code{filled} variable to the number
|
||||
found. A default implementation is provided.
|
||||
@item @code{(getAllThreadIds())} -- This should return an array of
|
||||
all live thread identifiers. An implementation is provided against
|
||||
@code{getAllThreads()} by default.
|
||||
@item @code{(getCurrentThreadCpuTime())} -- This should return the
|
||||
approximate number of nanoseconds of CPU time the current thread
|
||||
has used. This is an optional native method, which is used by VMs
|
||||
supporting time monitoring.
|
||||
@item @code{(getCurrentThreadUserTime())} -- This should return the
|
||||
approximate number of nanoseconds of user time the current thread
|
||||
has used. This is an optional native method, which is used by VMs
|
||||
supporting time monitoring.
|
||||
@item @code{(getDaemonThreadCount())} -- This should return the number
|
||||
of live daemon threads. A default implementation is provided, based
|
||||
on @code{getAllThreads()}.
|
||||
@item @code{(getPeakThreadCount())} -- The VM should maintain a record
|
||||
of the peak number of live threads, and return it when this method is
|
||||
called. This is specified as a native method in the reference
|
||||
implementation.
|
||||
@item @code{(resetPeakThreadCount())} -- This should reset the record
|
||||
of the peak number of live threads to the current number of live
|
||||
threads. This is specified as a native method in the reference
|
||||
implementation.
|
||||
@item @code{(getThreadCount())} -- This should return the number of
|
||||
live threads. A default implementation is provided, based on
|
||||
@code{getAllThreads()}.
|
||||
@item @code{(getThreadCpuTime(long))} -- This should return the
|
||||
approximate number of nanoseconds of CPU time the specified thread
|
||||
has used. This is an optional native method, which is used by VMs
|
||||
supporting time monitoring.
|
||||
@item @code{(getThreadUserTime(long))} -- This should return the
|
||||
approximate number of nanoseconds of CPU time the specified thread
|
||||
has used. This is an optional native method, which is used by VMs
|
||||
supporting time monitoring.
|
||||
@item @code{(getThreadInfoForId(long, int))} -- This return an instance
|
||||
of @code{java.lang.management.ThreadInfo} for the specified thread.
|
||||
The class includes a private constructor which VMs should use to initialise
|
||||
it with the appropriate values for the thread. The second argument
|
||||
given here specifies the depth of the stack trace supplied on construction
|
||||
of the instance. Special values are 0 (return an empty array) and
|
||||
@code{Integer.MAX_VALUE} (return the maximum depth possible). This
|
||||
is specified as a native method in the reference implementation.
|
||||
@item @code{(getTotalStartedThreadCount())} -- This should return the
|
||||
total number of threads that have been started by the VM, including ones
|
||||
that have died. This is specified as a native method in the reference
|
||||
implementation.
|
||||
@end itemize
|
||||
|
||||
@node gnu.java.lang.management.VMMemoryMXBeanImpl,gnu.java.lang.management.VMCompilationMXBeanImpl,gnu.java.lang.management.VMThreadMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMMemoryMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.MemoryMXBeanImpl} provides an
|
||||
implementation of the @code{java.lang.management.MemoryMXBean} interface,
|
||||
and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMMemoryMXBeanImpl}. This provides a
|
||||
series of methods, which should be implemented by the virtual machine
|
||||
in order to provide the required information for the bean. Implementing
|
||||
this bean requires the VM to monitor the levels of heap and non-heap
|
||||
memory, and provide the number of objects which are eligible for garbage
|
||||
collection.
|
||||
|
||||
The methods are as follows:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getHeapMemoryUsage())} -- This should return
|
||||
an instance of @code{java.lang.management.MemoryUsage} with
|
||||
values pertaining to the heap. A default implementation is
|
||||
provided, based on @code{java.lang.Runtime}'s methods.
|
||||
@item @code{(getNonHeapMemoryUsage())} -- This should return
|
||||
an instance of @code{java.lang.management.MemoryUsage} with
|
||||
values pertaining to non-heap memory.
|
||||
@item @code{(getObjectPendingFinalizationCount())} -- Returns
|
||||
the number of objects which are no longer referenced, and which
|
||||
will thus be garbage collected on the next run of the garbage
|
||||
collector.
|
||||
@item @code{(isVerbose())} -- This should return @code{true}
|
||||
or @code{false}, depending on whether verbose memory management
|
||||
output is turned or not, respectively.
|
||||
@item @code{(setVerbose(boolean))} -- This should allow the
|
||||
verbose memory management output to be turned on and off.
|
||||
@end itemize
|
||||
|
||||
@node gnu.java.lang.management.VMCompilationMXBeanImpl,gnu.java.lang.management.VMMemoryPoolMXBeanImpl,gnu.java.lang.management.VMMemoryMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMCompilationMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.CompilationMXBeanImpl} provides an
|
||||
implementation of the optional @code{java.lang.management.CompilationMXBean}
|
||||
interface, and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMCompilationMXBeanImpl}. This provides a
|
||||
single method for returning the number of milliseconds the virtual
|
||||
machine's Just-In-Time (JIT) compiler has spent compiling. Even if
|
||||
a JIT compiler is available and an instance of the bean supplied, this
|
||||
method is still optional.
|
||||
|
||||
Optional support is determined by the following properties:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{gnu.java.lang.compiler.name} -- This property should
|
||||
specify the name of the JIT compiler. Classpath also uses this,
|
||||
within @code{java.lang.management.ManagementFactory}, to determine
|
||||
whether a bean should be created. If this property is set to a
|
||||
non-null value, a bean will be created and its @code{getName()}
|
||||
method will return this value.
|
||||
@item @code{gnu.java.lang.management.CompilationTimeSupport} --
|
||||
This property should be present if the VM supports monitoring the
|
||||
time spent compiling.
|
||||
@end itemize
|
||||
|
||||
Time support is implemented by the following method:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getTotalCompilationTime())} -- This should return the
|
||||
number of milliseconds the JIT compiler has spent compiling.
|
||||
@end itemize
|
||||
|
||||
@node gnu.java.lang.management.VMMemoryPoolMXBeanImpl,gnu.java.lang.management.VMMemoryManagerMXBeanImpl,gnu.java.lang.management.VMCompilationMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMMemoryPoolMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.MemoryPoolMXBeanImpl} provides an
|
||||
implementation of the optional @code{java.lang.management.MemoryPoolMXBean}
|
||||
interface, and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMMemoryPoolMXBeanImpl}. Providing
|
||||
this interface requires implementing a number of methods for each supported
|
||||
pool. These return statistics on memory usage, and, optionally, allows
|
||||
monitoring of when memory usage exceedes a preset threshold.
|
||||
|
||||
Optional support is determined by the following properties:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{gnu.java.lang.management.CollectionUsageThresholdSupport} --
|
||||
This property should be present if the VM supports setting a collection
|
||||
usage threshold and monitoring when it is matched or exceeded. Collection
|
||||
usage thresholds are related to the remaining memory usage following a
|
||||
garbage collection cycle.
|
||||
@item @code{gnu.java.lang.management.UsageThresholdSupport} --
|
||||
This property should be present if the VM supports setting a
|
||||
usage threshold and monitoring when it is matched or exceeded.
|
||||
@end itemize
|
||||
|
||||
The methods are as follows (all take a pool name as their
|
||||
first parameter):
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getCollectionUsage(String))} -- Returns a
|
||||
@code{java.lang.management.MemoryUsage} object, containing the
|
||||
memory usage statistics following a garbage collection cycle
|
||||
for the specified pool. This may also return @code{null} if
|
||||
the pool isn't an appropriate pool for this particular task.
|
||||
@item @code{(getCollectionUsageThreshold(String))} -- Returns
|
||||
the pool's collection usage threshold, if supported.
|
||||
@item @code{(getCollectionUsageThresholdCount(String))} -- Returns
|
||||
the number of times the specified pool has matched or exceeded
|
||||
its collection usage threshold, if supported.
|
||||
@item @code{(getMemoryManagerNames(String))} -- Returns a list
|
||||
of names of memory managers which manage the specified pool.
|
||||
@item @code{(getPeakUsage(String))} -- Returns a
|
||||
@code{java.lang.management.MemoryUsage} object for the peak
|
||||
usage level of the specified pool.
|
||||
@item @code{(getType(String))} -- Returns a string containing
|
||||
either @code{"HEAP"} or @code{"NON_HEAP"} which indicates the type of
|
||||
memory used by the specified pool.
|
||||
@item @code{(getUsage(String))} -- Returns a
|
||||
@code{java.lang.management.MemoryUsage} object for the current
|
||||
usage level of the specified pool.
|
||||
@item @code{(getUsageThreshold(String))} -- Returns
|
||||
the pool's usage threshold, if supported.
|
||||
@item @code{(getUsageThresholdCount(String))} -- Returns
|
||||
the number of times the specified pool has matched or exceeded
|
||||
its usage threshold, if supported.
|
||||
@item @code{(isValid(String))} -- Returns true if the pool
|
||||
is still in use by the virtual machine.
|
||||
@item @code{(resetPeakUsage(String))} -- Resets the peak usage
|
||||
levels to the current usage levels for the specified pool.
|
||||
@item @code{(setCollectionUsageThreshold(String, long))} -- Sets
|
||||
the pool's collection usage threshold, if supported.
|
||||
@item @code{(setUsageThreshold(String, long))} -- Sets
|
||||
the pool's usage threshold, if supported.
|
||||
@end itemize
|
||||
|
||||
@node gnu.java.lang.management.VMMemoryManagerMXBeanImpl,gnu.java.lang.management.VMGarbageCollectorMXBeanImpl,gnu.java.lang.management.VMMemoryPoolMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMMemoryManagerMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.MemoryManagerMXBeanImpl} provides an
|
||||
implementation of the optional @code{java.lang.management.MemoryManagerMXBean}
|
||||
interface, and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMMemoryManagerMXBeanImpl}. Providing
|
||||
this interface requires implementing two methods (each takes the name
|
||||
of the manager as the first argument):
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getMemoryPoolNames(String))} -- Returns a list of the
|
||||
memory pools that the manager maintains. A default implementation
|
||||
which scans the results of @code{getMemoryManagerNames()} for each
|
||||
pool is provided.
|
||||
@item @code{(isValid(String))} -- Returns true if the specified
|
||||
manager is still valid i.e. it is still in use by the virtual machine.
|
||||
@end itemize
|
||||
|
||||
@node gnu.java.lang.management.VMGarbageCollectorMXBeanImpl,,gnu.java.lang.management.VMMemoryManagerMXBeanImpl,gnu.java.lang.management
|
||||
@subsection @code{gnu.java.lang.management.VMGarbageCollectorMXBeanImpl}
|
||||
|
||||
The @code{gnu.java.lang.management.GarbageCollectorMXBeanImpl} provides an
|
||||
implementation of the optional @code{java.lang.management.GarbageCollectorMXBean}
|
||||
interface, and is supported by VM functionality in the form of
|
||||
@code{gnu.java.lang.management.VMGarbageCollectorMXBeanImpl}. Providing
|
||||
this interface requires implementing two methods (each takes the name
|
||||
of the garbage collector as the first argument):
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getCollectionCount(String))} -- Returns the number of
|
||||
times the specified garbage collector has run.
|
||||
@item @code{(getCollectionTime(String))} -- Returns the accumulated
|
||||
number of milliseconds for which the garbage collector has run.
|
||||
@end itemize
|
||||
|
||||
Note that each garbage collector is also a memory manager, and so an
|
||||
implementation of the @code{gnu.java.lang.management.VMMemoryManagerMXBeanImpl}
|
||||
methods for its name should also be provided.
|
||||
|
||||
@node java.lang.management, Classpath Callbacks, gnu.java.lang.management, Classpath Hooks
|
||||
@section @code{java.lang.management}
|
||||
|
||||
@code{gnu.java.lang.management} provides the VM interfaces for the GNU
|
||||
implementations of the management beans.
|
||||
|
||||
@menu
|
||||
* java.lang.management.VMManagementFactory::
|
||||
@end menu
|
||||
|
||||
@node java.lang.management.VMManagementFactory,,,java.lang.management
|
||||
@subsection @code{java.lang.management.VMManagementFactory}
|
||||
|
||||
This VM interface provides the names of the memory pools, memory managers
|
||||
and garbage collectors for use by the @code{java.lang.management.ManagementFactory}
|
||||
in creating lists of appropriate beans for these types of managed object.
|
||||
|
||||
The methods are as follows:
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{(getMemoryPoolNames())} -- Returns a list of the names
|
||||
of the current memory pools in use by the virtual machine.
|
||||
@item @code{(getMemoryManagerNames())} -- Returns a list of the names
|
||||
of the current memory managers in use by the virtual machine. This
|
||||
should not include those that are also garbage collectors.
|
||||
@item @code{(getGarbageCollectorNames())} -- Returns a list of the names
|
||||
of the current garbage collectors in use by the virtual machine.
|
||||
@end itemize
|
||||
|
||||
@node Classpath Callbacks, , java.lang.management, Classpath Hooks
|
||||
Some of the classes you implement for the VM will need to call back to
|
||||
package-private methods in Classpath:
|
||||
|
||||
@ -1269,6 +1652,26 @@ the group.
|
||||
|
||||
@item @code{java.lang.ThreadGroup.removeThread(Thread)}
|
||||
Call this method from @code{Thread} when a @code{Thread} is stopped or destroyed.
|
||||
|
||||
@item @code{gnu.java.lang.management.MemoryMXBeanImpl.fireThresholdExceededNotification(String, long, long, long, long)}
|
||||
If the monitoring of memory usage thresholds is supported, this method
|
||||
should be called when the normal usage of a memory pool crosses the
|
||||
threshold, in order to emit a notification. Another notification
|
||||
should not be emitted until there is an intermittent period where the
|
||||
usage is again below the threshold. The parameters are the memory
|
||||
pool name, the usage levels (init, used, committed and max) and the
|
||||
number of times the threshold has been crossed.
|
||||
|
||||
@item @code{gnu.java.lang.management.MemoryMXBeanImpl.fireCollectionThresholdExceededNotification(String, long, long, long, long)}
|
||||
If the monitoring of memory usage thresholds is supported, this method
|
||||
should be called when the usage of a memory pool after a garbage
|
||||
collection cycle crosses the threshold, in order to emit a
|
||||
notification. Another notification should not be emitted until there
|
||||
is an intermittent period where the usage is again below the
|
||||
threshold. The parameters are the memory pool name, the usage levels
|
||||
(init, used, committed and max) and the number of times the threshold
|
||||
has been crossed.
|
||||
|
||||
@end itemize
|
||||
|
||||
@node VM Hooks, JNI Implementation, Classpath Hooks, Top
|
||||
@ -1369,7 +1772,7 @@ reinitialize it yourself, there should be no harm.
|
||||
|
||||
@end itemize
|
||||
|
||||
@node JNI Implementation, Miscellaneous VM Requirements, VM Hooks, Top
|
||||
@node JNI Implementation, JVMTI Implementation, VM Hooks, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter JNI Implementation
|
||||
|
||||
@ -1412,8 +1815,33 @@ be a sequence of field declarations.
|
||||
|
||||
@end itemize
|
||||
|
||||
@node JVMTI Implementation, Miscellaneous VM Requirements, JNI Implementation, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter JVMTI Implementation
|
||||
|
||||
@node Miscellaneous VM Requirements, , JNI Implementation, Top
|
||||
Classpath comes with its own implementation of @file{jvmti.h}. This
|
||||
file can be customized by the VM in a few ways by defining macros that
|
||||
affect the interpretation of the file. These macros are all intended
|
||||
for use for use by a VM which uses GNU Classpath and which wants to
|
||||
use a single copy of @file{jvmti.h} for both internal and external use.
|
||||
|
||||
@itemize @bullet
|
||||
@item _CLASSPATH_VM_JVMTI_TYPES_DEFINED
|
||||
Some VMs like to define JVMTI ``object'' types in a special way. If
|
||||
this macro is defined, the Classpath @file{jvmti.h} will avoid defining
|
||||
these types. By default these types are defined in @file{jvmti.h}.
|
||||
The full list of types and macros treated this way is: @samp{jthread},
|
||||
@samp{jthreadGroup}, @samp{jlocation}, and @samp{jrawMonitorID}. By
|
||||
default @samp{jrawMonitorID} is defined as an opaque pointer which
|
||||
must be defined by the VM.
|
||||
|
||||
@item _CLASSPATH_JVMTIENV_CONTENTS
|
||||
A VM can add fields to the @samp{jvmtiEnv} structure by defining this
|
||||
to be a sequence of field declarations.
|
||||
|
||||
@end itemize
|
||||
|
||||
@node Miscellaneous VM Requirements, , JVMTI Implementation, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Miscellaneous VM Requirements
|
||||
|
||||
|
@ -23,8 +23,9 @@ endif
|
||||
# All our example java source files
|
||||
EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*/*.java
|
||||
|
||||
# The example C source files
|
||||
# The example C source & header files
|
||||
EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c
|
||||
EXAMPLE_CH_FILES = $(srcdir)/gnu/classpath/examples/*/*.h
|
||||
|
||||
# The zip files with classes we want to produce.
|
||||
EXAMPLE_ZIP = examples.zip
|
||||
@ -39,7 +40,7 @@ EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
|
||||
READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
|
||||
|
||||
# All the files we find "interesting"
|
||||
ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_ICONS) $(READMES)
|
||||
ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(READMES)
|
||||
|
||||
# Some architecture independent data to be installed.
|
||||
example_DATA = $(EXAMPLE_ZIP) README
|
||||
@ -62,7 +63,9 @@ install-data-local:
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
|
||||
done
|
||||
echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
|
||||
echo "$(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/"
|
||||
$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
|
||||
$(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/
|
||||
|
||||
uninstall-local:
|
||||
srcdir_cnt=`echo $(srcdir) | wc -c`; \
|
||||
@ -72,10 +75,12 @@ uninstall-local:
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
|
||||
done
|
||||
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
|
||||
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d"
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d
|
||||
|
||||
# Make sure everything is included in the distribution.
|
||||
EXTRA_DIST = README Makefile.jawt.in
|
||||
EXTRA_DIST = README Makefile.jawt.in Makefile.java2d.in
|
||||
dist-hook:
|
||||
srcdir_cnt=`echo $(srcdir) | wc -c`; \
|
||||
for file in $(ALL_EXAMPLE_FILES); do \
|
||||
|
@ -39,7 +39,7 @@ host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = examples
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Makefile.jawt.in
|
||||
$(srcdir)/Makefile.java2d.in $(srcdir)/Makefile.jawt.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
|
||||
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
|
||||
@ -52,7 +52,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = Makefile.jawt
|
||||
CONFIG_CLEAN_FILES = Makefile.jawt Makefile.java2d
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
@ -95,6 +95,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -115,6 +117,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -145,6 +148,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -195,6 +202,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -215,6 +223,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
@ -290,8 +300,9 @@ GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip'
|
||||
# All our example java source files
|
||||
EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*/*.java
|
||||
|
||||
# The example C source files
|
||||
# The example C source & header files
|
||||
EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c
|
||||
EXAMPLE_CH_FILES = $(srcdir)/gnu/classpath/examples/*/*.h
|
||||
|
||||
# The zip files with classes we want to produce.
|
||||
EXAMPLE_ZIP = examples.zip
|
||||
@ -306,7 +317,7 @@ EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
|
||||
READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
|
||||
|
||||
# All the files we find "interesting"
|
||||
ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_ICONS) $(READMES)
|
||||
ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(READMES)
|
||||
|
||||
# Some architecture independent data to be installed.
|
||||
example_DATA = $(EXAMPLE_ZIP) README
|
||||
@ -315,7 +326,7 @@ example_DATA = $(EXAMPLE_ZIP) README
|
||||
exampledir = $(pkgdatadir)/examples
|
||||
|
||||
# Make sure everything is included in the distribution.
|
||||
EXTRA_DIST = README Makefile.jawt.in
|
||||
EXTRA_DIST = README Makefile.jawt.in Makefile.java2d.in
|
||||
all: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
@ -351,6 +362,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
Makefile.jawt: $(top_builddir)/config.status $(srcdir)/Makefile.jawt.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
Makefile.java2d: $(top_builddir)/config.status $(srcdir)/Makefile.java2d.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
@ -524,7 +537,9 @@ install-data-local:
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
|
||||
done
|
||||
echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
|
||||
echo "$(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/"
|
||||
$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
|
||||
$(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/
|
||||
|
||||
uninstall-local:
|
||||
srcdir_cnt=`echo $(srcdir) | wc -c`; \
|
||||
@ -534,7 +549,9 @@ uninstall-local:
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
|
||||
done
|
||||
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
|
||||
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d"
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d
|
||||
dist-hook:
|
||||
srcdir_cnt=`echo $(srcdir) | wc -c`; \
|
||||
for file in $(ALL_EXAMPLE_FILES); do \
|
||||
|
17
libjava/classpath/examples/Makefile.java2d.in
Normal file
17
libjava/classpath/examples/Makefile.java2d.in
Normal file
@ -0,0 +1,17 @@
|
||||
# @configure_input@
|
||||
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
includedir = @includedir@
|
||||
libdir = @libdir@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
|
||||
all: $(srcdir)/gnu/classpath/examples/java2d/bench.c $(srcdir)/gnu/classpath/examples/java2d/bench.h
|
||||
gcc -g -O0 -Wall -I$(srcdir)/gnu/classpath/examples/java2d $(GTK_CFLAGS) -L$(GTK_LIBS) \
|
||||
-o cairobench $(srcdir)/gnu/classpath/examples/java2d/bench.c
|
||||
|
||||
clean:
|
||||
rm -f gnu/classpath/examples/java2d/bench
|
@ -46,6 +46,23 @@ You can then run the example as follows:
|
||||
export LD_LIBRARY_PATH=.:/usr/local/classpath/lib/classpath
|
||||
jamvm gnu.classpath.examples.jawt.DemoJAWT
|
||||
|
||||
The java2d benchmarking demos include a GTK widget to measure the native
|
||||
speed of some basic java2d options, without the JNI overhead.
|
||||
|
||||
You can invoke it with:
|
||||
|
||||
make -f Makefile.java2d
|
||||
|
||||
Or you can compile by hand as follows:
|
||||
|
||||
gcc -g -O0 -Wall -I./gnu/classpath/examples/java2d \
|
||||
-o cairobench gnu/classpath/examples/java2d/bench.c \
|
||||
`pkg-config --libs --cflags gtk+-2.0`
|
||||
|
||||
You can then run the example as follows:
|
||||
|
||||
./cairobench
|
||||
|
||||
All example code is distributed under the GNU General Public License (GPL).
|
||||
|
||||
The example icons used in some of the examples come from gnome-icon-theme
|
||||
|
@ -38,6 +38,8 @@ exception statement from your version. */
|
||||
|
||||
package gnu.classpath.examples.CORBA.SimpleCommunication.communication;
|
||||
|
||||
import gnu.CORBA.OrbRestricted;
|
||||
|
||||
import org.omg.CORBA.ORB;
|
||||
import org.omg.CORBA.StructMember;
|
||||
import org.omg.CORBA.TypeCode;
|
||||
@ -81,13 +83,14 @@ public abstract class StructureToPassHelper
|
||||
*/
|
||||
public static synchronized TypeCode type()
|
||||
{
|
||||
StructMember[] members = new StructMember[ 2 ];
|
||||
StructMember[] members = new StructMember[2];
|
||||
TypeCode member = null;
|
||||
member = ORB.init().create_string_tc(0);
|
||||
members [ 0 ] = new StructMember("a", member, null);
|
||||
member = ORB.init().create_string_tc(0);
|
||||
members [ 1 ] = new StructMember("b", member, null);
|
||||
return ORB.init().create_struct_tc(StructureToPassHelper.id(), "StructureToPass", members);
|
||||
member = OrbRestricted.Singleton.create_string_tc(0);
|
||||
members[0] = new StructMember("a", member, null);
|
||||
member = OrbRestricted.Singleton.create_string_tc(0);
|
||||
members[1] = new StructMember("b", member, null);
|
||||
return OrbRestricted.Singleton.create_struct_tc(StructureToPassHelper.id(),
|
||||
"StructureToPass", members);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,6 +37,8 @@ exception statement from your version. */
|
||||
|
||||
package gnu.classpath.examples.CORBA.SimpleCommunication.communication;
|
||||
|
||||
import gnu.CORBA.OrbRestricted;
|
||||
|
||||
import org.omg.CORBA.ORB;
|
||||
import org.omg.CORBA.StructMember;
|
||||
import org.omg.CORBA.TCKind;
|
||||
@ -86,17 +88,18 @@ public abstract class StructureToReturnHelper
|
||||
*/
|
||||
public static synchronized TypeCode type()
|
||||
{
|
||||
StructMember[] members = new StructMember[ 3 ];
|
||||
TypeCode member = ORB.init().get_primitive_tc(TCKind.tk_long);
|
||||
members [ 0 ] = new StructMember("n", member, null);
|
||||
member = ORB.init().create_string_tc(0);
|
||||
members [ 1 ] = new StructMember("c", member, null);
|
||||
member = ORB.init().get_primitive_tc(TCKind.tk_long);
|
||||
member = ORB.init().create_array_tc(3, member);
|
||||
members [ 2 ] = new StructMember("arra", member, null);
|
||||
return ORB.init().create_struct_tc(StructureToReturnHelper.id(), "StructureToReturn",
|
||||
members
|
||||
);
|
||||
StructMember[] members = new StructMember[3];
|
||||
TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
|
||||
members[0] = new StructMember("n", member, null);
|
||||
member = OrbRestricted.Singleton.create_string_tc(0);
|
||||
members[1] = new StructMember("c", member, null);
|
||||
member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
|
||||
member = OrbRestricted.Singleton.create_array_tc(3, member);
|
||||
members[2] = new StructMember("arra", member, null);
|
||||
return OrbRestricted.Singleton.create_struct_tc(
|
||||
StructureToReturnHelper.id(),
|
||||
"StructureToReturn",
|
||||
members);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,6 +38,9 @@ exception statement from your version. */
|
||||
|
||||
package gnu.classpath.examples.CORBA.SimpleCommunication.communication;
|
||||
|
||||
|
||||
import gnu.CORBA.OrbRestricted;
|
||||
|
||||
import org.omg.CORBA.Any;
|
||||
import org.omg.CORBA.ORB;
|
||||
import org.omg.CORBA.StructMember;
|
||||
@ -128,18 +131,18 @@ public abstract class TreeNodeHelper
|
||||
// To avoid the infinite recursion loop, the
|
||||
// recursive reference is handled in specific way.
|
||||
if (active)
|
||||
return ORB.init().create_recursive_tc(_id);
|
||||
return OrbRestricted.Singleton.create_recursive_tc(_id);
|
||||
active = true;
|
||||
|
||||
// List all memebers of the TreeNode structure.
|
||||
StructMember[] members = new StructMember[ 2 ];
|
||||
TypeCode memberType;
|
||||
memberType = ORB.init().create_string_tc(0);
|
||||
memberType = OrbRestricted.Singleton.create_string_tc(0);
|
||||
members [ 0 ] = new StructMember("name", memberType, null);
|
||||
memberType = ORB.init().create_recursive_tc("");
|
||||
memberType = OrbRestricted.Singleton.create_recursive_tc("");
|
||||
members [ 1 ] = new StructMember("children", memberType, null);
|
||||
typeCode =
|
||||
ORB.init().create_struct_tc(TreeNodeHelper.id(), "TreeNode", members);
|
||||
OrbRestricted.Singleton.create_struct_tc(TreeNodeHelper.id(), "TreeNode", members);
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,8 @@ exception statement from your version. */
|
||||
|
||||
package gnu.classpath.examples.CORBA.SimpleCommunication.communication;
|
||||
|
||||
import gnu.CORBA.OrbRestricted;
|
||||
|
||||
import org.omg.CORBA.Any;
|
||||
import org.omg.CORBA.ORB;
|
||||
import org.omg.CORBA.StructMember;
|
||||
@ -96,9 +98,9 @@ public abstract class WeThrowThisExceptionHelper
|
||||
{
|
||||
StructMember[] members = new StructMember[ 1 ];
|
||||
TypeCode member = null;
|
||||
member = ORB.init().get_primitive_tc(TCKind.tk_long);
|
||||
member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
|
||||
members [ 0 ] = new StructMember("ourField", member, null);
|
||||
return ORB.init().create_struct_tc(WeThrowThisExceptionHelper.id(),
|
||||
return OrbRestricted.Singleton.create_struct_tc(WeThrowThisExceptionHelper.id(),
|
||||
"WeThrowThisException", members
|
||||
);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -20,11 +20,70 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
|
||||
package gnu.classpath.examples.awt;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Button;
|
||||
import java.awt.Canvas;
|
||||
import java.awt.Checkbox;
|
||||
import java.awt.CheckboxGroup;
|
||||
import java.awt.CheckboxMenuItem;
|
||||
import java.awt.Choice;
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dialog;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.DisplayMode;
|
||||
import java.awt.FileDialog;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Label;
|
||||
import java.awt.List;
|
||||
import java.awt.event.*;
|
||||
import java.awt.Menu;
|
||||
import java.awt.MenuBar;
|
||||
import java.awt.MenuItem;
|
||||
import java.awt.MenuShortcut;
|
||||
import java.awt.Panel;
|
||||
import java.awt.ScrollPane;
|
||||
import java.awt.TextField;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Window;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.DragSourceContext;
|
||||
import java.awt.dnd.DragSourceDragEvent;
|
||||
import java.awt.dnd.DragSourceDropEvent;
|
||||
import java.awt.dnd.DragSourceEvent;
|
||||
import java.awt.dnd.DragSourceListener;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.DropTargetDragEvent;
|
||||
import java.awt.dnd.DropTargetDropEvent;
|
||||
import java.awt.dnd.DropTargetEvent;
|
||||
import java.awt.dnd.DropTargetListener;
|
||||
import java.awt.dnd.InvalidDnDOperationException;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
class Demo
|
||||
{
|
||||
@ -154,6 +213,9 @@ class Demo
|
||||
addSubWindow ("RandomTests", new TestWindow (this));
|
||||
addSubWindow ("RoundRect", new RoundRectWindow ());
|
||||
addSubWindow ("Animation", new AnimationWindow ());
|
||||
addSubWindow ("Resolution", new ResolutionWindow ());
|
||||
addSubWindow ("Fullscreen", new FullscreenWindow ());
|
||||
addSubWindow ("Drag n' Drop", new DragDropWindow ());
|
||||
|
||||
Panel sp = new Panel();
|
||||
PrettyPanel p = new PrettyPanel();
|
||||
@ -744,6 +806,234 @@ class Demo
|
||||
t.beep();
|
||||
}
|
||||
}
|
||||
|
||||
static class ResolutionWindow extends SubFrame
|
||||
{
|
||||
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
|
||||
|
||||
public void init ()
|
||||
{
|
||||
initted = true;
|
||||
|
||||
setTitle("Change Screen Resolution");
|
||||
final List list = new List();
|
||||
DisplayMode[] modes = gd.getDisplayModes();
|
||||
|
||||
for (int i=0;i<modes.length;i++ )
|
||||
list.add(modes[i].getWidth() + "x"
|
||||
+ modes[i].getHeight()
|
||||
+ ((modes[i].getBitDepth() != DisplayMode.BIT_DEPTH_MULTI)
|
||||
? "x" + modes[i].getBitDepth() + "bpp"
|
||||
: "")
|
||||
+ ((modes[i].getRefreshRate() != DisplayMode.REFRESH_RATE_UNKNOWN)
|
||||
? "@" + modes[i].getRefreshRate() + "Hz"
|
||||
: ""));
|
||||
|
||||
ActionListener al = new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent ae)
|
||||
{
|
||||
int i = list.getSelectedIndex();
|
||||
gd.setDisplayMode(gd.getDisplayModes()[i]);
|
||||
}
|
||||
};
|
||||
|
||||
Button b = new Button("Switch");
|
||||
Button c = new Button("Close");
|
||||
|
||||
list.addActionListener(al);
|
||||
b.addActionListener(al);
|
||||
|
||||
c.addActionListener(new ActionListener () {
|
||||
public void actionPerformed (ActionEvent e) {
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
|
||||
setLayout(new GridLayout(3, 1, 5, 5));
|
||||
add(list);
|
||||
add(b);
|
||||
add(c);
|
||||
|
||||
pack();
|
||||
}
|
||||
}
|
||||
|
||||
static class DragDropWindow
|
||||
extends SubFrame
|
||||
implements ActionListener, DropTargetListener
|
||||
{
|
||||
DragLabel source = new DragLabel("Drag and drop me to the following Button",
|
||||
Label.CENTER);
|
||||
|
||||
Button target = new Button();
|
||||
|
||||
public void init()
|
||||
{
|
||||
source.setForeground(Color.red);
|
||||
add(source, BorderLayout.NORTH);
|
||||
|
||||
target.addActionListener(this);
|
||||
add(target, BorderLayout.SOUTH);
|
||||
|
||||
new DropTarget(target, DnDConstants.ACTION_COPY_OR_MOVE, this);
|
||||
|
||||
setSize(205, 100);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
Button b = (Button) e.getSource();
|
||||
b.setLabel("");
|
||||
}
|
||||
|
||||
public void dragEnter(DropTargetDragEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
public void dragExit(DropTargetEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
public void dragOver(DropTargetDragEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
public void drop(DropTargetDropEvent e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Transferable t = e.getTransferable();
|
||||
|
||||
if (e.isDataFlavorSupported(DataFlavor.stringFlavor))
|
||||
{
|
||||
e.acceptDrop(e.getDropAction());
|
||||
|
||||
String s;
|
||||
s = (String) t.getTransferData(DataFlavor.stringFlavor);
|
||||
|
||||
target.setLabel(s);
|
||||
|
||||
e.dropComplete(true);
|
||||
}
|
||||
else
|
||||
e.rejectDrop();
|
||||
}
|
||||
catch (java.io.IOException e2)
|
||||
{
|
||||
}
|
||||
catch (UnsupportedFlavorException e2)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void dropActionChanged(DropTargetDragEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
class DragLabel
|
||||
extends Label
|
||||
implements DragGestureListener, DragSourceListener
|
||||
{
|
||||
private DragSource ds = DragSource.getDefaultDragSource();
|
||||
|
||||
public DragLabel(String s, int alignment)
|
||||
{
|
||||
super(s, alignment);
|
||||
int action = DnDConstants.ACTION_COPY_OR_MOVE;
|
||||
ds.createDefaultDragGestureRecognizer(this, action, this);
|
||||
}
|
||||
|
||||
public void dragGestureRecognized(DragGestureEvent e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Transferable t = new StringSelection(getText());
|
||||
e.startDrag(DragSource.DefaultCopyNoDrop, t, this);
|
||||
}
|
||||
catch (InvalidDnDOperationException e2)
|
||||
{
|
||||
System.out.println(e2);
|
||||
}
|
||||
}
|
||||
|
||||
public void dragDropEnd(DragSourceDropEvent e)
|
||||
{
|
||||
if (e.getDropSuccess() == false)
|
||||
return;
|
||||
|
||||
int action = e.getDropAction();
|
||||
if ((action & DnDConstants.ACTION_MOVE) != 0)
|
||||
setText("");
|
||||
}
|
||||
|
||||
public void dragEnter(DragSourceDragEvent e)
|
||||
{
|
||||
DragSourceContext ctx = e.getDragSourceContext();
|
||||
|
||||
int action = e.getDropAction();
|
||||
if ((action & DnDConstants.ACTION_COPY) != 0)
|
||||
ctx.setCursor(DragSource.DefaultCopyDrop);
|
||||
else
|
||||
ctx.setCursor(DragSource.DefaultCopyNoDrop);
|
||||
}
|
||||
|
||||
public void dragExit(DragSourceEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
public void dragOver(DragSourceDragEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
public void dropActionChanged(DragSourceDragEvent e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class FullscreenWindow extends SubFrame
|
||||
{
|
||||
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
|
||||
|
||||
public void init ()
|
||||
{
|
||||
initted = true;
|
||||
|
||||
setTitle("Fullscreen Exclusive Mode");
|
||||
|
||||
ActionListener al = new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent ae)
|
||||
{
|
||||
if (gd.getFullScreenWindow() == FullscreenWindow.this)
|
||||
gd.setFullScreenWindow(null);
|
||||
else
|
||||
gd.setFullScreenWindow(FullscreenWindow.this);
|
||||
}
|
||||
};
|
||||
|
||||
Button b = new Button("Toggle Fullscreen");
|
||||
Button c = new Button("Close");
|
||||
|
||||
b.addActionListener(al);
|
||||
|
||||
c.addActionListener(new ActionListener () {
|
||||
public void actionPerformed (ActionEvent e) {
|
||||
gd.setFullScreenWindow(null);
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
|
||||
setLayout(new GridLayout(3, 1, 5, 5));
|
||||
add(b);
|
||||
add(c);
|
||||
|
||||
pack();
|
||||
}
|
||||
}
|
||||
|
||||
static class RoundRectWindow extends SubFrame
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,891 @@
|
||||
/* J2dBenchmarkGUI.java -- GUI for java2d benchmarker
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
package gnu.classpath.examples.java2d;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Container;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.border.BevelBorder;
|
||||
|
||||
/**
|
||||
* Extends the J2dBenchmark to provide a GUI for selecting options and tests.
|
||||
*/
|
||||
public class J2dBenchmarkGUI
|
||||
implements ActionListener
|
||||
{
|
||||
|
||||
JLabel errorLabel;
|
||||
|
||||
JCheckBox noClipping;
|
||||
|
||||
JCheckBox withClipping;
|
||||
|
||||
JCheckBox zeroClipping;
|
||||
|
||||
JCheckBox singleBuffer;
|
||||
|
||||
JCheckBox doubleBuffer;
|
||||
|
||||
public J2dBenchmarkGUI()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new J2dBenchmarkGUI().run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the initial GUI
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
// Store all elements in a hashtable so that they can be passed into the
|
||||
// harness easily.
|
||||
Hashtable elements = new Hashtable();
|
||||
|
||||
// Set up frame
|
||||
final JFrame frame = new JFrame("Java2D benchmark");
|
||||
errorLabel = new JLabel(" ");
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
||||
Container content = frame.getContentPane();
|
||||
|
||||
// Display options for dimensions, iterations, test size, etc
|
||||
JPanel options = new JPanel(new GridLayout(0, 2));
|
||||
|
||||
options.add(new JLabel("Height: "));
|
||||
JTextField heightField = new JTextField(Integer.toString(J2dBenchmark.DEFAULT_SCREEN_HEIGHT));
|
||||
heightField.setColumns(5);
|
||||
options.add(heightField);
|
||||
elements.put("height", heightField);
|
||||
|
||||
options.add(new JLabel("Width: "));
|
||||
JTextField widthField = new JTextField(Integer.toString(J2dBenchmark.DEFAULT_SCREEN_WIDTH));
|
||||
widthField.setColumns(5);
|
||||
options.add(widthField);
|
||||
elements.put("width", widthField);
|
||||
|
||||
options.add(new JLabel("Iterations: "));
|
||||
JTextField iterField = new JTextField("1");
|
||||
iterField.setColumns(5);
|
||||
options.add(iterField);
|
||||
elements.put("iterations", iterField);
|
||||
|
||||
options.add(new JLabel("Test size: "));
|
||||
JTextField testSizeField = new JTextField(Integer.toString(J2dBenchmark.DEFAULT_TEST_SIZE));
|
||||
testSizeField.setColumns(5);
|
||||
options.add(testSizeField);
|
||||
elements.put("size", testSizeField);
|
||||
|
||||
options.add(new JLabel("Test without clipping: "));
|
||||
noClipping = new JCheckBox("", true);
|
||||
noClipping.addActionListener(this);
|
||||
options.add(noClipping);
|
||||
elements.put("noclip", noClipping);
|
||||
|
||||
options.add(new JLabel("Test with clipping: "));
|
||||
withClipping = new JCheckBox("", true);
|
||||
withClipping.addActionListener(this);
|
||||
options.add(withClipping);
|
||||
elements.put("withclip", withClipping);
|
||||
|
||||
options.add(new JLabel("Test with clipping to zero: "));
|
||||
zeroClipping = new JCheckBox("", true);
|
||||
zeroClipping.addActionListener(this);
|
||||
options.add(zeroClipping);
|
||||
elements.put("zeroclip", zeroClipping);
|
||||
|
||||
options.add(new JLabel("Run single-buffer test: "));
|
||||
singleBuffer = new JCheckBox("", true);
|
||||
singleBuffer.addActionListener(this);
|
||||
options.add(singleBuffer);
|
||||
elements.put("singlebuffer", singleBuffer);
|
||||
|
||||
options.add(new JLabel("Run double-buffer test: "));
|
||||
doubleBuffer = new JCheckBox("", true);
|
||||
doubleBuffer.addActionListener(this);
|
||||
options.add(doubleBuffer);
|
||||
elements.put("doublebuffer", doubleBuffer);
|
||||
|
||||
// Allow user to select tests to run
|
||||
JPanel tests = new JPanel();
|
||||
tests.setLayout(new BoxLayout(tests, BoxLayout.PAGE_AXIS));
|
||||
tests.setBorder(new BevelBorder(BevelBorder.RAISED));
|
||||
tests.add(new JLabel("Shapes to test:"));
|
||||
|
||||
JCheckBox test_arcDraw = new JCheckBox("Arc", true);
|
||||
tests.add(test_arcDraw);
|
||||
elements.put("test_arcDraw", test_arcDraw);
|
||||
|
||||
JCheckBox test_ccurveDraw = new JCheckBox("Cubic Curve", true);
|
||||
tests.add(test_ccurveDraw);
|
||||
elements.put("test_ccurveDraw", test_ccurveDraw);
|
||||
|
||||
JCheckBox test_ellipseDraw = new JCheckBox("Ellipse", true);
|
||||
tests.add(test_ellipseDraw);
|
||||
elements.put("test_ellipseDraw", test_ellipseDraw);
|
||||
|
||||
/*
|
||||
JCheckBox test_pathDraw = new JCheckBox("General Path", true);
|
||||
tests.add(test_pathDraw);
|
||||
elements.put("test_pathDraw", test_pathDraw);
|
||||
*/
|
||||
|
||||
JCheckBox test_lineDraw = new JCheckBox("Line", true);
|
||||
tests.add(test_lineDraw);
|
||||
elements.put("test_lineDraw", test_lineDraw);
|
||||
|
||||
JCheckBox test_qcurveDraw = new JCheckBox("Quadratic Curve", true);
|
||||
tests.add(test_qcurveDraw);
|
||||
elements.put("test_qcurveDraw", test_qcurveDraw);
|
||||
|
||||
JCheckBox test_rectDraw = new JCheckBox("Rectangle", true);
|
||||
tests.add(test_rectDraw);
|
||||
elements.put("test_rectDraw", test_rectDraw);
|
||||
|
||||
JCheckBox test_rrectDraw = new JCheckBox("Round Rectangle", true);
|
||||
tests.add(test_rrectDraw);
|
||||
elements.put("test_rrectDraw", test_rrectDraw);
|
||||
|
||||
JCheckBox test_image = new JCheckBox("Images", true);
|
||||
tests.add(test_image);
|
||||
elements.put("test_image", test_image);
|
||||
|
||||
// Additional image-processing options
|
||||
JPanel extras = new JPanel();
|
||||
extras.setBorder(new BevelBorder(BevelBorder.LOWERED));
|
||||
GridBagLayout layout = new GridBagLayout();
|
||||
GridBagConstraints gbc = new GridBagConstraints();
|
||||
gbc.anchor = GridBagConstraints.NORTHWEST;
|
||||
gbc.insets = new Insets(5, 2, 15, 15);
|
||||
extras.setLayout(layout);
|
||||
|
||||
// Filling (solid, gradient, or texture)
|
||||
JPanel opt_Fill = new JPanel();
|
||||
opt_Fill.setLayout(new BoxLayout(opt_Fill, BoxLayout.PAGE_AXIS));
|
||||
JLabel opt_FillLabel = new JLabel("Filling:");
|
||||
opt_FillLabel.setBorder(new BevelBorder(BevelBorder.RAISED));
|
||||
opt_Fill.add(opt_FillLabel);
|
||||
|
||||
ButtonGroup opt_FillGroup = new ButtonGroup();
|
||||
JRadioButton opt_FillSolid = new JRadioButton("Solid colour", true);
|
||||
opt_FillSolid.setActionCommand("solid");
|
||||
opt_Fill.add(opt_FillSolid);
|
||||
opt_FillGroup.add(opt_FillSolid);
|
||||
JRadioButton opt_FillGradient = new JRadioButton("Gradient", false);
|
||||
opt_FillGradient.setActionCommand("gradient");
|
||||
opt_Fill.add(opt_FillGradient);
|
||||
opt_FillGroup.add(opt_FillGradient);
|
||||
JRadioButton opt_FillTexture = new JRadioButton("Texture", false);
|
||||
opt_FillTexture.setActionCommand("texture");
|
||||
opt_Fill.add(opt_FillTexture);
|
||||
opt_FillGroup.add(opt_FillTexture);
|
||||
JTextField opt_FillTextureFile = new JTextField("texture file");
|
||||
opt_FillTextureFile.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
opt_Fill.add(opt_FillTextureFile);
|
||||
elements.put("opt_FillGroup", opt_FillGroup);
|
||||
elements.put("opt_FillTextureFile", opt_FillTextureFile);
|
||||
layout.setConstraints(opt_Fill, gbc);
|
||||
extras.add(opt_Fill);
|
||||
|
||||
// Stroke
|
||||
JPanel opt_Stroke = new JPanel();
|
||||
opt_Stroke.setLayout(new BoxLayout(opt_Stroke, BoxLayout.PAGE_AXIS));
|
||||
JLabel opt_StrokeLabel = new JLabel("Stroke:");
|
||||
opt_StrokeLabel.setBorder(new BevelBorder(BevelBorder.RAISED));
|
||||
opt_Stroke.add(opt_StrokeLabel);
|
||||
JCheckBox opt_StrokeRandom = new JCheckBox("random", false);
|
||||
elements.put("opt_StrokeRandom", opt_StrokeRandom);
|
||||
opt_Stroke.add(opt_StrokeRandom);
|
||||
gbc.gridwidth = GridBagConstraints.REMAINDER;
|
||||
layout.setConstraints(opt_Stroke, gbc);
|
||||
extras.add(opt_Stroke);
|
||||
|
||||
// Anti-Alias
|
||||
JPanel opt_Alias = new JPanel();
|
||||
opt_Alias.setLayout(new BoxLayout(opt_Alias, BoxLayout.PAGE_AXIS));
|
||||
JLabel opt_AliasLabel = new JLabel("Anti-Aliasing:");
|
||||
opt_AliasLabel.setBorder(new BevelBorder(BevelBorder.RAISED));
|
||||
opt_Alias.add(opt_AliasLabel);
|
||||
JCheckBox opt_AliasOn = new JCheckBox("on", false);
|
||||
elements.put("opt_AliasOn", opt_AliasOn);
|
||||
opt_Alias.add(opt_AliasOn);
|
||||
gbc.gridwidth = 1;
|
||||
layout.setConstraints(opt_Alias, gbc);
|
||||
extras.add(opt_Alias);
|
||||
|
||||
// Alpha composite
|
||||
JPanel opt_Composite = new JPanel();
|
||||
opt_Composite.setLayout(new BoxLayout(opt_Composite, BoxLayout.PAGE_AXIS));
|
||||
JLabel opt_CompositeLabel = new JLabel("Alpha Composite:");
|
||||
opt_CompositeLabel.setBorder(new BevelBorder(BevelBorder.RAISED));
|
||||
opt_Composite.add(opt_CompositeLabel);
|
||||
JTextField opt_CompositeValue = new JTextField("1.0");
|
||||
opt_CompositeValue.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
elements.put("opt_CompositeValue", opt_CompositeValue);
|
||||
opt_Composite.add(opt_CompositeValue);
|
||||
gbc.gridwidth = GridBagConstraints.REMAINDER;
|
||||
layout.setConstraints(opt_Composite, gbc);
|
||||
extras.add(opt_Composite);
|
||||
|
||||
// Transformations
|
||||
// TODO: allow user-defined matrices for AffineTransform
|
||||
// (backend already has hooks for it, need to create gui)
|
||||
JLabel opt_TransformLabel = new JLabel("Transformations:");
|
||||
opt_TransformLabel.setBorder(new BevelBorder(BevelBorder.RAISED));
|
||||
gbc.insets = new Insets(5, 2, 0, 15);
|
||||
layout.setConstraints(opt_TransformLabel, gbc);
|
||||
extras.add(opt_TransformLabel);
|
||||
|
||||
JPanel opt_Transform_Translate = new JPanel(new GridLayout(0, 2, 5, 5));
|
||||
opt_Transform_Translate.add(new JLabel("x-axis translation "));
|
||||
JTextField opt_TransformTranslateX = new JTextField("0");
|
||||
opt_TransformTranslateX.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
opt_Transform_Translate.add(opt_TransformTranslateX);
|
||||
elements.put("opt_TransformTranslateX", opt_TransformTranslateX);
|
||||
opt_Transform_Translate.add(new JLabel("y-axis translation "));
|
||||
JTextField opt_TransformTranslateY = new JTextField("0");
|
||||
opt_TransformTranslateY.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
opt_Transform_Translate.add(opt_TransformTranslateY);
|
||||
elements.put("opt_TransformTranslateY", opt_TransformTranslateY);
|
||||
gbc.gridwidth = 1;
|
||||
gbc.insets = new Insets(0, 2, 5, 15);
|
||||
layout.setConstraints(opt_Transform_Translate, gbc);
|
||||
extras.add(opt_Transform_Translate);
|
||||
|
||||
JPanel opt_Transform_Shear = new JPanel(new GridLayout(0, 2, 5, 5));
|
||||
opt_Transform_Shear.add(new JLabel("x-axis shear "));
|
||||
JTextField opt_TransformShearX = new JTextField("0");
|
||||
opt_TransformShearX.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
opt_Transform_Shear.add(opt_TransformShearX);
|
||||
elements.put("opt_TransformShearX", opt_TransformShearX);
|
||||
opt_Transform_Shear.add(new JLabel("y-axis shear "));
|
||||
JTextField opt_TransformShearY = new JTextField("0");
|
||||
opt_Transform_Shear.add(opt_TransformShearY);
|
||||
elements.put("opt_TransformShearY", opt_TransformShearY);
|
||||
gbc.gridwidth = GridBagConstraints.REMAINDER;
|
||||
layout.setConstraints(opt_Transform_Shear, gbc);
|
||||
extras.add(opt_Transform_Shear);
|
||||
|
||||
JPanel opt_Transform_Rotate = new JPanel(new GridLayout(0, 2, 5, 5));
|
||||
opt_Transform_Rotate.add(new JLabel("rotation (radians) "));
|
||||
JTextField opt_TransformRotate = new JTextField("0");
|
||||
opt_Transform_Rotate.add(opt_TransformRotate);
|
||||
elements.put("opt_TransformRotate", opt_TransformRotate);
|
||||
layout.setConstraints(opt_Transform_Rotate, gbc);
|
||||
extras.add(opt_Transform_Rotate);
|
||||
|
||||
// Final submit button
|
||||
JPanel submit = new JPanel();
|
||||
submit.setLayout(new BoxLayout(submit, BoxLayout.PAGE_AXIS));
|
||||
|
||||
JButton rectButton = new JButton("Run benchmark");
|
||||
rectButton.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
submit.add(rectButton, BorderLayout.CENTER);
|
||||
|
||||
errorLabel.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
errorLabel.setForeground(Color.RED);
|
||||
submit.add(errorLabel);
|
||||
|
||||
rectButton.addActionListener(new Harness(elements, errorLabel));
|
||||
|
||||
// Lay it all out
|
||||
JPanel body = new JPanel();
|
||||
body.setLayout(new BoxLayout(body, BoxLayout.LINE_AXIS));
|
||||
options.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
body.add(options);
|
||||
body.add(Box.createHorizontalStrut(50));
|
||||
tests.setAlignmentX(JComponent.RIGHT_ALIGNMENT);
|
||||
body.add(tests);
|
||||
|
||||
body.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
panel.add(body);
|
||||
extras.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
panel.add(extras);
|
||||
submit.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
panel.add(submit);
|
||||
|
||||
content.add(panel, BorderLayout.CENTER);
|
||||
|
||||
// Leave some breathing space in the frame
|
||||
frame.pack();
|
||||
|
||||
frame.addWindowListener(new WindowAdapter()
|
||||
{
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
frame.setVisible(false);
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
frame.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles user events on the options GUI, ensuring that user input is valid
|
||||
*/
|
||||
public void actionPerformed(ActionEvent ev)
|
||||
{
|
||||
if (! noClipping.isSelected() && ! withClipping.isSelected()
|
||||
&& ! zeroClipping.isSelected())
|
||||
errorLabel.setText("You must select at least one clipping option");
|
||||
|
||||
else if (! singleBuffer.isSelected() && ! doubleBuffer.isSelected())
|
||||
errorLabel.setText("You must select at least one buffering option");
|
||||
|
||||
else
|
||||
errorLabel.setText(" ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses GUI input and sets options in the benchmarker
|
||||
*/
|
||||
private class Harness
|
||||
implements ActionListener
|
||||
{
|
||||
Hashtable elements;
|
||||
|
||||
JLabel errorLabel;
|
||||
|
||||
/**
|
||||
* Creates a new Harness object
|
||||
*
|
||||
* @param elements Hashtable containing the swing elements from the GUI
|
||||
* @param errorLabel JLabel on which to display any error messages
|
||||
*/
|
||||
public Harness(Hashtable elements, JLabel errorLabel)
|
||||
{
|
||||
super();
|
||||
|
||||
this.elements = elements;
|
||||
this.errorLabel = errorLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles user button-clicks, parsing the form, setting options, and
|
||||
* starting the J2dBenchmark
|
||||
*
|
||||
* @param ae event that triggered this action
|
||||
*/
|
||||
public void actionPerformed(ActionEvent ae)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create benchmarker object
|
||||
final JFrame frame = new JFrame("Java2D benchmark");
|
||||
J2dBenchmarkWrapper speed = new J2dBenchmarkWrapper(frame);
|
||||
|
||||
// Set options
|
||||
speed.setDimensions(Integer.parseInt(((JTextField) elements.get("width")).getText()),
|
||||
Integer.parseInt(((JTextField) elements.get("height")).getText()));
|
||||
|
||||
speed.setIterations(Integer.parseInt(((JTextField) elements.get("iterations")).getText()));
|
||||
speed.setTestSize(Integer.parseInt(((JTextField) elements.get("size")).getText()));
|
||||
|
||||
speed.setClipping(((JCheckBox) elements.get("noclip")).isSelected(),
|
||||
((JCheckBox) elements.get("withclip")).isSelected(),
|
||||
((JCheckBox) elements.get("zeroclip")).isSelected());
|
||||
|
||||
speed.setBuffers(((JCheckBox) elements.get("singlebuffer")).isSelected(),
|
||||
((JCheckBox) elements.get("doublebuffer")).isSelected());
|
||||
|
||||
// Set additional processing options
|
||||
speed.setFill(((ButtonGroup) elements.get("opt_FillGroup")).getSelection().getActionCommand(),
|
||||
((JTextField) elements.get("opt_FillTextureFile")).getText());
|
||||
|
||||
speed.setStroke(((JCheckBox) elements.get("opt_StrokeRandom")).isSelected());
|
||||
|
||||
speed.setAlias(((JCheckBox) elements.get("opt_AliasOn")).isSelected());
|
||||
|
||||
speed.setComposite(Float.parseFloat(((JTextField) elements.get("opt_CompositeValue")).getText()));
|
||||
|
||||
speed.setTranslation(Integer.parseInt(((JTextField) elements.get("opt_TransformTranslateX")).getText()),
|
||||
Integer.parseInt(((JTextField) elements.get("opt_TransformTranslateY")).getText()));
|
||||
|
||||
speed.setRotation(Double.parseDouble(((JTextField) elements.get("opt_TransformRotate")).getText()));
|
||||
|
||||
speed.setShear(Double.parseDouble(((JTextField) elements.get("opt_TransformShearX")).getText()),
|
||||
Double.parseDouble(((JTextField) elements.get("opt_TransformShearY")).getText()));
|
||||
|
||||
// Set tests
|
||||
int testSuite = 0;
|
||||
if (((JCheckBox) elements.get("test_arcDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_ARC;
|
||||
if (((JCheckBox) elements.get("test_ccurveDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_CUBICCURVE;
|
||||
if (((JCheckBox) elements.get("test_ellipseDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_ELLIPSE;
|
||||
//if (((JCheckBox)elements.get("test_pathDraw")).isSelected())
|
||||
// testSuite |= J2dBenchmarkWrapper.J2DTEST_GENERALPATH;
|
||||
if (((JCheckBox) elements.get("test_lineDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_LINE;
|
||||
if (((JCheckBox) elements.get("test_qcurveDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_QUADCURVE;
|
||||
if (((JCheckBox) elements.get("test_rectDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_RECTANGLE;
|
||||
if (((JCheckBox) elements.get("test_rrectDraw")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_ROUNDRECTANGLE;
|
||||
if (((JCheckBox) elements.get("test_image")).isSelected())
|
||||
testSuite |= J2dBenchmarkWrapper.J2DTEST_IMAGE;
|
||||
|
||||
if (testSuite != 0)
|
||||
{
|
||||
speed.setTests(testSuite);
|
||||
|
||||
String initResult = speed.init();
|
||||
|
||||
if (initResult == null)
|
||||
{
|
||||
// Create graphics.
|
||||
frame.add(speed, BorderLayout.CENTER);
|
||||
frame.setSize(
|
||||
Integer.parseInt(((JTextField) elements.get("width")).getText()),
|
||||
Integer.parseInt(((JTextField) elements.get("height")).getText()));
|
||||
frame.setVisible(true);
|
||||
|
||||
// Insets are correctly set only after the native peer was
|
||||
// created.
|
||||
Insets insets = frame.getInsets();
|
||||
frame.setSize(frame.getWidth() + insets.right + insets.left,
|
||||
frame.getHeight() + insets.top + insets.bottom);
|
||||
|
||||
// Clear any old error messages
|
||||
errorLabel.setText(" ");
|
||||
}
|
||||
else
|
||||
errorLabel.setText(initResult);
|
||||
}
|
||||
else
|
||||
errorLabel.setText("Please select at least one test.");
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
errorLabel.setText("Please enter valid integers");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for the J2dBenchmark, which outputs the results to a GUI
|
||||
* instead of the command-line
|
||||
*/
|
||||
private class J2dBenchmarkWrapper
|
||||
extends J2dBenchmark
|
||||
{
|
||||
JFrame myFrame;
|
||||
|
||||
ResultsDisplay display;
|
||||
|
||||
/**
|
||||
* Create new J2dBenchmarkWrapper object
|
||||
*
|
||||
* @param frame parent frame
|
||||
*/
|
||||
public J2dBenchmarkWrapper(JFrame frame)
|
||||
{
|
||||
// Redirect log messages to the custom handler
|
||||
logger.setUseParentHandlers(false);
|
||||
display = new ResultsDisplay();
|
||||
display.setLevel(Level.INFO);
|
||||
logger.addHandler(display);
|
||||
|
||||
myFrame = frame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set dimensions of benchmarking canvas
|
||||
*
|
||||
* @param width width of canvas
|
||||
* @param height height of canvas
|
||||
*/
|
||||
public void setDimensions(int width, int height)
|
||||
{
|
||||
screenHeight = height;
|
||||
screenWidth = width;
|
||||
setSize(width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set number of iterations
|
||||
*
|
||||
* @param it number of iterations
|
||||
*/
|
||||
public void setIterations(int it)
|
||||
{
|
||||
iterations = it;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set size of each test
|
||||
*
|
||||
* @param size size of test
|
||||
*/
|
||||
public void setTestSize(int size)
|
||||
{
|
||||
testSize = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set clipping options
|
||||
*
|
||||
* @param no run test with no clipping
|
||||
* @param with run test with clipping
|
||||
* @param zero run test with clipping to zero
|
||||
*/
|
||||
public void setClipping(boolean no, boolean with, boolean zero)
|
||||
{
|
||||
this.noClippingFlag = no;
|
||||
this.withClippingFlag = with;
|
||||
this.zeroClippingFlag = zero;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set buffering options
|
||||
*
|
||||
* @param single run test without double-buffering
|
||||
* @param doubleb run test with double-buffering
|
||||
*/
|
||||
public void setBuffers(boolean single, boolean doubleb)
|
||||
{
|
||||
this.singleBufferFlag = single;
|
||||
this.doubleBufferFlag = doubleb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fill options
|
||||
*
|
||||
* @param type fill type: "solid", "gradient", or "texture"
|
||||
* @param file filename to use if texturing
|
||||
*/
|
||||
public void setFill(String type, String file)
|
||||
{
|
||||
if (type.equals("gradient"))
|
||||
this.gradientFlag = true;
|
||||
else if (type.equals("texture"))
|
||||
{
|
||||
this.texture = file;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set stroke options
|
||||
*
|
||||
* @param stroke boolean flag to use random stroking or not
|
||||
*/
|
||||
public void setStroke(boolean stroke)
|
||||
{
|
||||
this.strokeFlag = stroke;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set anti-aliasing options
|
||||
*
|
||||
* @param alias boolean flag to use anti-aliasing or not
|
||||
*/
|
||||
public void setAlias(boolean alias)
|
||||
{
|
||||
this.antialiasFlag = alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set alpha composite
|
||||
*
|
||||
* @param alpha alpha composite
|
||||
*/
|
||||
public void setComposite(float alpha)
|
||||
{
|
||||
this.composite = alpha;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set translation values
|
||||
*
|
||||
* @param x x-axis translation
|
||||
* @param y y-axis translation
|
||||
*/
|
||||
public void setTranslation(int x, int y)
|
||||
{
|
||||
this.xtranslate = x;
|
||||
this.ytranslate = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set rotation
|
||||
*
|
||||
* @param theta angle to rotate by (radians)
|
||||
*/
|
||||
public void setRotation(double theta)
|
||||
{
|
||||
this.rotate = theta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set shear values
|
||||
*
|
||||
* @param x x-axis shear value
|
||||
* @param y-axis shear value
|
||||
*/
|
||||
public void setShear(double x, double y)
|
||||
{
|
||||
this.xshear = x;
|
||||
this.yshear = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tests to run
|
||||
*
|
||||
* @param tests bit-shifted list of tests (see J2dBenchmark constants)
|
||||
*/
|
||||
public void setTests(int tests)
|
||||
{
|
||||
awtTests = tests;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves test report after each iteration
|
||||
*/
|
||||
void printReport()
|
||||
{
|
||||
// Report test results to the GUI display
|
||||
ArrayList results = new ArrayList();
|
||||
for (Iterator i = testSetMap.testIterator(); i.hasNext();)
|
||||
{
|
||||
TestRecorder recorder = testSetMap.getTest((String) i.next());
|
||||
|
||||
results.add("TEST " + recorder.getTestName() + ": average "
|
||||
+ recorder.getAverage() + "ms [" + recorder.getMinTime()
|
||||
+ "-" + recorder.getMaxTime() + "]");
|
||||
}
|
||||
|
||||
display.report(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables current frame and displays test results
|
||||
*/
|
||||
void testComplete()
|
||||
{
|
||||
// Clear benchmarking canvas and display results instead
|
||||
myFrame.setVisible(false);
|
||||
|
||||
display.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GUI to display results of benchmarking
|
||||
*/
|
||||
private class ResultsDisplay
|
||||
extends Handler
|
||||
implements ActionListener
|
||||
{
|
||||
/**
|
||||
* Allow user to select results from each iteration
|
||||
*/
|
||||
JComboBox iterations;
|
||||
|
||||
/**
|
||||
* Area to print results in
|
||||
*/
|
||||
JTextArea results;
|
||||
|
||||
/**
|
||||
* Allow user to view summary or full details of test report
|
||||
*/
|
||||
JCheckBox details;
|
||||
|
||||
/**
|
||||
* Store all test results
|
||||
*/
|
||||
ArrayList testResults;
|
||||
|
||||
/**
|
||||
* Store all test details
|
||||
*/
|
||||
ArrayList testDetails;
|
||||
|
||||
/**
|
||||
* Initialize variables
|
||||
*/
|
||||
public ResultsDisplay()
|
||||
{
|
||||
testResults = new ArrayList();
|
||||
testDetails = new ArrayList();
|
||||
testDetails.add(new ArrayList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse all results and display on a GUI
|
||||
*/
|
||||
public void show()
|
||||
{
|
||||
// Set up panel
|
||||
JFrame frame = new JFrame("Java2D benchmark results");
|
||||
Container cp = frame.getContentPane();
|
||||
|
||||
// Non-editable text area for the results
|
||||
results = new JTextArea();
|
||||
results.setEditable(false);
|
||||
results.setRows(15);
|
||||
results.setColumns(60);
|
||||
|
||||
// Checkbox to optionally display details (ie log messages)
|
||||
details = new JCheckBox("Details", false);
|
||||
details.addActionListener(this);
|
||||
|
||||
// Combo box to allow selection of iteration number
|
||||
iterations = new JComboBox();
|
||||
iterations.addActionListener(this);
|
||||
for (int i = 0; i < testResults.size(); i++)
|
||||
iterations.addItem("Iteration #" + (i + 1));
|
||||
|
||||
// Lay it all out
|
||||
JPanel topleft = new JPanel();
|
||||
topleft.add(new JLabel("View results from: "));
|
||||
topleft.add(iterations);
|
||||
topleft.setAlignmentX(JComponent.LEFT_ALIGNMENT);
|
||||
details.setAlignmentX(JComponent.RIGHT_ALIGNMENT);
|
||||
JPanel top = new JPanel();
|
||||
top.setLayout(new BoxLayout(top, BoxLayout.LINE_AXIS));
|
||||
top.add(topleft);
|
||||
top.add(details);
|
||||
|
||||
cp.add(top, BorderLayout.NORTH);
|
||||
cp.add(new JScrollPane(results), BorderLayout.SOUTH);
|
||||
|
||||
frame.pack();
|
||||
frame.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* This overrides the logger publish method, which accepts log messages and
|
||||
* saves them for later display
|
||||
*
|
||||
* @param record information about the log event
|
||||
*/
|
||||
public void publish(LogRecord record)
|
||||
{
|
||||
((ArrayList) testDetails.get(testDetails.size() - 1)).add(record.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts a test summary report, generated after each iteration of a test
|
||||
*
|
||||
* @param results test results
|
||||
*/
|
||||
public void report(ArrayList results)
|
||||
{
|
||||
testResults.add(results);
|
||||
testDetails.add(new ArrayList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Provided as part of the Handler interface; not used
|
||||
*/
|
||||
public void flush()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Provided as part of the Handler interface; not used
|
||||
*/
|
||||
public void close()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle user-generated events on the results GUI
|
||||
*/
|
||||
public void actionPerformed(ActionEvent ev)
|
||||
{
|
||||
// Display information about the requested iteration
|
||||
int iteration = iterations.getSelectedIndex();
|
||||
String message = "";
|
||||
|
||||
// Display summary or details, as requested
|
||||
Iterator it;
|
||||
if (details.isSelected())
|
||||
it = ((ArrayList) testDetails.get(iteration)).iterator();
|
||||
else
|
||||
it = ((ArrayList) testResults.get(iteration)).iterator();
|
||||
|
||||
// Parse the ArrayList's
|
||||
while (it.hasNext())
|
||||
{
|
||||
message = message + ((String) it.next() + "\n");
|
||||
}
|
||||
|
||||
// Output to screen
|
||||
results.setText(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,390 @@
|
||||
/* JNIOverhead.java - demonstrator for classpath/gcj fillrect performance issue
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.java2d;
|
||||
|
||||
import gnu.classpath.examples.swing.DemoFactory;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
/**
|
||||
* @author Norman Hendrich
|
||||
*/
|
||||
public class JNIOverhead
|
||||
extends JPanel
|
||||
implements ActionListener
|
||||
{
|
||||
|
||||
static JNIOverhead fillRectDemo;
|
||||
|
||||
LCDCanvas lcd;
|
||||
Worker worker;
|
||||
JLabel label;
|
||||
JCheckBox translate;
|
||||
JCheckBox lines;
|
||||
|
||||
int nx = 128;
|
||||
int ny = 64;
|
||||
int matrix[][], future[][];
|
||||
int generation = 0;
|
||||
|
||||
// 20 msec, or 50 repaints per sec (theoretically)
|
||||
int sleepMillis = 20;
|
||||
long lastMillis = System.currentTimeMillis();
|
||||
|
||||
boolean enableRepaints = true;
|
||||
|
||||
/**
|
||||
* If true, test translation.
|
||||
*/
|
||||
boolean testTranslation = false;
|
||||
|
||||
/**
|
||||
* If true, paint lines rather than rectangles
|
||||
*/
|
||||
boolean paintLines;
|
||||
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
if (e.getActionCommand().equals("CLOSE"))
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
public JNIOverhead()
|
||||
{
|
||||
setSize(nx, ny);
|
||||
createContent();
|
||||
}
|
||||
|
||||
public void createContent()
|
||||
{
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
JPanel p = new JPanel(new BorderLayout());
|
||||
lcd = new LCDCanvas();
|
||||
label = new JLabel();
|
||||
label.setText("not running");
|
||||
|
||||
translate = new JCheckBox("translate");
|
||||
translate.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
testTranslation = translate.isSelected();
|
||||
}
|
||||
});
|
||||
|
||||
lines = new JCheckBox("lines");
|
||||
lines.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
paintLines = lines.isSelected();
|
||||
}
|
||||
});
|
||||
|
||||
JPanel bottom = new JPanel();
|
||||
bottom.add(lines);
|
||||
bottom.add(translate);
|
||||
|
||||
p.add(lcd, BorderLayout.CENTER);
|
||||
p.add(bottom, BorderLayout.SOUTH);
|
||||
p.add(label, BorderLayout.NORTH);
|
||||
add(p);
|
||||
}
|
||||
|
||||
public void setSize(int _nx,int _ny )
|
||||
{
|
||||
nx = _nx;
|
||||
ny = _ny;
|
||||
matrix = new int[nx][ny];
|
||||
future = new int[nx][ny];
|
||||
}
|
||||
|
||||
public void initFrameContent()
|
||||
{
|
||||
JPanel closePanel = new JPanel();
|
||||
JButton closeButton = new JButton("Close");
|
||||
closeButton.setActionCommand("CLOSE");
|
||||
closeButton.addActionListener(this);
|
||||
closePanel.add(closeButton);
|
||||
add(closePanel, BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
public void setSleepMillis(int millis)
|
||||
{
|
||||
sleepMillis = millis;
|
||||
}
|
||||
|
||||
public class LCDCanvas extends JPanel
|
||||
{
|
||||
private int sx, sy;
|
||||
private Color activePixel = new Color(30, 30, 40);
|
||||
private Color passivePixel = new Color(200, 180, 240);
|
||||
private Color gridPixel = new Color(255, 240, 240);
|
||||
|
||||
public LCDCanvas()
|
||||
{
|
||||
super();
|
||||
sx = 4 * nx;
|
||||
sy = 4 * ny;
|
||||
}
|
||||
|
||||
public void paintComponent(Graphics g)
|
||||
{
|
||||
// for buffered drawing - not used atm
|
||||
// g.drawImage( buffer, 0, 0, null );
|
||||
long t1 = System.currentTimeMillis();
|
||||
|
||||
g.setColor(gridPixel);
|
||||
g.fillRect(0, 0, sx, sy);
|
||||
|
||||
Color pixelColor = null;
|
||||
|
||||
int dx, dy;
|
||||
|
||||
if (paintLines)
|
||||
{
|
||||
for (int ix = 0; ix < nx; ix++)
|
||||
for (int iy = 0; iy < ny; iy++)
|
||||
{
|
||||
if (matrix[ix][iy] != 0)
|
||||
pixelColor = activePixel;
|
||||
else
|
||||
pixelColor = passivePixel;
|
||||
|
||||
dx = 4 * ix;
|
||||
dy = 4 * iy;
|
||||
g.setColor(pixelColor);
|
||||
|
||||
if (testTranslation)
|
||||
{
|
||||
g.translate(dx, dy);
|
||||
g.drawLine(0, 0, 5, 5);
|
||||
g.translate(- dx, - dy);
|
||||
}
|
||||
else
|
||||
g.drawLine(dx, dy, dx + 5, dy + 5);
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int ix = 0; ix < nx; ix++)
|
||||
{
|
||||
for (int iy = 0; iy < ny; iy++)
|
||||
{
|
||||
if (matrix[ix][iy] != 0)
|
||||
pixelColor = activePixel;
|
||||
else
|
||||
pixelColor = passivePixel;
|
||||
|
||||
dx = 4 * ix;
|
||||
dy = 4 * iy;
|
||||
g.setColor(pixelColor);
|
||||
|
||||
if (testTranslation)
|
||||
{
|
||||
g.translate(dx, dy);
|
||||
g.fillRect(0, 0, 3, 3);
|
||||
g.translate(- dx, - dy);
|
||||
}
|
||||
else
|
||||
g.fillRect(dx, dy, 3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
long t2 = System.currentTimeMillis();
|
||||
|
||||
label.setText("paintComponent took " + (t2 - t1) + " msec. " + "("
|
||||
+ (nx * ny + 1) + " "
|
||||
+ (paintLines ? "drawLine" : "fillRect") + " calls)");
|
||||
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize()
|
||||
{
|
||||
return new Dimension(sx,sy);
|
||||
}
|
||||
|
||||
public Dimension getMinimumSize()
|
||||
{
|
||||
return new Dimension(sx,sy);
|
||||
}
|
||||
}
|
||||
|
||||
public class Worker extends Thread
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
boolean running = true;
|
||||
while(running)
|
||||
{
|
||||
iteration();
|
||||
|
||||
if (enableRepaints)
|
||||
display();
|
||||
|
||||
if (sleepMillis > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.sleep( sleepMillis );
|
||||
}
|
||||
catch(InterruptedException ie)
|
||||
{
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* stupid animation algorithm: show binary representation of current
|
||||
* iteration.
|
||||
*/
|
||||
public void iteration()
|
||||
{
|
||||
generation++;
|
||||
|
||||
for (int i = 0; i < nx; i++)
|
||||
{
|
||||
long tmp1 = 1L << i;
|
||||
for (int j = 0; j < ny; j++)
|
||||
{
|
||||
// count neighbors
|
||||
long tmp2 = (1L << j);
|
||||
|
||||
|
||||
long tmp3 = generation & tmp1 & tmp2;
|
||||
if (tmp3 != 0)
|
||||
matrix[i][j] = 1;
|
||||
else
|
||||
matrix[i][j] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((generation % 100) == 0)
|
||||
{
|
||||
long t = System.currentTimeMillis();
|
||||
// System.out.println(
|
||||
// " generation= " + generation +
|
||||
// " iterations/sec= " + 100.0*1000/(t-lastMillis) );
|
||||
lastMillis = t;
|
||||
}
|
||||
}
|
||||
|
||||
public void display()
|
||||
{
|
||||
lcd.repaint();
|
||||
}
|
||||
|
||||
public static void usage()
|
||||
{
|
||||
System.out.println(
|
||||
"Usage: <java> FillRect2 [-sleep <millis>] [-size <int>] [-nopaint]\n"
|
||||
+ "Example: jamvm FillRect2 -sleep 10 -size 100\n"
|
||||
);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public static void main(String args[])
|
||||
throws Exception
|
||||
{
|
||||
fillRectDemo = new JNIOverhead();
|
||||
for (int i = 0; i < args.length; i++)
|
||||
{
|
||||
if ("-help".equals(args[i]))
|
||||
{
|
||||
usage();
|
||||
}
|
||||
if ("-sleep".equals(args[i]))
|
||||
{
|
||||
fillRectDemo.setSleepMillis( Integer.parseInt(args[i + 1]));
|
||||
i++;
|
||||
}
|
||||
if ("-size".equals(args[i]))
|
||||
{
|
||||
int size = Integer.parseInt(args[i + 1]);
|
||||
fillRectDemo.setSize(size, size);
|
||||
i++;
|
||||
}
|
||||
if ("-nopaint".equals(args[i]))
|
||||
{
|
||||
fillRectDemo.enableRepaints = false;
|
||||
}
|
||||
}
|
||||
|
||||
SwingUtilities.invokeLater (new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
|
||||
fillRectDemo.initFrameContent();
|
||||
JFrame frame = new JFrame("FillRect performance test");
|
||||
frame.getContentPane().add(fillRectDemo);
|
||||
frame.pack();
|
||||
frame.show();
|
||||
fillRectDemo.worker = fillRectDemo.new Worker();
|
||||
fillRectDemo.worker.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DemoFactory that creates a SliderDemo.
|
||||
*
|
||||
* @return a DemoFactory that creates a SliderDemo
|
||||
*/
|
||||
public static DemoFactory createDemoFactory()
|
||||
{
|
||||
return new DemoFactory()
|
||||
{
|
||||
public JComponent createDemo()
|
||||
{
|
||||
fillRectDemo = new JNIOverhead();
|
||||
SwingUtilities.invokeLater
|
||||
(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
fillRectDemo.worker = fillRectDemo.new Worker();
|
||||
fillRectDemo.worker.start();
|
||||
}
|
||||
});
|
||||
return fillRectDemo;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
606
libjava/classpath/examples/gnu/classpath/examples/java2d/bench.c
Normal file
606
libjava/classpath/examples/gnu/classpath/examples/java2d/bench.c
Normal file
@ -0,0 +1,606 @@
|
||||
/* bench.c -- native benchmark for Cairo library (meant to test java2d)
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
#include "bench.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
G_DEFINE_TYPE (Benchmark, benchmark, GTK_TYPE_DRAWING_AREA);
|
||||
|
||||
// Needed for the gtk widget, but not used:
|
||||
static void
|
||||
benchmark_class_init (BenchmarkClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
benchmark_init (Benchmark *obj)
|
||||
{
|
||||
}
|
||||
|
||||
// The Arc2D's PathIterator uses some transforms, so we condense the required
|
||||
// functionality of AffineTransform
|
||||
static void
|
||||
doTransform (double rx, double ry, double theta, double *cvec)
|
||||
{
|
||||
// Define identity matrix (corresponds to new AffineTransform())
|
||||
double m00 = 1;
|
||||
double m10 = 0;
|
||||
double m01 = 0;
|
||||
double m11 = 1;
|
||||
double m02 = 0;
|
||||
double m12 = 0;
|
||||
|
||||
// AffineTransform.scale(rx, ry)
|
||||
m00 = m00 * rx;
|
||||
m01 = m01 * ry;
|
||||
m10 = m10 * rx;
|
||||
m11 = m11 * ry;
|
||||
|
||||
// AffineTransform.rotate(theta)
|
||||
double c = cos(theta);
|
||||
double s = sin(theta);
|
||||
double n00 = m00 * c + m01 * s;
|
||||
double n01 = m00 * -s + m01 * c;
|
||||
double n10 = m10 * c + m11 * s;
|
||||
double n11 = m10 * -s + m11 * c;
|
||||
|
||||
m00 = n00;
|
||||
m01 = n01;
|
||||
m10 = n10;
|
||||
m11 = n11;
|
||||
|
||||
// AffineTransform.transform(cvec, 0, cvec, 0, 1)
|
||||
double dstPts[2];
|
||||
dstPts[0] = (float) (m00 * cvec[0] + m01 * cvec[1] + m02);
|
||||
dstPts[1] = (float) (m10 * cvec[0] + m11 * cvec[1] + m12);
|
||||
cvec[0] = dstPts[0];
|
||||
cvec[1] = dstPts[1];
|
||||
}
|
||||
|
||||
// Place an arc on the cairo path, simulating java2d's Arc2D
|
||||
static void
|
||||
setupArc(cairo_t *cr, GtkWidget *bench, int shift)
|
||||
{
|
||||
double x, y;
|
||||
|
||||
// Normally passed into the Arc2D constructor
|
||||
x = bench->allocation.x + (rand() % (bench->allocation.width - minSize + 1));
|
||||
y = bench->allocation.y + (rand() % (bench->allocation.height - minSize + 1));
|
||||
|
||||
int angle = rand() % 360;
|
||||
int length = (rand() % 360) - angle;
|
||||
int width = rand() % (int)((bench->allocation.width - x - 10) + 10);
|
||||
int height = rand() % (int)((bench->allocation.height - y - 10) + 10);
|
||||
|
||||
// This is from the ArcPath iterator
|
||||
double start = angle * (M_PI / 180);
|
||||
double extent = length * (M_PI / 180);
|
||||
|
||||
if (extent < 0)
|
||||
{
|
||||
extent = -extent;
|
||||
start = 2 * M_PI - extent + start;
|
||||
}
|
||||
|
||||
int limit;
|
||||
if (width < 0 || height < 0) // We assume type == 0; ie, Arc2D.OPEN
|
||||
limit = -1;
|
||||
else if (extent == 0)
|
||||
limit = 0;
|
||||
else if (extent <= M_PI / 2.0)
|
||||
limit = 1;
|
||||
else if (extent <= M_PI)
|
||||
limit = 2;
|
||||
else if (extent <= 3.0 * (M_PI / 2.0))
|
||||
limit = 3;
|
||||
else
|
||||
limit = 4;
|
||||
|
||||
// This is from CairoGraphics2D.walkPath
|
||||
double xnew = 0;
|
||||
double ynew = 0;
|
||||
double coords[6];
|
||||
|
||||
cairo_fill_rule_t cfillrule = CAIRO_FILL_RULE_WINDING;
|
||||
cairo_set_fill_rule(cr, cfillrule);
|
||||
|
||||
// First iteration will move to the starting point
|
||||
double rx = width / 2;
|
||||
double ry = height / 2;
|
||||
double xmid = x + rx;
|
||||
double ymid = y + ry;
|
||||
coords[0] = xmid + rx * cos(start);
|
||||
coords[1] = ymid - ry * sin(start);
|
||||
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(coords[0]) + 0.5;
|
||||
ynew = floor(coords[1]) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = coords[0];
|
||||
ynew = coords[1];
|
||||
}
|
||||
|
||||
cairo_move_to(cr, xnew, ynew);
|
||||
|
||||
// Iterate through segments of the arc
|
||||
int current;
|
||||
for (current = 1; current <= limit; current++)
|
||||
{
|
||||
// Back to the ArcPath iterator's getCurrent
|
||||
double kappa = (sqrt(2.0) - 1.0) * (4.0 / 3.0);
|
||||
double quad = (M_PI / 2.0);
|
||||
|
||||
double curr_begin = start + (current - 1) * quad;
|
||||
double curr_extent;
|
||||
|
||||
if (start + extent - curr_begin < quad)
|
||||
curr_extent = (start + extent) - curr_begin;
|
||||
else
|
||||
curr_extent = quad;
|
||||
|
||||
double portion_of_a_quadrant = curr_extent / quad;
|
||||
|
||||
double x0 = xmid + rx * cos(curr_begin);
|
||||
double y0 = ymid - ry * sin(curr_begin);
|
||||
|
||||
double x1 = xmid + rx * cos(curr_begin + curr_extent);
|
||||
double y1 = ymid - ry * sin(curr_begin + curr_extent);
|
||||
|
||||
double cvec[2];
|
||||
double len = kappa * portion_of_a_quadrant;
|
||||
double angle = curr_begin;
|
||||
|
||||
cvec[0] = 0;
|
||||
cvec[1] = len;
|
||||
doTransform(rx, ry, angle, cvec);
|
||||
coords[0] = x0 + cvec[0];
|
||||
coords[1] = y0 - cvec[1];
|
||||
|
||||
cvec[0] = 0;
|
||||
cvec[1] = -len;
|
||||
doTransform(rx, ry, angle, cvec);
|
||||
doTransform(1, 1, curr_extent, cvec);
|
||||
coords[2] = x1 + cvec[0];
|
||||
coords[3] = y1 - cvec[1];
|
||||
|
||||
coords[4] = x1;
|
||||
coords[5] = y1;
|
||||
|
||||
// draw it, from CairoGraphics2D.walkPath
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(coords[4]) + 0.5;
|
||||
ynew = floor(coords[5]) + 0.5;
|
||||
cairo_curve_to(cr, floor(coords[0]) + 0.5, floor(coords[1]) + 0.5,
|
||||
floor(coords[2]) + 0.5, floor(coords[3]) + 0.5,
|
||||
xnew, ynew);
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = coords[4];
|
||||
ynew = coords[5];
|
||||
cairo_curve_to(cr, coords[0], coords[1], coords[2],
|
||||
coords[3], xnew, ynew);
|
||||
}
|
||||
}
|
||||
|
||||
// Randomize the colour, just for asthetics =)
|
||||
cairo_set_source_rgb(cr, (rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100));
|
||||
|
||||
}
|
||||
|
||||
// Place a beizer curve on the cairo path, simulating java2d's CubicCurve2D
|
||||
static void
|
||||
setupCurve(cairo_t *cr, GtkWidget *bench, int shift)
|
||||
{
|
||||
// These are options when creating a new curve
|
||||
int x1 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int y1 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
int xc1 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int yc1 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
int xc2 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int yc2 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
int x2 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int y2 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
|
||||
// From CairoGraphics2D.walkPath
|
||||
double xnew = 0;
|
||||
double ynew = 0;
|
||||
double coords[6];
|
||||
|
||||
cairo_fill_rule_t cfillrule = CAIRO_FILL_RULE_WINDING;
|
||||
cairo_set_fill_rule(cr, cfillrule);
|
||||
|
||||
// And into CubicCurve's PathIterator...
|
||||
// start by moving to the starting coordinate
|
||||
coords[0] = (float) x1;
|
||||
coords[1] = (float) y1;
|
||||
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(coords[0]) + 0.5;
|
||||
ynew = floor(coords[1]) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = coords[0];
|
||||
ynew = coords[1];
|
||||
}
|
||||
|
||||
cairo_move_to(cr, xnew, ynew);
|
||||
|
||||
// Now the curve itself
|
||||
coords[0] = (float) xc1;
|
||||
coords[1] = (float) yc1;
|
||||
coords[2] = (float) xc2;
|
||||
coords[3] = (float) yc2;
|
||||
coords[4] = (float) x2;
|
||||
coords[5] = (float) y2;
|
||||
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(coords[4]) + 0.5;
|
||||
ynew = floor(coords[5]) + 0.5;
|
||||
cairo_curve_to(cr, floor(coords[0]) + 0.5, floor(coords[1]) + 0.5,
|
||||
floor(coords[2]) + 0.5, floor(coords[3]) + 0.5,
|
||||
xnew, ynew);
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = coords[4];
|
||||
ynew = coords[5];
|
||||
cairo_curve_to(cr, coords[0], coords[1], coords[2],
|
||||
coords[3], xnew, ynew);
|
||||
}
|
||||
|
||||
// Randomize colour for asthetics
|
||||
cairo_set_source_rgb(cr, (rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100));
|
||||
}
|
||||
|
||||
// Place a line on the cairo path, simulating java2d's Line2D
|
||||
static void
|
||||
setupLine(cairo_t *cr, GtkWidget *bench, int shift)
|
||||
{
|
||||
// These are set when you create a line
|
||||
int x1 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int y1 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
int x2 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int y2 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
|
||||
// This is from CairoGraphics2D.walkPath
|
||||
double xnew = 0;
|
||||
double ynew = 0;
|
||||
double coords[6];
|
||||
|
||||
cairo_fill_rule_t cfillrule = CAIRO_FILL_RULE_WINDING;
|
||||
cairo_set_fill_rule(cr, cfillrule);
|
||||
|
||||
// And into Line2D's PathIterator
|
||||
coords[0] = (float) x1;
|
||||
coords[1] = (float) y1;
|
||||
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(coords[0]) + 0.5;
|
||||
ynew = floor(coords[1]) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = coords[0];
|
||||
ynew = coords[1];
|
||||
}
|
||||
|
||||
cairo_move_to(cr, xnew, ynew);
|
||||
|
||||
coords[0] = (float) x2;
|
||||
coords[1] = (float) y2;
|
||||
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(coords[0]) + 0.5;
|
||||
ynew = floor(coords[1]) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = coords[0];
|
||||
ynew = coords[1];
|
||||
}
|
||||
|
||||
cairo_line_to(cr, xnew, ynew);
|
||||
|
||||
// Randomize colour for asthetics
|
||||
cairo_set_source_rgb(cr, (rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100));
|
||||
}
|
||||
|
||||
// Place a rectangle on the cairo path, simulating java2d's Rectangle2D
|
||||
static void
|
||||
setupRect(cairo_t *cr, GtkWidget *bench, int shift)
|
||||
{
|
||||
// These are set when you create a rectangle
|
||||
int x1 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int y1 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
int x2 = bench->allocation.x + (rand() % (bench->allocation.width - minSize));
|
||||
int y2 = bench->allocation.y + (rand() % (bench->allocation.height - minSize));
|
||||
|
||||
// draw() and fill() have been optimized to ignore the PathIterator.
|
||||
// We do the same here.
|
||||
double xnew = 0;
|
||||
double ynew = 0;
|
||||
|
||||
if (shift == 1)
|
||||
{
|
||||
xnew = floor(x1) + 0.5;
|
||||
ynew = floor(y1) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
xnew = x1;
|
||||
ynew = y1;
|
||||
}
|
||||
|
||||
cairo_rectangle(cr, x1, y1, x2, y2);
|
||||
|
||||
// Randomize colour for asthetics
|
||||
cairo_set_source_rgb(cr, (rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100),
|
||||
(rand() % 100 / (float)100));
|
||||
}
|
||||
|
||||
// The real work gets done here: this function is called when the widget
|
||||
// is drawn on screen.
|
||||
static void
|
||||
draw (GtkWidget *bench, cairo_t *cr)
|
||||
{
|
||||
// Setup
|
||||
struct timeb t1, t2;
|
||||
int i, timeElapsed;
|
||||
|
||||
cairo_set_line_width(cr, lineWidth);
|
||||
|
||||
if (antialias == 0)
|
||||
cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
|
||||
else
|
||||
cairo_set_antialias(cr, CAIRO_ANTIALIAS_GRAY);
|
||||
|
||||
// Tell the user what's going on
|
||||
printf("Testing native cairo drawing..\n");
|
||||
printf(" Screen size is %d x %d \n", screenWidth, screenHeight);
|
||||
printf(" Line width is %d\n", lineWidth);
|
||||
printf(" Test size: %d\n", testSize);
|
||||
|
||||
if (antialias == 0)
|
||||
printf(" Anti-alias is off\n");
|
||||
else
|
||||
printf(" Anti-alias is on\n");
|
||||
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
|
||||
// Draw & fill Arc
|
||||
if (arcTest == 1)
|
||||
{
|
||||
// Draw
|
||||
ftime(&t1);
|
||||
for (i = 0; i < testSize; i++)
|
||||
{
|
||||
setupArc(cr, bench, 1);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
ftime(&t2);
|
||||
timeElapsed = 1000 * (t2.time - t1.time) + (t2.millitm - t1.millitm);
|
||||
printf("Draw arc: %d ms\n", timeElapsed);
|
||||
fflush(stdout);
|
||||
|
||||
// Fill
|
||||
ftime(&t1);
|
||||
for (i = 0; i < testSize; i++)
|
||||
{
|
||||
setupArc(cr, bench, 0);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
ftime(&t2);
|
||||
timeElapsed = 1000 * (t2.time - t1.time) + (t2.millitm - t1.millitm);
|
||||
printf("Fill arc: %d ms\n", timeElapsed);
|
||||
}
|
||||
|
||||
// Draw cubic curve
|
||||
if (curveTest == 1)
|
||||
{
|
||||
ftime(&t1);
|
||||
for (i = 0; i < testSize; i++)
|
||||
{
|
||||
setupCurve(cr, bench, 1);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
ftime(&t2);
|
||||
timeElapsed = 1000 * (t2.time - t1.time) + (t2.millitm - t1.millitm);
|
||||
printf("Draw cubic curve: %d ms\n", timeElapsed);
|
||||
}
|
||||
|
||||
// Ellipse: skip; this is just a special case of arc
|
||||
// General path: skip; this doesn't even work in java2d
|
||||
|
||||
// Draw Line
|
||||
if (lineTest == 1)
|
||||
{
|
||||
ftime(&t1);
|
||||
for (i = 0; i < testSize; i++)
|
||||
{
|
||||
setupLine(cr, bench, 1);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
ftime(&t2);
|
||||
timeElapsed = 1000 * (t2.time - t1.time) + (t2.millitm - t1.millitm);
|
||||
printf("Draw line: %d ms\n", timeElapsed);
|
||||
}
|
||||
|
||||
// Draw & fill Rectangle
|
||||
if (rectTest == 1)
|
||||
{
|
||||
// Draw
|
||||
ftime(&t1);
|
||||
for (i = 0; i < testSize; i++)
|
||||
{
|
||||
setupRect(cr, bench, 1);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
ftime(&t2);
|
||||
timeElapsed = 1000 * (t2.time - t1.time) + (t2.millitm - t1.millitm);
|
||||
printf("Draw rectangle: %d ms\n", timeElapsed);
|
||||
|
||||
// Fill
|
||||
ftime(&t1);
|
||||
for (i = 0; i < testSize; i++)
|
||||
{
|
||||
setupRect(cr, bench, 0);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
ftime(&t2);
|
||||
timeElapsed = 1000 * (t2.time - t1.time) + (t2.millitm - t1.millitm);
|
||||
printf("Fill rectangle: %d ms\n", timeElapsed);
|
||||
}
|
||||
|
||||
// Round rectangle: skip, it's just a combination of lines and curves
|
||||
// Image: skip?
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
benchmark_new (void)
|
||||
{
|
||||
return g_object_new (BENCHMARK_TYPE, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
// Set defaults
|
||||
minSize = 10;
|
||||
arcTest = 0;
|
||||
curveTest = 0;
|
||||
lineTest = 0;
|
||||
rectTest = 0;
|
||||
screenWidth = 320;
|
||||
screenHeight = 240;
|
||||
testSize = 1000;
|
||||
antialias = 0;
|
||||
lineWidth = 1;
|
||||
|
||||
// Process any command-line user options
|
||||
int i;
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
// Process options first
|
||||
if (!strcmp(argv[i], "-a"))
|
||||
antialias = 1;
|
||||
else if (!strcmp(argv[i], "-h"))
|
||||
screenHeight = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-l"))
|
||||
lineWidth = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-t"))
|
||||
testSize = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-w"))
|
||||
screenWidth = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--h")
|
||||
|| !strcmp(argv[i], "-help") || !strcmp(argv[i], "--help"))
|
||||
{
|
||||
printf("Cairo benchmarker, meant to measure JNI overhead\n");
|
||||
printf("Usage: bench [-a] [-h height] [-t test size] [-w width] [tests...]\n");
|
||||
printf("\n");
|
||||
printf(" Valid options: -a turn on anti-aliasing (default off)\n");
|
||||
printf(" -h set screen height (default 240)\n");
|
||||
printf(" -l set stroke line width (default 1)\n");
|
||||
printf(" -t set test size (default 1000)\n");
|
||||
printf(" -w set screen width (default 320)\n");
|
||||
printf(" -h | --help\n");
|
||||
printf(" Valid tests: arc\n");
|
||||
printf(" curve\n");
|
||||
printf(" line\n");
|
||||
printf(" rect\n");
|
||||
printf(" (default: run all)\n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
// Process tests
|
||||
else if (!strcmp(argv[i], "arc"))
|
||||
arcTest = 1;
|
||||
else if (!strcmp(argv[i], "curve"))
|
||||
curveTest = 1;
|
||||
else if (!strcmp(argv[i], "line"))
|
||||
lineTest = 1;
|
||||
else if (!strcmp(argv[i], "rect"))
|
||||
rectTest = 1;
|
||||
}
|
||||
|
||||
// If no tests were specified, we default to running all of them
|
||||
if (arcTest == 0 && curveTest == 0 && lineTest == 0 && rectTest == 0)
|
||||
{
|
||||
arcTest = 1;
|
||||
curveTest = 1;
|
||||
lineTest = 1;
|
||||
rectTest = 1;
|
||||
}
|
||||
|
||||
// Set up gtk widget
|
||||
GtkWidget *window, *bench;
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_resize(GTK_WINDOW(window), screenWidth, screenHeight);
|
||||
gtk_window_set_title(GTK_WINDOW(window), "cairo benchmark");
|
||||
|
||||
// Set up benchmkar and cairo surface
|
||||
bench = benchmark_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), bench);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
cairo_t *cr;
|
||||
cr = gdk_cairo_create (bench->window);
|
||||
|
||||
// Run tests
|
||||
draw (bench, cr);
|
||||
|
||||
// Hold output on screen until user exits.
|
||||
printf("Press any key to exit.\n");
|
||||
getchar();
|
||||
exit(0);
|
||||
gtk_main();
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/* bench.h -- native benchmark for Cairo library (meant to test java2d)
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
#ifndef __BENCH_H__
|
||||
#define __BENCH_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BENCHMARK_TYPE (benchmark_get_type())
|
||||
#define BENCHMARK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj, BENCHMARK_TYPE, Benchmark)
|
||||
#define BENCHMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BENCHMARK_TYPE, BenchmarkClass);
|
||||
#define IS_BENCHMARK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BENCHMARK_TYPE))
|
||||
#define IS_BENCHMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BENCHMARK_TYPE))
|
||||
#define BENCHMARK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BENCHMARK_TYPE, BenchmarkClass))
|
||||
|
||||
typedef struct _Benchmark Benchmark;
|
||||
typedef struct _BenchmarkClass BenchmarkClass;
|
||||
|
||||
struct _Benchmark {
|
||||
GtkDrawingArea parent;
|
||||
|
||||
};
|
||||
|
||||
struct _BenchmarkClass {
|
||||
GtkDrawingAreaClass parent_class;
|
||||
};
|
||||
|
||||
GType benchmark_get_type (void);
|
||||
GtkWidget *benchmark_new (void);
|
||||
|
||||
static int minSize;
|
||||
static int antialias;
|
||||
static int arcTest;
|
||||
static int curveTest;
|
||||
static int lineTest;
|
||||
static int rectTest;
|
||||
|
||||
static int screenHeight;
|
||||
static int screenWidth;
|
||||
static int testSize;
|
||||
static int lineWidth;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
@ -0,0 +1,55 @@
|
||||
/* TestBeans.java -- Tests the dynamic interface of the beans.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.management.DynamicMBean;
|
||||
|
||||
public class TestBeans
|
||||
{
|
||||
public static void main(String[] args)
|
||||
throws Exception
|
||||
{
|
||||
List beans = new ArrayList();
|
||||
/* FIXME: When there's a server, this will be easier... :) */
|
||||
beans.add(ManagementFactory.getOperatingSystemMXBean());
|
||||
beans.add(ManagementFactory.getRuntimeMXBean());
|
||||
beans.add(ManagementFactory.getThreadMXBean());
|
||||
beans.add(ManagementFactory.getCompilationMXBean());
|
||||
beans.add(ManagementFactory.getClassLoadingMXBean());
|
||||
beans.add(ManagementFactory.getMemoryMXBean());
|
||||
beans.addAll(ManagementFactory.getMemoryPoolMXBeans());
|
||||
beans.addAll(ManagementFactory.getMemoryManagerMXBeans());
|
||||
beans.addAll(ManagementFactory.getGarbageCollectorMXBeans());
|
||||
Iterator it = beans.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
DynamicMBean bean = (DynamicMBean) it.next();
|
||||
if (bean != null)
|
||||
System.out.println(bean.getMBeanInfo());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/* TestClassLoading.java -- Tests the class loading bean.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ClassLoadingMXBean;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
public class TestClassLoading
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
ClassLoadingMXBean bean = ManagementFactory.getClassLoadingMXBean();
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("Loaded classes: " + bean.getLoadedClassCount());
|
||||
System.out.println("Unloaded classes: " + bean.getUnloadedClassCount());
|
||||
System.out.println("Total loaded classes: " + bean.getTotalLoadedClassCount());
|
||||
boolean verbosity = bean.isVerbose();
|
||||
System.out.println("Verbose class output: " + (verbosity ? "yes" : "no"));
|
||||
System.out.println("Changing verbose setting...");
|
||||
bean.setVerbose(!verbosity);
|
||||
System.out.println("Verbose class output: " + (bean.isVerbose() ? "yes" : "no"));
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/* TestCompilation.java -- Tests the compilation bean.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.CompilationMXBean;
|
||||
|
||||
public class TestCompilation
|
||||
{
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
CompilationMXBean bean = ManagementFactory.getCompilationMXBean();
|
||||
if (bean == null)
|
||||
{
|
||||
System.out.println("The compilation bean is not supported by this VM.");
|
||||
System.exit(-1);
|
||||
}
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("JIT compiler name: " + bean.getName());
|
||||
boolean timeMonitoring = bean.isCompilationTimeMonitoringSupported();
|
||||
System.out.println("Compilation time monitoring supported: " + timeMonitoring);
|
||||
if (timeMonitoring)
|
||||
{
|
||||
System.out.println("Compilation time: "
|
||||
+ bean.getTotalCompilationTime() + "ms");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/* TestGarbageCollector.java -- Tests the garbage collector beans.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.GarbageCollectorMXBean;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class TestGarbageCollector
|
||||
{
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Iterator beans = ManagementFactory.getGarbageCollectorMXBeans().iterator();
|
||||
while (beans.hasNext())
|
||||
{
|
||||
GarbageCollectorMXBean bean = (GarbageCollectorMXBean) beans.next();
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("Name: " + bean.getName());
|
||||
System.out.println("Memory pool names: "
|
||||
+ Arrays.toString(bean.getMemoryPoolNames()));
|
||||
System.out.println("Is valid: "
|
||||
+ (bean.isValid() ? "yes" : "no"));
|
||||
System.out.println("Collection count: "
|
||||
+ bean.getCollectionCount());
|
||||
System.out.println("Collection time: "
|
||||
+ bean.getCollectionTime() + "ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,52 @@
|
||||
/* TestMemory.java -- Tests the memory bean.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.MemoryMXBean;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
public class TestMemory
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
MemoryMXBean bean = ManagementFactory.getMemoryMXBean();
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("Heap memory usage: "
|
||||
+ bean.getHeapMemoryUsage());
|
||||
System.out.println("Non-heap memory usage: "
|
||||
+ bean.getNonHeapMemoryUsage());
|
||||
System.out.println("Objects pending finalization: "
|
||||
+ bean.getObjectPendingFinalizationCount());
|
||||
System.out.println("Running garbage collector via bean...");
|
||||
bean.gc();
|
||||
System.out.println("Heap memory usage: "
|
||||
+ bean.getHeapMemoryUsage());
|
||||
System.out.println("Non-heap memory usage: "
|
||||
+ bean.getNonHeapMemoryUsage());
|
||||
System.out.println("Objects pending finalization: "
|
||||
+ bean.getObjectPendingFinalizationCount());
|
||||
boolean verbosity = bean.isVerbose();
|
||||
System.out.println("Verbose memory output: " + (verbosity ? "yes" : "no"));
|
||||
System.out.println("Changing verbose setting...");
|
||||
bean.setVerbose(!verbosity);
|
||||
System.out.println("Verbose memory output: " + (bean.isVerbose() ? "yes" : "no"));
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/* TestMemoryManager.java -- Tests the memory manager beans.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryManagerMXBean;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class TestMemoryManager
|
||||
{
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Iterator beans = ManagementFactory.getMemoryManagerMXBeans().iterator();
|
||||
while (beans.hasNext())
|
||||
{
|
||||
MemoryManagerMXBean bean = (MemoryManagerMXBean) beans.next();
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("Name: " + bean.getName());
|
||||
System.out.println("Memory pool names: "
|
||||
+ Arrays.toString(bean.getMemoryPoolNames()));
|
||||
System.out.println("Is valid: "
|
||||
+ (bean.isValid() ? "yes" : "no"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,93 @@
|
||||
/* TestMemoryPool.java -- Tests the memory pool beans.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryPoolMXBean;
|
||||
import java.lang.management.MemoryUsage;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class TestMemoryPool
|
||||
{
|
||||
|
||||
/**
|
||||
* 1mb in bytes
|
||||
*/
|
||||
private static final int MB = 1 << 20;
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Iterator beans = ManagementFactory.getMemoryPoolMXBeans().iterator();
|
||||
while (beans.hasNext())
|
||||
{
|
||||
MemoryPoolMXBean bean = (MemoryPoolMXBean) beans.next();
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("Name: " + bean.getName());
|
||||
System.out.println("Collection usage: " + bean.getCollectionUsage());
|
||||
boolean collectionUsage = bean.isCollectionUsageThresholdSupported();
|
||||
System.out.println("Collection usage threshold supported: "
|
||||
+ collectionUsage);
|
||||
if (collectionUsage)
|
||||
{
|
||||
System.out.println("Collection usage threshold: "
|
||||
+ bean.getCollectionUsageThreshold());
|
||||
System.out.println("Setting collection usage threshold to 1MB ("
|
||||
+ MB + " bytes)");
|
||||
bean.setCollectionUsageThreshold(MB);
|
||||
System.out.println("Collection usage threshold: "
|
||||
+ bean.getCollectionUsageThreshold());
|
||||
System.out.println("Collection usage threshold count: "
|
||||
+ bean.getCollectionUsageThresholdCount());
|
||||
System.out.println("Collection usage threshold exceeded: "
|
||||
+ (bean.isCollectionUsageThresholdExceeded()
|
||||
? "yes" : "no"));
|
||||
}
|
||||
System.out.println("Memory manager names: "
|
||||
+ Arrays.toString(bean.getMemoryManagerNames()));
|
||||
System.out.println("Peak usage: " + bean.getPeakUsage());
|
||||
System.out.println("Current usage: " + bean.getUsage());
|
||||
System.out.println("Resetting peak usage...");
|
||||
bean.resetPeakUsage();
|
||||
System.out.println("Peak usage: " + bean.getPeakUsage());
|
||||
System.out.println("Current usage: " + bean.getUsage());
|
||||
boolean usage = bean.isUsageThresholdSupported();
|
||||
System.out.println("Usage threshold supported: " + usage);
|
||||
if (usage)
|
||||
{
|
||||
System.out.println("Usage threshold: "
|
||||
+ bean.getUsageThreshold());
|
||||
System.out.println("Setting usage threshold to 1MB ("
|
||||
+ MB + " bytes)");
|
||||
bean.setUsageThreshold(MB);
|
||||
System.out.println("Usage threshold: "
|
||||
+ bean.getUsageThreshold());
|
||||
System.out.println("Usage threshold count: "
|
||||
+ bean.getUsageThresholdCount());
|
||||
System.out.println("Usage threshold exceeded: "
|
||||
+ (bean.isUsageThresholdExceeded()
|
||||
? "yes" : "no"));
|
||||
}
|
||||
System.out.println("Valid: " + (bean.isValid() ? "yes" : "no"));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
/* TestOS.java -- Tests the OS bean.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.OperatingSystemMXBean;
|
||||
|
||||
public class TestOS
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
|
||||
System.out.println("Bean: " + osBean);
|
||||
System.out.println("OS Name: " + osBean.getName());
|
||||
System.out.println("OS Version: " + osBean.getVersion());
|
||||
System.out.println("Architecture: " + osBean.getArch());
|
||||
System.out.println("Processors: " + osBean.getAvailableProcessors());
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
/* TestRuntime.java -- Tests the runtime bean.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TestRuntime
|
||||
{
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
RuntimeMXBean vmBean = ManagementFactory.getRuntimeMXBean();
|
||||
System.out.println("Bean: " + vmBean);
|
||||
boolean bootClassPath = vmBean.isBootClassPathSupported();
|
||||
System.out.println("Boot Class Path Supported: " + bootClassPath);
|
||||
if (bootClassPath)
|
||||
System.out.println("Boot Class Path: " + vmBean.getBootClassPath());
|
||||
System.out.println("Class Path: " + vmBean.getClassPath());
|
||||
System.out.println("Input Arguments: " + vmBean.getInputArguments());
|
||||
System.out.println("Library Path: " + vmBean.getLibraryPath());
|
||||
System.out.println("Management Spec. Version: " + vmBean.getManagementSpecVersion());
|
||||
System.out.println("Name: " + vmBean.getName());
|
||||
System.out.println("Spec Name: " + vmBean.getSpecName());
|
||||
System.out.println("Spec Vendor: " + vmBean.getSpecVendor());
|
||||
System.out.println("Spec Version: " + vmBean.getSpecVersion());
|
||||
System.out.println("Start Time: " + new Date(vmBean.getStartTime()));
|
||||
System.out.println("System Properties: " + vmBean.getSystemProperties());
|
||||
System.out.println("Uptime: " + vmBean.getUptime() + "ms");
|
||||
System.out.println("VM Name: " + vmBean.getVmName());
|
||||
System.out.println("VM Vendor: " + vmBean.getVmVendor());
|
||||
System.out.println("VM Version: " + vmBean.getVmVersion());
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
/* TestThread.java -- Tests the thread bean.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath examples.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
package gnu.classpath.examples.management;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.ThreadInfo;
|
||||
import java.lang.management.ThreadMXBean;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TestThread
|
||||
{
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
|
||||
System.out.println("Bean: " + bean);
|
||||
System.out.println("Monitor deadlocked threads: " + bean.findMonitorDeadlockedThreads());
|
||||
long[] ids = bean.getAllThreadIds();
|
||||
System.out.println("Live thread ids: " + Arrays.toString(ids));
|
||||
boolean currentTimeMonitoring = bean.isCurrentThreadCpuTimeSupported();
|
||||
System.out.println("Current thread CPU time monitoring supported: " + currentTimeMonitoring);
|
||||
if (currentTimeMonitoring)
|
||||
{
|
||||
boolean timeEnabled = bean.isThreadCpuTimeEnabled();
|
||||
System.out.println("Is time monitoring enabled... " +
|
||||
(timeEnabled ? "yes" : "no"));
|
||||
if (!timeEnabled)
|
||||
{
|
||||
System.out.println("Enabling...");
|
||||
bean.setThreadCpuTimeEnabled(true);
|
||||
timeEnabled = bean.isThreadCpuTimeEnabled();
|
||||
System.out.println("Should now be enabled... " +
|
||||
(timeEnabled ? "yes" : "no"));
|
||||
}
|
||||
if (timeEnabled)
|
||||
{
|
||||
System.out.println("Current thread CPU time: "
|
||||
+ bean.getCurrentThreadCpuTime()
|
||||
+ "ns");
|
||||
System.out.println("Current thread user time: "
|
||||
+ bean.getCurrentThreadUserTime()
|
||||
+ "ns");
|
||||
}
|
||||
}
|
||||
System.out.println("Daemon thread count: " + bean.getDaemonThreadCount());
|
||||
System.out.println("Peak thread count: " + bean.getPeakThreadCount());
|
||||
System.out.println("Resetting...");
|
||||
bean.resetPeakThreadCount();
|
||||
System.out.println("Peak thread count: " + bean.getPeakThreadCount());
|
||||
System.out.println("Thread count: " + bean.getThreadCount());
|
||||
boolean timeMonitoring = bean.isThreadCpuTimeSupported();
|
||||
System.out.println("Thread CPU time monitoring supported: " + timeMonitoring);
|
||||
if (timeMonitoring)
|
||||
{
|
||||
for (int a = 0; a < ids.length; ++a)
|
||||
{
|
||||
System.out.println("Thread " + a
|
||||
+ " CPU time: "
|
||||
+ bean.getThreadCpuTime(ids[a]) + "ns");
|
||||
System.out.println("Thread "
|
||||
+ a + " user time: "
|
||||
+ bean.getThreadUserTime(ids[a]) + "ns");
|
||||
}
|
||||
}
|
||||
System.out.println("Current thread info: "
|
||||
+ bean.getThreadInfo(Thread.currentThread().getId()));
|
||||
System.out.println("All thread info: " + Arrays.toString(bean.getThreadInfo(ids)));
|
||||
System.out.println("Total started threads: " + bean.getTotalStartedThreadCount());
|
||||
boolean contentionMonitoring = bean.isThreadContentionMonitoringSupported();
|
||||
System.out.println("Thread contention monitoring supported: " + contentionMonitoring);
|
||||
if (contentionMonitoring)
|
||||
{
|
||||
boolean contentionEnabled = bean.isThreadContentionMonitoringEnabled();
|
||||
System.out.println("Thread contention monitoring shouldn't be enabled... " +
|
||||
(contentionEnabled ? "but it is" : "true"));
|
||||
if (!contentionEnabled)
|
||||
{
|
||||
System.out.println("Enabling...");
|
||||
bean.setThreadContentionMonitoringEnabled(true);
|
||||
contentionEnabled = bean.isThreadContentionMonitoringEnabled();
|
||||
System.out.println("Should now be enabled... " +
|
||||
(contentionEnabled ? "it is" : "nope"));
|
||||
}
|
||||
if (contentionEnabled)
|
||||
{
|
||||
ThreadInfo[] info = bean.getThreadInfo(ids);
|
||||
for (int a = 0; a < info.length; ++a)
|
||||
{
|
||||
System.out.println("Blocked time for thread "
|
||||
+ info[a].getThreadId() + ": "
|
||||
+ info[a].getBlockedTime() + "ms");
|
||||
System.out.println("Waited time for thread "
|
||||
+ info[a].getThreadId() + ": "
|
||||
+ info[a].getWaitedTime() + "ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -22,12 +22,15 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
|
||||
package gnu.classpath.examples.swing;
|
||||
|
||||
import gnu.classpath.examples.java2d.JNIOverhead;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.*;
|
||||
|
||||
import javax.swing.plaf.basic.BasicLookAndFeel;
|
||||
import javax.swing.plaf.metal.DefaultMetalTheme;
|
||||
import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||
import javax.swing.plaf.metal.MetalTheme;
|
||||
@ -156,7 +159,10 @@ public class Demo
|
||||
|
||||
examples.add(new JMenuItem(new PopupAction("NavigationFilter",
|
||||
NavigationFilterDemo.createDemoFactory())));
|
||||
|
||||
examples.add(new JMenuItem(new PopupAction("JNI Overhead",
|
||||
JNIOverhead.createDemoFactory())));
|
||||
|
||||
|
||||
final JMenuItem vmMenu;
|
||||
|
||||
help.add(new JMenuItem("just play with the widgets"));
|
||||
@ -187,6 +193,10 @@ public class Demo
|
||||
}
|
||||
});
|
||||
|
||||
// Installs the BasicLookAndFeel.
|
||||
UIManager.installLookAndFeel("(Basic Look And Feel)",
|
||||
InstantiableBasicLookAndFeel.class.getName());
|
||||
|
||||
// Create L&F menu.
|
||||
JMenu lafMenu = new JMenu("Look and Feel");
|
||||
ButtonGroup lafGroup = new ButtonGroup();
|
||||
@ -200,6 +210,8 @@ public class Demo
|
||||
boolean selected = laf.getClassName().equals(currentLaf);
|
||||
lafItem.setSelected(selected);
|
||||
lafMenu.add(lafItem);
|
||||
|
||||
lafGroup.add(lafItem);
|
||||
}
|
||||
|
||||
// Create themes menu.
|
||||
@ -543,7 +555,10 @@ public class Demo
|
||||
panel.add(new JButton(new PopupAction("Tree",
|
||||
TreeDemo.createDemoFactory())));
|
||||
panel.add(new JButton(new PopupAction("Theme Editor",
|
||||
MetalThemeEditor.createDemoFactory())));
|
||||
MetalThemeEditor.createDemoFactory())));
|
||||
panel.add(new JButton(new PopupAction("JNI Overhead",
|
||||
JNIOverhead.createDemoFactory())));
|
||||
|
||||
JButton exitDisposer = mkDisposerButton(frame);
|
||||
panel.add(exitDisposer);
|
||||
|
||||
@ -652,10 +667,45 @@ public class Demo
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
SwingUtilities.updateComponentTreeUI(frame);
|
||||
themesMenu.setEnabled(laf.getClassName()
|
||||
.equals("javax.swing.plaf.metal.MetalLookAndFeel"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation of BasicLookAndFeel which can be instantiated.
|
||||
*
|
||||
* @author Robert Schuster (robertschuster@fsfe.org)
|
||||
*
|
||||
*/
|
||||
public static class InstantiableBasicLookAndFeel extends BasicLookAndFeel
|
||||
{
|
||||
public String getDescription()
|
||||
{
|
||||
return "An instantiable implementation of BasicLookAndFeel";
|
||||
}
|
||||
|
||||
public String getID()
|
||||
{
|
||||
return "instantiableBasicLookAndFeel";
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "Instantiable Basic Look And Feel";
|
||||
}
|
||||
|
||||
public boolean isNativeLookAndFeel()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSupportedLookAndFeel()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,298 @@
|
||||
/* HtmlDemo.java -- HTML viewer demo
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.classpath.examples.swing;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.text.Element;
|
||||
import javax.swing.text.html.HTMLDocument;
|
||||
|
||||
/**
|
||||
* Parses and displays HTML content.
|
||||
*
|
||||
* @author Audrius Meskauskas (audriusa@bioinformatics.org)
|
||||
*/
|
||||
public class HtmlDemo extends JPanel
|
||||
{
|
||||
|
||||
JTextPane html = new JTextPane();
|
||||
|
||||
JTextArea text = new JTextArea("<html><body>" +
|
||||
"123456789HR!<hr>987654321"+
|
||||
"123456789BR!<br>987654321"+
|
||||
"<p id='insertHere'>Insertion target</p><p>"+
|
||||
"<font color=red>ma</font>"+
|
||||
"<sup>sup</sup>normal<sub>sub</sub>normal</p><p>Table:"+
|
||||
"<table><tr>a<td>b<td>c<tr>x<td>y<td>z</table></body></html>");
|
||||
|
||||
JPanel buttons;
|
||||
|
||||
int n;
|
||||
|
||||
public HtmlDemo()
|
||||
{
|
||||
super();
|
||||
html.setContentType("text/html"); // not now.
|
||||
createContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a panel with the demo content. The panel uses a BorderLayout(), and
|
||||
* the BorderLayout.SOUTH area is empty, to allow callers to add controls to
|
||||
* the bottom of the panel if they want to (a close button is added if this
|
||||
* demo is being run as a standalone demo).
|
||||
*/
|
||||
private void createContent()
|
||||
{
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
JPanel center = new JPanel();
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.setRows(2);
|
||||
center.setLayout(layout);
|
||||
center.add(new JScrollPane(text));
|
||||
center.add(new JScrollPane(html));
|
||||
|
||||
buttons = new JPanel();
|
||||
|
||||
JButton parse = new JButton("parse");
|
||||
parse.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
String t = text.getText();
|
||||
System.out.println("HtmlDemo.java.createContent:Parsing started");
|
||||
html.setText(t);
|
||||
System.out.println("HtmlDemo.java.createContent:Parsing completed");
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(parse);
|
||||
|
||||
JButton insertBeforeEnd = new JButton("before end");
|
||||
insertBeforeEnd.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
HTMLDocument doc = (HTMLDocument) html.getDocument();
|
||||
Element el = doc.getElement("insertHere");
|
||||
System.out.println("Element found:"+el);
|
||||
try
|
||||
{
|
||||
doc.insertBeforeEnd(el,"before end "+(n++));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JButton insertBeforeStart = new JButton("before start");
|
||||
insertBeforeStart.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
HTMLDocument doc = (HTMLDocument) html.getDocument();
|
||||
Element el = doc.getElement("insertHere");
|
||||
System.out.println("Element found:"+el);
|
||||
try
|
||||
{
|
||||
doc.insertBeforeStart(el,"before start "+(n++));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JButton insertAfterEnd = new JButton("after end");
|
||||
insertAfterEnd.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
HTMLDocument doc = (HTMLDocument) html.getDocument();
|
||||
Element el = doc.getElement("insertHere");
|
||||
System.out.println("Element found:"+el);
|
||||
try
|
||||
{
|
||||
doc.insertAfterEnd(el,"after end "+(n++));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JButton insertAfterStart = new JButton("after start");
|
||||
insertAfterStart.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
HTMLDocument doc = (HTMLDocument) html.getDocument();
|
||||
Element el = doc.getElement("insertHere");
|
||||
System.out.println("Element found:"+el);
|
||||
try
|
||||
{
|
||||
doc.insertAfterStart(el,"after start "+(n++));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
JButton setInner = new JButton("inner");
|
||||
setInner.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
HTMLDocument doc = (HTMLDocument) html.getDocument();
|
||||
Element el = doc.getElement("insertHere");
|
||||
System.out.println("Element found:"+el);
|
||||
try
|
||||
{
|
||||
doc.setInnerHTML(el,"inner "+(n++));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JButton setOuter = new JButton("outer");
|
||||
setOuter.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
HTMLDocument doc = (HTMLDocument) html.getDocument();
|
||||
Element el = doc.getElement("insertHere");
|
||||
System.out.println("Element found:"+el);
|
||||
try
|
||||
{
|
||||
doc.setOuterHTML(el,"outer "+(n++));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
buttons.add(insertBeforeStart);
|
||||
buttons.add(insertAfterStart);
|
||||
buttons.add(insertBeforeEnd);
|
||||
buttons.add(insertAfterEnd);
|
||||
|
||||
buttons.add(setInner);
|
||||
buttons.add(setOuter);
|
||||
|
||||
add(center, BorderLayout.CENTER);
|
||||
add(buttons, BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* The executable method to display the editable table.
|
||||
*
|
||||
* @param args
|
||||
* unused.
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SwingUtilities.invokeLater
|
||||
(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
HtmlDemo demo = new HtmlDemo();
|
||||
|
||||
JButton exit = new JButton("exit");
|
||||
exit.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
demo.buttons.add(exit);
|
||||
|
||||
JFrame frame = new JFrame();
|
||||
frame.getContentPane().add(demo);
|
||||
frame.setSize(new Dimension(700, 480));
|
||||
frame.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DemoFactory that creates a HtmlDemo.
|
||||
*
|
||||
* @return a DemoFactory that creates a HtmlDemo
|
||||
*/
|
||||
public static DemoFactory createDemoFactory()
|
||||
{
|
||||
return new DemoFactory()
|
||||
{
|
||||
public JComponent createDemo()
|
||||
{
|
||||
return new HtmlDemo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public class NavigationFilterDemo
|
||||
pt = text.getCaret().getMagicCaretPosition();
|
||||
|
||||
// Calculate its position above.
|
||||
newpos = Utilities.getPositionAbove(text, pos, pt.x);
|
||||
newpos = Utilities.getPositionAbove(text, pos, (pt != null) ? pt.x : 0);
|
||||
|
||||
// If we have a valid position, then calculate the next word start
|
||||
// from there.
|
||||
@ -173,7 +173,7 @@ public class NavigationFilterDemo
|
||||
pt = text.getCaret().getMagicCaretPosition();
|
||||
|
||||
// Calculate its position below.
|
||||
newpos = Utilities.getPositionBelow(text, pos, pt.x);
|
||||
newpos = Utilities.getPositionBelow(text, pos, (pt != null) ? pt.x : 0);
|
||||
|
||||
// If we have a valid position, then calculate the next word start
|
||||
// from there.
|
||||
@ -192,7 +192,6 @@ public class NavigationFilterDemo
|
||||
else
|
||||
return Utilities.getPreviousWord(text, newpos);
|
||||
case SwingConstants.EAST:
|
||||
// Simply calculate the next word's start offset.
|
||||
return Utilities.getNextWord(text, newpos);
|
||||
default:
|
||||
// Do whatever the super implementation did.
|
||||
|
@ -66,17 +66,17 @@ public class TabbedPaneDemo
|
||||
JPanel p = new JPanel();
|
||||
p.setLayout(new GridLayout(2, 2));
|
||||
JTabbedPane tabs1 = new JTabbedPane(SwingConstants.TOP);
|
||||
tabs1.add("Top Item 1", new JButton("Button"));
|
||||
tabs1.add("Top Item 2", new JButton("Button"));
|
||||
tabs1.add("Top Item 1", new JButton("Content: Top Item 1"));
|
||||
tabs1.add("Top Item 2", new JButton("Content: Top Item 2"));
|
||||
JTabbedPane tabs2 = new JTabbedPane(SwingConstants.LEFT);
|
||||
tabs2.add("Left Item 1", new JButton("Button"));
|
||||
tabs2.add("Left Item 2", new JButton("Button"));
|
||||
tabs2.add("Left Item 1", new JButton("Content: Left Item 1"));
|
||||
tabs2.add("Left Item 2", new JButton("Content: Left Item 2"));
|
||||
JTabbedPane tabs3 = new JTabbedPane(SwingConstants.BOTTOM);
|
||||
tabs3.add("Bottom Item 1", new JButton("Button"));
|
||||
tabs3.add("Bottom Item 2", new JButton("Button"));
|
||||
tabs3.add("Bottom Item 1", new JButton("Content: Bottom Item 1"));
|
||||
tabs3.add("Bottom Item 2", new JButton("Content: Bottom Item 2"));
|
||||
JTabbedPane tabs4 = new JTabbedPane(SwingConstants.RIGHT);
|
||||
tabs4.add("Right Item 1", new JButton("Button"));
|
||||
tabs4.add("Right Item 2", new JButton("Button"));
|
||||
tabs4.add("Right Item 1", new JButton("Content: Right Item 1"));
|
||||
tabs4.add("Right Item 2", new JButton("Content: Right Item 2"));
|
||||
p.add(tabs1);
|
||||
p.add(tabs2);
|
||||
p.add(tabs3);
|
||||
|
@ -39,19 +39,36 @@ exception statement from your version. */
|
||||
package gnu.classpath.examples.swing;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Rectangle;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.swing.AbstractCellEditor;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.DefaultCellEditor;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollBar;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JSlider;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.plaf.metal.MetalIconFactory;
|
||||
import javax.swing.table.DefaultTableColumnModel;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
|
||||
/**
|
||||
* Displays the editable table. The first column consists of check boxes.
|
||||
@ -78,12 +95,11 @@ public class TableDemo extends JPanel
|
||||
{
|
||||
|
||||
/**
|
||||
* Return true if the cell is editable.
|
||||
* Icons are not editable, other cells are editable.
|
||||
* All cells are editable in our table.
|
||||
*/
|
||||
public boolean isCellEditable(int row, int column)
|
||||
{
|
||||
return column!=1;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -143,6 +159,77 @@ public class TableDemo extends JPanel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The scroll bar renderer.
|
||||
*/
|
||||
class SliderCell
|
||||
extends AbstractCellEditor
|
||||
implements TableCellEditor, TableCellRenderer
|
||||
{
|
||||
/**
|
||||
* The editor bar.
|
||||
*/
|
||||
JSlider bar;
|
||||
|
||||
/**
|
||||
* The renderer bar.
|
||||
*/
|
||||
JSlider rendererBar;
|
||||
|
||||
/**
|
||||
* The border around the bar, if required.
|
||||
*/
|
||||
Border border = BorderFactory.createLineBorder(table.getGridColor());
|
||||
|
||||
SliderCell()
|
||||
{
|
||||
bar = new JSlider();
|
||||
bar.setOrientation(JScrollBar.HORIZONTAL);
|
||||
bar.setMinimum(0);
|
||||
bar.setMaximum(rows);
|
||||
bar.setBorder(border);
|
||||
|
||||
rendererBar = new JSlider();
|
||||
rendererBar.setMinimum(0);
|
||||
rendererBar.setMaximum(rows);
|
||||
rendererBar.setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the editor.
|
||||
*/
|
||||
public Component getTableCellEditorComponent(JTable table, Object value,
|
||||
boolean isSelected, int row,
|
||||
int column)
|
||||
{
|
||||
if (value instanceof Integer)
|
||||
bar.setValue(((Integer) value).intValue());
|
||||
return bar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the renderer.
|
||||
*/
|
||||
public Component getTableCellRendererComponent(JTable table, Object value,
|
||||
boolean isSelected,
|
||||
boolean hasFocus, int row,
|
||||
int column)
|
||||
{
|
||||
rendererBar.setValue(((Integer) value).intValue());
|
||||
if (hasFocus)
|
||||
rendererBar.setBorder(border);
|
||||
else
|
||||
rendererBar.setBorder(null);
|
||||
return rendererBar;
|
||||
}
|
||||
|
||||
public Object getCellEditorValue()
|
||||
{
|
||||
return new Integer(bar.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The table being displayed.
|
||||
*/
|
||||
@ -158,6 +245,25 @@ public class TableDemo extends JPanel
|
||||
*/
|
||||
Object[][] values;
|
||||
|
||||
/**
|
||||
* The icons that appear in the icon column.
|
||||
*/
|
||||
Icon[] icons = new Icon[]
|
||||
{
|
||||
MetalIconFactory.getTreeComputerIcon(),
|
||||
MetalIconFactory.getTreeHardDriveIcon(),
|
||||
MetalIconFactory.getTreeFolderIcon(),
|
||||
};
|
||||
|
||||
/**
|
||||
* The choices in the combo boxes
|
||||
*/
|
||||
String [] sides = new String[]
|
||||
{
|
||||
"north", "south", "east", "west"
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Create the table demo with the given titel.
|
||||
*/
|
||||
@ -178,29 +284,25 @@ public class TableDemo extends JPanel
|
||||
setLayout(new BorderLayout());
|
||||
values = new Object[rows][];
|
||||
|
||||
// The icons that appear in the icon column.
|
||||
Icon[] icons = new Icon[]
|
||||
{
|
||||
MetalIconFactory.getTreeComputerIcon(),
|
||||
MetalIconFactory.getTreeHardDriveIcon(),
|
||||
MetalIconFactory.getTreeFolderIcon(),
|
||||
};
|
||||
|
||||
for (int i = 0; i < values.length; i++)
|
||||
{
|
||||
values[i] = new Object[cols];
|
||||
for (int j = 2; j < cols; j++)
|
||||
for (int j = 3; j < cols; j++)
|
||||
{
|
||||
values[i][j] = "" + ((char) ('a' + j)) + i;
|
||||
}
|
||||
values [i][0] = i % 2 == 0? Boolean.TRUE : Boolean.FALSE;
|
||||
values [i][1] = icons [ i % icons.length ];
|
||||
values [i][1] = icons [ i % icons.length ];
|
||||
values [i][2] = sides [ i % sides.length ];
|
||||
values [i][4] = new Integer(i);
|
||||
}
|
||||
|
||||
table.setModel(model);
|
||||
|
||||
// Make the columns with gradually increasing width:
|
||||
DefaultTableColumnModel cm = new DefaultTableColumnModel();
|
||||
table.setColumnModel(cm);
|
||||
|
||||
for (int i = 0; i < cols; i++)
|
||||
{
|
||||
TableColumn column = new TableColumn(i);
|
||||
@ -215,8 +317,9 @@ public class TableDemo extends JPanel
|
||||
|
||||
cm.addColumn(column);
|
||||
}
|
||||
|
||||
table.setColumnModel(cm);
|
||||
|
||||
setCustomEditors();
|
||||
setInformativeHeaders();
|
||||
|
||||
// Create the table, place it into scroll pane and place
|
||||
// the pane into this frame.
|
||||
@ -226,6 +329,52 @@ public class TableDemo extends JPanel
|
||||
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
scroll.getViewport().add(table);
|
||||
add(scroll, BorderLayout.CENTER);
|
||||
|
||||
// Increase the row height to make the icons and sliders look better.
|
||||
table.setRowHeight(table.getRowHeight()+2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the more informative column headers for specific columns.
|
||||
*/
|
||||
void setInformativeHeaders()
|
||||
{
|
||||
TableColumnModel cm = table.getColumnModel();
|
||||
|
||||
cm.getColumn(0).setHeaderValue("check");
|
||||
cm.getColumn(1).setHeaderValue("icon");
|
||||
cm.getColumn(2).setHeaderValue("combo");
|
||||
cm.getColumn(3).setHeaderValue("edit combo");
|
||||
cm.getColumn(4).setHeaderValue("slider");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the custom editors for combo boxes. This method also sets one
|
||||
* custom renderer.
|
||||
*/
|
||||
void setCustomEditors()
|
||||
{
|
||||
TableColumnModel cm = table.getColumnModel();
|
||||
|
||||
// Set combo-box based editor for icons (note that no custom
|
||||
// renderer is needed for JComboBox to work with icons.
|
||||
JComboBox combo0 = new JComboBox(icons);
|
||||
cm.getColumn(1).setCellEditor(new DefaultCellEditor(combo0));
|
||||
|
||||
// Set the simple combo box editor for the third column:
|
||||
JComboBox combo1 = new JComboBox(sides);
|
||||
cm.getColumn(2).setCellEditor(new DefaultCellEditor(combo1));
|
||||
|
||||
// Set the editable combo box for the forth column:
|
||||
JComboBox combo2 = new JComboBox(sides);
|
||||
combo2.setEditable(true);
|
||||
cm.getColumn(3).setCellEditor(new DefaultCellEditor(combo2));
|
||||
|
||||
SliderCell scrollView = new SliderCell();
|
||||
cm.getColumn(4).setCellEditor(scrollView);
|
||||
cm.getColumn(4).setCellRenderer(scrollView);
|
||||
|
||||
table.setColumnModel(cm);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -266,3 +415,4 @@ public class TableDemo extends JPanel
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
10
libjava/classpath/external/Makefile.in
vendored
10
libjava/classpath/external/Makefile.in
vendored
@ -93,6 +93,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -113,6 +115,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -143,6 +146,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -193,6 +200,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -213,6 +221,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
|
@ -84,6 +84,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -104,6 +106,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -134,6 +137,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -184,6 +191,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -204,6 +212,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
|
10
libjava/classpath/external/sax/Makefile.in
vendored
10
libjava/classpath/external/sax/Makefile.in
vendored
@ -84,6 +84,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -104,6 +106,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -134,6 +137,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -184,6 +191,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -204,6 +212,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
|
10
libjava/classpath/external/w3c_dom/Makefile.in
vendored
10
libjava/classpath/external/w3c_dom/Makefile.in
vendored
@ -84,6 +84,8 @@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
|
||||
CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
|
||||
CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
|
||||
CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
|
||||
CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
||||
@ -104,6 +106,7 @@ CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATE = @DATE@
|
||||
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
@ -134,6 +137,10 @@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
|
||||
FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
||||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GCONF_CFLAGS = @GCONF_CFLAGS@
|
||||
GCONF_LIBS = @GCONF_LIBS@
|
||||
GDK_CFLAGS = @GDK_CFLAGS@
|
||||
GDK_LIBS = @GDK_LIBS@
|
||||
GJDOC = @GJDOC@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
@ -184,6 +191,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
|
||||
PANGOFT2_LIBS = @PANGOFT2_LIBS@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_ESCHER = @PATH_TO_ESCHER@
|
||||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
@ -204,6 +212,8 @@ USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
|
||||
USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
|
||||
USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
|
||||
USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
||||
USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
|
||||
USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
|
@ -61,11 +61,6 @@ import org.omg.PortableServer.ForwardRequest;
|
||||
*/
|
||||
public abstract class ForwardRequestHelper
|
||||
{
|
||||
/**
|
||||
* The cached typecode value, computed only once.
|
||||
*/
|
||||
private static TypeCode typeCode;
|
||||
|
||||
/**
|
||||
* Extract the ForwardRequest from given Any.
|
||||
* This method uses the ForwardRequestHolder.
|
||||
@ -132,18 +127,14 @@ public abstract class ForwardRequestHelper
|
||||
*/
|
||||
public static TypeCode type()
|
||||
{
|
||||
if (typeCode == null)
|
||||
{
|
||||
ORB orb = ORB.init();
|
||||
StructMember[] members = new StructMember[ 1 ];
|
||||
|
||||
TypeCode field;
|
||||
|
||||
field = ObjectHelper.type();
|
||||
members [ 0 ] = new StructMember("forward_reference", field, null);
|
||||
typeCode = orb.create_exception_tc(id(), "ForwardRequest", members);
|
||||
}
|
||||
return typeCode;
|
||||
ORB orb = OrbRestricted.Singleton;
|
||||
StructMember[] members = new StructMember[ 1 ];
|
||||
|
||||
TypeCode field;
|
||||
|
||||
field = ObjectHelper.type();
|
||||
members [ 0 ] = new StructMember("forward_reference", field, null);
|
||||
return orb.create_exception_tc(id(), "ForwardRequest", members);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,10 +38,11 @@ exception statement from your version. */
|
||||
|
||||
package gnu.classpath.debug;
|
||||
|
||||
import gnu.classpath.SystemProperties;
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.security.AccessController;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
@ -91,20 +92,27 @@ public class Simple1LineFormatter
|
||||
extends Formatter
|
||||
{
|
||||
private static final String DAT_PATTERN = "yyyy-MM-dd HH:mm:ss.SSSS Z ";
|
||||
private static final DateFormat DAT_FORMAT = new SimpleDateFormat(DAT_PATTERN);
|
||||
private static final String THREAD_PATTERN = " #########0;-#########0";
|
||||
private static final NumberFormat THREAD_FORMAT = new DecimalFormat(THREAD_PATTERN);
|
||||
private static final String SPACES_32 = " ";
|
||||
private static final String SPACES_6 = " ";
|
||||
private static final String LS = SystemProperties.getProperty("line.separator");
|
||||
private static final String LS = (String) AccessController.doPrivileged
|
||||
(new GetPropertyAction("line.separator"));
|
||||
private DateFormat dateFormat;
|
||||
private NumberFormat threadFormat;
|
||||
|
||||
// default 0-arguments constructor
|
||||
|
||||
public String format(LogRecord record)
|
||||
{
|
||||
StringBuffer sb = new StringBuffer(180)
|
||||
.append(DAT_FORMAT.format(new Date(record.getMillis())))
|
||||
.append(THREAD_FORMAT.format(record.getThreadID()))
|
||||
if (dateFormat == null)
|
||||
dateFormat = new SimpleDateFormat(DAT_PATTERN);
|
||||
|
||||
if (threadFormat == null)
|
||||
threadFormat = new DecimalFormat(THREAD_PATTERN);
|
||||
|
||||
StringBuilder sb = new StringBuilder(180)
|
||||
.append(dateFormat.format(new Date(record.getMillis())))
|
||||
.append(threadFormat.format(record.getThreadID()))
|
||||
.append(" ");
|
||||
String s = record.getSourceClassName();
|
||||
if (s == null)
|
||||
|
@ -38,7 +38,9 @@ version. */
|
||||
|
||||
package gnu.classpath.debug;
|
||||
|
||||
import gnu.classpath.SystemProperties;
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@ -49,8 +51,8 @@ public final class SystemLogger
|
||||
static
|
||||
{
|
||||
SYSTEM.setFilter (PreciseFilter.GLOBAL);
|
||||
|
||||
String defaults = SystemProperties.getProperty ("gnu.classpath.debug.components");
|
||||
String defaults = (String) AccessController.doPrivileged
|
||||
(new GetPropertyAction("gnu.classpath.debug.components"));
|
||||
|
||||
if (defaults != null)
|
||||
{
|
||||
|
98
libjava/classpath/gnu/classpath/debug/TeeInputStream.java
Normal file
98
libjava/classpath/gnu/classpath/debug/TeeInputStream.java
Normal file
@ -0,0 +1,98 @@
|
||||
/* TeeInputStream.java
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is a part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under terms
|
||||
of your choice, provided that you also meet, for each linked independent
|
||||
module, the terms and conditions of the license of that module. An
|
||||
independent module is a module which is not derived from or based on
|
||||
this library. If you modify this library, you may extend this exception
|
||||
to your version of the library, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from your
|
||||
version. */
|
||||
|
||||
package gnu.classpath.debug;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* An input stream that copies all its input to a byte sink.
|
||||
*
|
||||
* @author Chris Burdess
|
||||
*/
|
||||
public class TeeInputStream
|
||||
extends InputStream
|
||||
{
|
||||
|
||||
private final InputStream in;
|
||||
private final OutputStream out;
|
||||
|
||||
/**
|
||||
* Constructs a tee input stream.
|
||||
* @param in the underlying input stream
|
||||
* @param out the output sink
|
||||
*/
|
||||
public TeeInputStream(InputStream in, OutputStream out)
|
||||
{
|
||||
this.in = in;
|
||||
this.out = out;
|
||||
}
|
||||
|
||||
public int read()
|
||||
throws IOException
|
||||
{
|
||||
int ret = in.read();
|
||||
out.write(ret);
|
||||
out.flush();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int read(byte[] b, int off, int len)
|
||||
throws IOException
|
||||
{
|
||||
int ret = in.read(b, off, len);
|
||||
if (ret != -1)
|
||||
{
|
||||
out.write(b, off, ret);
|
||||
out.flush();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void close()
|
||||
throws IOException
|
||||
{
|
||||
in.close();
|
||||
out.close();
|
||||
}
|
||||
|
||||
public final boolean markSupported()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
93
libjava/classpath/gnu/classpath/debug/TeeOutputStream.java
Normal file
93
libjava/classpath/gnu/classpath/debug/TeeOutputStream.java
Normal file
@ -0,0 +1,93 @@
|
||||
/* TeeOutputStream.java
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is a part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under terms
|
||||
of your choice, provided that you also meet, for each linked independent
|
||||
module, the terms and conditions of the license of that module. An
|
||||
independent module is a module which is not derived from or based on
|
||||
this library. If you modify this library, you may extend this exception
|
||||
to your version of the library, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from your
|
||||
version. */
|
||||
|
||||
package gnu.classpath.debug;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* An output stream that copies all its output to an additional byte sink.
|
||||
*
|
||||
* @author Chris Burdess
|
||||
*/
|
||||
public class TeeOutputStream
|
||||
extends OutputStream
|
||||
{
|
||||
|
||||
private final OutputStream out;
|
||||
private final OutputStream sink;
|
||||
|
||||
/**
|
||||
* Constructs a tee output stream.
|
||||
* @param out the underlying output stream
|
||||
* @param sink the output sink
|
||||
*/
|
||||
public TeeOutputStream(OutputStream out, OutputStream sink)
|
||||
{
|
||||
this.out = out;
|
||||
this.sink = sink;
|
||||
}
|
||||
|
||||
public void write(int c)
|
||||
throws IOException
|
||||
{
|
||||
out.write(c);
|
||||
sink.write(c);
|
||||
}
|
||||
|
||||
public void write(byte[] b, int off, int len)
|
||||
throws IOException
|
||||
{
|
||||
out.write(b, off, len);
|
||||
sink.write(b, off, len);
|
||||
}
|
||||
|
||||
public void flush()
|
||||
throws IOException
|
||||
{
|
||||
out.flush();
|
||||
sink.flush();
|
||||
}
|
||||
|
||||
public void close()
|
||||
throws IOException
|
||||
{
|
||||
out.close();
|
||||
sink.close();
|
||||
}
|
||||
|
||||
}
|
98
libjava/classpath/gnu/classpath/debug/TeeReader.java
Normal file
98
libjava/classpath/gnu/classpath/debug/TeeReader.java
Normal file
@ -0,0 +1,98 @@
|
||||
/* TeeReader.java
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is a part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under terms
|
||||
of your choice, provided that you also meet, for each linked independent
|
||||
module, the terms and conditions of the license of that module. An
|
||||
independent module is a module which is not derived from or based on
|
||||
this library. If you modify this library, you may extend this exception
|
||||
to your version of the library, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from your
|
||||
version. */
|
||||
|
||||
package gnu.classpath.debug;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* A reader that copies all characters read to an output sink.
|
||||
*
|
||||
* @author Chris Burdess
|
||||
*/
|
||||
public class TeeReader
|
||||
extends Reader
|
||||
{
|
||||
|
||||
private final Reader in;
|
||||
private final Writer out;
|
||||
|
||||
/**
|
||||
* Constructs a tee reader.
|
||||
* @param in the input
|
||||
* @param out the output sink
|
||||
*/
|
||||
public TeeReader(Reader in, Writer out)
|
||||
{
|
||||
this.in = in;
|
||||
this.out = out;
|
||||
}
|
||||
|
||||
public int read()
|
||||
throws IOException
|
||||
{
|
||||
int ret = in.read();
|
||||
out.write(ret);
|
||||
out.flush();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int read(char[] b, int off, int len)
|
||||
throws IOException
|
||||
{
|
||||
int ret = in.read(b, off, len);
|
||||
if (ret != -1)
|
||||
{
|
||||
out.write(b, off, ret);
|
||||
out.flush();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void close()
|
||||
throws IOException
|
||||
{
|
||||
in.close();
|
||||
out.close();
|
||||
}
|
||||
|
||||
public final boolean markSupported()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
93
libjava/classpath/gnu/classpath/debug/TeeWriter.java
Normal file
93
libjava/classpath/gnu/classpath/debug/TeeWriter.java
Normal file
@ -0,0 +1,93 @@
|
||||
/* TeeWriter.java
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is a part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under terms
|
||||
of your choice, provided that you also meet, for each linked independent
|
||||
module, the terms and conditions of the license of that module. An
|
||||
independent module is a module which is not derived from or based on
|
||||
this library. If you modify this library, you may extend this exception
|
||||
to your version of the library, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from your
|
||||
version. */
|
||||
|
||||
package gnu.classpath.debug;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* A writer that copies all its output to an additional character sink.
|
||||
*
|
||||
* @author Chris Burdess
|
||||
*/
|
||||
public class TeeWriter
|
||||
extends Writer
|
||||
{
|
||||
|
||||
private final Writer out;
|
||||
private final Writer sink;
|
||||
|
||||
/**
|
||||
* Constructs a tee writer.
|
||||
* @param out the underlying writer
|
||||
* @param sink the output sink
|
||||
*/
|
||||
public TeeWriter(Writer out, Writer sink)
|
||||
{
|
||||
this.out = out;
|
||||
this.sink = sink;
|
||||
}
|
||||
|
||||
public void write(int c)
|
||||
throws IOException
|
||||
{
|
||||
out.write(c);
|
||||
sink.write(c);
|
||||
}
|
||||
|
||||
public void write(char[] b, int off, int len)
|
||||
throws IOException
|
||||
{
|
||||
out.write(b, off, len);
|
||||
sink.write(b, off, len);
|
||||
}
|
||||
|
||||
public void flush()
|
||||
throws IOException
|
||||
{
|
||||
out.flush();
|
||||
sink.flush();
|
||||
}
|
||||
|
||||
public void close()
|
||||
throws IOException
|
||||
{
|
||||
out.close();
|
||||
sink.close();
|
||||
}
|
||||
|
||||
}
|
@ -56,6 +56,9 @@ import java.util.HashMap;
|
||||
/**
|
||||
* Main interface from the virtual machine to the JDWP back-end.
|
||||
*
|
||||
* The thread created by this class is only used for initialization.
|
||||
* Once it exits, the JDWP backend is fully initialized.
|
||||
*
|
||||
* @author Keith Seitz (keiths@redhat.com)
|
||||
*/
|
||||
public class Jdwp
|
||||
@ -65,7 +68,8 @@ public class Jdwp
|
||||
private static Jdwp _instance = null;
|
||||
|
||||
/**
|
||||
* Are we debugging?
|
||||
* Are we debugging? Only true if debugging
|
||||
* *and* initialized.
|
||||
*/
|
||||
public static boolean isDebugging = false;
|
||||
|
||||
@ -89,13 +93,16 @@ public class Jdwp
|
||||
// A thread group for the JDWP threads
|
||||
private ThreadGroup _group;
|
||||
|
||||
// Initialization synchronization
|
||||
private Object _initLock = new Object ();
|
||||
private int _initCount = 0;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public Jdwp ()
|
||||
{
|
||||
_shutdown = false;
|
||||
isDebugging = true;
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
@ -271,17 +278,52 @@ public class Jdwp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows subcomponents to specify that they are
|
||||
* initialized.
|
||||
*
|
||||
* Subcomponents include JdwpConnection and PacketProcessor.
|
||||
*/
|
||||
public void subcomponentInitialized ()
|
||||
{
|
||||
synchronized (_initLock)
|
||||
{
|
||||
++_initCount;
|
||||
_initLock.notify ();
|
||||
}
|
||||
}
|
||||
|
||||
public void run ()
|
||||
{
|
||||
try
|
||||
{
|
||||
_doInitialization ();
|
||||
|
||||
/* We need a little internal synchronization here, so that
|
||||
when this thread dies, the back-end will be fully initialized,
|
||||
ready to start servicing the VM and debugger. */
|
||||
synchronized (_initLock)
|
||||
{
|
||||
while (_initCount != 2)
|
||||
_initLock.wait ();
|
||||
}
|
||||
_initLock = null;
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
System.out.println ("Exception in JDWP back-end: " + t);
|
||||
System.exit (1);
|
||||
}
|
||||
|
||||
/* Force creation of the EventManager. If the event manager
|
||||
has not been created when isDebugging is set, it is possible
|
||||
that the VM will call Jdwp.notify (which uses EventManager)
|
||||
while the EventManager is being created (or at least this is
|
||||
a problem with gcj/gij). */
|
||||
EventManager.getDefault();
|
||||
|
||||
// Now we are finally ready and initialized
|
||||
isDebugging = true;
|
||||
}
|
||||
|
||||
// A helper function to process the configure string "-Xrunjdwp:..."
|
||||
|
@ -62,18 +62,23 @@ public class BreakpointEvent
|
||||
|
||||
// Location where breakpoint occurred
|
||||
private Location _location;
|
||||
|
||||
//object instance
|
||||
private Object _instance;
|
||||
|
||||
/**
|
||||
* Constructs a new BreakpointEvent
|
||||
*
|
||||
* @param thread thread in which event occurred
|
||||
* @param loc location where breakpoint occurred
|
||||
* @param instance object instance
|
||||
*/
|
||||
public BreakpointEvent(Thread thread, Location loc)
|
||||
public BreakpointEvent(Thread thread, Location loc, Object instance)
|
||||
{
|
||||
super(JdwpConstants.EventKind.BREAKPOINT);
|
||||
_thread = thread;
|
||||
_location = loc;
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,12 +88,14 @@ public class BreakpointEvent
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or null
|
||||
*/
|
||||
public Object getParameter(Class type)
|
||||
public Object getParameter(int type)
|
||||
{
|
||||
if (type == ThreadId.class)
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
else if (type == Location.class)
|
||||
else if (type == EVENT_LOCATION)
|
||||
return _location;
|
||||
else if (type == EVENT_INSTANCE)
|
||||
return _instance;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -116,11 +116,11 @@ public class ClassPrepareEvent
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or <code>null</code>
|
||||
*/
|
||||
public Object getParameter (Class type)
|
||||
public Object getParameter (int type)
|
||||
{
|
||||
if (type == ThreadId.class)
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
else if (type == ReferenceTypeId.class)
|
||||
else if (type == EVENT_CLASS)
|
||||
return _class;
|
||||
|
||||
return null;
|
||||
|
@ -0,0 +1,96 @@
|
||||
/* ClassUnloadEvent.java -- event generated when a class is unloaded
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.classpath.jdwp.event;
|
||||
|
||||
import gnu.classpath.jdwp.JdwpConstants;
|
||||
import gnu.classpath.jdwp.VMIdManager;
|
||||
import gnu.classpath.jdwp.util.JdwpString;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* "Notification of a class unload in the target VM" -- JDWP 1.4.2
|
||||
*
|
||||
* @author Kyle Galloway (kgallowa@redhat.com)
|
||||
*/
|
||||
public class ClassUnloadEvent
|
||||
extends Event
|
||||
{
|
||||
//signature directly from VM
|
||||
private String _signature;
|
||||
|
||||
/**
|
||||
* Constructs a new <code>ClassUnloadEvent</code>
|
||||
*
|
||||
* @param signature the signature reported from the VM
|
||||
*/
|
||||
public ClassUnloadEvent(String signature)
|
||||
{
|
||||
super(JdwpConstants.EventKind.CLASS_UNLOAD);
|
||||
_signature = signature;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific filtering parameter for this event. Class is the only
|
||||
* valid type.
|
||||
*
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or <code>null</code>
|
||||
*/
|
||||
public Object getParameter(int type)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the event to the given stream
|
||||
*
|
||||
* @param outStream the output stream to write the event to
|
||||
*/
|
||||
protected void _writeData(DataOutputStream outStream)
|
||||
throws IOException
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
|
||||
JdwpString.writeString(outStream, _signature);
|
||||
}
|
||||
|
||||
}
|
@ -54,6 +54,41 @@ import java.io.IOException;
|
||||
*/
|
||||
public abstract class Event
|
||||
{
|
||||
/**
|
||||
* The class of the object in which the event occurred
|
||||
*/
|
||||
public static final int EVENT_CLASS = 1;
|
||||
|
||||
/**
|
||||
* The thread where the event occurred
|
||||
*/
|
||||
public static final int EVENT_THREAD = 2;
|
||||
|
||||
/**
|
||||
* The location where an event occurred
|
||||
*/
|
||||
public static final int EVENT_LOCATION = 3;
|
||||
|
||||
/**
|
||||
* The instance of the class where the event occurred
|
||||
*/
|
||||
public static final int EVENT_INSTANCE = 4;
|
||||
|
||||
/**
|
||||
* The field acted on by an event
|
||||
*/
|
||||
public static final int EVENT_FIELD = 5;
|
||||
|
||||
/**
|
||||
* The class of the exception for ExceptionEvent
|
||||
*/
|
||||
public static final int EVENT_EXCEPTION_CLASS = 6;
|
||||
|
||||
/**
|
||||
* Whether this exception was caught (only valid for ExceptionEvents)
|
||||
*/
|
||||
public static final int EVENT_EXCEPTION_CAUGHT = 7;
|
||||
|
||||
// The kind of event represented by this event
|
||||
private byte _eventKind;
|
||||
|
||||
@ -97,7 +132,7 @@ public abstract class Event
|
||||
* @returns the parameter (not the ID) or <code>null</code> if none is
|
||||
* is defined for this event
|
||||
*/
|
||||
public abstract Object getParameter (Class type);
|
||||
public abstract Object getParameter (int type);
|
||||
|
||||
/**
|
||||
* Converts this event into to a JDWP packet
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* EventManager.java -- event management and notification infrastructure
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
Copyright (C) 2005, 2006 Free Software Foundation
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -69,7 +69,7 @@ import java.util.Iterator;
|
||||
public class EventManager
|
||||
{
|
||||
// Single instance
|
||||
private static EventManager _instance = new EventManager ();
|
||||
private static EventManager _instance = null;
|
||||
|
||||
// maps event (EVENT_*) to lists of EventRequests
|
||||
private Hashtable _requests = null;
|
||||
@ -79,8 +79,11 @@ public class EventManager
|
||||
*
|
||||
* @return the event manager
|
||||
*/
|
||||
public static EventManager getDefault ()
|
||||
public static EventManager getDefault()
|
||||
{
|
||||
if (_instance == null)
|
||||
_instance = new EventManager();
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
|
157
libjava/classpath/gnu/classpath/jdwp/event/ExceptionEvent.java
Normal file
157
libjava/classpath/gnu/classpath/jdwp/event/ExceptionEvent.java
Normal file
@ -0,0 +1,157 @@
|
||||
/* ExceptionEvent.java -- an event specifying an exception has been thrown
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.classpath.jdwp.event;
|
||||
|
||||
import gnu.classpath.jdwp.JdwpConstants;
|
||||
import gnu.classpath.jdwp.VMIdManager;
|
||||
import gnu.classpath.jdwp.id.ObjectId;
|
||||
import gnu.classpath.jdwp.id.ThreadId;
|
||||
import gnu.classpath.jdwp.util.Location;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Notification from the VM that an exception has occurred along with where it
|
||||
* occurred, and if and where it was caught.
|
||||
*
|
||||
* @author Kyle Galloway (kgallowa@redhat.com)
|
||||
*/
|
||||
public class ExceptionEvent
|
||||
extends Event
|
||||
{
|
||||
//object instance
|
||||
private Object _instance;
|
||||
|
||||
// the exception thrown
|
||||
private Throwable _exception;
|
||||
|
||||
// the thread in which the exception occurred
|
||||
private Thread _thread;
|
||||
|
||||
// the location where the exception was thrown
|
||||
private Location _location;
|
||||
|
||||
//the location where the exception was caught
|
||||
private Location _catchLocation;
|
||||
|
||||
//the class where the exeption was thrown
|
||||
private Class _klass;
|
||||
|
||||
/**
|
||||
* Constructs a new <code>ExceptionEvent</code> where the exception was
|
||||
* caught.
|
||||
*
|
||||
* @param exception the throwable object that generated the event
|
||||
* @param thread the thread where the exception occurred
|
||||
* @param location the location where the exception was thrown
|
||||
* @param catchLocation the location where the exception was caught
|
||||
* @param instance the instance that threw the exception
|
||||
*/
|
||||
public ExceptionEvent(Throwable exception, Thread thread, Location location,
|
||||
Location catchLocation, Class clazz, Object instance)
|
||||
{
|
||||
super(JdwpConstants.EventKind.EXCEPTION);
|
||||
_exception = exception;
|
||||
_thread = thread;
|
||||
_location = location;
|
||||
_catchLocation = catchLocation;
|
||||
_klass = clazz;
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific filtering parameter for this event. Valid types are
|
||||
* thread, location, and catchLocation.
|
||||
*
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or null
|
||||
*/
|
||||
public Object getParameter(int type)
|
||||
{
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
else if (type == EVENT_LOCATION)
|
||||
return _location;
|
||||
else if (type == EVENT_INSTANCE)
|
||||
return _instance;
|
||||
else if (type == EVENT_CLASS)
|
||||
return _klass;
|
||||
else if (type == EVENT_EXCEPTION_CLASS)
|
||||
return _exception.getClass();
|
||||
else if (type == EVENT_EXCEPTION_CAUGHT)
|
||||
if (_catchLocation.getMethod() != null)
|
||||
return new Boolean(true);
|
||||
else
|
||||
return new Boolean(false);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the catchLocation, used for exceptions that are caught in different
|
||||
* stack frames from where they are thrown.
|
||||
*
|
||||
* @param catchLoc the location of the catch
|
||||
*/
|
||||
public void setCatchLoc(Location catchLoc)
|
||||
{
|
||||
_catchLocation = catchLoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the event to the given stream
|
||||
*
|
||||
* @param outStream the output stream to write the event to
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void _writeData(DataOutputStream outStream)
|
||||
throws IOException
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
ThreadId tid = (ThreadId) idm.getObjectId(_thread);
|
||||
ObjectId oid = idm.getObjectId(_exception);
|
||||
|
||||
tid.write(outStream);
|
||||
_location.write(outStream);
|
||||
oid.writeTagged(outStream);
|
||||
_catchLocation.write(outStream);
|
||||
|
||||
}
|
||||
}
|
118
libjava/classpath/gnu/classpath/jdwp/event/MethodEntryEvent.java
Normal file
118
libjava/classpath/gnu/classpath/jdwp/event/MethodEntryEvent.java
Normal file
@ -0,0 +1,118 @@
|
||||
/* MethodEntryEvent.java -- an event specifying that a method has been invoked
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.classpath.jdwp.event;
|
||||
|
||||
import gnu.classpath.jdwp.JdwpConstants;
|
||||
import gnu.classpath.jdwp.VMIdManager;
|
||||
import gnu.classpath.jdwp.id.ThreadId;
|
||||
import gnu.classpath.jdwp.util.Location;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Notification from the VM that that a method has been invoked
|
||||
*
|
||||
* @author Kyle Galloway (kgallowa@redhat.com)
|
||||
*/
|
||||
public class MethodEntryEvent
|
||||
extends Event
|
||||
{
|
||||
// The thread where the event occurred
|
||||
private Thread _thread;
|
||||
|
||||
// the location where the event occurred
|
||||
private Location _location;
|
||||
|
||||
//object instance
|
||||
private Object _instance;
|
||||
|
||||
/**
|
||||
* Constructs a new <code>MethodEntryEvent</code>
|
||||
*
|
||||
* @param thread the thread where the exception occurred
|
||||
* @param location the location single stepped to
|
||||
* @param instance instance from which the method was called
|
||||
*/
|
||||
public MethodEntryEvent(Thread thread, Location location, Object instance)
|
||||
{
|
||||
super(JdwpConstants.EventKind.METHOD_ENTRY);
|
||||
_thread = thread;
|
||||
_location = location;
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific filtering parameter for this event. Valid types are
|
||||
* thread and location
|
||||
*
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or null
|
||||
*/
|
||||
public Object getParameter(int type)
|
||||
{
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
else if (type == EVENT_LOCATION)
|
||||
return _location;
|
||||
else if (type == EVENT_INSTANCE)
|
||||
return _instance;
|
||||
else if (type == EVENT_CLASS)
|
||||
return _instance.getClass();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the event to the given stream
|
||||
*
|
||||
* @param outStream the output stream to write the event to
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void _writeData(DataOutputStream outStream)
|
||||
throws IOException
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
ThreadId tid = (ThreadId) idm.getObjectId(_thread);
|
||||
|
||||
tid.write(outStream);
|
||||
_location.write(outStream);
|
||||
}
|
||||
|
||||
}
|
115
libjava/classpath/gnu/classpath/jdwp/event/MethodExitEvent.java
Normal file
115
libjava/classpath/gnu/classpath/jdwp/event/MethodExitEvent.java
Normal file
@ -0,0 +1,115 @@
|
||||
/* MethodExitEvent.java -- an event specifying that a method has returned
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.classpath.jdwp.event;
|
||||
|
||||
import gnu.classpath.jdwp.JdwpConstants;
|
||||
import gnu.classpath.jdwp.VMIdManager;
|
||||
import gnu.classpath.jdwp.id.ThreadId;
|
||||
import gnu.classpath.jdwp.util.Location;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Notification from the VM that that a method has returned
|
||||
*
|
||||
* @author Kyle Galloway (kgallowa@redhat.com)
|
||||
*/
|
||||
public class MethodExitEvent
|
||||
extends Event
|
||||
{
|
||||
// The thread where the event occurred
|
||||
private Thread _thread;
|
||||
|
||||
// the location where the event occurred
|
||||
private Location _location;
|
||||
|
||||
// object instance
|
||||
private Object _instance;
|
||||
|
||||
/**
|
||||
* Constructs a new <code>MethodExitEvent</code>
|
||||
*
|
||||
* @param thread the thread where the exception occurred
|
||||
* @param location the location single stepped to
|
||||
* @param instance the instance from which the method was called
|
||||
*/
|
||||
public MethodExitEvent(Thread thread, Location location, Object instance)
|
||||
{
|
||||
super(JdwpConstants.EventKind.METHOD_EXIT);
|
||||
_thread = thread;
|
||||
_location = location;
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific filtering parameter for this event. Valid types are
|
||||
* thread and location
|
||||
*
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or null
|
||||
*/
|
||||
public Object getParameter(int type)
|
||||
{
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
else if (type == EVENT_LOCATION)
|
||||
return _location;
|
||||
else if (type == EVENT_CLASS)
|
||||
return _instance.getClass();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the event to the given stream
|
||||
*
|
||||
* @param outStream the output stream to write the event to
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void _writeData(DataOutputStream outStream)
|
||||
throws IOException
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
ThreadId tid = (ThreadId) idm.getObjectId(_thread);
|
||||
|
||||
tid.write(outStream);
|
||||
_location.write(outStream);
|
||||
}
|
||||
}
|
121
libjava/classpath/gnu/classpath/jdwp/event/SingleStepEvent.java
Normal file
121
libjava/classpath/gnu/classpath/jdwp/event/SingleStepEvent.java
Normal file
@ -0,0 +1,121 @@
|
||||
/* SingleStepEvent.java -- an event specifying that a single step has
|
||||
compleated
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.classpath.jdwp.event;
|
||||
|
||||
import gnu.classpath.jdwp.JdwpConstants;
|
||||
import gnu.classpath.jdwp.VMIdManager;
|
||||
import gnu.classpath.jdwp.id.ThreadId;
|
||||
import gnu.classpath.jdwp.util.Location;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Notification from the VM that a single step has compleated including the
|
||||
* thread and location stepped to
|
||||
*
|
||||
* @author Kyle Galloway (kgallowa@redhat.com)
|
||||
*/
|
||||
public class SingleStepEvent
|
||||
extends Event
|
||||
{
|
||||
// the thread where the event occurred
|
||||
private Thread _thread;
|
||||
|
||||
// the location where the event occurred
|
||||
private Location _location;
|
||||
|
||||
//object instance
|
||||
private Object _instance;
|
||||
|
||||
/**
|
||||
* Constructs a new <code>SingleStepEvent</code>
|
||||
*
|
||||
* @param thread the thread where the exception occurred
|
||||
* @param location the location single stepped to
|
||||
* @param instance the instance in which the single step occurred
|
||||
*/
|
||||
public SingleStepEvent(Thread thread, Location location, Object instance)
|
||||
{
|
||||
super(JdwpConstants.EventKind.SINGLE_STEP);
|
||||
_thread = thread;
|
||||
_location = location;
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific filtering parameter for this event. Valid types are
|
||||
* thread and location
|
||||
*
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or null
|
||||
*/
|
||||
public Object getParameter(int type)
|
||||
{
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
else if (type == EVENT_LOCATION)
|
||||
return _location;
|
||||
else if (type == EVENT_INSTANCE)
|
||||
return _instance;
|
||||
else if (type == EVENT_CLASS)
|
||||
return _instance.getClass();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the event to the given stream
|
||||
*
|
||||
* @param outStream the output stream to write the event to
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void _writeData(DataOutputStream outStream)
|
||||
throws IOException
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
ThreadId tid = (ThreadId) idm.getObjectId(_thread);
|
||||
|
||||
tid.write(outStream);
|
||||
_location.write(outStream);
|
||||
}
|
||||
|
||||
}
|
@ -81,9 +81,9 @@ public class ThreadEndEvent
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or <code>null</code>
|
||||
*/
|
||||
public Object getParameter (Class type)
|
||||
public Object getParameter (int type)
|
||||
{
|
||||
if (type == ThreadId.class)
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
|
||||
return null;
|
||||
|
@ -86,9 +86,9 @@ public class ThreadStartEvent
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or <code>null</code>
|
||||
*/
|
||||
public Object getParameter (Class type)
|
||||
public Object getParameter (int type)
|
||||
{
|
||||
if (type == ThreadId.class)
|
||||
if (type == EVENT_THREAD)
|
||||
return _thread;
|
||||
|
||||
return null;
|
||||
|
@ -67,7 +67,7 @@ public class VmDeathEvent
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or <code>null</code>
|
||||
*/
|
||||
public Object getParameter (Class type)
|
||||
public Object getParameter (int type)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class VmInitEvent
|
||||
* @param type the type of parameter desired
|
||||
* @returns the desired parameter or <code>null</code>
|
||||
*/
|
||||
public Object getParameter (Class type)
|
||||
public Object getParameter (int type)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ package gnu.classpath.jdwp.event.filters;
|
||||
|
||||
import gnu.classpath.jdwp.event.Event;
|
||||
import gnu.classpath.jdwp.exception.InvalidStringException;
|
||||
import gnu.classpath.jdwp.id.ReferenceTypeId;
|
||||
|
||||
/**
|
||||
* An event filter which includes events matching a
|
||||
@ -91,7 +90,7 @@ public class ClassMatchFilter
|
||||
*/
|
||||
public boolean matches (Event event)
|
||||
{
|
||||
Object type = event.getParameter (ReferenceTypeId.class);
|
||||
Object type = event.getParameter (Event.EVENT_CLASS);
|
||||
if (type != null)
|
||||
{
|
||||
Class eventClass = (Class) type;
|
||||
|
@ -87,7 +87,7 @@ public class ClassOnlyFilter
|
||||
*/
|
||||
public boolean matches (Event event)
|
||||
{
|
||||
Object type = event.getParameter (ReferenceTypeId.class);
|
||||
Object type = event.getParameter (Event.EVENT_CLASS);
|
||||
if (type != null)
|
||||
{
|
||||
try
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ExceptionOnlyFilter.java --
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
/* ExceptionOnlyFilter.java -- filter for excetions by caught/uncaught and type
|
||||
Copyright (C) 2005, 2006 Free Software Foundation
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -61,7 +61,7 @@ public class ExceptionOnlyFilter
|
||||
/**
|
||||
* Constructs a new ExceptionOnlyFilter
|
||||
*
|
||||
* @param refId ID of the exception to report
|
||||
* @param refId ID of the exception to report(null for all exceptions)
|
||||
* @param caught Report caught exceptions
|
||||
* @param uncaught Report uncaught exceptions
|
||||
* @throws InvalidClassException if refid is invalid
|
||||
@ -70,8 +70,8 @@ public class ExceptionOnlyFilter
|
||||
boolean uncaught)
|
||||
throws InvalidClassException
|
||||
{
|
||||
if (refId == null || refId.getReference().get () == null)
|
||||
throw new InvalidClassException (refId.getId ());
|
||||
if (refId != null && refId.getReference().get() == null)
|
||||
throw new InvalidClassException(refId.getId());
|
||||
|
||||
_refId = refId;
|
||||
_caught = caught;
|
||||
@ -88,34 +88,36 @@ public class ExceptionOnlyFilter
|
||||
return _refId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report caught exceptions?
|
||||
*
|
||||
* @return whether to report caught exceptions
|
||||
*/
|
||||
public boolean forCaught ()
|
||||
{
|
||||
return _caught;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report uncaught exceptions?
|
||||
*
|
||||
* @return whether to report uncaught exceptions
|
||||
*/
|
||||
public boolean forUncaught ()
|
||||
{
|
||||
return _uncaught;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Does the given event match the filter?
|
||||
*
|
||||
* @param event the <code>Event</code> to scrutinize
|
||||
*
|
||||
* @param event the <code>Event</code> to scrutinize
|
||||
*/
|
||||
public boolean matches (Event event)
|
||||
public boolean matches(Event event)
|
||||
{
|
||||
// FIXME
|
||||
throw new RuntimeException ("ExceptionOnlyFilter.matches not implemented");
|
||||
boolean classMatch = true;
|
||||
|
||||
// if not allowing all exceptions check if the exception matches
|
||||
if (_refId != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class klass
|
||||
= (Class) event.getParameter(Event.EVENT_EXCEPTION_CLASS);
|
||||
classMatch = klass == _refId.getType();
|
||||
}
|
||||
catch (InvalidClassException ex)
|
||||
{
|
||||
classMatch = false;
|
||||
}
|
||||
}
|
||||
|
||||
// check against the caught and uncaught options
|
||||
Boolean caught
|
||||
= (Boolean) event.getParameter(Event.EVENT_EXCEPTION_CAUGHT);
|
||||
|
||||
return classMatch && ((caught.booleanValue()) ? _caught : _uncaught);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class InstanceOnlyFilter
|
||||
*/
|
||||
public boolean matches (Event event)
|
||||
{
|
||||
Object eventInstance = event.getParameter (ObjectId.class);
|
||||
Object eventInstance = event.getParameter (Event.EVENT_INSTANCE);
|
||||
if (eventInstance != null)
|
||||
{
|
||||
Object myInstance = _instance.getReference().get ();
|
||||
|
@ -65,7 +65,7 @@ public class ThreadOnlyFilter
|
||||
public ThreadOnlyFilter (ThreadId tid)
|
||||
throws InvalidThreadException
|
||||
{
|
||||
if (tid.getReference().get () == null)
|
||||
if (tid == null || tid.getReference().get () == null)
|
||||
throw new InvalidThreadException (tid.getId ());
|
||||
|
||||
_tid = tid;
|
||||
@ -88,7 +88,7 @@ public class ThreadOnlyFilter
|
||||
*/
|
||||
public boolean matches (Event event)
|
||||
{
|
||||
Object thread = event.getParameter (ThreadId.class);
|
||||
Object thread = event.getParameter (Event.EVENT_THREAD);
|
||||
if (thread != null)
|
||||
{
|
||||
Thread eventThread = (Thread) thread;
|
||||
|
@ -106,8 +106,12 @@ public class ClassTypeCommandSet
|
||||
Class clazz = refId.getType();
|
||||
Class superClazz = clazz.getSuperclass();
|
||||
|
||||
ReferenceTypeId clazzId = idMan.getReferenceTypeId(superClazz);
|
||||
clazzId.write(os);
|
||||
if (superClazz == null) {
|
||||
os.writeLong(0L);
|
||||
} else {
|
||||
ReferenceTypeId clazzId = idMan.getReferenceTypeId(superClazz);
|
||||
clazzId.write(os);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeSetValues(ByteBuffer bb, DataOutputStream os)
|
||||
|
@ -147,7 +147,7 @@ public class EventRequestCommandSet
|
||||
if (id == 0)
|
||||
refId = null;
|
||||
else
|
||||
refId = idMan.readReferenceTypeId(bb);
|
||||
refId = idMan.getReferenceType(id);
|
||||
boolean caught = (bb.get() == 0) ? false : true;
|
||||
boolean unCaught = (bb.get() == 0) ? false : true;
|
||||
filter = new ExceptionOnlyFilter(refId, caught, unCaught);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* PacketProcessor.java -- a thread which processes command packets
|
||||
from the debugger
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
Copyright (C) 2005, 2006 Free Software Foundation
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -137,6 +137,10 @@ public class PacketProcessor
|
||||
*/
|
||||
public Object run ()
|
||||
{
|
||||
// Notify initialization thread (gnu.classpath.jdwp.Jdwp) that
|
||||
// the PacketProcessor thread is ready.
|
||||
Jdwp.getDefault().subcomponentInitialized ();
|
||||
|
||||
try
|
||||
{
|
||||
while (!_shutdown)
|
||||
@ -144,7 +148,7 @@ public class PacketProcessor
|
||||
_processOnePacket ();
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -103,8 +103,12 @@ public class ThreadGroupReferenceCommandSet
|
||||
ObjectId oid = idMan.readObjectId(bb);
|
||||
ThreadGroup group = (ThreadGroup) oid.getObject();
|
||||
ThreadGroup parent = group.getParent();
|
||||
ObjectId parentId = idMan.getObjectId(parent);
|
||||
parentId.write(os);
|
||||
if (parent == null) {
|
||||
os.writeLong(0L);
|
||||
} else {
|
||||
ObjectId parentId = idMan.getObjectId(parent);
|
||||
parentId.write(os);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeChildren(ByteBuffer bb, DataOutputStream os)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* JdwpConnection.java -- A JDWP-speaking connection
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
Copyright (C) 2005, 2006 Free Software Foundation
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -165,6 +165,10 @@ public class JdwpConnection
|
||||
*/
|
||||
public void run ()
|
||||
{
|
||||
// Notify initialization thread (gnu.classpath.jdwp.Jdwp) that
|
||||
// the JdwpConnection thread is ready.
|
||||
Jdwp.getDefault().subcomponentInitialized ();
|
||||
|
||||
while (!_shutdown)
|
||||
{
|
||||
try
|
||||
|
@ -94,18 +94,40 @@ public class Location
|
||||
* @param os stream to write to
|
||||
* @throws IOException when an error occurs writing to the stream
|
||||
*/
|
||||
public void write(DataOutputStream os)
|
||||
public void write(DataOutputStream os)
|
||||
throws IOException
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
ClassReferenceTypeId crti = (ClassReferenceTypeId)
|
||||
idm.getReferenceTypeId(method.getDeclaringClass());
|
||||
// check if this is an empty location
|
||||
if (method != null)
|
||||
{
|
||||
VMIdManager idm = VMIdManager.getDefault();
|
||||
ClassReferenceTypeId crti =
|
||||
(ClassReferenceTypeId)
|
||||
idm.getReferenceTypeId(method.getDeclaringClass());
|
||||
|
||||
crti.writeTagged(os);
|
||||
method.writeId(os);
|
||||
os.writeLong(index);
|
||||
crti.writeTagged(os);
|
||||
method.writeId(os);
|
||||
os.writeLong(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
os.writeByte(1);
|
||||
os.writeLong((long) 0);
|
||||
os.writeLong((long) 0);
|
||||
os.writeLong((long) 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets up an empty location
|
||||
*
|
||||
* @return new Location (setup as empty)
|
||||
*/
|
||||
public static Location getEmptyLocation()
|
||||
{
|
||||
return new Location(null, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the method of this location
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ClasspathToolkit.java -- Abstract superclass for Classpath toolkits.
|
||||
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -41,7 +41,6 @@ package gnu.java.awt;
|
||||
import gnu.java.awt.EmbeddedWindow;
|
||||
import gnu.java.awt.peer.ClasspathFontPeer;
|
||||
import gnu.java.awt.peer.EmbeddedWindowPeer;
|
||||
import gnu.java.awt.peer.ClasspathTextLayoutPeer;
|
||||
import gnu.java.security.action.SetAccessibleAction;
|
||||
|
||||
import java.awt.AWTException;
|
||||
@ -53,6 +52,7 @@ import java.awt.FontMetrics;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.font.FontRenderContext;
|
||||
import java.awt.image.ColorModel;
|
||||
@ -120,10 +120,6 @@ public abstract class ClasspathToolkit
|
||||
*/
|
||||
public abstract ClasspathFontPeer getClasspathFontPeer (String name, Map attrs);
|
||||
|
||||
public abstract ClasspathTextLayoutPeer
|
||||
getClasspathTextLayoutPeer (AttributedString str, FontRenderContext frc);
|
||||
|
||||
|
||||
/**
|
||||
* Creates a {@link Font}, in a platform-specific manner.
|
||||
*
|
||||
@ -193,6 +189,9 @@ public abstract class ClasspathToolkit
|
||||
*/
|
||||
public abstract Font createFont(int format, InputStream stream);
|
||||
|
||||
/**
|
||||
* Creates a RobotPeer on a given GraphicsDevice.
|
||||
*/
|
||||
public abstract RobotPeer createRobot (GraphicsDevice screen)
|
||||
throws AWTException;
|
||||
|
||||
@ -206,8 +205,24 @@ public abstract class ClasspathToolkit
|
||||
|
||||
/**
|
||||
* Used to register ImageIO SPIs provided by the toolkit.
|
||||
*
|
||||
* Our default implementation does nothing.
|
||||
*/
|
||||
public void registerImageIOSpis(IIORegistry reg)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of mouse buttons.
|
||||
* (used by java.awt.MouseInfo).
|
||||
*
|
||||
* This dummy implementation returns -1 (no mouse).
|
||||
* toolkit implementors should overload this method if possible.
|
||||
* @since 1.5
|
||||
*/
|
||||
public int getMouseNumberOfButtons()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,172 @@
|
||||
/* GtkMouseDragGestureRecognizer.java --
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.java.awt.dnd;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Point;
|
||||
import java.awt.dnd.DnDConstants;
|
||||
import java.awt.dnd.DragGestureListener;
|
||||
import java.awt.dnd.DragSource;
|
||||
import java.awt.dnd.MouseDragGestureRecognizer;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
public class GtkMouseDragGestureRecognizer
|
||||
extends MouseDragGestureRecognizer
|
||||
{
|
||||
|
||||
public GtkMouseDragGestureRecognizer (DragSource ds)
|
||||
{
|
||||
this(ds, null, 0, null);
|
||||
}
|
||||
|
||||
public GtkMouseDragGestureRecognizer (DragSource ds, Component c)
|
||||
{
|
||||
this (ds, c, 0, null);
|
||||
}
|
||||
|
||||
public GtkMouseDragGestureRecognizer (DragSource ds, Component c, int act)
|
||||
{
|
||||
this(ds, c, act, null);
|
||||
}
|
||||
|
||||
public GtkMouseDragGestureRecognizer (DragSource ds, Component c, int act,
|
||||
DragGestureListener dgl)
|
||||
{
|
||||
super(ds, c, act, dgl);
|
||||
}
|
||||
|
||||
public void registerListeners ()
|
||||
{
|
||||
super.registerListeners();
|
||||
}
|
||||
|
||||
public void unregisterListeners ()
|
||||
{
|
||||
super.unregisterListeners();
|
||||
}
|
||||
|
||||
public void mouseClicked (MouseEvent e)
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
public void mousePressed (MouseEvent e)
|
||||
{
|
||||
events.clear();
|
||||
if (getDropActionFromEvent(e) != DnDConstants.ACTION_NONE)
|
||||
appendEvent(e);
|
||||
}
|
||||
|
||||
public void mouseReleased (MouseEvent e)
|
||||
{
|
||||
events.clear();
|
||||
}
|
||||
|
||||
public void mouseEntered (MouseEvent e)
|
||||
{
|
||||
events.clear();
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent e)
|
||||
{
|
||||
if (!events.isEmpty())
|
||||
if (getDropActionFromEvent(e) == DnDConstants.ACTION_NONE)
|
||||
events.clear();
|
||||
}
|
||||
|
||||
public void mouseDragged(MouseEvent e)
|
||||
{
|
||||
if (!events.isEmpty())
|
||||
{
|
||||
int act = getDropActionFromEvent(e);
|
||||
|
||||
if (act == DnDConstants.ACTION_NONE)
|
||||
return;
|
||||
|
||||
Point origin = ((MouseEvent) events.get(0)).getPoint();
|
||||
Point current = e.getPoint();
|
||||
int dx = Math.abs(origin.x - current.x);
|
||||
int dy = Math.abs(origin.y - current.y);
|
||||
int threshold = DragSource.getDragThreshold();
|
||||
|
||||
if (dx > threshold || dy > threshold)
|
||||
fireDragGestureRecognized(act, origin);
|
||||
else
|
||||
appendEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseMoved (MouseEvent e)
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
private int getDropActionFromEvent(MouseEvent e)
|
||||
{
|
||||
int modEx = e.getModifiersEx();
|
||||
int buttons = modEx & (MouseEvent.BUTTON1_DOWN_MASK
|
||||
| MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK);
|
||||
if (!(buttons == MouseEvent.BUTTON1_DOWN_MASK ||
|
||||
buttons == MouseEvent.BUTTON2_DOWN_MASK))
|
||||
return DnDConstants.ACTION_NONE;
|
||||
|
||||
// Convert modifier to a drop action
|
||||
int sourceActions = getSourceActions();
|
||||
int mod = modEx
|
||||
& (MouseEvent.SHIFT_DOWN_MASK | MouseEvent.CTRL_DOWN_MASK);
|
||||
switch (mod)
|
||||
{
|
||||
case MouseEvent.SHIFT_DOWN_MASK | MouseEvent.CTRL_DOWN_MASK:
|
||||
return DnDConstants.ACTION_LINK & sourceActions;
|
||||
case MouseEvent.CTRL_DOWN_MASK:
|
||||
return DnDConstants.ACTION_COPY & sourceActions;
|
||||
case MouseEvent.SHIFT_DOWN_MASK:
|
||||
return DnDConstants.ACTION_MOVE & sourceActions;
|
||||
default:
|
||||
if ((sourceActions & DnDConstants.ACTION_MOVE) != 0)
|
||||
return DnDConstants.ACTION_MOVE & sourceActions;
|
||||
else if ((sourceActions & DnDConstants.ACTION_COPY) != 0)
|
||||
return DnDConstants.ACTION_COPY & sourceActions;
|
||||
else if ((sourceActions & DnDConstants.ACTION_LINK) != 0)
|
||||
return DnDConstants.ACTION_LINK & sourceActions;
|
||||
}
|
||||
|
||||
return DnDConstants.ACTION_NONE & sourceActions;
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
/* GtkDragSourceContextPeer.java --
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.java.awt.dnd.peer.gtk;
|
||||
|
||||
import gnu.java.awt.peer.gtk.GtkGenericPeer;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.dnd.DragGestureEvent;
|
||||
import java.awt.dnd.DragSourceContext;
|
||||
import java.awt.dnd.DragSourceDragEvent;
|
||||
import java.awt.dnd.DragSourceDropEvent;
|
||||
import java.awt.dnd.DragSourceEvent;
|
||||
import java.awt.dnd.InvalidDnDOperationException;
|
||||
import java.awt.dnd.peer.DragSourceContextPeer;
|
||||
import java.awt.peer.ComponentPeer;
|
||||
import java.awt.peer.LightweightPeer;
|
||||
|
||||
public class GtkDragSourceContextPeer
|
||||
extends GtkGenericPeer
|
||||
implements DragSourceContextPeer
|
||||
{
|
||||
private ComponentPeer peer;
|
||||
private Cursor cursor;
|
||||
private DragSourceContext context;
|
||||
|
||||
native void nativeStartDrag(Image i, int x, int y, int action, String target);
|
||||
native void connectSignals(ComponentPeer comp);
|
||||
native void create(ComponentPeer comp);
|
||||
native void nativeSetCursor(int cursor);
|
||||
|
||||
public GtkDragSourceContextPeer(DragGestureEvent e)
|
||||
{
|
||||
super(e.getComponent());
|
||||
Component comp = e.getComponent();
|
||||
peer = getComponentPeer(comp);
|
||||
|
||||
create(peer);
|
||||
connectSignals(peer);
|
||||
cursor = comp.getCursor();
|
||||
}
|
||||
|
||||
ComponentPeer getComponentPeer(Component c)
|
||||
{
|
||||
Component curr = c;
|
||||
while (curr.getPeer() instanceof LightweightPeer)
|
||||
curr = curr.getParent();
|
||||
|
||||
if (curr != null)
|
||||
return curr.getPeer();
|
||||
return null;
|
||||
}
|
||||
|
||||
public void startDrag(DragSourceContext context, Cursor c, Image i, Point p)
|
||||
throws InvalidDnDOperationException
|
||||
{
|
||||
this.context = context;
|
||||
|
||||
if (p == null)
|
||||
p = new Point();
|
||||
|
||||
// FIXME: use proper DataFlavor, not "text/plain".
|
||||
// Also, add check to determine if dragging.
|
||||
|
||||
setCursor(c);
|
||||
nativeStartDrag(i, p.x, p.y, context.getTrigger().getDragAction(),
|
||||
"text/plain");
|
||||
}
|
||||
|
||||
public Cursor getCursor()
|
||||
{
|
||||
return cursor;
|
||||
}
|
||||
|
||||
public void setCursor(Cursor c) throws InvalidDnDOperationException
|
||||
{
|
||||
if (c != null)
|
||||
{
|
||||
nativeSetCursor(c.getType());
|
||||
cursor = c;
|
||||
}
|
||||
}
|
||||
|
||||
public void transferablesFlavorsChanged()
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from native code.
|
||||
*/
|
||||
|
||||
public void dragEnter(int action, int modifiers)
|
||||
{
|
||||
context.dragEnter(new DragSourceDragEvent(context, action,
|
||||
action
|
||||
& context.getSourceActions(),
|
||||
modifiers));
|
||||
}
|
||||
|
||||
public void dragExit(int action, int x, int y)
|
||||
{
|
||||
context.dragExit(new DragSourceEvent(context, x, y));
|
||||
}
|
||||
|
||||
public void dragDropEnd(int action, boolean success, int x, int y)
|
||||
{
|
||||
context.dragDropEnd(new DragSourceDropEvent(context, action, success, x, y));
|
||||
}
|
||||
|
||||
public void dragMouseMoved(int action, int modifiers)
|
||||
{
|
||||
context.dragMouseMoved(new DragSourceDragEvent(context,
|
||||
action,
|
||||
action
|
||||
& context.getSourceActions(),
|
||||
modifiers));
|
||||
}
|
||||
|
||||
public void dragOver(int action, int modifiers)
|
||||
{
|
||||
context.dragOver(new DragSourceDragEvent(context, action,
|
||||
action
|
||||
& context.getSourceActions(),
|
||||
modifiers));
|
||||
}
|
||||
|
||||
public void dragActionChanged(int newAction, int modifiers)
|
||||
{
|
||||
context.dropActionChanged(new DragSourceDragEvent(context,
|
||||
newAction,
|
||||
newAction
|
||||
& context.getSourceActions(),
|
||||
modifiers));
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
/* GtkDropTargetContextPeer.java --
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.java.awt.dnd.peer.gtk;
|
||||
|
||||
import gnu.java.awt.peer.gtk.GtkGenericPeer;
|
||||
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.InvalidDnDOperationException;
|
||||
import java.awt.dnd.peer.DropTargetContextPeer;
|
||||
|
||||
public class GtkDropTargetContextPeer
|
||||
extends GtkGenericPeer
|
||||
implements DropTargetContextPeer
|
||||
{
|
||||
|
||||
public GtkDropTargetContextPeer()
|
||||
{
|
||||
super(null);
|
||||
}
|
||||
|
||||
public void setTargetActions(int actions)
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
public int getTargetActions()
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
return 0;
|
||||
}
|
||||
|
||||
public DropTarget getDropTarget()
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
return null;
|
||||
}
|
||||
|
||||
public DataFlavor[] getTransferDataFlavors()
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
return null;
|
||||
}
|
||||
|
||||
public Transferable getTransferable() throws InvalidDnDOperationException
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isTransferableJVMLocal()
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
return false;
|
||||
}
|
||||
|
||||
public void acceptDrag(int dragAction)
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
public void rejectDrag()
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
public void acceptDrop(int dropAction)
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
public void rejectDrop()
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
public void dropComplete(boolean success)
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
/* GtkDropTargetPeer.java --
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.java.awt.dnd.peer.gtk;
|
||||
|
||||
import gnu.java.awt.peer.gtk.GtkGenericPeer;
|
||||
|
||||
import java.awt.dnd.DropTarget;
|
||||
import java.awt.dnd.peer.DropTargetPeer;
|
||||
|
||||
public class GtkDropTargetPeer
|
||||
extends GtkGenericPeer
|
||||
implements DropTargetPeer
|
||||
{
|
||||
|
||||
public GtkDropTargetPeer()
|
||||
{
|
||||
super(null);
|
||||
}
|
||||
|
||||
public void addDropTarget(DropTarget target)
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
public void removeDropTarget(DropTarget target)
|
||||
{
|
||||
// FIXME: Not Implemented
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -39,6 +39,7 @@ package gnu.java.awt.java2d;
|
||||
|
||||
import java.awt.AWTError;
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.AWTPermission;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Composite;
|
||||
@ -72,6 +73,7 @@ import java.awt.geom.RoundRectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.BufferedImageOp;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.RenderedImage;
|
||||
@ -144,7 +146,7 @@ public abstract class AbstractGraphics2D
|
||||
/**
|
||||
* The transformation for this Graphics2D instance
|
||||
*/
|
||||
private AffineTransform transform;
|
||||
protected AffineTransform transform;
|
||||
|
||||
/**
|
||||
* The foreground.
|
||||
@ -539,6 +541,15 @@ public abstract class AbstractGraphics2D
|
||||
*/
|
||||
public void setComposite(Composite comp)
|
||||
{
|
||||
if (! (comp instanceof AlphaComposite))
|
||||
{
|
||||
// FIXME: this check is only required "if this Graphics2D
|
||||
// context is drawing to a Component on the display screen".
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null)
|
||||
sm.checkPermission(new AWTPermission("readDisplayPixels"));
|
||||
}
|
||||
|
||||
composite = comp;
|
||||
if (! (comp.equals(AlphaComposite.SrcOver)))
|
||||
isOptimized = false;
|
||||
@ -2054,7 +2065,34 @@ public abstract class AbstractGraphics2D
|
||||
*
|
||||
* @return the destination raster
|
||||
*/
|
||||
protected abstract WritableRaster getDestinationRaster();
|
||||
protected WritableRaster getDestinationRaster()
|
||||
{
|
||||
// TODO: Ideally we would fetch the xdrawable's surface pixels for
|
||||
// initialization of the raster.
|
||||
Rectangle db = getDeviceBounds();
|
||||
if (destinationRaster == null)
|
||||
{
|
||||
int[] bandMasks = new int[]{ 0xFF0000, 0xFF00, 0xFF };
|
||||
destinationRaster = Raster.createPackedRaster(DataBuffer.TYPE_INT,
|
||||
db.width, db.height,
|
||||
bandMasks, null);
|
||||
// Initialize raster with white.
|
||||
int x0 = destinationRaster.getMinX();
|
||||
int x1 = destinationRaster.getWidth() + x0;
|
||||
int y0 = destinationRaster.getMinY();
|
||||
int y1 = destinationRaster.getHeight() + y0;
|
||||
int numBands = destinationRaster.getNumBands();
|
||||
for (int y = y0; y < y1; y++)
|
||||
{
|
||||
for (int x = x0; x < x1; x++)
|
||||
{
|
||||
for (int b = 0; b < numBands; b++)
|
||||
destinationRaster.setSample(x, y, b, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
return destinationRaster;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies the backend that the raster has changed in the specified
|
||||
|
@ -39,6 +39,7 @@ exception statement from your version. */
|
||||
package gnu.java.awt.java2d;
|
||||
|
||||
|
||||
import java.awt.geom.CubicCurve2D;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
/**
|
||||
@ -78,34 +79,89 @@ public class CubicSegment extends Segment
|
||||
*/
|
||||
public Object clone()
|
||||
{
|
||||
return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(),
|
||||
cp2.getX(), cp2.getY(), P2.getX(), P2.getY());
|
||||
CubicSegment segment = null;
|
||||
|
||||
try
|
||||
{
|
||||
segment = (CubicSegment) super.clone();
|
||||
|
||||
segment.P1 = (Point2D) P1.clone();
|
||||
segment.P2 = (Point2D) P2.clone();
|
||||
segment.cp1 = (Point2D) cp1.clone();
|
||||
segment.cp2 = (Point2D) cp2.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException cnse)
|
||||
{
|
||||
InternalError ie = new InternalError();
|
||||
ie.initCause(cnse);
|
||||
throw ie;
|
||||
}
|
||||
|
||||
return segment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "top" and "bottom" segments of this segment.
|
||||
* First array element is p0 + normal, second is p0 - normal.
|
||||
* Get the "top" and "bottom" segments of this segment. First array element is
|
||||
* p0 + normal, second is p0 - normal.
|
||||
*/
|
||||
public Segment[] getDisplacedSegments(double radius)
|
||||
{
|
||||
// It is, apparently, impossible to derive a curve parallel to a bezier
|
||||
// curve (unless it's a straight line), so we have no choice but to
|
||||
// approximate the displaced segments. Similar to FlattenPathIterator.
|
||||
|
||||
Segment segmentTop = null;
|
||||
Segment segmentBottom = null;
|
||||
this.radius = radius;
|
||||
double x0 = P1.getX();
|
||||
double y0 = P1.getY();
|
||||
double x1 = cp1.getX();
|
||||
double y1 = cp1.getY();
|
||||
double x2 = cp2.getX();
|
||||
double y2 = cp2.getY();
|
||||
double x3 = P2.getX();
|
||||
double y3 = P2.getY();
|
||||
double[] p1 = normal(x0, y0, x1, y1);
|
||||
double[] p2 = normal(x2, y2, x3, y3);
|
||||
|
||||
|
||||
// FIXME: Doesn't compile.
|
||||
// return new Segment[]{s1, s2};
|
||||
return new Segment[0];
|
||||
CubicCurve2D[] curves = new CubicCurve2D[10];
|
||||
curves[0] = new CubicCurve2D.Double(P1.getX(), P1.getY(), cp1.getX(),
|
||||
cp1.getY(), cp2.getX(), cp2.getY(),
|
||||
P2.getX(), P2.getY());
|
||||
int numCurves = 1;
|
||||
|
||||
// Hard-coded a recursion limit of 10 and flatness of 1... should we make
|
||||
// this an option somewhere?
|
||||
while (numCurves > 0)
|
||||
{
|
||||
// The curve is flat enough, or we've reached our recursion limit,
|
||||
// so take the current start/end points and add it as a line segment
|
||||
// to our final approximated curves
|
||||
if (curves[numCurves - 1].getFlatnessSq() <= (radius / 3) || numCurves == 10)
|
||||
{
|
||||
Segment[] displaced = new LineSegment(
|
||||
curves[numCurves - 1].getP1(),
|
||||
curves[numCurves - 1].getP2()).getDisplacedSegments(radius);
|
||||
if (segmentTop == null)
|
||||
{
|
||||
segmentTop = displaced[0];
|
||||
segmentBottom = displaced[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
segmentTop.add(displaced[0]);
|
||||
segmentBottom.add(displaced[1]);
|
||||
}
|
||||
numCurves--;
|
||||
}
|
||||
|
||||
// Otherwise, subdivide again and continue
|
||||
else
|
||||
{
|
||||
CubicCurve2D left = new CubicCurve2D.Double();
|
||||
CubicCurve2D right = new CubicCurve2D.Double();
|
||||
curves[numCurves - 1].subdivide(left, right);
|
||||
curves[numCurves - 1] = right;
|
||||
curves[numCurves] = left;
|
||||
curves[numCurves - 1] = right;
|
||||
curves[numCurves] = left;
|
||||
numCurves++;
|
||||
}
|
||||
}
|
||||
|
||||
return new Segment[] { segmentTop, segmentBottom };
|
||||
}
|
||||
|
||||
|
||||
public void reverse()
|
||||
{
|
||||
Point2D temp = P1;
|
||||
@ -116,12 +172,12 @@ public class CubicSegment extends Segment
|
||||
cp2 = temp;
|
||||
}
|
||||
|
||||
public double[] first()
|
||||
public double[] cp1()
|
||||
{
|
||||
return new double[]{cp1.getX(), cp1.getY()};
|
||||
}
|
||||
|
||||
public double[] last()
|
||||
public double[] cp2()
|
||||
{
|
||||
return new double[]{cp2.getX(), cp2.getY()};
|
||||
}
|
||||
|
@ -62,7 +62,22 @@ public class LineSegment extends Segment
|
||||
*/
|
||||
public Object clone()
|
||||
{
|
||||
return new LineSegment(P1, P2);
|
||||
LineSegment segment = null;
|
||||
|
||||
try
|
||||
{
|
||||
segment = (LineSegment) super.clone();
|
||||
segment.P1 = (Point2D) P1.clone();
|
||||
segment.P2 = (Point2D) P2.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException cnse)
|
||||
{
|
||||
InternalError ie = new InternalError();
|
||||
ie.initCause(cnse);
|
||||
throw ie;
|
||||
}
|
||||
|
||||
return segment;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,12 +106,12 @@ public class LineSegment extends Segment
|
||||
P2 = p;
|
||||
}
|
||||
|
||||
public double[] first()
|
||||
public double[] cp1()
|
||||
{
|
||||
return new double[]{P2.getX(), P2.getY()};
|
||||
}
|
||||
|
||||
public double[] last()
|
||||
public double[] cp2()
|
||||
{
|
||||
return new double[]{P1.getX(), P1.getY()};
|
||||
}
|
||||
|
@ -88,8 +88,24 @@ public class QuadSegment extends Segment
|
||||
*/
|
||||
public Object clone()
|
||||
{
|
||||
return new QuadSegment(P1.getX(), P1.getY(), cp.getX(), cp.getY(),
|
||||
P2.getX(), P2.getY());
|
||||
QuadSegment segment = null;
|
||||
|
||||
try
|
||||
{
|
||||
segment = (QuadSegment) super.clone();
|
||||
|
||||
segment.P1 = (Point2D) P1.clone();
|
||||
segment.P2 = (Point2D) P2.clone();
|
||||
segment.cp = (Point2D) cp.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException cnse)
|
||||
{
|
||||
InternalError ie = new InternalError();
|
||||
ie.initCause(cnse);
|
||||
throw ie;
|
||||
}
|
||||
|
||||
return segment;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -201,12 +217,12 @@ public class QuadSegment extends Segment
|
||||
P2 = p;
|
||||
}
|
||||
|
||||
public double[] first()
|
||||
public double[] cp1()
|
||||
{
|
||||
return new double[]{cp.getX(), cp.getY()};
|
||||
}
|
||||
|
||||
public double[] last()
|
||||
public double[] cp2()
|
||||
{
|
||||
return new double[]{cp.getX(), cp.getY()};
|
||||
}
|
||||
|
@ -42,24 +42,38 @@ import java.awt.geom.Point2D;
|
||||
|
||||
public abstract class Segment implements Cloneable
|
||||
{
|
||||
// segment type, PathIterator segment types are used.
|
||||
// Start and end points of THIS segment
|
||||
public Point2D P1;
|
||||
public Point2D P2;
|
||||
|
||||
// Segments can be linked together internally as a linked list
|
||||
public Segment first;
|
||||
public Segment next;
|
||||
public Segment last;
|
||||
|
||||
// Half the stroke width
|
||||
protected double radius;
|
||||
|
||||
/**
|
||||
* Create a new, empty segment
|
||||
*/
|
||||
public Segment()
|
||||
{
|
||||
P1 = P2 = null;
|
||||
first = this;
|
||||
next = null;
|
||||
last = this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a segment to the polygon
|
||||
* @param newsegment segment to add
|
||||
*/
|
||||
public void add(Segment newsegment)
|
||||
{
|
||||
newsegment.first = first;
|
||||
last.next = newsegment;
|
||||
last = last.next;
|
||||
last = last.next.last;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,6 +82,7 @@ public abstract class Segment implements Cloneable
|
||||
public void reverseAll()
|
||||
{
|
||||
reverse();
|
||||
first = last;
|
||||
Segment v = next;
|
||||
Segment former = this;
|
||||
next = null;
|
||||
@ -91,7 +106,7 @@ public abstract class Segment implements Cloneable
|
||||
|
||||
/**
|
||||
* Get the normal vector to the slope of the line.
|
||||
* Returns: 0.5*width*(norm of derivative of the (x0,y0)-(x1,y1) vector)
|
||||
* @return vector of length radius, normal to the (x0,y0)-(x1,y1) vector)
|
||||
*/
|
||||
protected double[] normal(double x0, double y0, double x1, double y1)
|
||||
{
|
||||
@ -117,6 +132,9 @@ public abstract class Segment implements Cloneable
|
||||
return new double[]{ dx, dy };
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the current segment
|
||||
*/
|
||||
public abstract void reverse();
|
||||
|
||||
/**
|
||||
@ -125,7 +143,16 @@ public abstract class Segment implements Cloneable
|
||||
*/
|
||||
public abstract Segment[] getDisplacedSegments(double radius);
|
||||
|
||||
public abstract double[] first();
|
||||
public abstract double[] last();
|
||||
/**
|
||||
* Returns the coordinates of the first control point, or the start point
|
||||
* for a line segment.
|
||||
*/
|
||||
public abstract double[] cp1();
|
||||
|
||||
/**
|
||||
* Returns the coordinates of the second control point, or the end point
|
||||
* for a line segment.
|
||||
*/
|
||||
public abstract double[] cp2();
|
||||
|
||||
}
|
||||
|
@ -145,7 +145,8 @@ public abstract class ClasspathFontPeer
|
||||
uname.equals ("SERIF") ||
|
||||
uname.equals ("MONOSPACED") ||
|
||||
uname.equals ("DIALOG") ||
|
||||
uname.equals ("DIALOGINPUT"));
|
||||
uname.equals ("DIALOGINPUT") ||
|
||||
uname.equals ("DEFAULT"));
|
||||
}
|
||||
|
||||
protected static String logicalFontNameToFaceName (String name)
|
||||
@ -161,6 +162,8 @@ public abstract class ClasspathFontPeer
|
||||
return "Helvetica";
|
||||
else if (uname.equals ("DIALOGINPUT"))
|
||||
return "Helvetica";
|
||||
else if (uname.equals ("DEFAULT"))
|
||||
return "Dialog.plain";
|
||||
else
|
||||
return "Helvetica";
|
||||
}
|
||||
@ -233,7 +236,7 @@ public abstract class ClasspathFontPeer
|
||||
family = (String) attribs.get (TextAttribute.FAMILY);
|
||||
|
||||
if (name == null)
|
||||
name = "SansSerif";
|
||||
name = "Default";
|
||||
|
||||
if (attribs.containsKey (TextAttribute.WEIGHT))
|
||||
{
|
||||
|
@ -1,104 +0,0 @@
|
||||
/* ClasspathTextLayoutPeer.java
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
GNU Classpath 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA.
|
||||
|
||||
Linking this library statically or dynamically with other modules is
|
||||
making a combined work based on this library. Thus, the terms and
|
||||
conditions of the GNU General Public License cover the whole
|
||||
combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent
|
||||
modules, and to copy and distribute the resulting executable under
|
||||
terms of your choice, provided that you also meet, for each linked
|
||||
independent module, the terms and conditions of the license of that
|
||||
module. An independent module is a module which is not derived from
|
||||
or based on this library. If you modify this library, you may extend
|
||||
this exception to your version of the library, but you are not
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
|
||||
package gnu.java.awt.peer;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Shape;
|
||||
import java.awt.font.TextHitInfo;
|
||||
import java.awt.font.TextLayout;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
/**
|
||||
* @author Graydon Hoare
|
||||
*/
|
||||
|
||||
public interface ClasspathTextLayoutPeer
|
||||
{
|
||||
TextHitInfo getStrongCaret (TextHitInfo hit1,
|
||||
TextHitInfo hit2);
|
||||
|
||||
void draw (Graphics2D g2, float x, float y);
|
||||
|
||||
byte getBaseline ();
|
||||
|
||||
boolean isLeftToRight ();
|
||||
boolean isVertical ();
|
||||
|
||||
float getAdvance ();
|
||||
float getAscent ();
|
||||
float getDescent ();
|
||||
float getLeading ();
|
||||
|
||||
int getCharacterCount ();
|
||||
byte getCharacterLevel (int index);
|
||||
|
||||
float[] getBaselineOffsets ();
|
||||
Shape getBlackBoxBounds (int firstEndpoint, int secondEndpoint);
|
||||
Rectangle2D getBounds ();
|
||||
|
||||
float[] getCaretInfo (TextHitInfo hit, Rectangle2D bounds);
|
||||
Shape getCaretShape (TextHitInfo hit, Rectangle2D bounds);
|
||||
Shape[] getCaretShapes (int offset, Rectangle2D bounds,
|
||||
TextLayout.CaretPolicy policy);
|
||||
|
||||
Shape getLogicalHighlightShape (int firstEndpoint, int secondEndpoint,
|
||||
Rectangle2D bounds);
|
||||
int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint,
|
||||
TextHitInfo secondEndpoint);
|
||||
|
||||
TextHitInfo getNextLeftHit (int offset, TextLayout.CaretPolicy policy);
|
||||
TextHitInfo getNextRightHit (int offset, TextLayout.CaretPolicy policy);
|
||||
TextHitInfo hitTestChar (float x, float y, Rectangle2D bounds);
|
||||
TextHitInfo getVisualOtherHit (TextHitInfo hit);
|
||||
|
||||
float getVisibleAdvance ();
|
||||
Shape getOutline (AffineTransform tx);
|
||||
Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
|
||||
TextHitInfo secondEndpoint,
|
||||
Rectangle2D bounds);
|
||||
|
||||
TextLayout getJustifiedLayout (float justificationWidth);
|
||||
void handleJustify (float justificationWidth);
|
||||
|
||||
Object clone ();
|
||||
int hashCode ();
|
||||
boolean equals (ClasspathTextLayoutPeer tl);
|
||||
String toString ();
|
||||
}
|
@ -40,10 +40,8 @@ package gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.font.GlyphVector;
|
||||
|
@ -40,6 +40,7 @@ package gnu.java.awt.peer.gtk;
|
||||
|
||||
import gnu.java.awt.ClasspathToolkit;
|
||||
|
||||
import java.awt.AWTPermission;
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
@ -52,11 +53,11 @@ import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.Paint;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Shape;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.TexturePaint;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.font.FontRenderContext;
|
||||
@ -65,8 +66,8 @@ import java.awt.font.TextLayout;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Arc2D;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.Ellipse2D;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.NoninvertibleTransformException;
|
||||
import java.awt.geom.PathIterator;
|
||||
import java.awt.geom.Point2D;
|
||||
@ -322,6 +323,11 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
* Set the current transform matrix
|
||||
*/
|
||||
private native void cairoSetMatrix(long pointer, double[] m);
|
||||
|
||||
/**
|
||||
* Scaling method
|
||||
*/
|
||||
private native void cairoScale(long pointer, double x, double y);
|
||||
|
||||
/**
|
||||
* Set the compositing operator
|
||||
@ -369,6 +375,18 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
*/
|
||||
private native void cairoRectangle(long pointer, double x, double y,
|
||||
double width, double height);
|
||||
|
||||
/**
|
||||
* Appends an arc to the current path
|
||||
*/
|
||||
private native void cairoArc(long pointer, double x, double y,
|
||||
double radius, double angle1, double angle2);
|
||||
|
||||
/**
|
||||
* Save / restore a cairo path
|
||||
*/
|
||||
private native void cairoSave(long pointer);
|
||||
private native void cairoRestore(long pointer);
|
||||
|
||||
/**
|
||||
* New current path
|
||||
@ -427,6 +445,46 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
*/
|
||||
private native void cairoSurfaceSetFilter(long pointer, int filter);
|
||||
|
||||
/**
|
||||
* Draws a line from (x1,y1) to (x2,y2).
|
||||
*
|
||||
* @param pointer the native pointer
|
||||
*
|
||||
* @param x1 the x coordinate of the starting point
|
||||
* @param y1 the y coordinate of the starting point
|
||||
* @param x2 the x coordinate of the end point
|
||||
* @param y2 the y coordinate of the end point
|
||||
*/
|
||||
private native void cairoDrawLine(long pointer, double x1, double y1,
|
||||
double x2, double y2);
|
||||
|
||||
/**
|
||||
* Draws a rectangle at starting point (x,y) and with the specified width
|
||||
* and height.
|
||||
*
|
||||
* @param pointer the native pointer
|
||||
* @param x the x coordinate of the upper left corner
|
||||
* @param y the y coordinate of the upper left corner
|
||||
* @param w the width of the rectangle
|
||||
* @param h the height of the rectangle
|
||||
*/
|
||||
private native void cairoDrawRect(long pointer, double x, double y, double w,
|
||||
double h);
|
||||
|
||||
/**
|
||||
* Fills a rectangle at starting point (x,y) and with the specified width
|
||||
* and height.
|
||||
*
|
||||
* @param pointer the native pointer
|
||||
* @param x the x coordinate of the upper left corner
|
||||
* @param y the y coordinate of the upper left corner
|
||||
* @param w the width of the rectangle
|
||||
* @param h the height of the rectangle
|
||||
*/
|
||||
private native void cairoFillRect(long pointer, double x, double y, double w,
|
||||
double h);
|
||||
|
||||
|
||||
///////////////////////// TRANSFORMS ///////////////////////////////////
|
||||
/**
|
||||
* Set the current transform
|
||||
@ -625,8 +683,8 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
int width = (int) tp.getAnchorRect().getWidth();
|
||||
int height = (int) tp.getAnchorRect().getHeight();
|
||||
|
||||
double scaleX = (width+1) / (double) img.getWidth();
|
||||
double scaleY = (height+1) / (double) img.getHeight();
|
||||
double scaleX = width / (double) img.getWidth();
|
||||
double scaleY = height / (double) img.getHeight();
|
||||
|
||||
AffineTransform at = new AffineTransform(scaleX, 0, 0, scaleY, 0, 0);
|
||||
AffineTransformOp op = new AffineTransformOp(at, getRenderingHints());
|
||||
@ -737,7 +795,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
else
|
||||
{
|
||||
GeneralPath p = new GeneralPath();
|
||||
PathIterator pi = clip.getPathIterator(new AffineTransform());
|
||||
PathIterator pi = clip.getPathIterator(null);
|
||||
p.append(pi, false);
|
||||
return p;
|
||||
}
|
||||
@ -847,6 +905,12 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: this check is only required "if this Graphics2D
|
||||
// context is drawing to a Component on the display screen".
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null)
|
||||
sm.checkPermission(new AWTPermission("readDisplayPixels"));
|
||||
|
||||
// FIXME: implement general Composite support
|
||||
throw new java.lang.UnsupportedOperationException();
|
||||
}
|
||||
@ -857,49 +921,21 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
public void draw(Shape s)
|
||||
{
|
||||
if ((stroke != null && ! (stroke instanceof BasicStroke))
|
||||
|| (comp instanceof AlphaComposite
|
||||
&& ((AlphaComposite) comp).getAlpha() != 1.0))
|
||||
|| (comp instanceof AlphaComposite && ((AlphaComposite) comp).getAlpha() != 1.0))
|
||||
{
|
||||
// FIXME: This is a hack to work around BasicStrokes's current
|
||||
// limitations wrt cubic curves.
|
||||
// See CubicSegment.getDisplacedSegments().
|
||||
if (stroke instanceof BasicStroke)
|
||||
{
|
||||
PathIterator flatten = s.getPathIterator(new AffineTransform(),
|
||||
1.0);
|
||||
GeneralPath p = new GeneralPath();
|
||||
p.append(flatten, false);
|
||||
s = p;
|
||||
}
|
||||
fill(stroke.createStrokedShape(s));
|
||||
return;
|
||||
// Cairo doesn't support stroking with alpha, so we create the stroked
|
||||
// shape and fill with alpha instead
|
||||
fill(stroke.createStrokedShape(s));
|
||||
return;
|
||||
}
|
||||
|
||||
cairoNewPath(nativePointer);
|
||||
|
||||
if (s instanceof Rectangle2D)
|
||||
{
|
||||
Rectangle2D r = (Rectangle2D) s;
|
||||
cairoRectangle(nativePointer, shifted(r.getX(), shiftDrawCalls),
|
||||
shifted(r.getY(), shiftDrawCalls), r.getWidth(),
|
||||
r.getHeight());
|
||||
}
|
||||
else
|
||||
walkPath(s.getPathIterator(null), shiftDrawCalls);
|
||||
createPath(s);
|
||||
cairoStroke(nativePointer);
|
||||
}
|
||||
|
||||
public void fill(Shape s)
|
||||
{
|
||||
cairoNewPath(nativePointer);
|
||||
if (s instanceof Rectangle2D)
|
||||
{
|
||||
Rectangle2D r = (Rectangle2D) s;
|
||||
cairoRectangle(nativePointer, r.getX(), r.getY(), r.getWidth(),
|
||||
r.getHeight());
|
||||
}
|
||||
else
|
||||
walkPath(s.getPathIterator(null), false);
|
||||
createPath(s);
|
||||
|
||||
double alpha = 1.0;
|
||||
if (comp instanceof AlphaComposite)
|
||||
@ -907,6 +943,59 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
cairoFill(nativePointer, alpha);
|
||||
}
|
||||
|
||||
private void createPath(Shape s)
|
||||
{
|
||||
cairoNewPath(nativePointer);
|
||||
|
||||
// Optimize rectangles, since there is a direct Cairo function
|
||||
if (s instanceof Rectangle2D)
|
||||
{
|
||||
Rectangle2D r = (Rectangle2D) s;
|
||||
cairoRectangle(nativePointer, shifted(r.getX(), shiftDrawCalls),
|
||||
shifted(r.getY(), shiftDrawCalls), r.getWidth(),
|
||||
r.getHeight());
|
||||
}
|
||||
|
||||
// We can optimize ellipses too; however we don't bother optimizing arcs:
|
||||
// the iterator is fast enough (an ellipse requires 5 steps using the
|
||||
// iterator, while most arcs are only 2-3)
|
||||
else if (s instanceof Ellipse2D)
|
||||
{
|
||||
Ellipse2D e = (Ellipse2D) s;
|
||||
|
||||
double radius = Math.min(e.getHeight(), e.getWidth()) / 2;
|
||||
|
||||
// Cairo only draws circular shapes, but we can use a stretch to make
|
||||
// them into ellipses
|
||||
double xscale = 1, yscale = 1;
|
||||
if (e.getHeight() != e.getWidth())
|
||||
{
|
||||
cairoSave(nativePointer);
|
||||
|
||||
if (e.getHeight() < e.getWidth())
|
||||
xscale = e.getWidth() / (radius * 2);
|
||||
else
|
||||
yscale = e.getHeight() / (radius * 2);
|
||||
|
||||
if (xscale != 1 || yscale != 1)
|
||||
cairoScale(nativePointer, xscale, yscale);
|
||||
}
|
||||
|
||||
cairoArc(nativePointer,
|
||||
shifted(e.getCenterX() / xscale, shiftDrawCalls),
|
||||
shifted(e.getCenterY() / yscale, shiftDrawCalls), radius, 0,
|
||||
Math.PI * 2);
|
||||
|
||||
if (xscale != 1 || yscale != 1)
|
||||
cairoRestore(nativePointer);
|
||||
}
|
||||
|
||||
// All other shapes are broken down and drawn in steps using the
|
||||
// PathIterator
|
||||
else
|
||||
walkPath(s.getPathIterator(null), shiftDrawCalls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Note that the rest of the drawing methods go via fill() or draw() for the drawing,
|
||||
* although subclasses may with to overload these methods where context-specific
|
||||
@ -940,12 +1029,19 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
|
||||
public void drawLine(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
draw(new Line2D.Double(x1, y1, x2, y2));
|
||||
// The coordinates being pairwise identical means one wants
|
||||
// to draw a single pixel. This is emulated by drawing
|
||||
// a one pixel sized rectangle.
|
||||
if (x1 == x2 && y1 == y2)
|
||||
cairoFillRect(nativePointer, x1, y1, 1, 1);
|
||||
else
|
||||
cairoDrawLine(nativePointer, x1 + 0.5, y1 + 0.5, x2 + 0.5, y2 + 0.5);
|
||||
}
|
||||
|
||||
public void drawRect(int x, int y, int width, int height)
|
||||
{
|
||||
draw(new Rectangle(x, y, width, height));
|
||||
cairoDrawRect(nativePointer, shifted(x, shiftDrawCalls),
|
||||
shifted(y, shiftDrawCalls), width, height);
|
||||
}
|
||||
|
||||
public void fillArc(int x, int y, int width, int height, int startAngle,
|
||||
@ -958,7 +1054,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
|
||||
public void fillRect(int x, int y, int width, int height)
|
||||
{
|
||||
fill(new Rectangle(x, y, width, height));
|
||||
cairoFillRect(nativePointer, x, y, width, height);
|
||||
}
|
||||
|
||||
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
|
||||
@ -1137,6 +1233,9 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
if (img == null)
|
||||
return false;
|
||||
|
||||
if (xform == null)
|
||||
xform = new AffineTransform();
|
||||
|
||||
// In this case, xform is an AffineTransform that transforms bounding
|
||||
// box of the specified image from image space to user space. However
|
||||
// when we pass this transform to cairo, cairo will use this transform
|
||||
@ -1160,6 +1259,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
// Note - this can get us in trouble when the gdk lock is re-acquired.
|
||||
// for example by VolatileImage. See ComponentGraphics for how we work
|
||||
// around this.
|
||||
|
||||
if( !(img instanceof BufferedImage) )
|
||||
{
|
||||
ImageProducer source = img.getSource();
|
||||
@ -1176,6 +1276,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
|
||||
// If this BufferedImage has a BufferedImageGraphics object,
|
||||
// use the cached CairoSurface that BIG is drawing onto
|
||||
|
||||
if( BufferedImageGraphics.bufferedImages.get( b ) != null )
|
||||
db = (DataBuffer)BufferedImageGraphics.bufferedImages.get( b );
|
||||
else
|
||||
@ -1190,6 +1291,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
if(db instanceof CairoSurface)
|
||||
{
|
||||
((CairoSurface)db).drawSurface(nativePointer, i2u, alpha);
|
||||
updateColor();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1206,24 +1308,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
setPaint( oldPaint );
|
||||
}
|
||||
|
||||
int[] pixels;
|
||||
|
||||
// Shortcut for easy color models.
|
||||
if( b.getColorModel().equals(rgb32) )
|
||||
{
|
||||
pixels = ((DataBufferInt)db).getData();
|
||||
for(int i = 0; i < pixels.length; i++)
|
||||
pixels[i] |= 0xFF000000;
|
||||
}
|
||||
else if( b.getColorModel().equals(argb32) )
|
||||
{
|
||||
pixels = ((DataBufferInt)db).getData();
|
||||
}
|
||||
else
|
||||
{
|
||||
pixels = b.getRGB(0, 0, width, height,
|
||||
null, 0, width);
|
||||
}
|
||||
int[] pixels = b.getRGB(0, 0, width, height, null, 0, width);
|
||||
|
||||
drawPixels(nativePointer, pixels, width, height, width, i2u, alpha);
|
||||
|
||||
@ -1249,7 +1334,9 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
|
||||
public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
|
||||
{
|
||||
Image filtered = op.filter(image, null);
|
||||
Image filtered = image;
|
||||
if (op != null)
|
||||
filtered = op.filter(image, null);
|
||||
drawImage(filtered, new AffineTransform(1f, 0f, 0f, 1f, x, y), null, null);
|
||||
}
|
||||
|
||||
@ -1317,7 +1404,7 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
else
|
||||
{ cy = dy2; ch = dy1 - dy2; }
|
||||
|
||||
setClip( cx, cy, cw, ch );
|
||||
clipRect( cx, cy, cw, ch );
|
||||
|
||||
AffineTransform tx = new AffineTransform();
|
||||
tx.translate( dx1 - sx1*scaleX, dy1 - sy1*scaleY );
|
||||
@ -1358,6 +1445,10 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
public void drawGlyphVector(GlyphVector gv, float x, float y)
|
||||
{
|
||||
double alpha = 1.0;
|
||||
|
||||
if( gv.getNumGlyphs() <= 0 )
|
||||
return;
|
||||
|
||||
if (comp instanceof AlphaComposite)
|
||||
alpha = ((AlphaComposite) comp).getAlpha();
|
||||
if (gv instanceof FreetypeGlyphVector && alpha == 1.0)
|
||||
@ -1367,8 +1458,11 @@ public abstract class CairoGraphics2D extends Graphics2D
|
||||
float[] positions = gv.getGlyphPositions (0, n, null);
|
||||
|
||||
setFont (gv.getFont ());
|
||||
cairoDrawGlyphVector(nativePointer, (GdkFontPeer)getFont().getPeer(),
|
||||
x, y, n, codes, positions);
|
||||
synchronized( this.font )
|
||||
{
|
||||
cairoDrawGlyphVector(nativePointer, (GdkFontPeer)getFont().getPeer(),
|
||||
x, y, n, codes, positions);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -38,26 +38,16 @@ exception statement from your version. */
|
||||
|
||||
package gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.net.URL;
|
||||
import gnu.classpath.Pointer;
|
||||
|
||||
/**
|
||||
* CairoSurface - wraps a Cairo surface.
|
||||
@ -79,10 +69,10 @@ public class CairoSurface extends DataBuffer
|
||||
long bufferPointer;
|
||||
|
||||
|
||||
static ColorModel nativeModel = new DirectColorModel(32,
|
||||
0x000000FF,
|
||||
0x0000FF00,
|
||||
static ColorModel nativeModel = new DirectColorModel(32,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
0x000000FF,
|
||||
0xFF000000);
|
||||
|
||||
/**
|
||||
@ -177,28 +167,45 @@ public class CairoSurface extends DataBuffer
|
||||
height = image.height;
|
||||
|
||||
create(width, height, width);
|
||||
|
||||
|
||||
if(surfacePointer == 0 || bufferPointer == 0)
|
||||
throw new Error("Could not allocate bitmap.");
|
||||
|
||||
|
||||
// Copy the pixel data from the GtkImage.
|
||||
int[] data = image.getPixels();
|
||||
|
||||
// Swap ordering from GdkPixbuf to Cairo
|
||||
for(int i = 0; i < data.length; i++ )
|
||||
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN)
|
||||
{
|
||||
int alpha = (data[i] & 0xFF000000) >> 24;
|
||||
if( alpha == 0 ) // I do not know why we need this, but it works.
|
||||
data[i] = 0;
|
||||
else
|
||||
for (int i = 0; i < data.length; i++ )
|
||||
{
|
||||
int r = (((data[i] & 0x00FF0000) >> 16) );
|
||||
int g = (((data[i] & 0x0000FF00) >> 8) );
|
||||
int b = ((data[i] & 0x000000FF) );
|
||||
data[i] = (( alpha << 24 ) & 0xFF000000)
|
||||
| (( b << 16 ) & 0x00FF0000)
|
||||
| (( g << 8 ) & 0x0000FF00)
|
||||
| ( r & 0x000000FF);
|
||||
// On a big endian system we get a RRGGBBAA data array.
|
||||
int alpha = data[i] & 0xFF;
|
||||
if( alpha == 0 ) // I do not know why we need this, but it works.
|
||||
data[i] = 0;
|
||||
else
|
||||
{
|
||||
// Cairo needs a ARGB32 native array.
|
||||
data[i] = (data[i] >>> 8) | (alpha << 24);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < data.length; i++ )
|
||||
{
|
||||
// On a little endian system we get a AABBGGRR data array.
|
||||
int alpha = data[i] & 0xFF000000;
|
||||
if( alpha == 0 ) // I do not know why we need this, but it works.
|
||||
data[i] = 0;
|
||||
else
|
||||
{
|
||||
int b = (data[i] & 0xFF0000) >> 16;
|
||||
int g = (data[i] & 0xFF00);
|
||||
int r = (data[i] & 0xFF) << 16;
|
||||
// Cairo needs a ARGB32 native array.
|
||||
data[i] = alpha | r | g | b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user