protected String getNodeStyle(Node n) {
String style = "tikzgsnode";
if (n instanceof GraphicNode) {
GraphicNode gn = (GraphicNode) n;
style = classNames.get(gn.style.getId());
if (gn.style.getFillMode() == FillMode.DYN_PLAIN) {
double uicolor = gn.getNumber("ui.color");
if (Double.isNaN(uicolor))
uicolor = 0;
int c = gn.style.getFillColorCount();
int s = 1;
double d = 1.0 / (c - 1);
while (s * d < uicolor && s < c)
s++;
uicolor -= (s - 1) * d;
uicolor *= c;
style += String.format(Locale.ROOT, ", fill=%s!%d!%s",
checkColor(gn.style.getFillColor(0)),
(int) (uicolor * 100),
checkColor(gn.style.getFillColor(1)));
}
if (gn.style.getSizeMode() == SizeMode.DYN_SIZE) {
double uisize = gn.getNumber("ui.size");
if (Double.isNaN(uisize))
uisize = minSize;
uisize = (uisize - minSize) / (maxSize - minSize);