Background Image

3 views
Skip to first unread message

Fidel Viegas

unread,
Jul 26, 2009, 5:07:25 AM7/26/09
to aria-fr...@googlegroups.com
Hi Luan,

I was playing with layers, and I was able to use a background image
just by using layers. What I did was create a background layer where I
placed my image constrained by the with and height of the Page, and
then created another layer on top of that, where I placed my
components. Nonetheless, I have noticed something that I don't know it
is supposed to work like that or not. I have added a Panel inside my
layer, and it does not show in the page. Aren't we supposed to add
other containers inside a layer?

I know you have explained to me how you would do it, but could you
post an example of that using a Panel with a background image.

Thanks in advance,

Fidel.

Luan O'Carroll

unread,
Jul 26, 2009, 6:47:58 AM7/26/09
to aria-fr...@googlegroups.com
Hi Fidel,

Does the layer have a layout? If so that could be affecting the
behavior. Aria should be setting the layout to null (but I'll have to
check that).

Regards

Luan

2009/7/26 Fidel Viegas <fidel....@gmail.com>:

Luan O'Carroll

unread,
Jul 26, 2009, 9:30:27 AM7/26/09
to aria-fr...@googlegroups.com
Hi Fidel,

I've just commited a small sample to SVN, see
http://aria.svn.sourceforge.net/viewvc/aria/trunk/samples/features/Layers

It has a background image and some trivial interaction with the layers.

-Luan



2009/7/26 Luan O'Carroll <luan.o...@gmail.com>:

Fidel Viegas

unread,
Jul 26, 2009, 4:31:32 PM7/26/09
to aria-fr...@googlegroups.com
Hi Luan,

On Sun, Jul 26, 2009 at 11:47 AM, Luan O'Carroll<luan.o...@gmail.com> wrote:
>
> Hi Fidel,
>
> Does the layer have a layout? If so that could be affecting the
> behavior. Aria should be setting the layout to null (but I'll have to
> check that).
>

No, it doesn't. I haven't added any layout. I have added to the page
afterwards, but not to the layer itself.

Thanks,

Fidel.

Fidel Viegas

unread,
Jul 26, 2009, 4:31:58 PM7/26/09
to aria-fr...@googlegroups.com
On Sun, Jul 26, 2009 at 2:30 PM, Luan O'Carroll<luan.o...@gmail.com> wrote:
>
> Hi Fidel,
>
> I've just commited a small sample to SVN, see
> http://aria.svn.sourceforge.net/viewvc/aria/trunk/samples/features/Layers
>
> It has a background image and some trivial interaction with the layers.
>
> -Luan
>

Thanks!

I will have a look at it.

Fidel.

Fidel Viegas

unread,
Jul 26, 2009, 4:42:44 PM7/26/09
to aria-fr...@googlegroups.com
Hi Luan,


On Sun, Jul 26, 2009 at 2:30 PM, Luan O'Carroll<luan.o...@gmail.com> wrote:
>

> Hi Fidel,
>
> I've just commited a small sample to SVN, see
> http://aria.svn.sourceforge.net/viewvc/aria/trunk/samples/features/Layers
>
> It has a background image and some trivial interaction with the layers.
>

I have looked into the code and this is how I had done on my code, but
I was having problems when adding a Panel inside a Layer. It wasn't
showing. So my question was regarding containers inside layers. Are
they allowed? Why isn't my Panel showing?

Thanks in advance,

Fidel.

Luan O'Carroll

unread,
Jul 27, 2009, 3:26:51 AM7/27/09
to aria-fr...@googlegroups.com
Yes, panels should be allowed and work - I'll take a look later.

2009/7/26 Fidel Viegas <fidel....@gmail.com>:

Luan O'Carroll

unread,
Jul 27, 2009, 4:39:00 PM7/27/09
to aria-fr...@googlegroups.com
Hi Fidel,

I just tried the XML below and it worked OK for me...

My guess is that the z-order you have is not correct and some
components are obscured, or that your nested components are offset and
go offscreen. In the example the nested label is at 0,0 in its parent
panel.

Regards

Luan

