Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Roger A. Shepherd on April 18, 2006, 10:31:15 am

Title: How can I get the Swimlanes to have a fill color?
Post by: Roger A. Shepherd on April 18, 2006, 10:31:15 am
Is it possible to set the background color of swimlanes in a BPMN diagram to give it an alternatively shaded 'greenbar paper' effect?  I know the BPMN specification discourages the use of color, but is shading of model elements supported in EA?
If so, how might I accomplish it in the tool?
Thanks  
Title: Re: How can I get the Swimlanes to have a fill col
Post by: «Midnight» on April 18, 2006, 12:48:27 pm
I don't think EA treats swimlanes as elements per se. Thus I do not think you can individually set the color properties.

There was something though in the latest build about extending the cases in which you could set a background color. Take a look at the release notes for build 789 and see if that might help. Of course, you would also have to ensure you were using the latest build in that case.
Title: Re: How can I get the Swimlanes to have a fill col
Post by: nara_c on April 18, 2006, 03:20:17 pm
It does not appear to be possible to set the background colour of the BPMN swimlane.  

However as an alternative, have you cosidered selecting the "Swimlanes..." option from the right click menu on a diagram or the "Configure Swimlanes..." option from the Diagram menu options.  Both options lead to the same "Diagram Swimlanes" screen.

While creating diagram swimlaes it is possible to set the background colour and orientation of the swimlane.

Note however that unlike Swimlane elements from the toolbar, diagrams swimlanes are specific to the diagram where they were created and hence cannot be moved to other diagrams (i.e.) no reusability.  That is the reason they do not appear in the project browser.

Another option is to create stereotypes using shapescripts and making the rectangle at the left end of the partition to appear filled with a colour.  A messy and cumbersome approach but a workaround to meet your need that creates reusable partitions.  

If you want to experiment with this approach here is the shapescript.
----------------
shape main

{

noshadow = true;


//Create Rectangle for colour

setfillcolor(0,150,0);

rectangle(0,0,5,100); // (x1,y1,x2,y2)


//Create lines for rest of Partition

startpath(); // Start to trace out a path

moveto(5,100);

lineto(100,100);

moveto(5,0);

lineto(100,0);

endpath(); //  End tracing out a path

fillandstrokepath(); // Fill the traced path with the fill color

}
----------------

I suggest you consider issues like need, maintenance downstream and overhead before you adopt any option.

Please post here if you find another alternative.

Cheers
Title: Re: How can I get the Swimlanes to have a fill col
Post by: sargasso on April 18, 2006, 04:04:12 pm
or...

Either use boundary elements to fill your swimlanes.  These can be filled.

or...
use Partitions (from the Activity toolbox) instead of swimlanes. These can be filled and are more modern than swimlanes and have much more tricks up their sleeves.

hth
bruce
Title: Re: How can I get the Swimlanes to have a fill col
Post by: nara_c on April 18, 2006, 06:32:27 pm
Quote
or...

or...
use Partitions (from the Activity toolbox) instead of swimlanes. These can be filled and are more modern than swimlanes and have much more tricks up their sleeves.


Bruce,  

how do you fill up the partitions from Activity toolbox?  I have tried it and was not able to change the fill colour.  Even after applying colours from element toolbox or changing the default colour it is not refreshing on the diagram.  Hence my work arounds.

Am I doing something totally wrong while trying to change colours or is there some other setting that needs to be modified to enable filling partitions with different colours.
Title: Re: How can I get the Swimlanes to have a fill col
Post by: KP on April 18, 2006, 06:42:30 pm
Quote
how do you fill up the partitions from Activity toolbox?


This was introduced with build 6.1.789. From the release notes:
Quote
Interaction Fragments, Activity Partitions, and Boundary elements may now have custom background colours
Just select and F4...
Title: Re: How can I get the Swimlanes to have a fill col
Post by: Roger A. Shepherd on April 19, 2006, 04:34:07 pm
Just downloaded and installed Build 789. I had 788 which was my problem.
It works great. Just select the swim lane and press F4.....the rest is the typical pallete dialog that lets you select standard colors or create custom colors.
Thanks, KP for your help.
Dang, this BPMN model is looking pretty ;)
Title: Re: How can I get the Swimlanes to have a fill col
Post by: CaptainXsp on April 20, 2006, 12:24:54 am
To add a background color to a swimlane right click on the diagram window, select swimlanes form the popup menu, select the desired swimlane and chose modify, then you will see back color box: here you can change the color.

Bye Bye
Luca