JDiagram version 4.6.2 contains the following new features and improvements:
Multiple labels per nodeThe NodeLabel class allows multiple captions to be displayed for a single DiagramNode of any type. Node labels provide a set of properties allowing full customization of their display and positioning. Label position is defined by specifying a pin point and offset from it, set through setCornerPosition, setEdgePosition, setCenterPosition methods. In addition, the HorizontalAlign and VerticalAlign properties of NodeLabel specify on which side of pin point to draw the label's caption.
For example, following code adds extra labels to top-left and bottom-right corners of a ShapeNode:
ShapeNode node = diagram.getFactory().createShapeNode(10, 50, 40, 30);
node.setText("text"); // centered main text
NodeLabel lb1 = node.addLabel("label 1");
lb1.setCornerPosition(0, 0, 0);
lb1.setHorizontalAlign(Align.Near);
lb1.setVerticalAlign(Align.Near);
lb1.setBrush(new SolidBrush(Color.red));
lb1.setTextColor(Color.white);
NodeLabel lb2 = node.addLabel("label 2");
lb2.setCornerPosition(2, 0, 0);
lb2.setHorizontalAlign(Align.Far);
lb2.setVerticalAlign(Align.Far);
lb2.setBrush(new SolidBrush(Color.yellow));
lb2.setTextColor(Color.red);
Miscellaneous- The MoveLabels behavior lets user move link and node labels interactively.
- HorizontalOffset and VerticalOffset now work for link labels positioned using setLinkLengthPosition method.
- ExcelExporter exports pen width of links.
- ExcelExporter sets more precise positions of link end points.
- Improved ZoomControl rendering quality.
- More precise vertical centering of text in table captions and cells.
- DashStyle.DashDotDot serialization fix.
If anyone is interested in trying the beta version, please download this archive containing updated JAR file:
https://mindfusion.eu/_beta/jdiag462.zipAny comments, questions and general feedback are welcome.