osmbonuspack get KmlPlacemark Style - kml

In Osmbonuspack, I am displaying a KML on the OSM map. Now I am parsing the KML using KmlDocument. When I get a KmlPlacemark, how to get the "style" attribute of this KmlPlacemark?
kmlPlacemark.mStyle is just a String variable.

I found that KmlDocument object is used to get the Style like this:
Style style = kmlDocument.getStyle(kmlPlacemark.mStyle);

Related

fabricJS - SVG parameters with toSVG

According to this link, it is possible to modify a SVG, depending on the parameters included in the URL used to access this SVG.
Is it possible to do so using the toSVG() method ?
Let's say I create a basic canvas with a few elements. Once I'm done, I export and save the result of my canvas.toSVG() on AWS.
I get this image
Is it possible to modify the way toSVG() behaves, so that adding ?color=red at the end of the URL would make my tshirt red ?
I tried using the example from the documentation, using replace() on my canvas objects, but this generates empty SVGs.

Get RaphaelJS parent from node

Is it possible to get the parent of the RaphaelJS generated code? I use a converter to convert my SVG to Raphael code, which I don't want to change, as I would have to do that for every iteration of my SVG file. Inside Illustrator, I have a structure like this:
GroupName
<Path>
<Path>
<Path>
The group has a name, which gets set like this:
var GroupName = rsr.set();
var path_a = rsr.path("......").attr({parent: "GroupName"});
var path_b = rsr.path("......").attr({parent: "GroupName"});
So they're not nested in the code or on the object, but the path actually has an attribute called "parent". How do I access that variable? I have tried multiple things, such as element.node.data("parent"), element.getAttribute("parent"), element.node.getAttribute("parent"), and so on.
I want to be able to mouseover on multiple paths, which has the same parent, and then run some code.
Workaround hack here:
It's trying to add the parent attribute on the element, but it's not allowed by Raphael. Inside the Raphael source code, there's an availableAttrs property. By adding parent: "" to it, I could actually add the HTML property on the element, then simply grab it with getAttribute on my node.
Neat little workaround which I only have to apply everytime Raphael comes out with an update (which is never).

How to set the global font of word file via Apache poi?

I'm a newbie of apache poi, and am using poi to write some data to docx file. Recently I encountered a problem of font, hope any body can give me some help.
I began the writing with an empty word file named empty.docx, as following.
InputStream input = getClass().getClassLoader().getResourceAsStream("empty.docx");
XWPFDocument document = new XWPFDocument(input);
In the empty.docx the default font is 'Arial', that means if you add any content they will inherit this font as long as you don't change the font manually.
But after I filled the content and write it to a new docx file,the default font was changed to 'Century'.
OutputStream output = new FileOutputStream("output.docx");
document.write(output);
I want to change it back to 'Arial', but after a lot of search only found the methods to set font of XWPFRun.
run.getCTR().getRPr().getRFonts().setEastAsia(eastAsiaFontName);
run.getCTR().getRPr().getRFonts().setHAnsi(normalFontName);
I want to know if there is any method to change the global font of the whole document?
You can set the default font of the document like this (using your variable names):
XWPFStyles styles = document.createStyles();
CTFonts fonts = CTFonts.Factory.newInstance();
fonts.setEastAsia(eastAsiaFontName);
fonts.setHAnsi(normalFontName);
styles.setDefaultFonts(fonts);
I am currently stuck at how I set the default font size. That's why I found this question... The XWPFStyles class has a member "CTStyles ctStyles" with which it would be possible to define any property defined in the XML spec. But unfortunately it has only a public setter, but no getter.

How to wrap af:inputFile text name?

I am using JDeveloper 11.1.2.3.0,
I have an inputFile component in my page that takes its text value from the name of some components. The problem is that that when the text is long it gets displayed all there and may even occupy the whole window. Is there any possibility to wrap this text value in this case?
I don't think <af:inputFile> has a labelStyle attribute:
You can try adding the CSS in the component's inlineStyle or contentStyle
<af:inputFile inlineStyle="word-wrap:break-word;" />
It depends if the very long text is in the content or the label of the field.
If this doesn't do the trick, you can try creating a custom skin and customizing the label or content style via the adf style selectors: af|inputFile::content , af|inputFile::label.
Btw, you need to check if word-wrap works on all browsers you're targeting.
You can try setting the labelStyle attribute of the <af:inputFile> component to wrap the contents of the label. I am not sure of the CSS style attribtue information for it, but searching on the net I found word-wrap:break-word;.
I too had this problem with af:inputFile.
Just give contentStyle="width:200px" it will solve the issue.
we can adjust the width accordingly.

Cytoscape equivalent of graphviz URL/href node attribute when exporting SVG?

In the past I've using graphviz's node "label", "URL" (or "href") and "tooltip" attributes to generate SVG graphics where the nodes have the text label, mouse-over displays the tooltip, and clicking the node (assuming your browser is displaying the svg) takes you to the URL target (and all those strings can be different).
Right now I'm trying to generate the same sort of thing in Cytoscape. Exporting svg works nicely, but linkage of nodes to external URLs seems all tied up with Cytoscape's "linkout" feature; while this seems very powerful while you're actually using Cytoscape, it's not clear to me whether there's some way of getting it to produce clickable nodes or labels (I'd settle for either) in an exported SVG. The URLs I want to link to are a node attribute of my imported graph.
Is there something I'm missing in Cytoscape which will create links in exported SVG ? Any suggestions for alternative approaches ? e.g some way of getting labels to be arbitrary HTML including <a href=...>...</a> ?
My "plan B" is to postprocess the exported SVG, but it'd be nicer to have Cytoscape do it all.
So far as my further use of the tool permitted me to determine, Cytoscape just doesn't have this capability.

Resources