├── .DS_Store ├── .gitignore ├── build.sh ├── build.xml ├── build └── .DS_Store ├── lib ├── .DS_Store ├── .gitignore ├── ant-launcher.jar ├── ant.jar ├── j2h.jar ├── jcalendar-1.4.jar ├── jgoodies-forms-1.8.0.jar ├── junit-4.12.jar ├── quaqua.jar ├── substance-7.2.1.jar ├── trident-7.2.1.jar └── ui.jar ├── license.txt ├── readme.txt ├── samples ├── .gitignore ├── Accelerator.java ├── Actions.java ├── Cards.java ├── ClientAttr.java ├── ComboModel.java ├── CustomTags.java ├── ExitAction.java ├── Form.java ├── FormLayout.java ├── GridBag.java ├── HelloList.java ├── HelloMac.java ├── HelloWorld.java ├── HelloWorldnoAction.java ├── InitClass.java ├── Layout.java ├── Localization.java ├── MacAboutAction.java ├── MacExitAction.java ├── MacHelpAction.java ├── MacMultipleAction.java ├── MacTest.java ├── MenuBarWithConstraints.java ├── Model.java ├── NewTag.java ├── RedLabel.java ├── SwixApplet.java ├── TimeZoneConverter.java ├── XInclude.java ├── XPanel.java ├── icons │ ├── .gitignore │ ├── about.gif │ ├── button.gif │ ├── copy.gif │ ├── cut.gif │ ├── del.gif │ ├── delete.gif │ ├── exit.gif │ ├── green.gif │ ├── help.gif │ ├── label.gif │ ├── new.gif │ ├── open.gif │ ├── panel.gif │ ├── paste.gif │ └── save.gif ├── img │ ├── .gitignore │ ├── accelerator.png │ ├── actions.png │ ├── applet.png │ ├── cards.png │ ├── customtags.png │ ├── form.png │ ├── gridbag.png │ ├── hellolist.png │ ├── hellomac.png │ ├── helloworld.png │ ├── initclass.gif │ ├── initclass.png │ ├── layout.png │ ├── localization.png │ ├── newtag.png │ └── xinclude.png ├── index.html ├── locale │ ├── .gitignore │ ├── swix_de.properties │ ├── swix_en.properties │ └── swix_en_mac.properties └── xml │ ├── .gitignore │ ├── accelerator.xml │ ├── actions.xml │ ├── applet.xml │ ├── cards.xml │ ├── clientattr.xml │ ├── customtags.xml │ ├── form.xml │ ├── formlayout.xml │ ├── fragments.xml │ ├── funlayout.xml │ ├── gridbag.xml │ ├── hellolist.xml │ ├── hellomac.xml │ ├── helloworld.xml │ ├── initclass.xml │ ├── localization.xml │ ├── mactester.xml │ ├── menu-bar.xml │ ├── newtag.xml │ ├── popup.xml │ └── xinclude.xml ├── src ├── .gitignore └── org │ ├── .gitignore │ └── swixml │ ├── .gitignore │ ├── Attribute.java │ ├── Converter.java │ ├── ConverterLibrary.java │ ├── DefaultFactory.java │ ├── Factory.java │ ├── LayoutConverter.java │ ├── LayoutConverterLibrary.java │ ├── Localizer.java │ ├── MacApp.java │ ├── Parser.java │ ├── SchemaGenerator.java │ ├── SwingEngine.java │ ├── SwingTagLibrary.java │ ├── TagLibrary.java │ ├── XAction.java │ ├── XDialog.java │ ├── XGlue.java │ ├── XGridBagConstraints.java │ ├── XHBox.java │ ├── XScrollPane.java │ ├── XSplitPane.java │ ├── XTabbedPane.java │ ├── XTitledSeparator.java │ ├── XVBox.java │ ├── converters │ ├── .gitignore │ ├── ActionConverter.java │ ├── BorderConverter.java │ ├── ColorConverter.java │ ├── ComponentConverter.java │ ├── DimensionConverter.java │ ├── FontConverter.java │ ├── ImageConverter.java │ ├── ImageIconConverter.java │ ├── InputEvent.java │ ├── InsetsConverter.java │ ├── KeyEvent.java │ ├── KeyStrokeConverter.java │ ├── LocaleConverter.java │ ├── PointConverter.java │ ├── PrimitiveConverter.java │ ├── RectangleConverter.java │ ├── StringConverter.java │ └── Util.java │ ├── doc-files │ ├── .gitignore │ └── swixml_1_0.png │ └── layoutconverters │ ├── .gitignore │ ├── BorderLayoutConverter.java │ ├── CardLayoutConverter.java │ ├── FlowLayoutConverter.java │ ├── FormLayoutConverter.java │ ├── GridBagLayoutConverter.java │ └── GridLayoutConverter.java ├── tagdocs ├── .DS_Store ├── customattr.html ├── doclet │ └── Documenter.java ├── img │ ├── apple.gif │ ├── bannerbackground.gif │ ├── swixml.gif │ └── swixmlbig.gif ├── index.html ├── swixcontent.html ├── swixheader.html └── swixml.css ├── tests ├── .DS_Store ├── .gitignore ├── locale │ ├── .gitignore │ └── swix_test.properties ├── org │ ├── .gitignore │ └── swixml │ │ ├── .gitignore │ │ ├── ActionGeneratorTest.java │ │ ├── ButtonGroupTest.java │ │ ├── ConverterTest.java │ │ ├── ExtMappingTest.java │ │ ├── GlobalActions.java │ │ ├── IdTest.java │ │ ├── IncludeTest.java │ │ ├── LayoutTest.java │ │ ├── LocalizationTest.java │ │ ├── MappingTest.java │ │ ├── MenuTest.java │ │ ├── ParserTest.java │ │ └── converters │ │ ├── .gitignore │ │ └── PrimitiveConverterTest.java └── xml │ ├── .gitignore │ ├── action.xml │ ├── converter.xml │ ├── dialog.xml │ ├── id.xml │ ├── include-part.xml │ ├── include.xml │ ├── layout.xml │ ├── local.xml │ ├── mappings.xml │ └── parsethis.xml └── www ├── .gitignore ├── alm-process ├── .gitignore └── snippets │ ├── .gitignore │ ├── HtmlSnippet1.html │ └── page.xml └── index.html /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo 4 | echo "SWIXML Two Build System" 5 | echo "-------------------" 6 | echo 7 | 8 | if [ -z "$JAVA_HOME" ] ; then 9 | echo 'ERROR: JAVA_HOME not found in your environment.' 10 | echo 11 | echo 'Please, set the JAVA_HOME variable in your environment to match the' 12 | echo 'location of the Java Virtual Machine you want to use.' 13 | exit 1 14 | fi 15 | 16 | if [ `uname | grep -n CYGWIN` ] ; then 17 | PS=";" 18 | elif [ `uname | grep -n Windows` ] ; then 19 | PS=";" 20 | else 21 | PS=":" 22 | fi 23 | 24 | LOCALCLASSPATH=${JAVA_HOME}/lib/tools.jar${PS}${JAVA_HOME}/lib/dev.jar${PS}./lib/ant.jar${PS}./lib/ant-launcher.jar${PS}./lib/j2h.jar${PS}./lib/ui.jar 25 | ANT_HOME=./lib 26 | 27 | echo Starting Ant... 28 | echo 29 | echo $LOCALCLASSPATH 30 | 31 | 32 | $JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH org.apache.tools.ant.Main $* 33 | -------------------------------------------------------------------------------- /build/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/build/.DS_Store -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/.DS_Store -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /**.DS_Store 2 | -------------------------------------------------------------------------------- /lib/ant-launcher.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/ant-launcher.jar -------------------------------------------------------------------------------- /lib/ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/ant.jar -------------------------------------------------------------------------------- /lib/j2h.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/j2h.jar -------------------------------------------------------------------------------- /lib/jcalendar-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/jcalendar-1.4.jar -------------------------------------------------------------------------------- /lib/jgoodies-forms-1.8.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/jgoodies-forms-1.8.0.jar -------------------------------------------------------------------------------- /lib/junit-4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/junit-4.12.jar -------------------------------------------------------------------------------- /lib/quaqua.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/quaqua.jar -------------------------------------------------------------------------------- /lib/substance-7.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/substance-7.2.1.jar -------------------------------------------------------------------------------- /lib/trident-7.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/trident-7.2.1.jar -------------------------------------------------------------------------------- /lib/ui.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/lib/ui.jar -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | $Id: readme.txt,v 1.3 2015/01/01, 05:05:06 wolfpaulus Exp $ 2 | 3 | Introduction 4 | ============ 5 | 6 | See the web site http://www.swixml.org 7 | 8 | 9 | Installing the build tools 10 | ========================== 11 | 12 | The SWIXML build system is based on Ant, which is a Java building tool 13 | originally developed for the Jakarta Tomcat project but now used in many other 14 | Apache projects and extended by many developers. 15 | 16 | Ant is a little but very handy tool that uses a build file written in XML 17 | (build.xml) as building instructions. For more information refer to 18 | "http://ant.apache.org". 19 | 20 | The only thing that you have to make sure of is that the "JAVA_HOME" 21 | environment property is set to match the top level directory containing the 22 | JVM you want to use. 23 | 24 | Building instructions 25 | ===================== 26 | 27 | Ok, let's build the code. First, make sure your current working directory is 28 | where the build.xml file is located. Then type 29 | 30 | ant 31 | - or - 32 | ant distribution 33 | 34 | if everything is right and all the required packages are visible, this action 35 | will generate a file called "swixml.jar" in the "./build" directory. Note, that 36 | if you do further development, compilation time is reduced since Ant is able 37 | to detect which files have changed and recompile them as needed. 38 | 39 | If something went wrong, go to the Swixml forum, available at the swixml web site.at 40 | 41 | http://www.swixml.org/forum/ 42 | 43 | 44 | Build targets 45 | ============= 46 | 47 | The build system is not only responsible for compiling SWIXML into a jar file, 48 | but is also responsible for creating the HTML documentation in the form of 49 | javadocs. 50 | 51 | These are the meaningful targets for this build file: 52 | 53 | - package [default] -> creates ./build/swixml.jar 54 | - compile -> compiles the source code 55 | - samples -> compiles example code 56 | - javadoc -> generates the API documentation in ./build/javadocs 57 | - distribution -> builds everything, incl. jar, javadoc, tagdoc, xsd, etc. etc. 58 | - clean -> restores the distribution to its original and clean state 59 | 60 | For example, to build the samples, type 61 | 62 | build samples 63 | 64 | To learn the details of what each target does, read the build.xml file. 65 | It is quite understandable. 66 | 67 | Best, 68 | Wolf Paulus and the Swixml Dev. Team. 69 | 70 | -------------------------------------------------------------------------------- /samples/.gitignore: -------------------------------------------------------------------------------- 1 | /.DS_Store 2 | -------------------------------------------------------------------------------- /samples/Accelerator.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | 7 | /** 8 | * The Accelerator shows in the usage of accelerators. 9 | * 10 | * @author Wolf Paulus 11 | * @version $Revision: 1.1 $ 12 | * 13 | * @since swixml (#101) 14 | */ 15 | public class Accelerator { 16 | private static final String DESCRIPTOR = "xml/accelerator.xml"; 17 | SwingEngine swix = new SwingEngine( this ); 18 | 19 | public Accelerator() throws Exception { 20 | swix.render( Accelerator.DESCRIPTOR ).setVisible( true ); 21 | } 22 | 23 | public Action newAction = new AbstractAction() { 24 | public void actionPerformed( ActionEvent e ) { 25 | JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, not implemented yet." ); 26 | } 27 | }; 28 | 29 | public Action aboutAction = new AbstractAction() { 30 | public void actionPerformed( ActionEvent e ) { 31 | JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Accelerator Example." ); 32 | } 33 | }; 34 | 35 | public static void main( String[] args ) { 36 | try { 37 | new Accelerator(); 38 | } catch (Exception e) { 39 | System.err.println( e.getMessage() ); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /samples/Actions.java: -------------------------------------------------------------------------------- 1 | import org.swixml.SwingEngine; 2 | 3 | import javax.swing.*; 4 | import java.awt.event.ActionEvent; 5 | import java.awt.event.ActionListener; 6 | import java.awt.event.WindowAdapter; 7 | import java.awt.event.WindowEvent; 8 | 9 | /** 10 | * The Actions class shows how to use the 11 | * Actions and ActionCommand attributes 12 | * 13 | * @author Wolf Paulus 14 | * @version $Revision: 1.1 $ 15 | * @since swixml #065 16 | */ 17 | public class Actions extends WindowAdapter implements ActionListener { 18 | private SwingEngine swix; 19 | 20 | public JMenuItem mi_exit, mi_save; 21 | public JPanel pnl_North; 22 | // 23 | // For every Actions, there needs to be a 24 | // public AbstractAction member variables with an anonymous inner class instantiation 25 | // 26 | 27 | /** Action newAction handles the new action attribute */ 28 | public Action newAction = new AbstractAction() { 29 | 30 | public void actionPerformed(ActionEvent e) { 31 | System.out.println( "New" ); // show the access outer class member .. 32 | this.setEnabled( false ); // disables ALL buttons that are tied to this action 33 | } 34 | }; 35 | 36 | /** Action modifyAction handles the modify action attribute */ 37 | public Action openAction = new AbstractAction() { 38 | /** Invoked when an action occurs. */ 39 | public void actionPerformed(ActionEvent e) { 40 | System.out.println( "Open" ); 41 | } 42 | }; 43 | 44 | /** Action petAction handles the combobox */ 45 | public Action petAction = new AbstractAction() { 46 | public void actionPerformed(ActionEvent e) { 47 | System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() ); 48 | } 49 | }; 50 | 51 | 52 | /** 53 | * Constructs a new Actions object, registering action handlers for center_panel components. 54 | */ 55 | private Actions() { 56 | try { 57 | swix = new SwingEngine( this ); 58 | swix.render( "xml/actions.xml" ); 59 | 60 | // at this point all AbstractActions are linked with the button etc. 61 | // ActionCommands however need to be linked manually, see below ... 62 | 63 | // add this class as an action listener to all buttons inside the panel with the id = center_panel 64 | swix.setActionListener( pnl_North, this ); 65 | // add this class as an action listener to MenuItem with the id = mi_exit. 66 | mi_exit.addActionListener( this ); 67 | // add this class as an action listener to MenuItem with the id = mi_save 68 | mi_save.addActionListener( this ); 69 | // 70 | // Note, the mi_about MenuItem was not linked at all so far. Therefore, no action is performed when this 71 | // menu item gets requested. 72 | // The Toolbar button with the Actions="newAction" attribute is covered twice, 73 | // during parsing the AbstactAction newAction is linked in and later, the setActionListener() adds 74 | // this object's actionPerformed(). Therefore, when clicked, both actionPerformed() methods are getting called 75 | // 76 | swix.getRootComponent().setVisible(true); 77 | } catch (Exception e) { 78 | e.printStackTrace(); 79 | } 80 | } 81 | 82 | // 83 | // Implement ActionListener 84 | // 85 | 86 | /** 87 | * Invoked when an action occurs. 88 | */ 89 | public void actionPerformed(ActionEvent e) { 90 | String command = e.getActionCommand(); 91 | if ("AC_EXIT".equals( command )) { 92 | this.windowClosing( null ); 93 | } else if ("AC_SAVE".equals( command )) { 94 | System.out.println( "Save" ); 95 | } else { 96 | System.out.println( "Click" ); 97 | } 98 | } 99 | 100 | // 101 | // Overwrite Superclass implementation 102 | // 103 | 104 | /** 105 | * Invoked when the user attempts to close the window 106 | * from the window's system menu. If the program does not 107 | * explicitly hide or dispose the window while processing 108 | * this event, the window close operation will be cancelled. 109 | */ 110 | public void windowClosing(WindowEvent e) { 111 | System.out.println( "Good Bye!" ); 112 | super.windowClosing(e); 113 | System.exit( 0 ); 114 | } 115 | 116 | // 117 | // Make the class bootable 118 | // 119 | 120 | public static void main(String[] args) { 121 | SwingEngine.DEBUG_MODE=true; 122 | new Actions(); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /samples/Cards.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.*; 6 | import java.awt.event.ActionEvent; 7 | 8 | /** 9 | * The Cards class shows an example for the usage of a CardLayout. 10 | * 11 | * @author Wolf Paulus 12 | * @version $Revision: 1.1 $ 13 | * 14 | * @since swixml #109 15 | */ 16 | public class Cards { 17 | 18 | private static final String DESCRIPTOR = "xml/cards.xml"; 19 | private SwingEngine swix = new SwingEngine( this ); 20 | 21 | /** panel with a CardLayout */ 22 | public JPanel pnl; 23 | 24 | private Cards() throws Exception { 25 | swix.render( Cards.DESCRIPTOR ).setVisible( true ); 26 | this.showAction.actionPerformed( null ); 27 | } 28 | 29 | /** shows the next card */ 30 | public Action nextAction = new AbstractAction() { 31 | public void actionPerformed( ActionEvent e ) { 32 | CardLayout cl = (CardLayout) ( pnl.getLayout() ); 33 | cl.next( pnl ); 34 | } 35 | }; 36 | 37 | /** shows the card with the id requested in the actioncommand */ 38 | public Action showAction = new AbstractAction() { 39 | public void actionPerformed( ActionEvent e ) { 40 | //System.err.println( "ActionCommand=" + e.getActionCommand() ); 41 | CardLayout cl = (CardLayout) ( pnl.getLayout() ); 42 | if (e!=null) { 43 | cl.show( pnl, e.getActionCommand() ); 44 | } 45 | } 46 | }; 47 | 48 | public static void main( String[] args ) { 49 | try { 50 | new Cards(); 51 | } catch (Exception e) { 52 | System.err.println( e.getMessage() ); 53 | } 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /samples/ClientAttr.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.WindowAdapter; 7 | 8 | /** 9 | * The ClientAttr shows in the usage of client attributes in swixml tags. 10 | * 11 | * @author Wolf Paulus 12 | * @version $Revision: 1.1 $ 13 | * 14 | * @since swixml 0.98 15 | */ 16 | public class ClientAttr extends WindowAdapter { 17 | private SwingEngine swix = new SwingEngine( this ); 18 | 19 | public JButton btn; 20 | public JTextArea ta; 21 | public Action show = new AbstractAction() { 22 | public void actionPerformed( ActionEvent e ) { 23 | ta.setText( "X:" + btn.getClientProperty( "X" ) + "\n" + "Y:" + btn.getClientProperty( "Y" ) ); 24 | } 25 | }; 26 | 27 | private ClientAttr() { 28 | try { 29 | swix.render( "xml/clientattr.xml" ).setVisible( true ); 30 | swix.forget( "x" ); 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | } 35 | 36 | public static void main( String[] args ) { 37 | new ClientAttr(); 38 | } 39 | } -------------------------------------------------------------------------------- /samples/ComboModel.java: -------------------------------------------------------------------------------- 1 | 2 | import javax.swing.*; 3 | 4 | /** 5 | * Combobox Model used in the InitClass sample. 6 | */ 7 | public class ComboModel extends DefaultComboBoxModel { 8 | /** 9 | * Constructs a DefaultComboBoxModel object. 10 | */ 11 | public ComboModel() { 12 | super( new Object[]{"Bird", "Cat", "Dog", "Rabbit", "Pig"} ); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /samples/CustomTags.java: -------------------------------------------------------------------------------- 1 | import com.toedter.calendar.*; 2 | import org.swixml.SwingEngine; 3 | 4 | import java.awt.event.WindowAdapter; 5 | import java.awt.event.WindowEvent; 6 | 7 | public class CustomTags extends WindowAdapter { 8 | 9 | 10 | public CustomTags() throws Exception { 11 | SwingEngine swix = new SwingEngine(this); 12 | swix.getTaglib().registerTag("Calendar", JCalendar.class); 13 | swix.render("xml/customtags.xml").setVisible(true); 14 | } 15 | 16 | /** 17 | * Invoked when a window is in the process of being closed. 18 | * The close operation can be overridden at this point. 19 | */ 20 | public void windowClosing(WindowEvent e) { 21 | super.windowClosing(e); 22 | System.exit(0); 23 | } 24 | 25 | // 26 | // Make the class bootable 27 | // 28 | public static void main(String[] args) throws Exception { 29 | new CustomTags(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/ExitAction.java: -------------------------------------------------------------------------------- 1 | import java.awt.event.ActionEvent; 2 | 3 | import javax.swing.AbstractAction; 4 | 5 | /** 6 | * Simple Action to exit a program. 7 | * 8 | * This is intended for usage in swixml xml descriptors and may be instantiated through 9 | * initclass="ExitAction" for arbitary enclosing {@link javax.swing.AbstractButton} 10 | * objects. 11 | */ 12 | public class ExitAction extends AbstractAction { 13 | public void actionPerformed(ActionEvent e) { 14 | System.exit(0); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/Form.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | 5 | /** 6 | * The Form class shows how to do a simple JGoodies FormLayout 7 | */ 8 | public class Form extends SwingEngine { 9 | /** Default ctor for a SwingEngine. */ 10 | 11 | private Form() { 12 | try { 13 | render( "xml/form.xml" ).setVisible( true ); 14 | } catch (Exception e) { 15 | e.printStackTrace(); 16 | } 17 | } 18 | 19 | public static void main(String[] args) { 20 | new Form(); 21 | } 22 | } -------------------------------------------------------------------------------- /samples/FormLayout.java: -------------------------------------------------------------------------------- 1 | import org.swixml.SwingEngine; 2 | 3 | /** 4 | * The Layout class shows the use of layout managers 5 | * 6 | * @author Wolf Paulus 7 | * @version $Revision: 1.1 $ 8 | * 9 | * @since swixml (#151) 10 | */ 11 | public class FormLayout { 12 | private static final String DESCRIPTOR = "xml/formlayout.xml"; 13 | 14 | private FormLayout() throws Exception { 15 | new SwingEngine( this ).render( FormLayout.DESCRIPTOR ).setVisible( true ); 16 | } 17 | 18 | public static void main( String[] args ) { 19 | try { 20 | new FormLayout(); 21 | } catch (Exception e) { 22 | System.err.println( e.getMessage() ); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /samples/GridBag.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | 5 | /** 6 | * The GridBag class shows how to do a simple GridBag layout 7 | * 8 | * @author Wolf Paulus 9 | * @version $Revision: 1.1 $ 10 | * 11 | * @since swixml 0.5 12 | */ 13 | public class GridBag extends SwingEngine { 14 | /** Default ctor for a SwingEngine. */ 15 | 16 | private GridBag() { 17 | try { 18 | render( "xml/gridbag.xml" ).setVisible( true ); 19 | } catch (Exception e) { 20 | e.printStackTrace(); 21 | } 22 | } 23 | 24 | public static void main(String[] args) { 25 | new GridBag(); 26 | } 27 | } -------------------------------------------------------------------------------- /samples/HelloList.java: -------------------------------------------------------------------------------- 1 | import org.swixml.SwingEngine; 2 | 3 | import javax.swing.JList; 4 | import java.awt.event.WindowAdapter; 5 | import java.awt.event.WindowEvent; 6 | import javax.swing.event.ListSelectionListener; 7 | import javax.swing.event.ListSelectionEvent; 8 | 9 | public class HelloList extends WindowAdapter { 10 | 11 | private JList mList; /*instantiated by swixml when rendering the UI */ 12 | 13 | private HelloList() throws Exception { 14 | new SwingEngine( this ).render( "./xml/hellolist.xml" ).setVisible( true ); 15 | System.out.println( mList.size() ); 16 | mList.addListSelectionListener( new ListSelectionListener() { 17 | public void valueChanged( final ListSelectionEvent e) { 18 | System.out.println( mList.getSelectedValue() ); 19 | } 20 | }); 21 | } 22 | 23 | /** 24 | * Invoked when a window is in the process of being closed. 25 | * The close operation can be overridden at this point. 26 | */ 27 | public void windowClosing(final WindowEvent e) { 28 | super.windowClosing(e); 29 | System.exit(0); 30 | } 31 | 32 | /** Makes the class bootable */ 33 | public static void main( final String[] args ) throws Exception { 34 | new HelloList(); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /samples/HelloMac.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.WindowEvent; 7 | import java.awt.event.WindowAdapter; 8 | import java.io.IOException; 9 | 10 | import com.apple.eio.FileManager; 11 | 12 | /** 13 | * The HelloMac class shows a couple of the Mac specifics exposed 14 | * HeeloMac renders the GUI, which is described in hellomac.xml 15 | * 16 | * @author Wolf Paulus 17 | * @version $Revision: 1.1 $ 18 | * 19 | * @since swixml 1.1 20 | */ 21 | public class HelloMac extends WindowAdapter { 22 | private SwingEngine swix; 23 | 24 | private HelloMac() throws Exception { 25 | swix= new SwingEngine( this ); 26 | swix.render( "xml/hellomac.xml" ); 27 | swix.getRootComponent().setVisible( true ); 28 | } 29 | 30 | public Action actionAbout = new AbstractAction() { 31 | public void actionPerformed( ActionEvent e ) { 32 | JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Mac OS X Example." ); 33 | } 34 | }; 35 | 36 | public Action actionHelp = new AbstractAction() { 37 | public void actionPerformed( ActionEvent e ) { 38 | try { 39 | FileManager.openURL("http://www.swixml.org/apidocs/index.html"); 40 | } catch (IOException e1) { 41 | e1.printStackTrace(); 42 | } 43 | } 44 | }; 45 | 46 | public Action actionExit = new AbstractAction() { 47 | public void actionPerformed( ActionEvent e ) { 48 | JOptionPane.showMessageDialog( swix.getRootComponent(), swix.getLocalizer().getString("mis_Exit")); 49 | HelloMac.this.windowClosing(null); 50 | } 51 | }; 52 | 53 | /** 54 | * Invoked when a window is in the process of being closed. 55 | * The close operation can be overridden at this point. 56 | */ 57 | public void windowClosing( WindowEvent e ) { 58 | super.windowClosing( e ); 59 | System.exit(0); 60 | } 61 | 62 | // 63 | // Make the class bootable 64 | // 65 | public static void main( String[] args ) throws Exception { 66 | new HelloMac(); 67 | } 68 | } -------------------------------------------------------------------------------- /samples/HelloWorld.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | 7 | public class HelloWorld { 8 | /** submit counter */ 9 | private int clicks; 10 | 11 | /** JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) */ 12 | public JTextField tf; 13 | 14 | /** Jlabel to display number of button clicks */ 15 | public JLabel cnt; 16 | 17 | /** Action appends a '#' to the textfields content. */ 18 | public Action submit = new AbstractAction() { 19 | public void actionPerformed( ActionEvent e ) { 20 | tf.setText( tf.getText() + '#' ); 21 | cnt.setText(String.valueOf( ++clicks )); 22 | } 23 | }; 24 | 25 | /** Renders UI at construction */ 26 | private HelloWorld() throws Exception { 27 | new SwingEngine( this ).render( "xml/helloworld.xml" ).setVisible( true ); 28 | } 29 | 30 | /** Makes the class bootable */ 31 | public static void main( String[] args ) throws Exception { 32 | new HelloWorld(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/HelloWorldnoAction.java: -------------------------------------------------------------------------------- 1 | import org.swixml.SwingEngine; 2 | 3 | import javax.swing.*; 4 | 5 | public class HelloWorldnoAction { 6 | /** 7 | * submit counter 8 | */ 9 | private int clicks; 10 | 11 | /** 12 | * JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) 13 | */ 14 | public JTextField tf; 15 | 16 | /** 17 | * Jlabel to display number of button clicks 18 | */ 19 | public JLabel cnt; 20 | 21 | /** 22 | * bound, using an element's action attribute, which was set to submit. 23 | */ 24 | public void submit() { 25 | 26 | tf.setText(tf.getText() + '#'); 27 | cnt.setText(String.valueOf(++clicks)); 28 | } 29 | 30 | 31 | /** 32 | * Renders UI at construction 33 | */ 34 | private HelloWorldnoAction() throws Exception { 35 | new SwingEngine(this).render("xml/helloworld.xml").setVisible(true); 36 | } 37 | 38 | /** 39 | * Makes the class bootable 40 | */ 41 | public static void main(String[] args) throws Exception { 42 | new HelloWorldnoAction(); 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /samples/InitClass.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.WindowAdapter; 7 | 8 | /** 9 | * The InitClass class demonstrates how to use the initclass attribute. 10 | * Date: Mar 10, 2003 11 | * 12 | * @author Wolf Paulus 13 | * @version $Revision: 1.1 $ 14 | * @since swixml 0.76 15 | */ 16 | 17 | public class InitClass extends WindowAdapter { 18 | public Action DO_SELECT = new AbstractAction() { 19 | public void actionPerformed(ActionEvent e) { 20 | System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() ); 21 | } 22 | }; 23 | 24 | private InitClass() throws Exception { 25 | new SwingEngine( this ).render( "xml/initclass.xml" ).setVisible( true ); 26 | } 27 | 28 | public static void main(String[] args) { 29 | try { 30 | new InitClass(); 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /samples/Layout.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | /** 5 | * The Layout class shows the use of layout managers 6 | * 7 | * @author Wolf Paulus 8 | * @version $Revision: 1.1 $ 9 | * 10 | * @since swixml (#136) 11 | */ 12 | public class Layout { 13 | private static final String DESCRIPTOR = "xml/funlayout.xml"; 14 | 15 | private Layout() throws Exception { 16 | new SwingEngine( this ).render( Layout.DESCRIPTOR ).setVisible( true ); 17 | } 18 | 19 | public static void main( String[] args ) { 20 | try { 21 | new Layout(); 22 | } catch (Exception e) { 23 | System.err.println( e.getMessage() ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/Localization.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Localization, also shows localization for the MAC OS 4 | * 5 | * @author Wolf Paulus 6 | * @version $Revision: 1.1 $ 7 | * 8 | * @since swixml (#129) 9 | */ 10 | import org.swixml.SwingEngine; 11 | 12 | import javax.swing.*; 13 | import java.awt.event.ActionEvent; 14 | import java.awt.event.WindowAdapter; 15 | import java.awt.event.WindowEvent; 16 | 17 | 18 | public class Localization extends WindowAdapter { 19 | 20 | private static final String DESCRIPTOR = "xml/localization.xml"; 21 | SwingEngine swix = new SwingEngine( this ); 22 | 23 | 24 | 25 | public Localization() throws Exception { 26 | swix.render( Localization.DESCRIPTOR ).setVisible( true ); 27 | } 28 | 29 | 30 | public Action actionOptions = new AbstractAction() { 31 | public void actionPerformed( ActionEvent e ) { 32 | JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, " +swix.getLocalizer().getString("mis_Options") + " not implemented yet."); 33 | } 34 | }; 35 | 36 | public Action actionAbout = new AbstractAction() { 37 | public void actionPerformed( ActionEvent e ) { 38 | JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Mac OS X Example." ); 39 | } 40 | }; 41 | 42 | public Action actionHelp = new AbstractAction() { 43 | public void actionPerformed( ActionEvent e ) { 44 | JOptionPane.showMessageDialog( swix.getRootComponent(), "Help ...." ); 45 | } 46 | }; 47 | 48 | public Action actionExit = new AbstractAction() { 49 | public void actionPerformed( ActionEvent e ) { 50 | JOptionPane.showMessageDialog( swix.getRootComponent(), swix.getLocalizer().getString("mis_Exit")); 51 | Localization.this.windowClosing(null); 52 | } 53 | }; 54 | 55 | /** 56 | * Invoked when a window is in the process of being closed. 57 | * The close operation can be overridden at this point. 58 | */ 59 | public void windowClosing( WindowEvent e ) { 60 | super.windowClosing( e ); 61 | System.exit(0); 62 | } 63 | 64 | public static void main( String[] args ) { 65 | try { 66 | new Localization(); 67 | } catch (Exception e) { 68 | System.err.println( e.getMessage() ); 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /samples/MacAboutAction.java: -------------------------------------------------------------------------------- 1 | import java.awt.event.ActionEvent; 2 | 3 | import javax.swing.AbstractAction; 4 | import javax.swing.JOptionPane; 5 | // $Id: MacAboutAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ 6 | 7 | /** 8 | * Externalized AboutAction taken from {@link HelloMac}. 9 | * 10 | * @author $Author: tichy $ 11 | */ 12 | public class MacAboutAction extends AbstractAction { 13 | public void actionPerformed( ActionEvent e ) { 14 | JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), "This is the Mac OS X Example." ); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /samples/MacExitAction.java: -------------------------------------------------------------------------------- 1 | import java.awt.event.ActionEvent; 2 | 3 | import javax.swing.AbstractAction; 4 | import javax.swing.JOptionPane; 5 | // $Id: MacExitAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ 6 | 7 | /** 8 | * Externalized exit action taken from {@link HelloMac}. 9 | * 10 | * @author $Author: tichy $ 11 | */ 12 | public class MacExitAction extends AbstractAction { 13 | public void actionPerformed( ActionEvent e ) { 14 | JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), 15 | MacTest.getSwix().getLocalizer().getString("mis_Exit")); 16 | System.exit(0); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/MacHelpAction.java: -------------------------------------------------------------------------------- 1 | import java.awt.event.ActionEvent; 2 | import java.io.IOException; 3 | 4 | import javax.swing.AbstractAction; 5 | 6 | import com.apple.eio.FileManager; 7 | // $Id: MacHelpAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ 8 | 9 | /** 10 | * Externalized help action taken from {@link HelloMac}. 11 | * 12 | * @author $Author: tichy $ 13 | */ 14 | public class MacHelpAction extends AbstractAction { 15 | public void actionPerformed( ActionEvent e ) { 16 | try { 17 | FileManager.openURL("http://www.swixml.org/apidocs/index.html"); 18 | } catch (IOException e1) { 19 | e1.printStackTrace(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/MacMultipleAction.java: -------------------------------------------------------------------------------- 1 | import java.awt.event.ActionEvent; 2 | 3 | import javax.swing.AbstractAction; 4 | import javax.swing.JOptionPane; 5 | // $Id: MacMultipleAction.java,v 1.1 2004/10/05 21:32:35 tichy Exp $ 6 | 7 | /** 8 | * Demonstrates delivering of a valid action command from the ActionEvent. 9 | * 10 | * On MacOS, this contains strings like {@link org.swixml.Parser#ATTR_MACOS_ABOUT} 11 | * when the attribute "macos_about" was set to true. See the 12 | * provided file mactester.xml as an usage example. This allows specifying 13 | * of multiple "macos_*" attributes for one {@link javax.swing.Action}. 14 | * 15 | * 16 | * @author $Author: tichy $ 17 | */ 18 | public class MacMultipleAction extends AbstractAction { 19 | 20 | /* (non-Javadoc) 21 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 22 | */ 23 | public void actionPerformed(ActionEvent arg0) { 24 | // TODO Auto-generated method stub 25 | JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), "This is the Mac OS X MultipleExample. Showing "+arg0.getActionCommand() ); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /samples/MacTest.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.WindowEvent; 7 | import java.awt.event.WindowAdapter; 8 | import java.io.IOException; 9 | 10 | import com.apple.eio.FileManager; 11 | 12 | /** 13 | * The HelloMac class shows a couple of the Mac specifics exposed 14 | * HeeloMac renders the GUI, which is described in hellomac.xml 15 | * 16 | * @author Wolf Paulus 17 | * @version $Revision: 1.1 $ 18 | * 19 | * @since swixml 1.1 20 | */ 21 | public class MacTest extends WindowAdapter { 22 | private static SwingEngine swix; 23 | 24 | private MacTest() throws Exception { 25 | swix= new SwingEngine( this ); 26 | swix.render( "xml/mactester.xml" ); 27 | swix.getRootComponent().setVisible( true ); 28 | } 29 | 30 | 31 | // 32 | // Make the class bootable 33 | // 34 | public static void main( String[] args ) throws Exception { 35 | new MacTest(); 36 | } 37 | 38 | /** 39 | * @return 40 | */ 41 | public static SwingEngine getSwix() { 42 | // TODO Auto-generated method stub 43 | return swix; 44 | } 45 | 46 | 47 | } -------------------------------------------------------------------------------- /samples/MenuBarWithConstraints.java: -------------------------------------------------------------------------------- 1 | import java.awt.Container; 2 | 3 | import org.swixml.SwingEngine; 4 | 5 | // $Id: MenuBarWithConstraints.java,v 1.1 2005/08/22 21:20:01 tichy Exp $ 6 | /** 7 | * Sample program to show a menubar with constraints attribute in it. 8 | * 9 | */ 10 | public class MenuBarWithConstraints { 11 | 12 | /** 13 | * @param args 14 | * @throws Exception if something goes wrong 15 | */ 16 | public static void main(String[] args) throws Exception { 17 | SwingEngine se = new SwingEngine(); 18 | Container container = se.render("xml/menu-bar.xml"); 19 | container.setVisible(true); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /samples/Model.java: -------------------------------------------------------------------------------- 1 | import javax.swing.DefaultListModel; 2 | 3 | public class Model extends DefaultListModel { 4 | /** 5 | * Constructs a DefaultComboBoxModel object. 6 | */ 7 | public Model() { 8 | for (String s : new String[] {"Bird", "Cat", "Dog", "Rabbit", "Pig"} ) { 9 | this.addElement(s); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/NewTag.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.ConverterLibrary; 3 | import org.swixml.SwingEngine; 4 | 5 | import java.util.TimeZone; 6 | 7 | /** 8 | * Extend the TagLib with a new Class and a new Converter 9 | */ 10 | public class NewTag extends SwingEngine { 11 | 12 | private NewTag() { 13 | // 14 | // Register a new new Converter, 15 | // Generally, Converters should be regsitered before Tags 16 | // 17 | ConverterLibrary.getInstance().register( TimeZone.class, new TimeZoneConverter() ); 18 | // 19 | // Register a Tag that uses a SwingEngine itself ... 20 | // 21 | this.getTaglib().registerTag( "xpanel", XPanel.class ); 22 | try { 23 | this.getTaglib().registerTag( "redlabel", RedLabel.class ); 24 | } catch (Exception e) { 25 | System.err.println( e.getMessage() ); 26 | } 27 | 28 | try { 29 | render( "xml/newtag.xml" ).setVisible( true ); 30 | } catch (Exception e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | 35 | public static void main(String[] args) { 36 | new NewTag(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/RedLabel.java: -------------------------------------------------------------------------------- 1 | 2 | import javax.swing.*; 3 | import java.awt.*; 4 | import java.util.TimeZone; 5 | 6 | public class RedLabel extends JLabel { 7 | public RedLabel() { 8 | this.setForeground( Color.red ); 9 | this.setFont( Font.decode( "VERDANA-BOLD-24" ) ); 10 | } 11 | 12 | public void setTimeZone(TimeZone tz) { 13 | 14 | this.setText( tz.getDisplayName() ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/SwixApplet.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | import java.awt.event.ActionEvent; 6 | import java.net.URL; 7 | 8 | 9 | /** 10 | * The SwixmlApplet class shows how to use the SwixmlmlEngine 11 | * to create JApplets. 12 | * The XML descriptor needs to be referenced with an parameter like this: 13 | * xml=xml/SwinxmlApplet.xml 14 | * When ran locally using SUN's AppletViewer, the file needs to be made available here: 15 | * C:\Temlp\xml\... 16 | * 17 | * @author Wolf Paulus 18 | * @version $Revision: 1.1 $ 19 | * 20 | */ 21 | 22 | public class SwixApplet extends JApplet { 23 | 24 | /** JTextField member gets instantiated through Swixml (look for id="tf" in the xml descriptor) */ 25 | public JTextField tf; 26 | /** 27 | * Action appends a '#' to the textfields content. 28 | */ 29 | public AbstractAction submit = new AbstractAction() { 30 | public void actionPerformed( ActionEvent e ) { 31 | tf.setText( tf.getText() + '#' ); 32 | } 33 | }; 34 | 35 | public void init() { 36 | 37 | super.init(); 38 | try { 39 | String descriptorfile = this.getParameter( "xml" ); 40 | if (descriptorfile == null) { 41 | descriptorfile = "xml/applet.xml"; 42 | } 43 | new SwingEngine( this ).insert( new URL( getCodeBase(), descriptorfile ), this ); 44 | this.setVisible( true ); 45 | } catch (Exception e) { 46 | e.printStackTrace(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /samples/TimeZoneConverter.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.Attribute; 3 | import org.swixml.Converter; 4 | import org.swixml.Localizer; 5 | 6 | import java.util.SimpleTimeZone; 7 | 8 | 9 | public class TimeZoneConverter implements Converter { 10 | /** 11 | * Convert the value of the given Attribute object into an output object of the 12 | * specified type. 13 | * 14 | * @param type Class Data type to which the Attribute's value should be converted 15 | * @param attr Attribute the attribute, providing the value to be converted. 16 | * 17 | */ 18 | public Object convert(Class type, Attribute attr, Localizer lz) throws Exception { 19 | SimpleTimeZone tz = null; 20 | if (attr != null && attr.getValue() != null) { 21 | tz = new SimpleTimeZone( 0, attr.getValue() ); 22 | } 23 | return tz; 24 | } 25 | 26 | /** 27 | * A Converters conversTo method informs about the Class type the converter 28 | * is returning when its convert method is called 29 | * @return Class - the Class the converter is returning when its convert method is called 30 | */ 31 | public Class convertsTo() { 32 | return SimpleTimeZone.class; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/XInclude.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import java.awt.event.WindowAdapter; 5 | 6 | /** 7 | * The XInclude class shows in simple way how to use xml includes. 8 | * XInclude extends the WindowAdapter and uses a SwingEngine to renders the GUI. 9 | * 10 | * @author Wolf Paulus 11 | * @version $Revision: 1.1 $ 12 | * 13 | * @since swixml 0.95 14 | */ 15 | public class XInclude extends WindowAdapter { 16 | private SwingEngine swix = new SwingEngine( this ); 17 | 18 | 19 | private XInclude() { 20 | try { 21 | swix.render( "xml/xinclude.xml" ).setVisible( true ); 22 | } catch (Exception e) { 23 | e.printStackTrace(); 24 | } 25 | } 26 | 27 | public static void main( String[] args ) { 28 | new XInclude(); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /samples/XPanel.java: -------------------------------------------------------------------------------- 1 | 2 | import org.swixml.SwingEngine; 3 | 4 | import javax.swing.*; 5 | 6 | /** 7 | * This file contains proprietary information of CarlsbadCubes 8 | * Copying or reproduction without prior written approval is prohibited. 9 | * Copyright (c) 2002-2003 10 | * 11 | * 12 | * 13 | * Date: Feb 28, 2003 14 | * 15 | * @author Wolf Paulus 16 | * @version $Revision: 1.1 $ 17 | * @since 18 | */ 19 | 20 | public class XPanel extends JPanel { 21 | 22 | private SwingEngine swix = new SwingEngine( this ); 23 | 24 | 25 | public void setXml(String resource) { 26 | try { 27 | swix.insert( "xml/" + resource, this ); 28 | } catch (Exception e) { 29 | System.err.println( e.getMessage() ); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/icons/.gitignore: -------------------------------------------------------------------------------- 1 | /*.DS_Store 2 | -------------------------------------------------------------------------------- /samples/icons/about.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/about.gif -------------------------------------------------------------------------------- /samples/icons/button.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/button.gif -------------------------------------------------------------------------------- /samples/icons/copy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/copy.gif -------------------------------------------------------------------------------- /samples/icons/cut.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/cut.gif -------------------------------------------------------------------------------- /samples/icons/del.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/del.gif -------------------------------------------------------------------------------- /samples/icons/delete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/delete.gif -------------------------------------------------------------------------------- /samples/icons/exit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/exit.gif -------------------------------------------------------------------------------- /samples/icons/green.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/green.gif -------------------------------------------------------------------------------- /samples/icons/help.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/help.gif -------------------------------------------------------------------------------- /samples/icons/label.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/label.gif -------------------------------------------------------------------------------- /samples/icons/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/new.gif -------------------------------------------------------------------------------- /samples/icons/open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/open.gif -------------------------------------------------------------------------------- /samples/icons/panel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/panel.gif -------------------------------------------------------------------------------- /samples/icons/paste.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/paste.gif -------------------------------------------------------------------------------- /samples/icons/save.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/icons/save.gif -------------------------------------------------------------------------------- /samples/img/.gitignore: -------------------------------------------------------------------------------- 1 | /*.DS_Store 2 | -------------------------------------------------------------------------------- /samples/img/accelerator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/accelerator.png -------------------------------------------------------------------------------- /samples/img/actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/actions.png -------------------------------------------------------------------------------- /samples/img/applet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/applet.png -------------------------------------------------------------------------------- /samples/img/cards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/cards.png -------------------------------------------------------------------------------- /samples/img/customtags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/customtags.png -------------------------------------------------------------------------------- /samples/img/form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/form.png -------------------------------------------------------------------------------- /samples/img/gridbag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/gridbag.png -------------------------------------------------------------------------------- /samples/img/hellolist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/hellolist.png -------------------------------------------------------------------------------- /samples/img/hellomac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/hellomac.png -------------------------------------------------------------------------------- /samples/img/helloworld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/helloworld.png -------------------------------------------------------------------------------- /samples/img/initclass.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/initclass.gif -------------------------------------------------------------------------------- /samples/img/initclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/initclass.png -------------------------------------------------------------------------------- /samples/img/layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/layout.png -------------------------------------------------------------------------------- /samples/img/localization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/localization.png -------------------------------------------------------------------------------- /samples/img/newtag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/newtag.png -------------------------------------------------------------------------------- /samples/img/xinclude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/img/xinclude.png -------------------------------------------------------------------------------- /samples/locale/.gitignore: -------------------------------------------------------------------------------- 1 | /*.DS_Store 2 | -------------------------------------------------------------------------------- /samples/locale/swix_de.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swixml/Two/dab7bda02798d31df537f78f24d4e3e382ea82f0/samples/locale/swix_de.properties -------------------------------------------------------------------------------- /samples/locale/swix_en.properties: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Localization 3 | ############################################################################# 4 | 5 | app_Title = Localization Sample Application 6 | 7 | # 8 | # Menu Items 9 | # 10 | 11 | mus_File = File 12 | mus_Help = Help 13 | 14 | mis_New = New 15 | mis_Open = Open 16 | mis_Save = Save 17 | mis_Exit = Exit 18 | mis_About = About 19 | mis_Options = Options 20 | mis_Help = Help 21 | 22 | # 23 | # Accelerators 24 | # 25 | acc_New = control N 26 | acc_About = alt A 27 | acc_Exit = control alt X 28 | acc_Help = F1 29 | 30 | # 31 | # Mnemonic 32 | # 33 | 34 | mn_New = VK_N 35 | mn_Open = VK_O 36 | mn_Save = VK_S 37 | mn_Exit = VK_X 38 | mn_Help = VK_H 39 | 40 | # 41 | # Tooltips 42 | # 43 | tt_Copy = Copy 44 | tt_Cut = Cut 45 | tt_Paste = Paste 46 | 47 | tt_Label = JLabel 48 | tt_Button = JButton 49 | tt_Panel = JPanel 50 | l 51 | # 52 | # Images 53 | # 54 | 55 | img_About = icons/about.gif 56 | img_App = icons/green.gif 57 | img_Copy = icons/copy.gif 58 | img_Cut = icons/cut.gif 59 | img_Exit = icons/exit.gif 60 | img_New = icons/new.gif 61 | img_Open = icons/open.gif 62 | img_Paste = icons/paste.gif 63 | img_Save = icons/save.gif 64 | img_Help = icons/help.gif 65 | 66 | img_Panel = icons/panel.gif 67 | img_Button = icons/button.gif 68 | img_Label = icons/label.gif 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /samples/locale/swix_en_mac.properties: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Localization 3 | ############################################################################# 4 | 5 | app_Title = Mac OS X Sample Application 6 | 7 | # 8 | # Menu Items 9 | # 10 | 11 | mis_Exit = Quit 12 | mis_Options = Preferences 13 | 14 | # 15 | # Mnemonic 16 | # 17 | 18 | mn_New = VK_N 19 | mn_Open = VK_O 20 | mn_Save = VK_S 21 | mn_Exit = VK_X 22 | 23 | # 24 | # Accelerators 25 | # 26 | 27 | acc_New = meta N 28 | acc_About = 29 | acc_Exit = meta Q 30 | acc_Help = meta L 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /samples/xml/.gitignore: -------------------------------------------------------------------------------- 1 | /*.DS_Store 2 | -------------------------------------------------------------------------------- /samples/xml/accelerator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |