diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6602afa --- /dev/null +++ b/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + org.swixml + swixml + 2.0.1 + pom + Swixml + http://www.swixml.org + GUI generating engine for Java applications + + + https://github.com/swixml + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + + jar + + + + + + + + + + ant + ant + 1.5.4 + + + java2html + j2h + 1.3.1 + + + jdom + jdom + 1.0 + + + + junit + junit + 4.8.2 + test + + + com.jgoodies + jgoodies-forms + 1.6.0 + + + com.toedter + jcalendar + 1.3.2 + + + + com.apple + ui + 1.2 + + + + + Other + file://licence.txt + + + + swixml-core + + diff --git a/samples/.gitignore b/samples/.gitignore index 9bb88d3..0261359 100644 --- a/samples/.gitignore +++ b/samples/.gitignore @@ -1 +1,2 @@ -/.DS_Store +/.DS_Store +/target diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 0000000..e7e862f --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,84 @@ + + 4.0.0 + org.swixml + swixml-samples + 2.0.1 + jar + Swixml + http://www.swixml.org + GUI generating engine for Java applications + + + https://github.com/swixml + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + + jar + + + + + + + + + + ant + ant + 1.5.4 + + + java2html + j2h + 1.3.1 + + + jdom + jdom + 1.0 + + + + junit + junit + 4.8.2 + test + + + com.jgoodies + jgoodies-forms + 1.6.0 + + + com.toedter + jcalendar + 1.3.2 + + + + com.apple + ui + 1.2 + + + org.swixml + swixml-core + 2.0.1 + + + + + Other + file://licence.txt + + + diff --git a/samples/Accelerator.java b/samples/src/main/java/Accelerator.java similarity index 96% rename from samples/Accelerator.java rename to samples/src/main/java/Accelerator.java index 70782fc..d622afe 100755 --- a/samples/Accelerator.java +++ b/samples/src/main/java/Accelerator.java @@ -1,43 +1,43 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -/** - * The Accelerator shows in the usage of accelerators. - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml (#101) - */ -public class Accelerator { - private static final String DESCRIPTOR = "xml/accelerator.xml"; - SwingEngine swix = new SwingEngine( this ); - - public Accelerator() throws Exception { - swix.render( Accelerator.DESCRIPTOR ).setVisible( true ); - } - - public Action newAction = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, not implemented yet." ); - } - }; - - public Action aboutAction = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Accelerator Example." ); - } - }; - - public static void main( String[] args ) { - try { - new Accelerator(); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - } - -} + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +/** + * The Accelerator shows in the usage of accelerators. + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml (#101) + */ +public class Accelerator { + private static final String DESCRIPTOR = "xml/accelerator.xml"; + SwingEngine swix = new SwingEngine( this ); + + public Accelerator() throws Exception { + swix.render( Accelerator.DESCRIPTOR ).setVisible( true ); + } + + public Action newAction = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, not implemented yet." ); + } + }; + + public Action aboutAction = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Accelerator Example." ); + } + }; + + public static void main( String[] args ) { + try { + new Accelerator(); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + } + +} diff --git a/samples/Actions.java b/samples/src/main/java/Actions.java similarity index 96% rename from samples/Actions.java rename to samples/src/main/java/Actions.java index 497a7e4..f45d36b 100755 --- a/samples/Actions.java +++ b/samples/src/main/java/Actions.java @@ -1,124 +1,124 @@ -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -/** - * The Actions class shows how to use the - * Actions and ActionCommand attributes - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * @since swixml #065 - */ -public class Actions extends WindowAdapter implements ActionListener { - private SwingEngine swix; - - public JMenuItem mi_exit, mi_save; - public JPanel pnl_North; - // - // For every Actions, there needs to be a - // public AbstractAction member variables with an anonymous inner class instantiation - // - - /** Action newAction handles the new action attribute */ - public Action newAction = new AbstractAction() { - - public void actionPerformed(ActionEvent e) { - System.out.println( "New" ); // show the access outer class member .. - this.setEnabled( false ); // disables ALL buttons that are tied to this action - } - }; - - /** Action modifyAction handles the modify action attribute */ - public Action openAction = new AbstractAction() { - /** Invoked when an action occurs. */ - public void actionPerformed(ActionEvent e) { - System.out.println( "Open" ); - } - }; - - /** Action petAction handles the combobox */ - public Action petAction = new AbstractAction() { - public void actionPerformed(ActionEvent e) { - System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() ); - } - }; - - - /** - * Constructs a new Actions object, registering action handlers for center_panel components. - */ - private Actions() { - try { - swix = new SwingEngine( this ); - swix.render( "xml/actions.xml" ); - - // at this point all AbstractActions are linked with the button etc. - // ActionCommands however need to be linked manually, see below ... - - // add this class as an action listener to all buttons inside the panel with the id = center_panel - swix.setActionListener( pnl_North, this ); - // add this class as an action listener to MenuItem with the id = mi_exit. - mi_exit.addActionListener( this ); - // add this class as an action listener to MenuItem with the id = mi_save - mi_save.addActionListener( this ); - // - // Note, the mi_about MenuItem was not linked at all so far. Therefore, no action is performed when this - // menu item gets requested. - // The Toolbar button with the Actions="newAction" attribute is covered twice, - // during parsing the AbstactAction newAction is linked in and later, the setActionListener() adds - // this object's actionPerformed(). Therefore, when clicked, both actionPerformed() methods are getting called - // - swix.getRootComponent().setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - - // - // Implement ActionListener - // - - /** - * Invoked when an action occurs. - */ - public void actionPerformed(ActionEvent e) { - String command = e.getActionCommand(); - if ("AC_EXIT".equals( command )) { - this.windowClosing( null ); - } else if ("AC_SAVE".equals( command )) { - System.out.println( "Save" ); - } else { - System.out.println( "Click" ); - } - } - - // - // Overwrite Superclass implementation - // - - /** - * Invoked when the user attempts to close the window - * from the window's system menu. If the program does not - * explicitly hide or dispose the window while processing - * this event, the window close operation will be cancelled. - */ - public void windowClosing(WindowEvent e) { - System.out.println( "Good Bye!" ); - super.windowClosing(e); - System.exit( 0 ); - } - - // - // Make the class bootable - // - - public static void main(String[] args) { - SwingEngine.DEBUG_MODE=true; - new Actions(); - } -} +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +/** + * The Actions class shows how to use the + * Actions and ActionCommand attributes + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * @since swixml #065 + */ +public class Actions extends WindowAdapter implements ActionListener { + private SwingEngine swix; + + public JMenuItem mi_exit, mi_save; + public JPanel pnl_North; + // + // For every Actions, there needs to be a + // public AbstractAction member variables with an anonymous inner class instantiation + // + + /** Action newAction handles the new action attribute */ + public Action newAction = new AbstractAction() { + + public void actionPerformed(ActionEvent e) { + System.out.println( "New" ); // show the access outer class member .. + this.setEnabled( false ); // disables ALL buttons that are tied to this action + } + }; + + /** Action modifyAction handles the modify action attribute */ + public Action openAction = new AbstractAction() { + /** Invoked when an action occurs. */ + public void actionPerformed(ActionEvent e) { + System.out.println( "Open" ); + } + }; + + /** Action petAction handles the combobox */ + public Action petAction = new AbstractAction() { + public void actionPerformed(ActionEvent e) { + System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() ); + } + }; + + + /** + * Constructs a new Actions object, registering action handlers for center_panel components. + */ + private Actions() { + try { + swix = new SwingEngine( this ); + swix.render( "xml/actions.xml" ); + + // at this point all AbstractActions are linked with the button etc. + // ActionCommands however need to be linked manually, see below ... + + // add this class as an action listener to all buttons inside the panel with the id = center_panel + swix.setActionListener( pnl_North, this ); + // add this class as an action listener to MenuItem with the id = mi_exit. + mi_exit.addActionListener( this ); + // add this class as an action listener to MenuItem with the id = mi_save + mi_save.addActionListener( this ); + // + // Note, the mi_about MenuItem was not linked at all so far. Therefore, no action is performed when this + // menu item gets requested. + // The Toolbar button with the Actions="newAction" attribute is covered twice, + // during parsing the AbstactAction newAction is linked in and later, the setActionListener() adds + // this object's actionPerformed(). Therefore, when clicked, both actionPerformed() methods are getting called + // + swix.getRootComponent().setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + // + // Implement ActionListener + // + + /** + * Invoked when an action occurs. + */ + public void actionPerformed(ActionEvent e) { + String command = e.getActionCommand(); + if ("AC_EXIT".equals( command )) { + this.windowClosing( null ); + } else if ("AC_SAVE".equals( command )) { + System.out.println( "Save" ); + } else { + System.out.println( "Click" ); + } + } + + // + // Overwrite Superclass implementation + // + + /** + * Invoked when the user attempts to close the window + * from the window's system menu. If the program does not + * explicitly hide or dispose the window while processing + * this event, the window close operation will be cancelled. + */ + public void windowClosing(WindowEvent e) { + System.out.println( "Good Bye!" ); + super.windowClosing(e); + System.exit( 0 ); + } + + // + // Make the class bootable + // + + public static void main(String[] args) { + SwingEngine.DEBUG_MODE=true; + new Actions(); + } +} diff --git a/samples/Cards.java b/samples/src/main/java/Cards.java similarity index 96% rename from samples/Cards.java rename to samples/src/main/java/Cards.java index a862af0..8918ca1 100755 --- a/samples/Cards.java +++ b/samples/src/main/java/Cards.java @@ -1,56 +1,56 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; - -/** - * The Cards class shows an example for the usage of a CardLayout. - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml #109 - */ -public class Cards { - - private static final String DESCRIPTOR = "xml/cards.xml"; - private SwingEngine swix = new SwingEngine( this ); - - /** panel with a CardLayout */ - public JPanel pnl; - - private Cards() throws Exception { - swix.render( Cards.DESCRIPTOR ).setVisible( true ); - this.showAction.actionPerformed( null ); - } - - /** shows the next card */ - public Action nextAction = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - CardLayout cl = (CardLayout) ( pnl.getLayout() ); - cl.next( pnl ); - } - }; - - /** shows the card with the id requested in the actioncommand */ - public Action showAction = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - //System.err.println( "ActionCommand=" + e.getActionCommand() ); - CardLayout cl = (CardLayout) ( pnl.getLayout() ); - if (e!=null) { - cl.show( pnl, e.getActionCommand() ); - } - } - }; - - public static void main( String[] args ) { - try { - new Cards(); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - } - -} + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; + +/** + * The Cards class shows an example for the usage of a CardLayout. + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml #109 + */ +public class Cards { + + private static final String DESCRIPTOR = "xml/cards.xml"; + private SwingEngine swix = new SwingEngine( this ); + + /** panel with a CardLayout */ + public JPanel pnl; + + private Cards() throws Exception { + swix.render( Cards.DESCRIPTOR ).setVisible( true ); + this.showAction.actionPerformed( null ); + } + + /** shows the next card */ + public Action nextAction = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + CardLayout cl = (CardLayout) ( pnl.getLayout() ); + cl.next( pnl ); + } + }; + + /** shows the card with the id requested in the actioncommand */ + public Action showAction = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + //System.err.println( "ActionCommand=" + e.getActionCommand() ); + CardLayout cl = (CardLayout) ( pnl.getLayout() ); + if (e!=null) { + cl.show( pnl, e.getActionCommand() ); + } + } + }; + + public static void main( String[] args ) { + try { + new Cards(); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + } + +} diff --git a/samples/ClientAttr.java b/samples/src/main/java/ClientAttr.java similarity index 96% rename from samples/ClientAttr.java rename to samples/src/main/java/ClientAttr.java index 11f0f37..dfbe26a 100755 --- a/samples/ClientAttr.java +++ b/samples/src/main/java/ClientAttr.java @@ -1,39 +1,39 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.WindowAdapter; - -/** - * The ClientAttr shows in the usage of client attributes in swixml tags. - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml 0.98 - */ -public class ClientAttr extends WindowAdapter { - private SwingEngine swix = new SwingEngine( this ); - - public JButton btn; - public JTextArea ta; - public Action show = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - ta.setText( "X:" + btn.getClientProperty( "X" ) + "\n" + "Y:" + btn.getClientProperty( "Y" ) ); - } - }; - - private ClientAttr() { - try { - swix.render( "xml/clientattr.xml" ).setVisible( true ); - swix.forget( "x" ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main( String[] args ) { - new ClientAttr(); - } + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; + +/** + * The ClientAttr shows in the usage of client attributes in swixml tags. + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml 0.98 + */ +public class ClientAttr extends WindowAdapter { + private SwingEngine swix = new SwingEngine( this ); + + public JButton btn; + public JTextArea ta; + public Action show = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + ta.setText( "X:" + btn.getClientProperty( "X" ) + "\n" + "Y:" + btn.getClientProperty( "Y" ) ); + } + }; + + private ClientAttr() { + try { + swix.render( "xml/clientattr.xml" ).setVisible( true ); + swix.forget( "x" ); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main( String[] args ) { + new ClientAttr(); + } } \ No newline at end of file diff --git a/samples/ComboModel.java b/samples/src/main/java/ComboModel.java similarity index 95% rename from samples/ComboModel.java rename to samples/src/main/java/ComboModel.java index c423713..b6c43d5 100755 --- a/samples/ComboModel.java +++ b/samples/src/main/java/ComboModel.java @@ -1,15 +1,15 @@ - -import javax.swing.*; - -/** - * Combobox Model used in the InitClass sample. - */ -public class ComboModel extends DefaultComboBoxModel { - /** - * Constructs a DefaultComboBoxModel object. - */ - public ComboModel() { - super( new Object[]{"Bird", "Cat", "Dog", "Rabbit", "Pig"} ); - } -} - + +import javax.swing.*; + +/** + * Combobox Model used in the InitClass sample. + */ +public class ComboModel extends DefaultComboBoxModel { + /** + * Constructs a DefaultComboBoxModel object. + */ + public ComboModel() { + super( new Object[]{"Bird", "Cat", "Dog", "Rabbit", "Pig"} ); + } +} + diff --git a/samples/CustomTags.java b/samples/src/main/java/CustomTags.java similarity index 96% rename from samples/CustomTags.java rename to samples/src/main/java/CustomTags.java index 577413a..b5f56c6 100644 --- a/samples/CustomTags.java +++ b/samples/src/main/java/CustomTags.java @@ -1,31 +1,31 @@ -import com.toedter.calendar.*; -import org.swixml.SwingEngine; - -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -public class CustomTags extends WindowAdapter { - - - public CustomTags() throws Exception { - SwingEngine swix = new SwingEngine(this); - swix.getTaglib().registerTag("Calendar", JCalendar.class); - swix.render("xml/customtags.xml").setVisible(true); - } - - /** - * Invoked when a window is in the process of being closed. - * The close operation can be overridden at this point. - */ - public void windowClosing(WindowEvent e) { - super.windowClosing(e); - System.exit(0); - } - - // - // Make the class bootable - // - public static void main(String[] args) throws Exception { - new CustomTags(); - } -} +import com.toedter.calendar.*; +import org.swixml.SwingEngine; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class CustomTags extends WindowAdapter { + + + public CustomTags() throws Exception { + SwingEngine swix = new SwingEngine(this); + swix.getTaglib().registerTag("Calendar", JCalendar.class); + swix.render("xml/customtags.xml").setVisible(true); + } + + /** + * Invoked when a window is in the process of being closed. + * The close operation can be overridden at this point. + */ + public void windowClosing(WindowEvent e) { + super.windowClosing(e); + System.exit(0); + } + + // + // Make the class bootable + // + public static void main(String[] args) throws Exception { + new CustomTags(); + } +} diff --git a/samples/ExitAction.java b/samples/src/main/java/ExitAction.java similarity index 96% rename from samples/ExitAction.java rename to samples/src/main/java/ExitAction.java index 5fb83c1..befe783 100755 --- a/samples/ExitAction.java +++ b/samples/src/main/java/ExitAction.java @@ -1,16 +1,16 @@ -import java.awt.event.ActionEvent; - -import javax.swing.AbstractAction; - -/** - * Simple Action to exit a program. - * - * This is intended for usage in swixml xml descriptors and may be instantiated through - * initclass="ExitAction" for arbitary enclosing {@link javax.swing.AbstractButton} - * objects. - */ -public class ExitAction extends AbstractAction { - public void actionPerformed(ActionEvent e) { - System.exit(0); - } -} +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; + +/** + * Simple Action to exit a program. + * + * This is intended for usage in swixml xml descriptors and may be instantiated through + * initclass="ExitAction" for arbitary enclosing {@link javax.swing.AbstractButton} + * objects. + */ +public class ExitAction extends AbstractAction { + public void actionPerformed(ActionEvent e) { + System.exit(0); + } +} diff --git a/samples/Form.java b/samples/src/main/java/Form.java similarity index 94% rename from samples/Form.java rename to samples/src/main/java/Form.java index 8238818..058e94c 100644 --- a/samples/Form.java +++ b/samples/src/main/java/Form.java @@ -1,22 +1,22 @@ - -import org.swixml.SwingEngine; - - -/** - * The Form class shows how to do a simple JGoodies FormLayout - */ -public class Form extends SwingEngine { - /** Default ctor for a SwingEngine. */ - - private Form() { - try { - render( "xml/form.xml" ).setVisible( true ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { - new Form(); - } + +import org.swixml.SwingEngine; + + +/** + * The Form class shows how to do a simple JGoodies FormLayout + */ +public class Form extends SwingEngine { + /** Default ctor for a SwingEngine. */ + + private Form() { + try { + render( "xml/form.xml" ).setVisible( true ); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { + new Form(); + } } \ No newline at end of file diff --git a/samples/FormLayout.java b/samples/src/main/java/FormLayout.java similarity index 96% rename from samples/FormLayout.java rename to samples/src/main/java/FormLayout.java index 8e1c1bf..c185bf8 100644 --- a/samples/FormLayout.java +++ b/samples/src/main/java/FormLayout.java @@ -1,25 +1,25 @@ -import org.swixml.SwingEngine; - -/** - * The Layout class shows the use of layout managers - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml (#151) - */ -public class FormLayout { - private static final String DESCRIPTOR = "xml/formlayout.xml"; - - private FormLayout() throws Exception { - new SwingEngine( this ).render( FormLayout.DESCRIPTOR ).setVisible( true ); - } - - public static void main( String[] args ) { - try { - new FormLayout(); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - } +import org.swixml.SwingEngine; + +/** + * The Layout class shows the use of layout managers + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml (#151) + */ +public class FormLayout { + private static final String DESCRIPTOR = "xml/formlayout.xml"; + + private FormLayout() throws Exception { + new SwingEngine( this ).render( FormLayout.DESCRIPTOR ).setVisible( true ); + } + + public static void main( String[] args ) { + try { + new FormLayout(); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + } } \ No newline at end of file diff --git a/samples/GridBag.java b/samples/src/main/java/GridBag.java similarity index 95% rename from samples/GridBag.java rename to samples/src/main/java/GridBag.java index c09014a..ae82009 100755 --- a/samples/GridBag.java +++ b/samples/src/main/java/GridBag.java @@ -1,27 +1,27 @@ - -import org.swixml.SwingEngine; - - -/** - * The GridBag class shows how to do a simple GridBag layout - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml 0.5 - */ -public class GridBag extends SwingEngine { - /** Default ctor for a SwingEngine. */ - - private GridBag() { - try { - render( "xml/gridbag.xml" ).setVisible( true ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { - new GridBag(); - } + +import org.swixml.SwingEngine; + + +/** + * The GridBag class shows how to do a simple GridBag layout + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml 0.5 + */ +public class GridBag extends SwingEngine { + /** Default ctor for a SwingEngine. */ + + private GridBag() { + try { + render( "xml/gridbag.xml" ).setVisible( true ); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { + new GridBag(); + } } \ No newline at end of file diff --git a/samples/HelloMac.java b/samples/src/main/java/HelloMac.java similarity index 96% rename from samples/HelloMac.java rename to samples/src/main/java/HelloMac.java index 9dea80a..4f501b3 100755 --- a/samples/HelloMac.java +++ b/samples/src/main/java/HelloMac.java @@ -1,68 +1,68 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; -import java.io.IOException; - -import com.apple.eio.FileManager; - -/** - * The HelloMac class shows a couple of the Mac specifics exposed - * HeeloMac renders the GUI, which is described in hellomac.xml - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml 1.1 - */ -public class HelloMac extends WindowAdapter { - private SwingEngine swix; - - private HelloMac() throws Exception { - swix= new SwingEngine( this ); - swix.render( "xml/hellomac.xml" ); - swix.getRootComponent().setVisible( true ); - } - - public Action actionAbout = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Mac OS X Example." ); - } - }; - - public Action actionHelp = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - try { - FileManager.openURL("http://www.swixml.org/apidocs/index.html"); - } catch (IOException e1) { - e1.printStackTrace(); - } - } - }; - - public Action actionExit = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), swix.getLocalizer().getString("mis_Exit")); - HelloMac.this.windowClosing(null); - } - }; - - /** - * Invoked when a window is in the process of being closed. - * The close operation can be overridden at this point. - */ - public void windowClosing( WindowEvent e ) { - super.windowClosing( e ); - System.exit(0); - } - - // - // Make the class bootable - // - public static void main( String[] args ) throws Exception { - new HelloMac(); - } + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.WindowEvent; +import java.awt.event.WindowAdapter; +import java.io.IOException; + +import com.apple.eio.FileManager; + +/** + * The HelloMac class shows a couple of the Mac specifics exposed + * HeeloMac renders the GUI, which is described in hellomac.xml + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml 1.1 + */ +public class HelloMac extends WindowAdapter { + private SwingEngine swix; + + private HelloMac() throws Exception { + swix= new SwingEngine( this ); + swix.render( "xml/hellomac.xml" ); + swix.getRootComponent().setVisible( true ); + } + + public Action actionAbout = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Mac OS X Example." ); + } + }; + + public Action actionHelp = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + try { + FileManager.openURL("http://www.swixml.org/apidocs/index.html"); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + }; + + public Action actionExit = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), swix.getLocalizer().getString("mis_Exit")); + HelloMac.this.windowClosing(null); + } + }; + + /** + * Invoked when a window is in the process of being closed. + * The close operation can be overridden at this point. + */ + public void windowClosing( WindowEvent e ) { + super.windowClosing( e ); + System.exit(0); + } + + // + // Make the class bootable + // + public static void main( String[] args ) throws Exception { + new HelloMac(); + } } \ No newline at end of file diff --git a/samples/HelloWorld.java b/samples/src/main/java/HelloWorld.java similarity index 96% rename from samples/HelloWorld.java rename to samples/src/main/java/HelloWorld.java index 949ce67..06938ea 100755 --- a/samples/HelloWorld.java +++ b/samples/src/main/java/HelloWorld.java @@ -1,34 +1,34 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -public class HelloWorld { - /** submit counter */ - private int clicks; - - /** JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) */ - public JTextField tf; - - /** Jlabel to display number of button clicks */ - public JLabel cnt; - - /** Action appends a '#' to the textfields content. */ - public Action submit = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - tf.setText( tf.getText() + '#' ); - cnt.setText(String.valueOf( ++clicks )); - } - }; - - /** Renders UI at construction */ - private HelloWorld() throws Exception { - new SwingEngine( this ).render( "xml/helloworld.xml" ).setVisible( true ); - } - - /** Makes the class bootable */ - public static void main( String[] args ) throws Exception { - new HelloWorld(); - } -} + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +public class HelloWorld { + /** submit counter */ + private int clicks; + + /** JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) */ + public JTextField tf; + + /** Jlabel to display number of button clicks */ + public JLabel cnt; + + /** Action appends a '#' to the textfields content. */ + public Action submit = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + tf.setText( tf.getText() + '#' ); + cnt.setText(String.valueOf( ++clicks )); + } + }; + + /** Renders UI at construction */ + private HelloWorld() throws Exception { + new SwingEngine( this ).render( "xml/helloworld.xml" ).setVisible( true ); + } + + /** Makes the class bootable */ + public static void main( String[] args ) throws Exception { + new HelloWorld(); + } +} diff --git a/samples/HelloWorldnoAction.java b/samples/src/main/java/HelloWorldnoAction.java similarity index 95% rename from samples/HelloWorldnoAction.java rename to samples/src/main/java/HelloWorldnoAction.java index 3fd54e3..e1ddfb9 100644 --- a/samples/HelloWorldnoAction.java +++ b/samples/src/main/java/HelloWorldnoAction.java @@ -1,45 +1,45 @@ -import org.swixml.SwingEngine; - -import javax.swing.*; - -public class HelloWorldnoAction { - /** - * submit counter - */ - private int clicks; - - /** - * JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) - */ - public JTextField tf; - - /** - * Jlabel to display number of button clicks - */ - public JLabel cnt; - - /** - * bound, using an element's action attribute, which was set to submit. - */ - public void submit() { - - tf.setText(tf.getText() + '#'); - cnt.setText(String.valueOf(++clicks)); - } - - - /** - * Renders UI at construction - */ - private HelloWorldnoAction() throws Exception { - new SwingEngine(this).render("xml/helloworld.xml").setVisible(true); - } - - /** - * Makes the class bootable - */ - public static void main(String[] args) throws Exception { - new HelloWorldnoAction(); - } -} - +import org.swixml.SwingEngine; + +import javax.swing.*; + +public class HelloWorldnoAction { + /** + * submit counter + */ + private int clicks; + + /** + * JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) + */ + public JTextField tf; + + /** + * Jlabel to display number of button clicks + */ + public JLabel cnt; + + /** + * bound, using an element's action attribute, which was set to submit. + */ + public void submit() { + + tf.setText(tf.getText() + '#'); + cnt.setText(String.valueOf(++clicks)); + } + + + /** + * Renders UI at construction + */ + private HelloWorldnoAction() throws Exception { + new SwingEngine(this).render("xml/helloworld.xml").setVisible(true); + } + + /** + * Makes the class bootable + */ + public static void main(String[] args) throws Exception { + new HelloWorldnoAction(); + } +} + diff --git a/samples/InitClass.java b/samples/src/main/java/InitClass.java similarity index 95% rename from samples/InitClass.java rename to samples/src/main/java/InitClass.java index f14c61a..7a9dc09 100755 --- a/samples/InitClass.java +++ b/samples/src/main/java/InitClass.java @@ -1,36 +1,36 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.WindowAdapter; - -/** - * The InitClass class demonstrates how to use the initclass attribute. - * Date: Mar 10, 2003 - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * @since swixml 0.76 - */ - -public class InitClass extends WindowAdapter { - public Action DO_SELECT = new AbstractAction() { - public void actionPerformed(ActionEvent e) { - System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() ); - } - }; - - private InitClass() throws Exception { - new SwingEngine( this ).render( "xml/initclass.xml" ).setVisible( true ); - } - - public static void main(String[] args) { - try { - new InitClass(); - } catch (Exception e) { - e.printStackTrace(); - } - } -} - + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; + +/** + * The InitClass class demonstrates how to use the initclass attribute. + * Date: Mar 10, 2003 + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * @since swixml 0.76 + */ + +public class InitClass extends WindowAdapter { + public Action DO_SELECT = new AbstractAction() { + public void actionPerformed(ActionEvent e) { + System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() ); + } + }; + + private InitClass() throws Exception { + new SwingEngine( this ).render( "xml/initclass.xml" ).setVisible( true ); + } + + public static void main(String[] args) { + try { + new InitClass(); + } catch (Exception e) { + e.printStackTrace(); + } + } +} + diff --git a/samples/Layout.java b/samples/src/main/java/Layout.java similarity index 95% rename from samples/Layout.java rename to samples/src/main/java/Layout.java index 5318c59..c2d2929 100755 --- a/samples/Layout.java +++ b/samples/src/main/java/Layout.java @@ -1,26 +1,26 @@ - -import org.swixml.SwingEngine; - -/** - * The Layout class shows the use of layout managers - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml (#136) - */ -public class Layout { - private static final String DESCRIPTOR = "xml/funlayout.xml"; - - private Layout() throws Exception { - new SwingEngine( this ).render( Layout.DESCRIPTOR ).setVisible( true ); - } - - public static void main( String[] args ) { - try { - new Layout(); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - } -} + +import org.swixml.SwingEngine; + +/** + * The Layout class shows the use of layout managers + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml (#136) + */ +public class Layout { + private static final String DESCRIPTOR = "xml/funlayout.xml"; + + private Layout() throws Exception { + new SwingEngine( this ).render( Layout.DESCRIPTOR ).setVisible( true ); + } + + public static void main( String[] args ) { + try { + new Layout(); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + } +} diff --git a/samples/Localization.java b/samples/src/main/java/Localization.java similarity index 96% rename from samples/Localization.java rename to samples/src/main/java/Localization.java index 01f19b4..dfe7cba 100755 --- a/samples/Localization.java +++ b/samples/src/main/java/Localization.java @@ -1,72 +1,72 @@ - -/** - * Localization, also shows localization for the MAC OS - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml (#129) - */ -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - - -public class Localization extends WindowAdapter { - - private static final String DESCRIPTOR = "xml/localization.xml"; - SwingEngine swix = new SwingEngine( this ); - - - - public Localization() throws Exception { - swix.render( Localization.DESCRIPTOR ).setVisible( true ); - } - - - public Action actionOptions = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, " +swix.getLocalizer().getString("mis_Options") + " not implemented yet."); - } - }; - - public Action actionAbout = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Mac OS X Example." ); - } - }; - - public Action actionHelp = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), "Help ...." ); - } - }; - - public Action actionExit = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( swix.getRootComponent(), swix.getLocalizer().getString("mis_Exit")); - Localization.this.windowClosing(null); - } - }; - - /** - * Invoked when a window is in the process of being closed. - * The close operation can be overridden at this point. - */ - public void windowClosing( WindowEvent e ) { - super.windowClosing( e ); - System.exit(0); - } - - public static void main( String[] args ) { - try { - new Localization(); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - } - -} + +/** + * Localization, also shows localization for the MAC OS + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml (#129) + */ +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + + +public class Localization extends WindowAdapter { + + private static final String DESCRIPTOR = "xml/localization.xml"; + SwingEngine swix = new SwingEngine( this ); + + + + public Localization() throws Exception { + swix.render( Localization.DESCRIPTOR ).setVisible( true ); + } + + + public Action actionOptions = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, " +swix.getLocalizer().getString("mis_Options") + " not implemented yet."); + } + }; + + public Action actionAbout = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Mac OS X Example." ); + } + }; + + public Action actionHelp = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), "Help ...." ); + } + }; + + public Action actionExit = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( swix.getRootComponent(), swix.getLocalizer().getString("mis_Exit")); + Localization.this.windowClosing(null); + } + }; + + /** + * Invoked when a window is in the process of being closed. + * The close operation can be overridden at this point. + */ + public void windowClosing( WindowEvent e ) { + super.windowClosing( e ); + System.exit(0); + } + + public static void main( String[] args ) { + try { + new Localization(); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + } + +} diff --git a/samples/MacAboutAction.java b/samples/src/main/java/MacAboutAction.java similarity index 96% rename from samples/MacAboutAction.java rename to samples/src/main/java/MacAboutAction.java index 06c06c0..ae88e3d 100755 --- a/samples/MacAboutAction.java +++ b/samples/src/main/java/MacAboutAction.java @@ -1,17 +1,17 @@ -import java.awt.event.ActionEvent; - -import javax.swing.AbstractAction; -import javax.swing.JOptionPane; -// $Id: MacAboutAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ - -/** - * Externalized AboutAction taken from {@link HelloMac}. - * - * @author $Author: tichy $ - */ -public class MacAboutAction extends AbstractAction { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), "This is the Mac OS X Example." ); - } - -} +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.JOptionPane; +// $Id: MacAboutAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ + +/** + * Externalized AboutAction taken from {@link HelloMac}. + * + * @author $Author: tichy $ + */ +public class MacAboutAction extends AbstractAction { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), "This is the Mac OS X Example." ); + } + +} diff --git a/samples/MacExitAction.java b/samples/src/main/java/MacExitAction.java similarity index 96% rename from samples/MacExitAction.java rename to samples/src/main/java/MacExitAction.java index eece9dd..6b1d811 100755 --- a/samples/MacExitAction.java +++ b/samples/src/main/java/MacExitAction.java @@ -1,18 +1,18 @@ -import java.awt.event.ActionEvent; - -import javax.swing.AbstractAction; -import javax.swing.JOptionPane; -// $Id: MacExitAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ - -/** - * Externalized exit action taken from {@link HelloMac}. - * - * @author $Author: tichy $ - */ -public class MacExitAction extends AbstractAction { - public void actionPerformed( ActionEvent e ) { - JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), - MacTest.getSwix().getLocalizer().getString("mis_Exit")); - System.exit(0); - } -} +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.JOptionPane; +// $Id: MacExitAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ + +/** + * Externalized exit action taken from {@link HelloMac}. + * + * @author $Author: tichy $ + */ +public class MacExitAction extends AbstractAction { + public void actionPerformed( ActionEvent e ) { + JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), + MacTest.getSwix().getLocalizer().getString("mis_Exit")); + System.exit(0); + } +} diff --git a/samples/MacHelpAction.java b/samples/src/main/java/MacHelpAction.java similarity index 96% rename from samples/MacHelpAction.java rename to samples/src/main/java/MacHelpAction.java index c49b406..51b8144 100755 --- a/samples/MacHelpAction.java +++ b/samples/src/main/java/MacHelpAction.java @@ -1,22 +1,22 @@ -import java.awt.event.ActionEvent; -import java.io.IOException; - -import javax.swing.AbstractAction; - -import com.apple.eio.FileManager; -// $Id: MacHelpAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ - -/** - * Externalized help action taken from {@link HelloMac}. - * - * @author $Author: tichy $ - */ -public class MacHelpAction extends AbstractAction { - public void actionPerformed( ActionEvent e ) { - try { - FileManager.openURL("http://www.swixml.org/apidocs/index.html"); - } catch (IOException e1) { - e1.printStackTrace(); - } - } -} +import java.awt.event.ActionEvent; +import java.io.IOException; + +import javax.swing.AbstractAction; + +import com.apple.eio.FileManager; +// $Id: MacHelpAction.java,v 1.1 2004/10/05 21:32:34 tichy Exp $ + +/** + * Externalized help action taken from {@link HelloMac}. + * + * @author $Author: tichy $ + */ +public class MacHelpAction extends AbstractAction { + public void actionPerformed( ActionEvent e ) { + try { + FileManager.openURL("http://www.swixml.org/apidocs/index.html"); + } catch (IOException e1) { + e1.printStackTrace(); + } + } +} diff --git a/samples/MacMultipleAction.java b/samples/src/main/java/MacMultipleAction.java similarity index 97% rename from samples/MacMultipleAction.java rename to samples/src/main/java/MacMultipleAction.java index 31c2557..fe4c08a 100755 --- a/samples/MacMultipleAction.java +++ b/samples/src/main/java/MacMultipleAction.java @@ -1,29 +1,29 @@ -import java.awt.event.ActionEvent; - -import javax.swing.AbstractAction; -import javax.swing.JOptionPane; -// $Id: MacMultipleAction.java,v 1.1 2004/10/05 21:32:35 tichy Exp $ - -/** - * Demonstrates delivering of a valid action command from the ActionEvent. - * - * On MacOS, this contains strings like {@link org.swixml.Parser#ATTR_MACOS_ABOUT} - * when the attribute "macos_about" was set to true. See the - * provided file mactester.xml as an usage example. This allows specifying - * of multiple "macos_*" attributes for one {@link javax.swing.Action}. - * - * - * @author $Author: tichy $ - */ -public class MacMultipleAction extends AbstractAction { - - /* (non-Javadoc) - * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) - */ - public void actionPerformed(ActionEvent arg0) { - // TODO Auto-generated method stub - JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), "This is the Mac OS X MultipleExample. Showing "+arg0.getActionCommand() ); - - } - -} +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.JOptionPane; +// $Id: MacMultipleAction.java,v 1.1 2004/10/05 21:32:35 tichy Exp $ + +/** + * Demonstrates delivering of a valid action command from the ActionEvent. + * + * On MacOS, this contains strings like {@link org.swixml.Parser#ATTR_MACOS_ABOUT} + * when the attribute "macos_about" was set to true. See the + * provided file mactester.xml as an usage example. This allows specifying + * of multiple "macos_*" attributes for one {@link javax.swing.Action}. + * + * + * @author $Author: tichy $ + */ +public class MacMultipleAction extends AbstractAction { + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + JOptionPane.showMessageDialog( MacTest.getSwix().getRootComponent(), "This is the Mac OS X MultipleExample. Showing "+arg0.getActionCommand() ); + + } + +} diff --git a/samples/MacTest.java b/samples/src/main/java/MacTest.java similarity index 95% rename from samples/MacTest.java rename to samples/src/main/java/MacTest.java index 0be165f..7fd4d38 100755 --- a/samples/MacTest.java +++ b/samples/src/main/java/MacTest.java @@ -1,47 +1,47 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; -import java.io.IOException; - -import com.apple.eio.FileManager; - -/** - * The HelloMac class shows a couple of the Mac specifics exposed - * HeeloMac renders the GUI, which is described in hellomac.xml - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml 1.1 - */ -public class MacTest extends WindowAdapter { - private static SwingEngine swix; - - private MacTest() throws Exception { - swix= new SwingEngine( this ); - swix.render( "xml/mactester.xml" ); - swix.getRootComponent().setVisible( true ); - } - - - // - // Make the class bootable - // - public static void main( String[] args ) throws Exception { - new MacTest(); - } - -/** - * @return - */ -public static SwingEngine getSwix() { - // TODO Auto-generated method stub - return swix; -} - - + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.WindowEvent; +import java.awt.event.WindowAdapter; +import java.io.IOException; + +import com.apple.eio.FileManager; + +/** + * The HelloMac class shows a couple of the Mac specifics exposed + * HeeloMac renders the GUI, which is described in hellomac.xml + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml 1.1 + */ +public class MacTest extends WindowAdapter { + private static SwingEngine swix; + + private MacTest() throws Exception { + swix= new SwingEngine( this ); + swix.render( "xml/mactester.xml" ); + swix.getRootComponent().setVisible( true ); + } + + + // + // Make the class bootable + // + public static void main( String[] args ) throws Exception { + new MacTest(); + } + +/** + * @return + */ +public static SwingEngine getSwix() { + // TODO Auto-generated method stub + return swix; +} + + } \ No newline at end of file diff --git a/samples/MenuBarWithConstraints.java b/samples/src/main/java/MenuBarWithConstraints.java similarity index 95% rename from samples/MenuBarWithConstraints.java rename to samples/src/main/java/MenuBarWithConstraints.java index 4c0a7aa..f21b601 100755 --- a/samples/MenuBarWithConstraints.java +++ b/samples/src/main/java/MenuBarWithConstraints.java @@ -1,22 +1,22 @@ -import java.awt.Container; - -import org.swixml.SwingEngine; - -// $Id: MenuBarWithConstraints.java,v 1.1 2005/08/22 21:20:01 tichy Exp $ -/** - * Sample program to show a menubar with constraints attribute in it. - * - */ -public class MenuBarWithConstraints { - - /** - * @param args - * @throws Exception if something goes wrong - */ - public static void main(String[] args) throws Exception { - SwingEngine se = new SwingEngine(); - Container container = se.render("xml/menu-bar.xml"); - container.setVisible(true); - } - -} +import java.awt.Container; + +import org.swixml.SwingEngine; + +// $Id: MenuBarWithConstraints.java,v 1.1 2005/08/22 21:20:01 tichy Exp $ +/** + * Sample program to show a menubar with constraints attribute in it. + * + */ +public class MenuBarWithConstraints { + + /** + * @param args + * @throws Exception if something goes wrong + */ + public static void main(String[] args) throws Exception { + SwingEngine se = new SwingEngine(); + Container container = se.render("xml/menu-bar.xml"); + container.setVisible(true); + } + +} diff --git a/samples/NewTag.java b/samples/src/main/java/NewTag.java similarity index 95% rename from samples/NewTag.java rename to samples/src/main/java/NewTag.java index aeeaa3b..4855651 100755 --- a/samples/NewTag.java +++ b/samples/src/main/java/NewTag.java @@ -1,38 +1,38 @@ - -import org.swixml.ConverterLibrary; -import org.swixml.SwingEngine; - -import java.util.TimeZone; - -/** - * Extend the TagLib with a new Class and a new Converter - */ -public class NewTag extends SwingEngine { - - private NewTag() { - // - // Register a new new Converter, - // Generally, Converters should be regsitered before Tags - // - ConverterLibrary.getInstance().register( TimeZone.class, new TimeZoneConverter() ); - // - // Register a Tag that uses a SwingEngine itself ... - // - this.getTaglib().registerTag( "xpanel", XPanel.class ); - try { - this.getTaglib().registerTag( "redlabel", RedLabel.class ); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - - try { - render( "xml/newtag.xml" ).setVisible( true ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { - new NewTag(); - } -} + +import org.swixml.ConverterLibrary; +import org.swixml.SwingEngine; + +import java.util.TimeZone; + +/** + * Extend the TagLib with a new Class and a new Converter + */ +public class NewTag extends SwingEngine { + + private NewTag() { + // + // Register a new new Converter, + // Generally, Converters should be regsitered before Tags + // + ConverterLibrary.getInstance().register( TimeZone.class, new TimeZoneConverter() ); + // + // Register a Tag that uses a SwingEngine itself ... + // + this.getTaglib().registerTag( "xpanel", XPanel.class ); + try { + this.getTaglib().registerTag( "redlabel", RedLabel.class ); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + + try { + render( "xml/newtag.xml" ).setVisible( true ); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { + new NewTag(); + } +} diff --git a/samples/RedLabel.java b/samples/src/main/java/RedLabel.java similarity index 95% rename from samples/RedLabel.java rename to samples/src/main/java/RedLabel.java index f476d82..a038227 100755 --- a/samples/RedLabel.java +++ b/samples/src/main/java/RedLabel.java @@ -1,16 +1,16 @@ - -import javax.swing.*; -import java.awt.*; -import java.util.TimeZone; - -public class RedLabel extends JLabel { - public RedLabel() { - this.setForeground( Color.red ); - this.setFont( Font.decode( "VERDANA-BOLD-24" ) ); - } - - public void setTimeZone(TimeZone tz) { - - this.setText( tz.getDisplayName() ); - } -} + +import javax.swing.*; +import java.awt.*; +import java.util.TimeZone; + +public class RedLabel extends JLabel { + public RedLabel() { + this.setForeground( Color.red ); + this.setFont( Font.decode( "VERDANA-BOLD-24" ) ); + } + + public void setTimeZone(TimeZone tz) { + + this.setText( tz.getDisplayName() ); + } +} diff --git a/samples/SwixApplet.java b/samples/src/main/java/SwixApplet.java similarity index 96% rename from samples/SwixApplet.java rename to samples/src/main/java/SwixApplet.java index 4e755b8..2c93b5b 100755 --- a/samples/SwixApplet.java +++ b/samples/src/main/java/SwixApplet.java @@ -1,49 +1,49 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.net.URL; - - -/** - * The SwixmlApplet class shows how to use the SwixmlmlEngine - * to create JApplets. - * The XML descriptor needs to be referenced with an parameter like this: - * xml=xml/SwinxmlApplet.xml - * When ran locally using SUN's AppletViewer, the file needs to be made available here: - * C:\Temlp\xml\... - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - */ - -public class SwixApplet extends JApplet { - - /** JTextField member gets instantiated through Swixml (look for id="tf" in the xml descriptor) */ - public JTextField tf; - /** - * Action appends a '#' to the textfields content. - */ - public AbstractAction submit = new AbstractAction() { - public void actionPerformed( ActionEvent e ) { - tf.setText( tf.getText() + '#' ); - } - }; - - public void init() { - - super.init(); - try { - String descriptorfile = this.getParameter( "xml" ); - if (descriptorfile == null) { - descriptorfile = "xml/applet.xml"; - } - new SwingEngine( this ).insert( new URL( getCodeBase(), descriptorfile ), this ); - this.setVisible( true ); - } catch (Exception e) { - e.printStackTrace(); - } - } -} + +import org.swixml.SwingEngine; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.net.URL; + + +/** + * The SwixmlApplet class shows how to use the SwixmlmlEngine + * to create JApplets. + * The XML descriptor needs to be referenced with an parameter like this: + * xml=xml/SwinxmlApplet.xml + * When ran locally using SUN's AppletViewer, the file needs to be made available here: + * C:\Temlp\xml\... + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + */ + +public class SwixApplet extends JApplet { + + /** JTextField member gets instantiated through Swixml (look for id="tf" in the xml descriptor) */ + public JTextField tf; + /** + * Action appends a '#' to the textfields content. + */ + public AbstractAction submit = new AbstractAction() { + public void actionPerformed( ActionEvent e ) { + tf.setText( tf.getText() + '#' ); + } + }; + + public void init() { + + super.init(); + try { + String descriptorfile = this.getParameter( "xml" ); + if (descriptorfile == null) { + descriptorfile = "xml/applet.xml"; + } + new SwingEngine( this ).insert( new URL( getCodeBase(), descriptorfile ), this ); + this.setVisible( true ); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/samples/TimeZoneConverter.java b/samples/src/main/java/TimeZoneConverter.java similarity index 96% rename from samples/TimeZoneConverter.java rename to samples/src/main/java/TimeZoneConverter.java index 9c455a8..89924e3 100755 --- a/samples/TimeZoneConverter.java +++ b/samples/src/main/java/TimeZoneConverter.java @@ -1,34 +1,34 @@ - -import org.swixml.Attribute; -import org.swixml.Converter; -import org.swixml.Localizer; - -import java.util.SimpleTimeZone; - - -public class TimeZoneConverter implements Converter { - /** - * Convert the value of the given Attribute object into an output object of the - * specified type. - * - * @param type Class Data type to which the Attribute's value should be converted - * @param attr Attribute the attribute, providing the value to be converted. - * - */ - public Object convert(Class type, Attribute attr, Localizer lz) throws Exception { - SimpleTimeZone tz = null; - if (attr != null && attr.getValue() != null) { - tz = new SimpleTimeZone( 0, attr.getValue() ); - } - return tz; - } - - /** - * A Converters conversTo method informs about the Class type the converter - * is returning when its convert method is called - * @return Class - the Class the converter is returning when its convert method is called - */ - public Class convertsTo() { - return SimpleTimeZone.class; - } -} + +import org.swixml.Attribute; +import org.swixml.Converter; +import org.swixml.Localizer; + +import java.util.SimpleTimeZone; + + +public class TimeZoneConverter implements Converter { + /** + * Convert the value of the given Attribute object into an output object of the + * specified type. + * + * @param type Class Data type to which the Attribute's value should be converted + * @param attr Attribute the attribute, providing the value to be converted. + * + */ + public Object convert(Class type, Attribute attr, Localizer lz) throws Exception { + SimpleTimeZone tz = null; + if (attr != null && attr.getValue() != null) { + tz = new SimpleTimeZone( 0, attr.getValue() ); + } + return tz; + } + + /** + * A Converters conversTo method informs about the Class type the converter + * is returning when its convert method is called + * @return Class - the Class the converter is returning when its convert method is called + */ + public Class convertsTo() { + return SimpleTimeZone.class; + } +} diff --git a/samples/XInclude.java b/samples/src/main/java/XInclude.java similarity index 95% rename from samples/XInclude.java rename to samples/src/main/java/XInclude.java index 18833c8..7ff9447 100755 --- a/samples/XInclude.java +++ b/samples/src/main/java/XInclude.java @@ -1,31 +1,31 @@ - -import org.swixml.SwingEngine; - -import java.awt.event.WindowAdapter; - -/** - * The XInclude class shows in simple way how to use xml includes. - * XInclude extends the WindowAdapter and uses a SwingEngine to renders the GUI. - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * - * @since swixml 0.95 - */ -public class XInclude extends WindowAdapter { - private SwingEngine swix = new SwingEngine( this ); - - - private XInclude() { - try { - swix.render( "xml/xinclude.xml" ).setVisible( true ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main( String[] args ) { - new XInclude(); - } -} - + +import org.swixml.SwingEngine; + +import java.awt.event.WindowAdapter; + +/** + * The XInclude class shows in simple way how to use xml includes. + * XInclude extends the WindowAdapter and uses a SwingEngine to renders the GUI. + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * + * @since swixml 0.95 + */ +public class XInclude extends WindowAdapter { + private SwingEngine swix = new SwingEngine( this ); + + + private XInclude() { + try { + swix.render( "xml/xinclude.xml" ).setVisible( true ); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main( String[] args ) { + new XInclude(); + } +} + diff --git a/samples/XPanel.java b/samples/src/main/java/XPanel.java similarity index 95% rename from samples/XPanel.java rename to samples/src/main/java/XPanel.java index 462a417..5203268 100755 --- a/samples/XPanel.java +++ b/samples/src/main/java/XPanel.java @@ -1,32 +1,32 @@ - -import org.swixml.SwingEngine; - -import javax.swing.*; - -/** - * This file contains proprietary information of CarlsbadCubes - * Copying or reproduction without prior written approval is prohibited. - * Copyright (c) 2002-2003 - * - * - * - * Date: Feb 28, 2003 - * - * @author Wolf Paulus - * @version $Revision: 1.1 $ - * @since - */ - -public class XPanel extends JPanel { - - private SwingEngine swix = new SwingEngine( this ); - - - public void setXml(String resource) { - try { - swix.insert( "xml/" + resource, this ); - } catch (Exception e) { - System.err.println( e.getMessage() ); - } - } -} + +import org.swixml.SwingEngine; + +import javax.swing.*; + +/** + * This file contains proprietary information of CarlsbadCubes + * Copying or reproduction without prior written approval is prohibited. + * Copyright (c) 2002-2003 + * + * + * + * Date: Feb 28, 2003 + * + * @author Wolf Paulus + * @version $Revision: 1.1 $ + * @since + */ + +public class XPanel extends JPanel { + + private SwingEngine swix = new SwingEngine( this ); + + + public void setXml(String resource) { + try { + swix.insert( "xml/" + resource, this ); + } catch (Exception e) { + System.err.println( e.getMessage() ); + } + } +} diff --git a/samples/index.html b/samples/src/main/java/index.html similarity index 96% rename from samples/index.html rename to samples/src/main/java/index.html index b310b34..f876ee0 100755 --- a/samples/index.html +++ b/samples/src/main/java/index.html @@ -1,225 +1,225 @@ - - - - - - SWIXML - Generate javax.swing at runtime based on XML descriptors - - - - -
- - -
-
- -

