// This sample shows how to associate anchor points with table rows // Create a sample table TableNode table = diagram.getFactory().createTableNode(10, 10, 50, 40); // Set the number of rows and columns table.setRowCount(2); table.setColumnCount(3); // Adjust the table column widths table.getColumns().get(0).setWidth(15); table.getColumns().get(1).setWidth(50); table.getColumns().get(2).setWidth(15); table.getColumns().get(0).setColumnStyle(ColumnStyle.FixedWidth); table.getColumns().get(1).setColumnStyle(ColumnStyle.AutoWidth); table.getColumns().get(2).setColumnStyle(ColumnStyle.FixedWidth); // Create an anchor pattern to be assigned to the table AnchorPattern pattern = new AnchorPattern( new AnchorPoint[] { new AnchorPoint(50, 50, true, false, Color.BLUE, (short)0), new AnchorPoint(50, 50, false, true, Color.BLUE, (short)2) }, "MyPattern"); // Use the newly created anchor pattern for all table rows table.setRowAnchorPattern(pattern); |