Commit ac1ed908 by Mark Wielaard

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
parent abab4604

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

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* .
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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
......@@ -165,6 +175,25 @@ 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
------------------------------------------------------------------
Compilation is accomplished using a compiler's @file syntax. For our
......
......@@ -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 \
......
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
......
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)
......
......@@ -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
......
#! /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
......
#! /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
......
......@@ -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@
......
......@@ -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 \
......
# @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
);
}
......
......@@ -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
{
......
/* 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;
}
};
}
}
/* 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
/* 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());
}
}
}
/* 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"));
}
}
/* 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");
}
}
}
/* 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");
}
}
}
/* 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"));
}
}
/* 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"));
}
}
}
/* 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"));
}
}
}
/* 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());
}
}
/* 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());
}
}
/* 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;
}
}
}
/* 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;
}
/**
......@@ -144,6 +160,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.
*/
JTable table = new JTable();
......@@ -159,6 +246,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.
*/
public TableDemo()
......@@ -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
};
}
}
......@@ -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@
......
......@@ -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@
......
......@@ -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@
......
......@@ -62,11 +62,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)
{
......
/* 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;
}
}
/* 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();
}
}
/* 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;
}
}
/* 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;
......
/* 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
......
/* 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;
}
......
/* 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);
}
}
/* 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);
}
}
/* 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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment