[graphicsbuilder] help on startup

View: New views
6 Messages — Rating Filter:   Alert me  

[graphicsbuilder] help on startup

by Raphaël :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi folks,

I  try to use graphics builder (GB), but fail.

I downloaded the latest sources of GB, changed some things in pom --
self version 0.6-SNAPSHOT forced and groovy version
1.6-beta-2-SNAPSHOT forced
I made a project (with dependencies to GB)
In a junit4 test case i tried these:
    @Test void graphics() {
        def width = 300
        def height = width * 3 / 4
        GraphicsBuilder gb = new GraphicsBuilder()
        // group all operations in the same set
        GroovyShell gs = new GroovyShell()
        Script tip = gs.evaluate("""  go={
            // translate the whole group to an arbitrary position
            transformations {
                translate(x: 10, y: 10)
            }
            // turn on antialiasing
            antialias('on')
            // base background shape, it will be reused for clipping
            rect(x: 0, y: 0, width: width, height: height, arcWidth:
40, arcHeight: 40,
                asShape: true, id: 'background')
            // clip everything outside of the background shape
            clip(background)
            // draw the actual background
            draw(background, borderColor: false) {
                // a nice downward diagonal gradient from 'blue' to 'cyan'
                gradientPaint(x1: 0, y1: 0, x2: 50, y2: 50,
                    color1: color('blue'), color2: color('cyan'))
            }}""")
        def graphicsOperation = gb.build(tip) // line 40
}

but have an exception:
-------------------------------------------------------------------------------
Test set: org.codehaus.groovy.swingrails.TestApplication
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.032
sec <<< FAILURE!
graphics(org.codehaus.groovy.swingrails.TestApplication)  Time
elapsed: 10.014 sec  <<< ERROR!
java.lang.IllegalArgumentException: object is not an instance of declaring class
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:941)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:780)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:941)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
        at groovy.lang.Closure.call(Closure.java:292)
        at groovy.util.FactoryBuilderSupport.handleNodeAttributes(FactoryBuilderSupport.java:688)
        at groovy.util.FactoryBuilderSupport.createNode(FactoryBuilderSupport.java:472)
        at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:528)
        at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:304)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.invoke(PogoMetaClassSite.java:40)
        at org.codehaus.groovy.runtime.callsite.CallSite.call(CallSite.java:126)
        at org.codehaus.groovy.swingrails.TestApplication.graphics(TestApplication.groovy:40)

can that be caused by the groovy version?

Regards,

Raphaël

Re: [graphicsbuilder] help on startup

by Andres Almiray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Raphaël,

GraphicsBuilder doesn't work with any version of Groovy 1.6. I haven't pinpointed the exact problem yet but I expect to have a working version either by 1.6-beta-2 or 1.6 final

Is there a particular reason to want 1.6-beta-2SNAPSHOT (other than sexy ASTTransformations and the new bind syntax?)

Cheers,
Andres

Raphaël wrote:
Hi folks,

I  try to use graphics builder (GB), but fail.

I downloaded the latest sources of GB, changed some things in pom --
self version 0.6-SNAPSHOT forced and groovy version
1.6-beta-2-SNAPSHOT forced
I made a project (with dependencies to GB)
In a junit4 test case i tried these:
    @Test void graphics() {
        def width = 300
        def height = width * 3 / 4
        GraphicsBuilder gb = new GraphicsBuilder()
        // group all operations in the same set
        GroovyShell gs = new GroovyShell()
        Script tip = gs.evaluate("""  go={
            // translate the whole group to an arbitrary position
            transformations {
                translate(x: 10, y: 10)
            }
            // turn on antialiasing
            antialias('on')
            // base background shape, it will be reused for clipping
            rect(x: 0, y: 0, width: width, height: height, arcWidth:
40, arcHeight: 40,
                asShape: true, id: 'background')
            // clip everything outside of the background shape
            clip(background)
            // draw the actual background
            draw(background, borderColor: false) {
                // a nice downward diagonal gradient from 'blue' to 'cyan'
                gradientPaint(x1: 0, y1: 0, x2: 50, y2: 50,
                    color1: color('blue'), color2: color('cyan'))
            }}""")
        def graphicsOperation = gb.build(tip) // line 40
}

but have an exception:
-------------------------------------------------------------------------------
Test set: org.codehaus.groovy.swingrails.TestApplication
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.032
sec <<< FAILURE!
graphics(org.codehaus.groovy.swingrails.TestApplication)  Time
elapsed: 10.014 sec  <<< ERROR!
java.lang.IllegalArgumentException: object is not an instance of declaring class
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:941)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:780)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:941)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
        at groovy.lang.Closure.call(Closure.java:292)
        at groovy.util.FactoryBuilderSupport.handleNodeAttributes(FactoryBuilderSupport.java:688)
        at groovy.util.FactoryBuilderSupport.createNode(FactoryBuilderSupport.java:472)
        at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:528)
        at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:304)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.invoke(PogoMetaClassSite.java:40)
        at org.codehaus.groovy.runtime.callsite.CallSite.call(CallSite.java:126)
        at org.codehaus.groovy.swingrails.TestApplication.graphics(TestApplication.groovy:40)

can that be caused by the groovy version?

Regards,

Raphaël

Re: [graphicsbuilder] help on startup

by Raphaël :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the bind syntax is what i seek.

