Hi all. I need to get the existing style keys for a cell to check whether a style is given or not. Therefore I tried the following mxUtils method: getStylenames(String style). If I have a style like

line;endArrow=none;strokeWidth=2;fontSize=32;strokeColor=#0000FF;fontColor=#0000FF;movable=0;
I expected an array like [line,endArrow,strokeWidth,fontSize,strokeColor,fontColor,movable] but got [line]. Maybe I misunderstood the functionality of this method or is it a bug? I searched the mxUtils class for another solution to get the style-keys of a given cell but didn't found someone. By the way, I use jgraphx 1.8.0.2.

asked 30 Jan '12, 22:41

Hardie82's gravatar image

Hardie82
76318
accept rate: 7%


Stylenames are the parts of a style with no equal sign. To get the keys instead, you'll have to parse the string.

link

answered 31 Jan '12, 06:06

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

In the mxUtils class I found methods like isTrue(Map<String, Object> dict, String key) etc. This would be nice to get a value of a specific style element. But I miss a method to convert a style string of a cell to a map. I use version 1.8.0.2 of jgraphx. Is there any method, that handle this? Otherwise it would be nice if it will be implement in a further version.

link

answered 27 Jul '12, 03:32

Hardie82's gravatar image

Hardie82
76318
accept rate: 7%

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:

×194
×66
×50

Asked: 30 Jan '12, 22:41

Seen: 2,184 times

Last updated: 27 Jul '12, 03:32