<?xml version="1.0" encoding="UTF-8"?>
<Page class="aria.projects.myproject.Welcome" w="632" h="446"
style="Stripe">
<Guides width="632" height="446">
<vert />
<horz />
</Guides>
<Components>
<Layer name="Background" x="0" y="0" w="634" h="448">
<Image name="bkImage" x="130" y="10" w="304" h="395"
imageName="iStock_000003278011XSmall.jpg"/>
</Layer>
<Layer name="WorkLayer" x="0" y="0" w="634" h="448">
<Button name="hideBtn" x="159" y="95" w="158" h="20"
content="Hide WorkLayer"/>
<Label name="child1" x="329" y="96" w="236" h="20"
content="This text is on the top Layer" verticalAlignment="Top"
antiAlias="false"/>
<Panel name="NestedPanel" x="200" y="200" w="200"
h="200" style="Stripe">
<Label name="Foo" x="0" y="0" w="236" h="20"
content="Text in a nested panels" verticalAlignment="Top"
antiAlias="false"/>
</Panel>
</Layer>
</Components>
<Events>
<Event method="hideTopLayer" target="hideBtn" type="ActionHandler"/>
</Events>
</Page>

2009/7/27 Luan O'Carroll <luan.o...@gmail.com>:

Fidel Viegas

unread,
Jul 28, 2009, 4:11:02 AM7/28/09
to aria-fr...@googlegroups.com
On Mon, Jul 27, 2009 at 9:39 PM, Luan O'Carroll<luan.o...@gmail.com> wrote:
>
> Hi Fidel,
>

Hi Luan,

I have had a very strange behaviour. I copied the code you have just
provided and execute it. It was working. I was unable to see the
panel, and the text that was supposed to be the top layer, wasn't also
showing. I then commented the panel, and I was able to see the label
inside the panel. Then, I uncommented once again and executed the
program and it was working as it should. It was very strange. I am
unable to reproduce this behaviour, but I will try and see if I find
what caused it.

All the best,

Fidel.

Luan O'Carroll

unread,
Jul 28, 2009, 11:48:45 AM7/28/09
to aria-fr...@googlegroups.com
Very strange alright... sounds like something stuck in memory or
cached somewhere.

Are you using Eclipse by any chance? it sometimes does stuff like that
unless you force it to refresh.

2009/7/28 Fidel Viegas <fidel....@gmail.com>:

Fidel Viegas

unread,
Jul 28, 2009, 12:15:20 PM7/28/09
to aria-fr...@googlegroups.com
On Tue, Jul 28, 2009 at 4:48 PM, Luan O'Carroll<luan.o...@gmail.com> wrote:
>
> Very strange alright... sounds like something stuck in memory or
> cached somewhere.
>
> Are you using Eclipse by any chance? it sometimes does stuff like that
> unless you force it to refresh.
>

Hi Luan,

No, I am using openjdk. I actually thought that it might be related to
the runtime itself. I am running it on Ubuntu 9.04. I will do quite a
few tests to see if I can reproduce the problem. It may have been
cached somewhere.

Now, there is one thing that I noticed in order to have Aria run with
openjdk or the sun sdk itself. I didn't know that you were using the
swingx components. You do not mention in the documentation, so I never
thought you would require extra libraries. But I am taking notes of
all of this so that I can write the first tutorial, on how to setup
the aria environment using the command line.

I am doing quite a bit of experiments and may come with some questions.

All the best,

Fidel.

Luan O'Carroll

unread,
Jul 29, 2009, 4:42:22 AM7/29/09
to aria-fr...@googlegroups.com
Hi Fidel,

There is some use of the painter's API in the Swing components, but
only the interface.

The JDK version is slightly different. I would like to get rid of the
dependancy, but I haven't come up with a scheme for doing that
**yet**.

Regards

Luan

2009/7/28 Fidel Viegas <fidel....@gmail.com>:

Luan O'Carroll

unread,
Aug 6, 2009, 3:55:56 PM8/6/09
to aria-fr...@googlegroups.com
Hi Fidel,

In the latest code I have just reduced the dependency on the SwingX
painters so that it should only be required if a SwingX painter is
actually used. The example now runs without the SwingX library. The
code is in SVN if you need it.

Regards

Luan

2009/7/28 Fidel Viegas <fidel....@gmail.com>:
>

Fidel Viegas

unread,
Aug 10, 2009, 7:01:31 PM8/10/09
to aria-fr...@googlegroups.com
Hi Luan,

On Thu, Aug 6, 2009 at 8:55 PM, Luan O'Carroll<luan.o...@gmail.com> wrote:
>
> Hi Fidel,
>
> In the latest code I have just reduced the dependency on the SwingX
> painters so that it should only be required if a SwingX painter is
> actually used. The example now runs without the SwingX library. The
> code is in SVN if you need it.
>

Thanks!

Fidel.

Reply all
Reply to author
Forward
0 new messages