Forum | 7 Aug 2005 08:25

Re: SwiXML and FormLayout


 <Forum <at> carlsbadcubes.com> writes:

> 
> Hello
> 
> First of all .. thanks for swixml ..
> 
> I very much like the swixml-forms "hack".
> I am trying to rewrite it so it can be plugged in into swixml but I am
> afraid this will requires some changes to swixml. The current aproach I have
chosen is to create new classes
> for the LayoutConverter to support the the fromlayout and the
ConstraintsConverter to support 
> formlayout constraints and then registering them to swixml
> 
> my now working xml looks like this
> <panel layout="formlayout('pref,2dlu,pref,min','pref,2dlu,pref')">
>    <label labelfor="name" text="Date format"  constraints="xy(1,1)"/> 
>     ..shorted...
> </panel>
> 
> I have managed to overide the  LayoutConverter by registering it a as
LayoutManager converter.
> ConverterLibrary.getInstance().register(LayoutManager.class,new
FormLayoutConverter());
> 
> but for the ConstraintsConverter I can not do the same since that class is not
a real converter
> (doen't implement the interface and is not registered in the converters).
(Continue reading)

Forum | 10 Aug 2005 17:48

Re: Re: SwiXML and FormLayout

Could you post your update of OZebee´s work? I would
also like to use SwiXML with JGoodies Form Layout.

TIA & best regards,
Álvaro Coronel.

--- Forum <at> carlsbadcubes.com wrote:

> 
>  <Forum <at> carlsbadcubes.com> writes:
> 
> > 
> > Hello
> > 
> > First of all .. thanks for swixml ..
> > 
> > I very much like the swixml-forms "hack".
> > I am trying to rewrite it so it can be plugged in
> into swixml but I am
> > afraid this will requires some changes to swixml.
> The current aproach I have
> chosen is to create new classes
> > for the LayoutConverter to support the the
> fromlayout and the
> ConstraintsConverter to support 
> > formlayout constraints and then registering them
> to swixml
> > 
> > my now working xml looks like this
> > <panel
(Continue reading)

Forum | 14 Aug 2005 03:19

OS X - Can't quit program with "Apple Q"

I am running a very simple program:

        JFrame frame = new JFrame();

        frame.setSize(200, 200);

       

        try {
            SwingEngine engine = new SwingEngine();

            engine.render(MainFrame.class.getResource("test.xml"));
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }

        frame.setVisible(true);

The "test.xml" file only has the following three lines:

    

    <?xml version="1.0" encoding="UTF-8"?>
    <panel>
    </panel>

When I run the program on windows, I can quit the program using "Alt-F4". However,  on OS X, "Apple-Q" does not cause the program to quit. I noticed if I comment out the line:
"engine.render(MainFrame.class.getResource("test.xml"));",
the program is able to quit using "Apple Q". Anybody know why this is happening? What does engine.render() do that causes it to not be able to quit? Thanks in advance,
Andrew
_______________________________________________
Forum mailing list
Forum <at> carlsbadcubes.com
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
Forum | 22 Aug 2005 16:05

constraints attribute doesn't work for menubar

Hello,

specifying constraints attribute for menubar tag doesn't have any affect.
here is the possible fix for the problem. Parser.addChild method
should be modified like this:

      //  Set a JMenuBar for JFrames, JDialogs, etc.
      //
      if (component instanceof JMenuBar) {
        try {
          Method m = parent.getClass().getMethod("setJMenuBar", new
Class[]{JMenuBar.class});
          m.invoke(parent, new Object[]{component});
        } catch (NoSuchMethodException e) {
!                       if (constrains == null) {
!                               parent.add(component);
!                       }
!                       else {
!                               parent.add(component, constrains);
!                       }
        } catch (Exception e) {
          // intentionally empty
        }

Regards,
Vitali
Forum | 22 Aug 2005 17:56

Re: constraints attribute doesn't work for menubar


Hello Vitali,

this sounds sensible and useful to me. Allthough the constraints of a menu bar seems to be not used *that*
much (or this would have been discovered earlier) I would like to integrate it.

Wolf, any objections?

Frank

List for Users of Carlsbad Cubes' Technologies and Products <Forum <at> carlsbadcubes.com> schrieb am
22.08.05 17:06:49:
> 
> Hello,
> 
> specifying constraints attribute for menubar tag doesn't have any affect.
> here is the possible fix for the problem. Parser.addChild method
> should be modified like this:
> 
>       //  Set a JMenuBar for JFrames, JDialogs, etc.
>       //
>       if (component instanceof JMenuBar) {
>         try {
>           Method m = parent.getClass().getMethod("setJMenuBar", new
> Class[]{JMenuBar.class});
>           m.invoke(parent, new Object[]{component});
>         } catch (NoSuchMethodException e) {
> !                       if (constrains == null) {
> !                               parent.add(component);
> !                       }
> !                       else {
> !                               parent.add(component, constrains);
> !                       }
>         } catch (Exception e) {
>           // intentionally empty
>         }
> 
> Regards,
> Vitali
> 
> _______________________________________________
> Forum mailing list
> Forum <at> carlsbadcubes.com
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
Forum | 22 Aug 2005 18:11

Re: constraints attribute doesn't work for menubar

I agree it's not used that much (though we do use it)
but this can be seen rather as a framework consistency issue then a
practical one.

Regards,
Vitali

2005/8/22, Forum <at> carlsbadcubes.com <Forum <at> carlsbadcubes.com>:
> 
> Hello Vitali,
> 
> this sounds sensible and useful to me. Allthough the constraints of a menu bar seems to be not used *that*
much (or this would have been discovered earlier) I would like to integrate it.
> 
> Wolf, any objections?
> 
> Frank
> 
> List for Users of Carlsbad Cubes' Technologies and Products <Forum <at> carlsbadcubes.com> schrieb am
22.08.05 17:06:49:
> >
> > Hello,
> >
> > specifying constraints attribute for menubar tag doesn't have any affect.
> > here is the possible fix for the problem. Parser.addChild method
> > should be modified like this:
> >
> >       //  Set a JMenuBar for JFrames, JDialogs, etc.
> >       //
> >       if (component instanceof JMenuBar) {
> >         try {
> >           Method m = parent.getClass().getMethod("setJMenuBar", new
> > Class[]{JMenuBar.class});
> >           m.invoke(parent, new Object[]{component});
> >         } catch (NoSuchMethodException e) {
> > !                       if (constrains == null) {
> > !                               parent.add(component);
> > !                       }
> > !                       else {
> > !                               parent.add(component, constrains);
> > !                       }
> >         } catch (Exception e) {
> >           // intentionally empty
> >         }
> >
> > Regards,
> > Vitali
> >
> > _______________________________________________
> > Forum mailing list
> > Forum <at> carlsbadcubes.com
> > http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
> 
> 
> 
> _______________________________________________
> Forum mailing list
> Forum <at> carlsbadcubes.com
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
Forum | 22 Aug 2005 19:20

ConstraintsConverter and Converter interface

Hello,

Why ConstraintsConverter doesn't implemente Converter interface, and why
when ConstraintsConverter is used we don't use ConverterLibrary to
retrieve ConstraintsConverter ?

With this, it's very hard to add support for new Layout :(
I can't juste register my own ConstraintsConverter and LayoutConverter :(

Could you change this ?

--

-- 
Benjamin
--------------------
email: poussin <at> codelutin.com           () campagne du ruban ascii
http://www.codelutin.com               /\ pour les mails en ascii
Forum | 22 Aug 2005 19:14

patch for JDK 5.0 for JFrame layout

Hello,

I think swixml doesn't work properly with JDK 5.0.

I have modified Parser.java to detect RootPaneContainer when we want to
get LayoutManager.

Before this patch, i can't change layout on frame, after there is no probleme.

--- swixml_144/src/org/swixml/Parser.java       2005-06-04 15:25:36.000000000 +0200
+++ swixml_144.patch/src/org/swixml/Parser.java 2005-08-03 22:24:13.000000000 +0200
 <at>  <at>  -518,7 +518,15  <at>  <at> 
     //  process child tags
     //

-    LayoutManager layoutMgr = obj instanceof Container ? ((Container) obj).getLayout() : null;
+// BB patch //
+    LayoutManager layoutMgr = null;
+    if(obj instanceof RootPaneContainer){
+      layoutMgr = ((RootPaneContainer)obj).getContentPane().getLayout();
+    } else if (obj instanceof Container){
+      layoutMgr = ((Container) obj).getLayout();
+    }
+//    LayoutManager layoutMgr = obj instanceof Container ? ((Container) obj).getLayout() : null;
+// BB patch //

     Iterator it = element.getChildren().iterator();
     while (it != null && it.hasNext()) {

--

-- 
Benjamin
--------------------
email: poussin <at> codelutin.com           () campagne du ruban ascii
http://www.codelutin.com               /\ pour les mails en ascii
Forum | 22 Aug 2005 23:01

Re: constraints attribute doesn't work for menubar

Forum <at> carlsbadcubes.com wrote:
> I agree it's not used that much (though we do use it)
> but this can be seen rather as a framework consistency issue then a
> practical one.

Hello,

Indeed, the framework is more consistent by that.

I integrated your patch and wrote a small sample program for it to test
it. Unfortunatly, I have some problems regarding my CVS access to
cvs.dev.java.net. Will try again tomorrow...

Yours,

Frank

> 
> Regards,
> Vitali
> 
> 2005/8/22, Forum <at> carlsbadcubes.com <Forum <at> carlsbadcubes.com>:
> 
>>Hello Vitali,
>>
>>this sounds sensible and useful to me. Allthough the constraints of a menu bar seems to be not used *that*
much (or this would have been discovered earlier) I would like to integrate it.
>>
>>Wolf, any objections?
>>
>>Frank
>>
>>List for Users of Carlsbad Cubes' Technologies and Products <Forum <at> carlsbadcubes.com> schrieb am
22.08.05 17:06:49:
>>
>>>Hello,
>>>
>>>specifying constraints attribute for menubar tag doesn't have any affect.
>>>here is the possible fix for the problem. Parser.addChild method
>>>should be modified like this:
>>>
>>>      //  Set a JMenuBar for JFrames, JDialogs, etc.
>>>      //
>>>      if (component instanceof JMenuBar) {
>>>        try {
>>>          Method m = parent.getClass().getMethod("setJMenuBar", new
>>>Class[]{JMenuBar.class});
>>>          m.invoke(parent, new Object[]{component});
>>>        } catch (NoSuchMethodException e) {
>>>!                       if (constrains == null) {
>>>!                               parent.add(component);
>>>!                       }
>>>!                       else {
>>>!                               parent.add(component, constrains);
>>>!                       }
>>>        } catch (Exception e) {
>>>          // intentionally empty
>>>        }
>>>
>>>Regards,
>>>Vitali
>>>
>>>_______________________________________________
>>>Forum mailing list
>>>Forum <at> carlsbadcubes.com
>>>http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>>
>>
>>
>>_______________________________________________
>>Forum mailing list
>>Forum <at> carlsbadcubes.com
>>http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>>
> 
> 
> _______________________________________________
> Forum mailing list
> Forum <at> carlsbadcubes.com
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
> 
Forum | 22 Aug 2005 23:06

iX Article

Hello Swixm-Users,

I might point out the german it-magazine "iX" mentioned Swixml in some
paragraphs regarding XML, issue august 2005. It caught my eye as I
flipped through the pages and something reminded me on the "Layout
Example" at www.swixml.org ;)

Yours,

Frank

Gmane