diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/examples | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/examples')
25 files changed, 1042 insertions, 289 deletions
diff --git a/libjava/classpath/examples/.cvsignore b/libjava/classpath/examples/.cvsignore new file mode 100644 index 00000000000..d79d635e81a --- /dev/null +++ b/libjava/classpath/examples/.cvsignore @@ -0,0 +1,6 @@ +Makefile +Makefile.in +examples.zip +Makefile.jawt +Makefile.java2d + diff --git a/libjava/classpath/examples/Makefile.am b/libjava/classpath/examples/Makefile.am index 84e3ebe0fc9..6940bdf2599 100644 --- a/libjava/classpath/examples/Makefile.am +++ b/libjava/classpath/examples/Makefile.am @@ -1,23 +1,23 @@ ## Input file for automake to generate the Makefile.in used by configure -GLIBJ_CLASSPATH='$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip' +GLIBJ_CLASSPATH='$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip':'$(top_builddir)/tools/tools.zip' # Setup the compiler to use the GNU Classpath library we just build -if FOUND_GCJ -JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C -else -if FOUND_JIKES -JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):. -else +#if FOUND_GCJ +#JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C +#else +#if FOUND_JIKES +#JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:. +#else if FOUND_GCJX JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):. else if FOUND_ECJ -JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath . +JCOMPILER = $(ECJ) -1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath . else error dunno how to setup the JCOMPILER and compile endif -endif -endif +#endif +#endif endif # All our example java source files @@ -36,11 +36,14 @@ BUILT_SOURCES = $(EXAMPLE_ZIP) # the png icons we use in some of the examples. EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png +# the html pages we use in the swing demo example. +EXAMPLE_HTML = $(srcdir)/gnu/classpath/examples/swing/*.html + # The example specific README files. 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_CH_FILES) $(EXAMPLE_ICONS) $(READMES) +ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(EXAMPLE_HTML) $(READMES) # Some architecture independent data to be installed. example_DATA = $(EXAMPLE_ZIP) README @@ -100,6 +103,8 @@ dist-hook: $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES) mkdir -p classes/gnu/classpath/examples/icons cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons + mkdir -p classes/gnu/classpath/examples/swing + cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing $(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES) (cd classes; \ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(EXAMPLE_ZIP) .; fi; \ diff --git a/libjava/classpath/examples/Makefile.in b/libjava/classpath/examples/Makefile.in index d40f2018d24..6e929df647e 100644 --- a/libjava/classpath/examples/Makefile.in +++ b/libjava/classpath/examples/Makefile.in @@ -43,12 +43,14 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \ $(top_srcdir)/../../config/lead-dot.m4 \ + $(top_srcdir)/../../config/no-executables.m4 \ $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \ $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ax_create_stdint_h.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -168,6 +170,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@ +JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@ +JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ @@ -289,15 +293,20 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -toolexeclibdir = @toolexeclibdir@ vm_classes = @vm_classes@ -GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip' -@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath . -@FOUND_GCJX_TRUE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):. -@FOUND_GCJ_FALSE@@FOUND_JIKES_TRUE@JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):. +GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip':'$(top_builddir)/tools/tools.zip' +@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@JCOMPILER = $(ECJ) -1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath . # Setup the compiler to use the GNU Classpath library we just build -@FOUND_GCJ_TRUE@JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C +#if FOUND_GCJ +#JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C +#else +#if FOUND_JIKES +#JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:. +#else +@FOUND_GCJX_TRUE@JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):. +#endif +#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 @@ -315,11 +324,14 @@ BUILT_SOURCES = $(EXAMPLE_ZIP) # the png icons we use in some of the examples. EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png +# the html pages we use in the swing demo example. +EXAMPLE_HTML = $(srcdir)/gnu/classpath/examples/swing/*.html + # The example specific README files. 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_CH_FILES) $(EXAMPLE_ICONS) $(READMES) +ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(EXAMPLE_HTML) $(READMES) # Some architecture independent data to be installed. example_DATA = $(EXAMPLE_ZIP) README @@ -522,7 +534,7 @@ uninstall-am: uninstall-exampleDATA uninstall-info-am uninstall-local uninstall uninstall-am uninstall-exampleDATA uninstall-info-am \ uninstall-local -@FOUND_ECJ_FALSE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@error dunno how to setup the JCOMPILER and compile +@FOUND_ECJ_FALSE@@FOUND_GCJX_FALSE@error dunno how to setup the JCOMPILER and compile # Make sure all sources and icons are also installed so users can use them. # (Be careful to strip off the srcdir part of the path when installing.) @@ -573,6 +585,8 @@ dist-hook: $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES) mkdir -p classes/gnu/classpath/examples/icons cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons + mkdir -p classes/gnu/classpath/examples/swing + cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing $(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES) (cd classes; \ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(EXAMPLE_ZIP) .; fi; \ diff --git a/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java b/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java index fb5ebdbb5dc..38c4ecb987a 100644 --- a/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java +++ b/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java @@ -39,7 +39,6 @@ exception statement from your version. */ package gnu.classpath.examples.CORBA.NamingService; import gnu.CORBA.IOR; -import gnu.CORBA.NamingService.NamingServiceTransient; import org.omg.CORBA.ORB; import org.omg.CORBA.Object; @@ -97,7 +96,7 @@ public class Demo { public void run() { - NamingServiceTransient.main(args); + gnu.classpath.tools.tnameserv.Main.main(args); } }.start(); diff --git a/libjava/classpath/examples/gnu/classpath/examples/awt/aicas.png b/libjava/classpath/examples/gnu/classpath/examples/awt/aicas.png Binary files differnew file mode 100644 index 00000000000..dcf39654b9f --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/awt/aicas.png diff --git a/libjava/classpath/examples/gnu/classpath/examples/awt/palme.gif b/libjava/classpath/examples/gnu/classpath/examples/awt/palme.gif Binary files differnew file mode 100644 index 00000000000..69479465594 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/awt/palme.gif diff --git a/libjava/classpath/examples/gnu/classpath/examples/icons/back.png b/libjava/classpath/examples/gnu/classpath/examples/icons/back.png Binary files differnew file mode 100644 index 00000000000..d320f26c65f --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/icons/back.png diff --git a/libjava/classpath/examples/gnu/classpath/examples/icons/reload.png b/libjava/classpath/examples/gnu/classpath/examples/icons/reload.png Binary files differnew file mode 100644 index 00000000000..04c57500211 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/icons/reload.png diff --git a/libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.png b/libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.png Binary files differnew file mode 100644 index 00000000000..dcf39654b9f --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.png diff --git a/libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gif b/libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gif Binary files differnew file mode 100644 index 00000000000..69479465594 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gif diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java b/libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java new file mode 100644 index 00000000000..f61275e5766 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java @@ -0,0 +1,57 @@ +/* BrowserEditorKit.java -- A tweaked editor kit for the browser + 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 javax.swing.text.html.HTMLEditorKit; + +/** + * A tweaked editor kit for out browser. + */ +public class BrowserEditorKit + extends HTMLEditorKit +{ + public BrowserEditorKit() + { + super(); + // Turn off automatic form submission so that we can receive notification + // instead and can update out location field. + setAutoFormSubmission(false); + } +} + diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch b/libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch new file mode 100644 index 00000000000..7d041a0b0e7 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launchConfiguration type="org.eclipse.cdt.launch.localCLaunch"> +<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="org.eclipse.cdt.debug.mi.core.CDebugger"/> +<stringAttribute key="org.eclipse.cdt.launch.protocol" value="mi"/> +<booleanAttribute key="org.eclipse.cdt.debug.mi.core.STOP_ON_SOLIB_EVENTS" value="false"/> +<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/> +<listAttribute key="org.eclipse.cdt.debug.mi.core.SOLIB_PATH"/> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<booleanAttribute key="org.eclipse.cdt.launch.ENABLE_REGISTER_BOOKKEEPING" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.mi.core.AUTO_SOLIB" value="true"/> +<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/> +<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="jamvm"/> +<booleanAttribute key="org.eclipse.cdt.launch.ENABLE_VARIABLE_BOOKKEEPING" value="false"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="gdb"/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="src/jamvm"/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel gnu.classpath.examples.swing.Demo"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.GDB_INIT" value=""/> +</launchConfiguration> diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java index 19bc27c1de8..3c7f0b887ef 100644 --- a/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java @@ -28,7 +28,6 @@ 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; @@ -67,7 +66,7 @@ public class Demo return getIcon("/gnu/classpath/examples/icons/big-" + s + ".png", s); } - private static Icon getIcon(String location, String name) + static Icon getIcon(String location, String name) { URL url = Demo.class.getResource(location); if (url == null) System.err.println("WARNING " + location + " not found."); @@ -161,6 +160,8 @@ public class Demo NavigationFilterDemo.createDemoFactory()))); examples.add(new JMenuItem(new PopupAction("JNI Overhead", JNIOverhead.createDemoFactory()))); + examples.add(new JMenuItem(new PopupAction("HTML Demo", + HtmlDemo.createDemoFactory()))); final JMenuItem vmMenu; @@ -294,21 +295,6 @@ public class Demo return bar; } - private static String valign2str(int a) - { - switch (a) - { - case SwingConstants.CENTER: - return "Center"; - case SwingConstants.TOP: - return "Top"; - case SwingConstants.BOTTOM: - return "Bottom"; - default: - return "Unknown"; - } - } - static String halign2str(int a) { switch (a) @@ -354,17 +340,6 @@ public class Demo return mkButton(null, i, -1, -1, -1, -1); } - - private static JScrollPane mkScrollPane(JComponent inner) - { - JScrollPane jsp; - jsp = new JScrollPane(inner, - JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, - JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); - - return jsp; - } - public Demo() { frame = new JFrame("Swing Activity Board"); @@ -376,10 +351,7 @@ public class Demo JPanel main = new JPanel(); main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS)); desktop = createDesktop(); - - // Put the desktop in a scrollpane. The scrollbars may show then - // up when the them or LaF is changed. - main.add(new JScrollPane(desktop)); + main.add(desktop); main.add(mkButtonBar()); component.add(main, BorderLayout.CENTER); frame.pack(); @@ -391,7 +363,7 @@ public class Demo { public void run() { - Demo demo = new Demo(); + new Demo(); } } @@ -407,16 +379,6 @@ public class Demo return b; } - private static JPanel mkPanel(JComponent[] inners) - { - JPanel p = new JPanel(); - for (int i = 0; i < inners.length; ++i) - { - p.add(inners[i]); - } - return p; - } - static JButton mkDisposerButton(final JFrame c) { JButton close = mkBigButton("Close"); @@ -479,52 +441,6 @@ public class Demo } } - /** - * Create the tree. - * - * @return thr scroll pane, containing the tree. - */ - private static JComponent mkTree() - { - DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root node"); - - addChildren("Node", root, 12); - - JTree tree = new JTree(root); - tree.setLargeModel(true); - DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel(); - dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); - tree.setSelectionModel(dtsm); - - // Make it editable. - tree.setEditable(true); - - JComponent t = mkScrollPane(tree); - t.setPreferredSize(new Dimension(200,200)); - return t; - } - - /** - * Add the specified number of children to this parent node. For each - * child, the method is called recursively adding the nChildren-3 number of - * grandchildren. - * - * @param parent the parent node - * @param nChildren the number of children - */ - private static void addChildren(String name, DefaultMutableTreeNode parent, - int nChildren) - { - for (int i = 0; i < nChildren; i++) - { - String child_name = parent+"."+i; - DefaultMutableTreeNode child = new DefaultMutableTreeNode - (child_name); - parent.add(child); - addChildren(child_name, child, nChildren-3); - } - } - private JPanel mkButtonBar() { JPanel panel = new JPanel(new GridLayout(3, 1, 5, 5)); @@ -558,6 +474,8 @@ public class Demo MetalThemeEditor.createDemoFactory()))); panel.add(new JButton(new PopupAction("JNI Overhead", JNIOverhead.createDemoFactory()))); + panel.add(new JButton(new PopupAction("HTML", + HtmlDemo.createDemoFactory()))); JButton exitDisposer = mkDisposerButton(frame); panel.add(exitDisposer); diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java index 223ee07cd4a..1a24ae2760e 100644 --- a/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java @@ -40,20 +40,31 @@ 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 java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.LinkedList; +import javax.swing.BoxLayout; +import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JComponent; +import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JTextArea; +import javax.swing.JTextField; import javax.swing.JTextPane; +import javax.swing.JToolBar; import javax.swing.SwingUtilities; -import javax.swing.text.Element; -import javax.swing.text.html.HTMLDocument; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import javax.swing.text.html.FormSubmitEvent; /** * Parses and displays HTML content. @@ -62,28 +73,54 @@ import javax.swing.text.html.HTMLDocument; */ 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; + private class LoadActionListener + implements ActionListener + { + + public void actionPerformed(ActionEvent event) + { + String urlStr = url.getText(); + try + { + setPage(new URL(url.getText())); + } + catch (MalformedURLException ex) + { + // Do something more useful here. + ex.printStackTrace(); + } + } + } + + /** + * Setting this to true causes the parsed element structure to be dumped. + */ + private static final boolean DEBUG = true; + + /** + * The URL entry field. + */ + JTextField url = new JTextField(); + + JTextPane html = new JTextPane(); int n; + /** + * The browsing history. + * + * Package private to avoid accessor method. + */ + LinkedList history; + public HtmlDemo() { super(); - html.setContentType("text/html"); // not now. + history = new LinkedList(); 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 @@ -93,158 +130,128 @@ public class HtmlDemo extends JPanel 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() + + JEditorPane.registerEditorKitForContentType("text/html", + BrowserEditorKit.class.getName()); + html.setEditable(false); + html.addHyperlinkListener(new HyperlinkListener() + { + + public void hyperlinkUpdate(HyperlinkEvent event) { - public void actionPerformed(ActionEvent event) + if (event instanceof FormSubmitEvent) { - String t = text.getText(); - System.out.println("HtmlDemo.java.createContent:Parsing started"); - html.setText(t); - System.out.println("HtmlDemo.java.createContent:Parsing completed"); + submitForm((FormSubmitEvent) event); } - }); - - buttons.add(parse); - - JButton insertBeforeEnd = new JButton("before end"); - insertBeforeEnd.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent event) + else { - 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) + URL u = event.getURL(); + if (u != null) { - e.printStackTrace(); + setPage(u); } } - }); - - 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() + } + + }); + + JScrollPane scroller = new JScrollPane(html); + JPanel urlPanel = new JPanel(); + urlPanel.setLayout(new BoxLayout(urlPanel, BoxLayout.X_AXIS)); + url.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); + LoadActionListener action = new LoadActionListener(); + url.addActionListener(action); + urlPanel.add(url); + JButton loadButton = new JButton("go"); + urlPanel.add(loadButton); + loadButton.addActionListener(action); + + // Setup control panel. + JToolBar controlPanel = createToolBar(); + JPanel browserPanel = new JPanel(); + browserPanel.setLayout(new BorderLayout()); + browserPanel.add(urlPanel, BorderLayout.NORTH); + browserPanel.add(scroller, BorderLayout.CENTER); + add(controlPanel, BorderLayout.NORTH); + add(browserPanel, BorderLayout.CENTER); + + // Load start page. + try { - 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() + URL startpage = getClass().getResource("welcome.html"); + html.setPage(startpage); + url.setText(startpage.toString()); + history.addLast(startpage); + } + catch (Exception ex) { - 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(); - } - } - }); - + System.err.println("couldn't load page: "/* + startpage*/); + ex.printStackTrace(); + } + setPreferredSize(new Dimension(800, 600)); + } + - JButton setInner = new JButton("inner"); - setInner.addActionListener(new ActionListener() + /** + * Creates the toolbar with the control buttons. + * + * @return the toolbar with the control buttons + */ + JToolBar createToolBar() + { + JToolBar tb = new JToolBar(); + Icon backIcon = Demo.getIcon("/gnu/classpath/examples/icons/back.png", + "back"); + JButton back = new JButton(backIcon); + back.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent ev) { - public void actionPerformed(ActionEvent event) + if (history.size() > 1) { - HTMLDocument doc = (HTMLDocument) html.getDocument(); - Element el = doc.getElement("insertHere"); - System.out.println("Element found:"+el); + URL last = (URL) history.removeLast(); + last = (URL) history.getLast(); + url.setText(last.toString()); try { - doc.setInnerHTML(el,"inner "+(n++)); + html.setPage(last); } - catch (Exception e) + catch (IOException ex) { - e.printStackTrace(); + // Do something more useful. + ex.printStackTrace(); } } - }); - - JButton setOuter = new JButton("outer"); - setOuter.addActionListener(new ActionListener() + } + }); + tb.add(back); + Icon reloadIcon = Demo.getIcon("/gnu/classpath/examples/icons/reload.png", + "reload"); + JButton reload = new JButton(reloadIcon); + reload.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent ev) { - public void actionPerformed(ActionEvent event) + if (history.size() > 0) { - HTMLDocument doc = (HTMLDocument) html.getDocument(); - Element el = doc.getElement("insertHere"); - System.out.println("Element found:"+el); + URL last = (URL) history.getLast(); + url.setText(last.toString()); try { - doc.setOuterHTML(el,"outer "+(n++)); + html.setPage(last); } - catch (Exception e) + catch (IOException ex) { - e.printStackTrace(); + // Do something more useful. + ex.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); + } + }); + tb.add(reload); + return tb; } - + /** * The executable method to display the editable table. * @@ -259,27 +266,102 @@ public class HtmlDemo extends JPanel 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.setSize(new Dimension(750, 480)); frame.setVisible(true); } }); } /** + * Helper method to navigate to a new URL. + * + * @param u the new URL to navigate to + */ + void setPage(URL u) + { + try + { + url.setText(u.toString()); + html.setPage(u); + history.addLast(u); + } + catch (IOException ex) + { + // Do something more useful here. + ex.printStackTrace(); + } + } + + /** + * Submits a form when a FormSubmitEvent is received. The HTML API + * provides automatic form submit but when this is enabled we don't + * receive any notification and can't update our location field. + * + * @param ev the form submit event + */ + void submitForm(FormSubmitEvent ev) + { + URL url = ev.getURL(); + String data = ev.getData(); + FormSubmitEvent.MethodType method = ev.getMethod(); + if (method == FormSubmitEvent.MethodType.POST) + { + try + { + URLConnection conn = url.openConnection(); + postData(conn, data); + } + catch (IOException ex) + { + // Deal with this. + ex.printStackTrace(); + } + } + else + { + try + { + url = new URL(url.toString() + "?" + data); + } + catch (MalformedURLException ex) + { + ex.printStackTrace(); + } + } + setPage(url); + } + + /** + * Posts the form data for forms with HTTP POST method. + * + * @param conn the connection + * @param data the form data + */ + private void postData(URLConnection conn, String data) + { + conn.setDoOutput(true); + PrintWriter out = null; + try + { + out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream())); + out.print(data); + out.flush(); + } + catch (IOException ex) + { + // Deal with this! + ex.printStackTrace(); + } + finally + { + if (out != null) + out.close(); + } + } + + /** * Returns a DemoFactory that creates a HtmlDemo. * * @return a DemoFactory that creates a HtmlDemo diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java index 527fe455e4b..bd0e6bf15b6 100644 --- a/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java @@ -39,15 +39,24 @@ exception statement from your version. */ package gnu.classpath.examples.swing; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuItem; import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; import javax.swing.JTabbedPane; +import javax.swing.JTextArea; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; @@ -55,6 +64,10 @@ public class TabbedPaneDemo extends JPanel implements ActionListener { + static Color[] colors = { Color.BLUE, Color.CYAN, Color.GRAY, Color.GREEN, + Color.MAGENTA, Color.ORANGE, Color.PINK, + Color.ORANGE, Color.RED, Color.BLUE, Color.YELLOW + }; TabbedPaneDemo() { super(); @@ -64,25 +77,123 @@ public class TabbedPaneDemo private void createContent() { JPanel p = new JPanel(); - p.setLayout(new GridLayout(2, 2)); - JTabbedPane tabs1 = new JTabbedPane(SwingConstants.TOP); - 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("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("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("Content: Right Item 1")); - tabs4.add("Right Item 2", new JButton("Content: Right Item 2")); - p.add(tabs1); - p.add(tabs2); - p.add(tabs3); - p.add(tabs4); + p.setLayout(new GridLayout(1, 1)); + + int COUNT = 25; + JTabbedPane tp = createTabbedPane(SwingConstants.TOP, "tab", COUNT); + p.add(tp); + + final JPopupMenu popup = new JPopupMenu(); + + JMenu menu = new JMenu("tab placement"); + menu.add(createPlacementChangingMenuItem("top", + SwingConstants.TOP, + tp)); + + menu.add(createPlacementChangingMenuItem("bottom", + SwingConstants.BOTTOM, + tp)); + + menu.add(createPlacementChangingMenuItem("left", + SwingConstants.LEFT, + tp)); + + menu.add(createPlacementChangingMenuItem("right", + SwingConstants.RIGHT, + tp)); + popup.add(menu); + + menu = new JMenu("tab layout"); + menu.add(createLayoutPolicyChangingMenuItem("wrapping tabs", + JTabbedPane.WRAP_TAB_LAYOUT, + tp)); + + menu.add(createLayoutPolicyChangingMenuItem("scrolling tabs", + JTabbedPane.SCROLL_TAB_LAYOUT, + tp)); + popup.add(menu); + + tp.addMouseListener(new MouseAdapter() + { + public void mousePressed(MouseEvent e) { + showPopup(e); + } + + public void mouseReleased(MouseEvent e) { + showPopup(e); + } + + void showPopup(MouseEvent e) { + if (e.isPopupTrigger()) { + popup.show(e.getComponent(), e.getX(), e.getY()); + } + } + }); + setLayout(new BorderLayout()); add(p, BorderLayout.CENTER); + + } + + private JMenuItem createPlacementChangingMenuItem(String t, + final int v, + final JTabbedPane dst) + { + JMenuItem item = new JMenuItem(t); + + item.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent ae) + { + dst.setTabPlacement(v); + } + }); + + return item; + } + + private JMenuItem createLayoutPolicyChangingMenuItem(String t, + final int v, + final JTabbedPane dst) + { + JMenuItem item = new JMenuItem(t); + + item.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent ae) + { + dst.setTabLayoutPolicy(v); + } + }); + + return item; + } + + private JTabbedPane createTabbedPane(int direction, String name, int count) + { + JTabbedPane pane = new JTabbedPane(direction); + + for(int i = 0; i< count; i++) + { + pane.addTab(name + " " + i, createTabContent(name + " " + i)); + if (Math.random() >= 0.75) + pane.setEnabledAt(i, false); + } + + return pane; + } + + private JPanel createTabContent(String name) + { + JTextArea ta; + JPanel panel = new JPanel(); + panel.add(new JLabel(name)); + panel.add(new JButton(name)); + panel.add(new JScrollPane(ta = new JTextArea(5, 5))); + + ta.setBackground(colors[(int) (Math.random() * colors.length)]); + + return panel; } public void actionPerformed(ActionEvent e) diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java index 32f765f73bb..8da37507152 100644 --- a/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java @@ -39,17 +39,17 @@ exception statement from your version. */ package gnu.classpath.examples.swing; import java.awt.BorderLayout; -import java.awt.JobAttributes.DefaultSelectionType; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.DebugGraphics; +import javax.swing.ButtonGroup; 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.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.SwingUtilities; @@ -59,7 +59,6 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.TreePath; -import javax.swing.tree.TreeSelectionModel; public class TreeDemo extends JPanel @@ -222,11 +221,39 @@ public class TreeDemo p2.add(add); p2.add(cbSingle); p2.add(cbRoot); - + tree.getSelectionModel(). setSelectionMode(DefaultTreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); + // Panel for selecting line style. + ActionListener l = new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + JRadioButton b = (JRadioButton) e.getSource(); + tree.putClientProperty("JTree.lineStyle", b.getText()); + tree.repaint(); + } + }; + JPanel lineStylePanel = new JPanel(); + ButtonGroup buttons = new ButtonGroup(); + lineStylePanel.add(new JLabel("Line style: ")); + JRadioButton none = new JRadioButton("None"); + lineStylePanel.add(none); + buttons.add(none); + none.addActionListener(l); + JRadioButton angled = new JRadioButton("Angled"); + lineStylePanel.add(angled); + buttons.add(angled); + angled.addActionListener(l); + JRadioButton horizontal = new JRadioButton("Horizontal"); + lineStylePanel.add(horizontal); + buttons.add(horizontal); + horizontal.addActionListener(l); + p2.add(lineStylePanel); + add(p2, BorderLayout.NORTH); + add(new JScrollPane(tree), BorderLayout.CENTER); add(choice, BorderLayout.SOUTH); } diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/forms.html b/libjava/classpath/examples/gnu/classpath/examples/swing/forms.html new file mode 100644 index 00000000000..010a94c9360 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/forms.html @@ -0,0 +1,98 @@ +<!-- welcome.html -- Some HTML stuff to show Swing HTML + 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. --> + +<html> + + <head> + <title>HTML text styles</title> + </head> + <body> + <form> + <a href="welcome.html">Back to start page</a> + <h1>Some form elements</h1> + <h2>Textarea</h2> + <textarea cols="30" rows="5"> + Hello GNU Classpath world. This text should show up in a text area + that has a size of 30 columns and 5 rows + </textarea> + + <h2>Input fields</h2> + <p> + <input type="text" value="This is a normal textfield"> + <input type="password" value="secret password"> + </p> + + <h2>Buttons</h2> + <p> + <input type="submit"></input> + <input type="reset"></input> + <input type="button" value="Some button"></input> + </p> + + <h2>Checkboxes and Radiobuttons</h2> + <p> + <input type="checkbox" name="2">Check this!</input> + <input type="checkbox" name="2">Or this</input> + </p> + <p> + <input type="radio" name="1">A radio button</input> + <input type="radio" name="1">Another radio</input> + </p> + <h2>Select lists and combo boxes</h2> + <p> + <select> + <option>Value1</option> + <option>Value2</option> + <option>Value3</option> + <option label="Labeled value 4">Value4</option> + <option>Value5</option> + <option>Value6</option> + </select> + </p> + <p> + <select size="3"> + <option>Value1</option> + <option>Value2</option> + <option>Value3</option> + <option label="Labeled value 4">Value4</option> + <option>Value5</option> + <option>Value6</option> + </select> + </p> + </form> + </body> +</html>
\ No newline at end of file diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html new file mode 100644 index 00000000000..b9150592fa7 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html @@ -0,0 +1,41 @@ +<!-- frame1.html -- Some HTML stuff to show Swing HTML + 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. --> +<html> +<body> +<h1>Top Left Frame</h1> +</body> +</html> diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html new file mode 100644 index 00000000000..9dbf33c5a0b --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html @@ -0,0 +1,42 @@ +<!-- frame2.html -- Some HTML stuff to show Swing HTML + 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. --> +<html> +<body> +<h1>Top Right + Frame</h1> +</body> +</html> diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html new file mode 100644 index 00000000000..e677bd6a100 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html @@ -0,0 +1,42 @@ +<!-- frame3.html -- Some HTML stuff to show Swing HTML + 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. --> +<html> +<body> +<h1>Bottom Left Frame</h1> +</body> +</html> + diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html new file mode 100644 index 00000000000..1da53b1017b --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html @@ -0,0 +1,41 @@ +<!-- frame4.html -- Some HTML stuff to show Swing HTML + 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. --> +<html> +<body> +<h1>Bottom Left Frame</h1> +</body> +</html> diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frames.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frames.html new file mode 100644 index 00000000000..e7e2bf87c95 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frames.html @@ -0,0 +1,44 @@ +<!-- frames.html -- Some HTML stuff to show Swing HTML + 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. --> +<html> +<frameset cols="40%,60%" rows="20%,80%"> + <frame src="frame1.html"> + <frame src="frame2.html"> + <frame src="frame3.html"> + <frame src="frame4.html"> +</frameset> +</html>
\ No newline at end of file diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/tables.html b/libjava/classpath/examples/gnu/classpath/examples/swing/tables.html new file mode 100644 index 00000000000..af908e1ab23 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/tables.html @@ -0,0 +1,66 @@ +<!-- tables.html -- Some HTML stuff to show Swing HTML + 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. --> + +<html> + +<head> + <title>HTML text styles</title> + </head> + <body> +<h1>Table examples</h1> +<h2>Table with grid and mixed rowspan/colspan</h2> + <table border="1"> + <tr> + <td width="30%" colspan="2">Spans two columns</td> + <td rowspan="3">Spans three rows</td> + </tr> + <tr> + <td rowspan="2">Spans two rows</td> + <td>This is the center</td> + </tr> + <tr> + <td>This should be in the middle of row number 3</td> + </tr> + <tr> + <td>A small one cell box</td> + <td colspan="2" rowspan="2">Spans two x two cells</td> + </tr> + <tr> + <td>Another small one cell box</td> + </tr> + </table> +</body></html> diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html b/libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html new file mode 100644 index 00000000000..786e18b77b8 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html @@ -0,0 +1,78 @@ +<!-- welcome.html -- Some HTML stuff to show Swing HTML + 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. --> + +<html> + + <head> + <title>HTML text styles</title> + </head> + <body> + <a href="welcome.html">Back to start page</a> + <h1>Colors</h1> + <p>The following are the 16 named colors in HTML. Of course you can also + use all RGB colors by specifying a value in the <code>#RRGGBB</code> + notation.</p> + <p> + <font color="black">Black</font>, <font color="gray">Gray</font>, + <font color="maroon">Maroon</font>, <font color="red">Red</font>, + <font color="green">Green</font>, <font color="lime">Lime</font>, + <font color="olive">Olive</font>, <font color="yellow">Yellow</font>, + <font color="navy">Navy</font>, <font color="blue">Blue</font>, + <font color="purple">Purple</font>, <font color="fuchsia">Fuchsia</font>, + <font color="teal">Teal</font>, <font color="aque">Aqua</font>, + <font color="silver">Silver</font>, <font color="white">White</font></p> + <h1>Font styles</h1> + <p>The following lists the logical and physical font styles that can be set + by certain HTML tags</p> + <p> + <!--<abbr>Abbreviation</abbr>, <acronym>Acronym</acronym>,--> + <address>Address</address>, <b>Bold</b>, <big>Big</big>, + <cite>Citation</cite>, <code>Code</code>, <del>Deleted</del>, + <em>Emphasized<em>, <i>Italic</i>, <ins>Inserted</ins>, <q>Quote</q>, + <s>Stroke-Through</s>, <samp>Example</samp>, <small>Small</small>, + <strike>Strike</strike>, <strong>Strong</strong>, <sub>Subscript</sub>, + <sup>Superscript</sup>, <u>Underlined</u>, <var>Variable</var> + </p> + <h1>Header Level 1</h1> + <h2>Header Level 2</h2> + <h3>Header Level 3</h3> + <h4>Header Level 4</h4> + <h5>Header Level 5</h5> + <h6>Header Level 6</h6> + <center>Some centered Text</center> + </body> +</html>
\ No newline at end of file diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html b/libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html new file mode 100644 index 00000000000..8bc987494c1 --- /dev/null +++ b/libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html @@ -0,0 +1,63 @@ +<!-- welcome.html -- Some HTML stuff to show Swing HTML + 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. --> + +<html> + <head> + <title>GNU Classpath HTML Browser</title> + </head> + <body> + <img src="../icons/badge.png" width="100" height="100"> + <h1>Welcome to GNU Classpath</h1> + <h2>A couple of websites that you might want to try out</h2> + <ul> + <li><a href="http://www.gnu.org/software/classpath/">GNU Classpath homepage</a></li> + <li><a href="http://planet.classpath.org">Planet Classpath</a></li> + <li><a href="http://developer.classpath.org">GNU Classpath developer pages</a></li> + <li><a href="http://www.google.com">Google</a></li> + </ul> + + <h2>Testpages</h2> + <p>These few pages are here to demonstrate and test the HTML rendering + capabilities of GNU Classpath's Swing.</p> + <ul> + <li><a href="textstyles.html">Text styles</li> + <li><a href="forms.html">Form elements</li> + <li><a href="tables.html">Tables</li> + <li><a href="frames.html">Frames</li> + </ul> + </body> +</html>
\ No newline at end of file |