Java and XML Sample Code

- -
    -
  1. - HelloWorld: Small Sample with Label, TextField, Button, and Submit Action - -
  2. -
  3. - HelloMac: Small Sample, showing a some Mac features. - -
  4. -
  5. - Eventhandling: Actions and ActionCommands - -
  6. - -
  7. - Accelerators and Mnemonics - -
  8. - -
  9. - Layout Managers - - - - -
  10. -
  11. - Swixml and Localization - -
  12. -
  13. - How to do Applets with Swixml - -
  14. -
  15. - Extend the Swixml TagLibrary with your own tags - -
  16. -
  17. - ComboBox Tag with an initclass attribute. - - The initclass is loaded, an instance is obtained and passed into the constructor of the tag's implementing - class. -
  18. -
  19. - Swixml now understands some XPointer / XInclude syntax - -
  20. -
  21. - Custom Tags - -
  22. -
  23. - Action Generator( public void myMethod() {..} instead of having to define public Action members. - -
  24. -
-
-Java2Html for all Samples
-The complete sample code is part of the Swixml distribution. -
-
- Carlsbad Cubes Swixml, founded by Wolf Paulus
- © Copyright 2007 - Wolf Paulus. All Rights Reserved.
- Email: info@swixml.org
- All trademarks are property of their respective owners. -
-
- -
- - - + + + + + + SWIXML - Generate javax.swing at runtime based on XML descriptors + + + + +
+ + +
+
+ +

Java and XML Sample Code

+ +
    +
  1. + HelloWorld: Small Sample with Label, TextField, Button, and Submit Action + +
  2. +
  3. + HelloMac: Small Sample, showing a some Mac features. + +
  4. +
  5. + Eventhandling: Actions and ActionCommands + +
  6. + +
  7. + Accelerators and Mnemonics + +
  8. + +
  9. + Layout Managers + + + + +
  10. +
  11. + Swixml and Localization + +
  12. +
  13. + How to do Applets with Swixml + +
  14. +
  15. + Extend the Swixml TagLibrary with your own tags + +
  16. +
  17. + ComboBox Tag with an initclass attribute. + + The initclass is loaded, an instance is obtained and passed into the constructor of the tag's implementing + class. +
  18. +
  19. + Swixml now understands some XPointer / XInclude syntax + +
  20. +
  21. + Custom Tags + +
  22. +
  23. + Action Generator( public void myMethod() {..} instead of having to define public Action members. + +
  24. +
+
+Java2Html for all Samples
+The complete sample code is part of the Swixml distribution. +
+
+ Carlsbad Cubes Swixml, founded by Wolf Paulus
+ © Copyright 2007 - Wolf Paulus. All Rights Reserved.
+ Email: info@swixml.org
+ All trademarks are property of their respective owners. +
+
+ +
+ + + diff --git a/samples/xml/.gitignore b/samples/src/main/resources/icons/.gitignore similarity index 92% rename from samples/xml/.gitignore rename to samples/src/main/resources/icons/.gitignore index a7cbee1..fdb381f 100644 --- a/samples/xml/.gitignore +++ b/samples/src/main/resources/icons/.gitignore @@ -1 +1 @@ -/*.DS_Store +/*.DS_Store diff --git a/samples/icons/about.gif b/samples/src/main/resources/icons/about.gif similarity index 100% rename from samples/icons/about.gif rename to samples/src/main/resources/icons/about.gif diff --git a/samples/icons/button.gif b/samples/src/main/resources/icons/button.gif similarity index 100% rename from samples/icons/button.gif rename to samples/src/main/resources/icons/button.gif diff --git a/samples/icons/copy.gif b/samples/src/main/resources/icons/copy.gif similarity index 100% rename from samples/icons/copy.gif rename to samples/src/main/resources/icons/copy.gif diff --git a/samples/icons/cut.gif b/samples/src/main/resources/icons/cut.gif similarity index 100% rename from samples/icons/cut.gif rename to samples/src/main/resources/icons/cut.gif diff --git a/samples/icons/del.gif b/samples/src/main/resources/icons/del.gif similarity index 100% rename from samples/icons/del.gif rename to samples/src/main/resources/icons/del.gif diff --git a/samples/icons/delete.gif b/samples/src/main/resources/icons/delete.gif similarity index 100% rename from samples/icons/delete.gif rename to samples/src/main/resources/icons/delete.gif diff --git a/samples/icons/exit.gif b/samples/src/main/resources/icons/exit.gif similarity index 100% rename from samples/icons/exit.gif rename to samples/src/main/resources/icons/exit.gif diff --git a/samples/icons/green.gif b/samples/src/main/resources/icons/green.gif similarity index 100% rename from samples/icons/green.gif rename to samples/src/main/resources/icons/green.gif diff --git a/samples/icons/help.gif b/samples/src/main/resources/icons/help.gif similarity index 100% rename from samples/icons/help.gif rename to samples/src/main/resources/icons/help.gif diff --git a/samples/icons/label.gif b/samples/src/main/resources/icons/label.gif similarity index 100% rename from samples/icons/label.gif rename to samples/src/main/resources/icons/label.gif diff --git a/samples/icons/new.gif b/samples/src/main/resources/icons/new.gif similarity index 100% rename from samples/icons/new.gif rename to samples/src/main/resources/icons/new.gif diff --git a/samples/icons/open.gif b/samples/src/main/resources/icons/open.gif similarity index 100% rename from samples/icons/open.gif rename to samples/src/main/resources/icons/open.gif diff --git a/samples/icons/panel.gif b/samples/src/main/resources/icons/panel.gif similarity index 100% rename from samples/icons/panel.gif rename to samples/src/main/resources/icons/panel.gif diff --git a/samples/icons/paste.gif b/samples/src/main/resources/icons/paste.gif similarity index 100% rename from samples/icons/paste.gif rename to samples/src/main/resources/icons/paste.gif diff --git a/samples/icons/save.gif b/samples/src/main/resources/icons/save.gif similarity index 100% rename from samples/icons/save.gif rename to samples/src/main/resources/icons/save.gif diff --git a/samples/icons/.gitignore b/samples/src/main/resources/img/.gitignore similarity index 92% rename from samples/icons/.gitignore rename to samples/src/main/resources/img/.gitignore index a7cbee1..fdb381f 100644 --- a/samples/icons/.gitignore +++ b/samples/src/main/resources/img/.gitignore @@ -1 +1 @@ -/*.DS_Store +/*.DS_Store diff --git a/samples/img/accelerator.png b/samples/src/main/resources/img/accelerator.png similarity index 100% rename from samples/img/accelerator.png rename to samples/src/main/resources/img/accelerator.png diff --git a/samples/img/actions.png b/samples/src/main/resources/img/actions.png similarity index 100% rename from samples/img/actions.png rename to samples/src/main/resources/img/actions.png diff --git a/samples/img/applet.png b/samples/src/main/resources/img/applet.png similarity index 100% rename from samples/img/applet.png rename to samples/src/main/resources/img/applet.png diff --git a/samples/img/cards.png b/samples/src/main/resources/img/cards.png similarity index 100% rename from samples/img/cards.png rename to samples/src/main/resources/img/cards.png diff --git a/samples/img/customtags.png b/samples/src/main/resources/img/customtags.png similarity index 100% rename from samples/img/customtags.png rename to samples/src/main/resources/img/customtags.png diff --git a/samples/img/form.png b/samples/src/main/resources/img/form.png similarity index 100% rename from samples/img/form.png rename to samples/src/main/resources/img/form.png diff --git a/samples/img/gridbag.png b/samples/src/main/resources/img/gridbag.png similarity index 100% rename from samples/img/gridbag.png rename to samples/src/main/resources/img/gridbag.png diff --git a/samples/img/hellomac.png b/samples/src/main/resources/img/hellomac.png similarity index 100% rename from samples/img/hellomac.png rename to samples/src/main/resources/img/hellomac.png diff --git a/samples/img/helloworld.png b/samples/src/main/resources/img/helloworld.png similarity index 100% rename from samples/img/helloworld.png rename to samples/src/main/resources/img/helloworld.png diff --git a/samples/img/initclass.gif b/samples/src/main/resources/img/initclass.gif similarity index 100% rename from samples/img/initclass.gif rename to samples/src/main/resources/img/initclass.gif diff --git a/samples/img/initclass.png b/samples/src/main/resources/img/initclass.png similarity index 100% rename from samples/img/initclass.png rename to samples/src/main/resources/img/initclass.png diff --git a/samples/img/layout.png b/samples/src/main/resources/img/layout.png similarity index 100% rename from samples/img/layout.png rename to samples/src/main/resources/img/layout.png diff --git a/samples/img/localization.png b/samples/src/main/resources/img/localization.png similarity index 100% rename from samples/img/localization.png rename to samples/src/main/resources/img/localization.png diff --git a/samples/img/newtag.png b/samples/src/main/resources/img/newtag.png similarity index 100% rename from samples/img/newtag.png rename to samples/src/main/resources/img/newtag.png diff --git a/samples/img/xinclude.png b/samples/src/main/resources/img/xinclude.png similarity index 100% rename from samples/img/xinclude.png rename to samples/src/main/resources/img/xinclude.png diff --git a/samples/img/.gitignore b/samples/src/main/resources/locale/.gitignore similarity index 92% rename from samples/img/.gitignore rename to samples/src/main/resources/locale/.gitignore index a7cbee1..fdb381f 100644 --- a/samples/img/.gitignore +++ b/samples/src/main/resources/locale/.gitignore @@ -1 +1 @@ -/*.DS_Store +/*.DS_Store diff --git a/samples/locale/swix_de.properties b/samples/src/main/resources/locale/swix_de.properties similarity index 94% rename from samples/locale/swix_de.properties rename to samples/src/main/resources/locale/swix_de.properties index 19fd427..950655c 100755 --- a/samples/locale/swix_de.properties +++ b/samples/src/main/resources/locale/swix_de.properties @@ -1,56 +1,56 @@ -############################################################################# -# Localization -############################################################################# -app_Title = Mac OS X Beispiel Programm -# -# Menu Items -# -mus_File = Datei -mus_Help = Hilfe - -mis_New = Anlegen -mis_Open = Öffnen -mis_Save = Speichern -mis_Exit = Beenden -mis_About = Über -mis_Options = Optionen -mis_Help = Hilfe - -# -# Mnemonic -# - -mn_New = VK_N -mn_Open = VK_O -mn_Save = VK_S -mn_Exit = VK_X - -# -# Tooltips -# -tt_Copy = Kopieren -tt_Cut = Ausschneiden -tt_Paste = Einfuegen - -tt_Label = JLabel -tt_Button = JButton -tt_Panel = JPanel -l -# -# Images -# - -img_About = icons/about.gif -img_App = icons/green.gif -img_Copy = icons/copy.gif -img_Cut = icons/cut.gif -img_Exit = icons/exit.gif -img_New = icons/new.gif -img_Open = icons/open.gif -img_Paste = icons/paste.gif -img_Save = icons/save.gif - - -img_Panel = icons/panel.gif -img_Button = icons/button.gif +############################################################################# +# Localization +############################################################################# +app_Title = Mac OS X Beispiel Programm +# +# Menu Items +# +mus_File = Datei +mus_Help = Hilfe + +mis_New = Anlegen +mis_Open = Öffnen +mis_Save = Speichern +mis_Exit = Beenden +mis_About = Über +mis_Options = Optionen +mis_Help = Hilfe + +# +# Mnemonic +# + +mn_New = VK_N +mn_Open = VK_O +mn_Save = VK_S +mn_Exit = VK_X + +# +# Tooltips +# +tt_Copy = Kopieren +tt_Cut = Ausschneiden +tt_Paste = Einfuegen + +tt_Label = JLabel +tt_Button = JButton +tt_Panel = JPanel +l +# +# Images +# + +img_About = icons/about.gif +img_App = icons/green.gif +img_Copy = icons/copy.gif +img_Cut = icons/cut.gif +img_Exit = icons/exit.gif +img_New = icons/new.gif +img_Open = icons/open.gif +img_Paste = icons/paste.gif +img_Save = icons/save.gif + + +img_Panel = icons/panel.gif +img_Button = icons/button.gif img_Label = icons/label.gif \ No newline at end of file diff --git a/samples/locale/swix_en.properties b/samples/src/main/resources/locale/swix_en.properties similarity index 93% rename from samples/locale/swix_en.properties rename to samples/src/main/resources/locale/swix_en.properties index 2bafa9c..c6380a2 100755 --- a/samples/locale/swix_en.properties +++ b/samples/src/main/resources/locale/swix_en.properties @@ -1,72 +1,72 @@ -############################################################################# -# Localization -############################################################################# - -app_Title = Localization Sample Application - -# -# Menu Items -# - -mus_File = File -mus_Help = Help - -mis_New = New -mis_Open = Open -mis_Save = Save -mis_Exit = Exit -mis_About = About -mis_Options = Options -mis_Help = Help - -# -# Accelerators -# -acc_New = control N -acc_About = alt A -acc_Exit = control alt X -acc_Help = F1 - -# -# Mnemonic -# - -mn_New = VK_N -mn_Open = VK_O -mn_Save = VK_S -mn_Exit = VK_X -mn_Help = VK_H - -# -# Tooltips -# -tt_Copy = Copy -tt_Cut = Cut -tt_Paste = Paste - -tt_Label = JLabel -tt_Button = JButton -tt_Panel = JPanel -l -# -# Images -# - -img_About = icons/about.gif -img_App = icons/green.gif -img_Copy = icons/copy.gif -img_Cut = icons/cut.gif -img_Exit = icons/exit.gif -img_New = icons/new.gif -img_Open = icons/open.gif -img_Paste = icons/paste.gif -img_Save = icons/save.gif -img_Help = icons/help.gif - -img_Panel = icons/panel.gif -img_Button = icons/button.gif -img_Label = icons/label.gif - - - - +############################################################################# +# Localization +############################################################################# + +app_Title = Localization Sample Application + +# +# Menu Items +# + +mus_File = File +mus_Help = Help + +mis_New = New +mis_Open = Open +mis_Save = Save +mis_Exit = Exit +mis_About = About +mis_Options = Options +mis_Help = Help + +# +# Accelerators +# +acc_New = control N +acc_About = alt A +acc_Exit = control alt X +acc_Help = F1 + +# +# Mnemonic +# + +mn_New = VK_N +mn_Open = VK_O +mn_Save = VK_S +mn_Exit = VK_X +mn_Help = VK_H + +# +# Tooltips +# +tt_Copy = Copy +tt_Cut = Cut +tt_Paste = Paste + +tt_Label = JLabel +tt_Button = JButton +tt_Panel = JPanel +l +# +# Images +# + +img_About = icons/about.gif +img_App = icons/green.gif +img_Copy = icons/copy.gif +img_Cut = icons/cut.gif +img_Exit = icons/exit.gif +img_New = icons/new.gif +img_Open = icons/open.gif +img_Paste = icons/paste.gif +img_Save = icons/save.gif +img_Help = icons/help.gif + +img_Panel = icons/panel.gif +img_Button = icons/button.gif +img_Label = icons/label.gif + + + + diff --git a/samples/locale/swix_en_mac.properties b/samples/src/main/resources/locale/swix_en_mac.properties similarity index 93% rename from samples/locale/swix_en_mac.properties rename to samples/src/main/resources/locale/swix_en_mac.properties index 18d2dbc..09e3e32 100755 --- a/samples/locale/swix_en_mac.properties +++ b/samples/src/main/resources/locale/swix_en_mac.properties @@ -1,33 +1,33 @@ -############################################################################# -# Localization -############################################################################# - -app_Title = Mac OS X Sample Application - -# -# Menu Items -# - -mis_Exit = Quit -mis_Options = Preferences - -# -# Mnemonic -# - -mn_New = VK_N -mn_Open = VK_O -mn_Save = VK_S -mn_Exit = VK_X - -# -# Accelerators -# - -acc_New = meta N -acc_About = -acc_Exit = meta Q -acc_Help = meta L - - - +############################################################################# +# Localization +############################################################################# + +app_Title = Mac OS X Sample Application + +# +# Menu Items +# + +mis_Exit = Quit +mis_Options = Preferences + +# +# Mnemonic +# + +mn_New = VK_N +mn_Open = VK_O +mn_Save = VK_S +mn_Exit = VK_X + +# +# Accelerators +# + +acc_New = meta N +acc_About = +acc_Exit = meta Q +acc_Help = meta L + + + diff --git a/samples/locale/.gitignore b/samples/src/main/resources/xml/.gitignore similarity index 92% rename from samples/locale/.gitignore rename to samples/src/main/resources/xml/.gitignore index a7cbee1..fdb381f 100644 --- a/samples/locale/.gitignore +++ b/samples/src/main/resources/xml/.gitignore @@ -1 +1 @@ -/*.DS_Store +/*.DS_Store diff --git a/samples/xml/accelerator.xml b/samples/src/main/resources/xml/accelerator.xml similarity index 97% rename from samples/xml/accelerator.xml rename to samples/src/main/resources/xml/accelerator.xml index 0e49a15..b7a18cc 100755 --- a/samples/xml/accelerator.xml +++ b/samples/src/main/resources/xml/accelerator.xml @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -