[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Ability to draw geometric shapes  XML
Forum Index -> Development
Author Message
bzeuner

Power User

Joined: 28/02/2011 17:12:24
Messages: 59
Offline

Hi,

Is there an ability to draw simple geometric shapes like circles, triangles, etc. on a pane? I need to do that to build a color flexible design. I want to create a more complex object out of geometric primitives.
Unfortunately I can't take images because they aren't flexible in matters of the color...

Greets
krinninger

Power User

Joined: 17/11/2008 21:19:41
Messages: 567
Offline

Hello,

you can do this by bgpaint.

there is oval() for circles or polygon() for triangles.

i thought there was a polygon drawing example in demo workplace, but
Containers -> Background Painting and
Containers -> Polygon Drawing is the same. Perhaps this is just a bug in demo workplace and there are already real good examples

Greetings,
Michael
bzeuner

Power User

Joined: 28/02/2011 17:12:24
Messages: 59
Offline

Hey,

thanks for your reply.
In the BGPaint Editor I just can find the oval command, but no polygon. What parameters does this command need?

Greets
krinninger

Power User

Joined: 17/11/2008 21:19:41
Messages: 567
Offline

i'm not quite sure.

so i thought there would be a demo in demo workplace.
but now i found one.

go to Components -> Straight Controls -> Label Control -> Status Sequence

there you can find following jsp code

Code:
                   <t:label id="g_3" background="#800000" bgpaint="image(100%-5,50%,/images/icons/ok.png,rightmiddle)" border="left:30;right:46" font="size:18" foreground="#FFFFFF" height="50" text="Initialized" >
                   </t:label>
                   <t:label id="g_4" background="#008000" bgpaint="line(0,0,0,100%,1,#FFFFFF);polygon(0,50%-7,10,50%,0,50%+7,#800000,#800000,vertical);line(0,50%-7,10,50%,1,#FFFFFF);line(10,50%,0,50%+7,1,#FFFFFF);" border="left:30;right:30" font="size:18" foreground="#FFFFFF" height="50" text="Prepared" >
                   </t:label>
                   <t:label id="g_5" background="#008000" bgpaint="line(0,0,0,100%,1,#FFFFFF);polygon(0,50%-7,10,50%,0,50%+7,#008000,#008000,vertical);line(0,50%-7,10,50%,1,#FFFFFF);line(10,50%,0,50%+7,1,#FFFFFF);" border="left:30;right:30" font="size:18" foreground="#FFFFFF" height="50" text="In Work" >
                   </t:label>
 


so perhapts its:
Code:
 polygon(x1,y1,x2,y2,...,xn,yn, #color) or polygon(x1,y1,x2,y2,...,xn,yn, #fromcolor,#tocolor,vertical/horizontal)
 


but i think you have to discover this on your own, or someone who knows better tells you...

Greetings,
Michael

bzeuner

Power User

Joined: 28/02/2011 17:12:24
Messages: 59
Offline

Thanks for your efforts!
I will try it
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team