Raphaël

2008/7/2 Andres Almiray <aalmiray@...>:

>
> Hi Raphaël,
>
> GraphicsBuilder doesn't work with any version of Groovy 1.6. I haven't
> pinpointed the exact problem yet but I expect to have a working version
> either by 1.6-beta-2 or 1.6 final
>
> Is there a particular reason to want 1.6-beta-2SNAPSHOT (other than sexy
> ASTTransformations and the new bind syntax?)
>
> Cheers,
> Andres
>
>
> Raphaël wrote:
>>
>> Hi folks,
>>
>> I  try to use graphics builder (GB), but fail.
>>
>> I downloaded the latest sources of GB, changed some things in pom --
>> self version 0.6-SNAPSHOT forced and groovy version
>> 1.6-beta-2-SNAPSHOT forced
>> I made a project (with dependencies to GB)
>> In a junit4 test case i tried these:
>>     @Test void graphics() {
>>         def width = 300
>>         def height = width * 3 / 4
>>         GraphicsBuilder gb = new GraphicsBuilder()
>>         // group all operations in the same set
>>         GroovyShell gs = new GroovyShell()
>>         Script tip = gs.evaluate("""  go={
>>             // translate the whole group to an arbitrary position
>>             transformations {
>>                 translate(x: 10, y: 10)
>>             }
>>             // turn on antialiasing
>>             antialias('on')
>>             // base background shape, it will be reused for clipping
>>             rect(x: 0, y: 0, width: width, height: height, arcWidth:
>> 40, arcHeight: 40,
>>                 asShape: true, id: 'background')
>>             // clip everything outside of the background shape
>>             clip(background)
>>             // draw the actual background
>>             draw(background, borderColor: false) {
>>                 // a nice downward diagonal gradient from 'blue' to 'cyan'
>>                 gradientPaint(x1: 0, y1: 0, x2: 50, y2: 50,
>>                     color1: color('blue'), color2: color('cyan'))
>>             }}""")
>>         def graphicsOperation = gb.build(tip) // line 40
>> }
>>
>> but have an exception:
>> -------------------------------------------------------------------------------
>> Test set: org.codehaus.groovy.swingrails.TestApplication
>> -------------------------------------------------------------------------------
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.032
>> sec <<< FAILURE!
>> graphics(org.codehaus.groovy.swingrails.TestApplication)  Time
>> elapsed: 10.014 sec  <<< ERROR!
>> java.lang.IllegalArgumentException: object is not an instance of declaring
>> class
>>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>       at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>       at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>       at java.lang.reflect.Method.invoke(Method.java:597)
>>       at
>> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
>>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
>>       at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:941)
>>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:780)
>>       at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:941)
>>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:743)
>>       at groovy.lang.Closure.call(Closure.java:292)
>>       at
>> groovy.util.FactoryBuilderSupport.handleNodeAttributes(FactoryBuilderSupport.java:688)
>>       at
>> groovy.util.FactoryBuilderSupport.createNode(FactoryBuilderSupport.java:472)
>>       at
>> groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:528)
>>       at
>> groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:304)
>>       at
>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.invoke(PogoMetaClassSite.java:40)
>>       at org.codehaus.groovy.runtime.callsite.CallSite.call(CallSite.java:126)
>>       at
>> org.codehaus.groovy.swingrails.TestApplication.graphics(TestApplication.groovy:40)
>>
>> can that be caused by the groovy version?
>>
>> Regards,
>>
>> Raphaël
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-graphicsbuilder--help-on-startup-tp18227015p18227529.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Re: [graphicsbuilder] help on startup

by Andres Almiray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Raphaël wrote:
the bind syntax is what i seek.
I will probably make a release of GB soon anyway, then I can take a look at g1.6 integration. But I'm not so sure the new bind syntax may be available in trunk, some portions of the code may exist only in the Griffon module, have to check that.

Re: [graphicsbuilder] help on startup

by Raphaël :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use only the one defined in groovy core
even if i use the same 1.6-beta-2-snapshot as griffon

Raphaël

2008/7/2 Andres Almiray <aalmiray@...>:

>
>
> Raphaël wrote:
>>
>> the bind syntax is what i seek.
>>
> I will probably make a release of GB soon anyway, then I can take a look at
> g1.6 integration. But I'm not so sure the new bind syntax may be available
> in trunk, some portions of the code may exist only in the Griffon module,
> have to check that.
> --
> View this message in context: http://www.nabble.com/-graphicsbuilder--help-on-startup-tp18227015p18244778.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Re: [graphicsbuilder] help on startup

by shemnon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'll bring it over tonight.  IMHO we are at least w month from the end of any 1.6 rc cycle, so it should be safe to add.

On Wed, Jul 2, 2008 at 1:17 PM, Andres Almiray <aalmiray@...> wrote:


Raphaël wrote:
>
> the bind syntax is what i seek.
>
I will probably make a release of GB soon anyway, then I can take a look at
g1.6 integration. But I'm not so sure the new bind syntax may be available
in trunk, some portions of the code may exist only in the Griffon module,
have to check that.
--
View this message in context: http://www.nabble.com/-graphicsbuilder--help-on-startup-tp18227015p18244778.html
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
------------------------------------------------------
I'm Danno Ferrin, and I approved this message.
LightInTheBox - Buy quality products at wholesale price