Forum | 12 Apr 21:54 2005

more flexible Factory interface

Hello,

we started porting our application to swixml. So far it works just 
great. 
We haven't encountered any serious problems. Thank you for great tool.

May I make some proposals concerning code improvements. There is 
a method Parser.addChild(..). Why can't we introduce addChild method 
in Factory
interface like this

/**
  *  <at> param parent component returned by newInstance method
  *  <at> param child child component
  *  <at> param index index of child as it appears in xml file
  *  <at> param attributes child's attributes specified in xml
  */
void addChild(Object parent, Object child, int index, List 
attributes);

then we could have different factories for specific containers 
like JMenuBar, JScrollPane etc.

What advantages does it give to us. 
1. it makes code more object oriented by avoiding 
long if .. else if .. block in Parser.addChild method.

2. It would allow users to create their own custom gui containers and 
incorporate them into swixml by creating custom factories and 
overriding addChild method. 
(Continue reading)

Forum | 16 Apr 21:15 2005

SwiXml Tutorial ?

Hello to everyone.

I am new to SwiXml and i cannot find a User's Guide or Developer's Guide or
something like a Tutorial to jump start with.

If anyone knows where i can find one please reply !

Thanks

Xarisd
Forum | 20 Apr 21:22 2005

Working optionpane tag example?

Does anyone have a working example of using the optionpane tag?
I tried the XML at the end of this email but no dialog displays.  In the
Java code, I've tried setVisible(true) and show() on the object returned
from render().  There are no errors or messages that I can tell.  If I
change the optionpane to dialog or frame, I can get the window to appear
with no problem.  

Any help or suggestions is appreciated!

	try {
        ScenarioModel sm = new ScenarioModel();
        SwingEngine sw = new SwingEngine( sm );
        Container c = sw.render("newScenario.xml");
        c.setVisible(true);
      } catch (Exception e) {
        e.printStackTrace();
      }

<?xml version="1.0" encoding="UTF-8"?>
<optionpane id="newScenario" layout="BorderLayout" 
  optiontype="JOptionPane.OK_CANCEL_OPTION"
messagetype="JOptionPane.INFORMATION_MESSAGE"
  defaultcloseoperation="WindowConstants.DISPOSE_ON_CLOSE" >
	<panel name="pnl" constraints="BorderLayout.CENTER"
layout="GridBagLayout">
    <label text="Name">
      <gridbagconstraints id="gbc_0" insets="0,0,0,0" gridx="0" gridy="0"
ipadx="0" ipady="0" weightx="1" weighty="1"/>
    </label>
    <textfield id="scenarioName" Columns="20" Text="Scenario name Here">
(Continue reading)

Forum | 24 Apr 21:06 2005

Re: Working optionpane tag example?

Hello,

Forum <at> carlsbadcubes.com wrote:
> Does anyone have a working example of using the optionpane tag?

> I tried the XML at the end of this email but no dialog displays.  In the

This is correct, your xml does not contain a dialog. The optionpane 
cannot be used that way. Have a look at the Javadocs of JOptionPane for 
that. IMHO the joptionpane tag should'nt be a valid swixml tag anyway.

> Java code, I've tried setVisible(true) and show() on the object returned
> from render().  There are no errors or messages that I can tell.  If I
> change the optionpane to dialog or frame, I can get the window to appear
> with no problem.  

Remove the <optionpane>-Element around your elements with a panel first. 
Then give the returned container to a JOptionPane.showXxxxDialog(...) as 
the message parameter (Object type). This is the way I usually render 
small (four, six elements) swixml files.

Yours,

Frank

PS: Sorry for the late reply, I was on a holiday for three weeks ;)

> 
> Any help or suggestions is appreciated!
>       
(Continue reading)


Gmane