hi,
still its not working..
heres are parts of the code:
diagram1 = new com.mindfusion.diagramming.Diagram();
diagramView2 = new DiagramView(diagram1);
diagram1.setAdjustmentHandlesSize(3.0F);
diagram1.setAutoResize(7);
diagram1.setBackBrush(new SolidBrush(new Color((int)0, (int)102, (int)153)));
diagram1.setDefaultShape(recShape);
diagram1.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
diagram1.setLinkBaseShapeSize(2.5F);
diagram1.setLinkCascadeOrientation(com.mindfusion.diagramming.jlayout.Orientati on.Vertical);
diagram1.setLinkHeadShape(ArrowHead.Arrow);
diagram1.setLinkSegments((short)2);
diagram1.setLinkStyle(com.mindfusion.diagramming.LinkStyle.Cascading);
diagram1.setLinksSnapToBorders(true);
diagram1.setMeasureUnit(GraphicsUnit.Point);
diagram1.setRecursiveExpand(true);
diagram1.setRouteLinks(true);
diagram1.setShadowOffsetX(2.0F);
diagram1.setShadowOffsetY(2.5F);
diagram1.setShapeBrush(new SolidBrush(new Color((int)128, (int)192, (int)128)));
diagram1.setTablePen(new Pen());
diagramView2.setBehavior(Behavior.Modify);
private void performLayout()
{
TreeLayout tl = new TreeLayout();
tl.setRoot(null);
tl.setType(TreeLayoutType.Centered);
tl.setDirection(com.mindfusion.diagramming.jlayout.TreeLayoutDirection.TopToBott om);
tl.setLevelDistance(50);
tl.setNodeDistance(15);
tl.setKeepRootPosition(true);
tl.setReversedLinks(false);
tl.setLinkStyle(TreeLayoutLinkType.Straight);
tl.arrange(diagram1);
}
int height = 0;
private void buildTree() {
// create a box that will be a root in our hierarchy ShapeNode root = diagram1.getFactory().createShapeNode(0,0,100,50,recShape);
root.setText("root"); DiagramNode root1 = root; root1.setAnchorPattern(AnchorPattern.fromId("Decision2In2Out")); height = 50;
ShapeNode Node1 = diagram1.getFactory().createShapeNode(50,50,105,50,recShape); Node1.setText("Node1"); Node1.setAnchorPattern(AnchorPattern.fromId("Decision2In2Out"));
DiagramLink arrow = diagram1.getFactory().createDiagramLink(root1, Node1); arrow.setSegmentCount(2);
arrow.setStyle(com.mindfusion.diagramming.LinkStyle.Cascading); arrow.setSnapToNodeBorder(true); ShapeNode Node2 = diagram1.getFactory().createShapeNode(100,100,105,50,recShape); Node2.setText("Node2"); Node2.setAnchorPattern(AnchorPattern.fromId("Decision2In2Out"));
arrow = diagram1.getFactory().createDiagramLink(Node1, Node2);
arrow.setSegmentCount(2);
arrow.setStyle(com.mindfusion.diagramming.LinkStyle.Cascading); arrow.setSnapToNodeBorder(true); performLayout();
diagram1.resizeToFitItems(40); }
|