Gentlemen,

I'm trying create a BPMN diagram using Javascript instructions, and I need to create a set of lanes inside a pool.

I realize that a swimlane is the same object of a pool, and I'm fine with that. But I realize that this is the same object as an standard rectangle! There's no difference if I use the last parameter of the insertVertex function with the a 'swimlane' configuration.

What's driving me mad is the text orientation of the "swimlanes" affecting every object of the diagram. I took a look at the swimlanes examples, but I still don't discovered how to avoid it.

Is there any way to set different styles only for swimlanes or pools without affecting the entire diagram?

Thanks,

Phillip.

asked 25 Oct '12, 07:25

PhillipSpring's gravatar image

PhillipSpring
26116
accept rate: 33%


This might help (ie. use shape=swimlane or define a style).

link

answered 25 Oct '12, 07:49

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

That worked fine, but at this point I had success creating a style. Here's a sample:

var style = graph.getStylesheet().getDefaultVertexStyle();
style = mxUtils.clone(style);
style[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_SWIMLANE;
style[mxConstants.STYLE_FONTSIZE] = 10;
style[mxConstants.STYLE_STARTSIZE] = 20;
style[mxConstants.STYLE_HORIZONTAL] = false;
style[mxConstants.STYLE_ROUNDED] = false;
style[mxConstants.STYLE_VERTICAL_ALIGN] = 'middle';
graph.getStylesheet().putCellStyle('poll', style);  
var pool1 = graph.insertVertex(parent, null, 'Pool 1', 0, 0, 600, 300, 'pool');
link

answered 25 Oct '12, 08:55

PhillipSpring's gravatar image

PhillipSpring
26116
accept rate: 33%

edited 25 Oct '12, 08:56

David's gravatar image

David
4.9k21831

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×50
×25
×9

Asked: 25 Oct '12, 07:25

Seen: 1,364 times

Last updated: 25 Oct '12, 08:56