Closed bdemchak closed 1 year ago
Good question for @scootermorris. Do you know what the customShape
string needs to be? In Java, we send GeneralPath objects. But I'm not sure how those serialize or if the command takes an alt approach.
GeneralPath is described here: https://docs.oracle.com/javase/7/docs/api/java/awt/geom/GeneralPath.html
There does seem to be a serialization format, and it looks conceptually easy, but with lots of details.
Supposing it's passed into this function, how does it interact with the "type" parameter, which specifies a canned shape?
Is there a demonstration of this parameter somewhere?
The "type" parameter should be "custom", I think.
I don't think I understand. The "type" parameter for this function is a pre-canned type, such as ELLIPSE or RECTANGLE ... something available in the list returned by GetNodeShapes().
As I understand, the custom_shape parameter would be a serialized version of the Java GeneralPath object, which is a connect-the-dots format.
So, they would be completely different concepts. Is that true??
If I have that right, then the next question would be how they interact when both customShape and type are provided in the call. And after that, whether it's possible to have customShape and not type. Certainly, the opposite is true.
Thanks.
Hi Barry, No, the "type" parameter has nothing to do with node shapes -- it's a ShapeType, so without looking at the details of the implementation, I would guess that if the "type" is not "CUSTOM" then the customShape argument is ignored.
Just checked the code, and that is indeed the case. If type is not "CUSTOM" then the customShape argument is ignored:
// Handle custom shapes
if (type.equalsIgnoreCase(ShapeAnnotation.ShapeType.CUSTOM.toString()))
putIfNotNull(tm, args, ShapeAnnotation.CUSTOMSHAPE, customShape);
OK ... good thanks. I can document that. Would you have an example (even a small one) of a suitable customShape string?
The documentation advises that customShape is a string, but there's no explanation of it, and no apparent analog in the Cytoscape UI. Also, if a value is supplied, how can it be tested?