Thanks. Yes, that does it. But there is another strange behavior. The cell text is not shown when I set the cell height exactly as (tableHeight - captionHeight). If I take 1 unit off, then I see the text but there is an extra area at the bottom that I want to remove.
final int TABLE_WIDTH = 100; final int TABLE_HEIGHT = 30;
TableNode mynode = diagram.getFactory().createTableNode(0, 0, TABLE_WIDTH, TABLE_HEIGHT, 1, 1); mynode.setBrush(new GradientBrush(Color.WHITE, Color.GREEN, 90)); mynode.setCaption("Parent Node"); mynode.getRows().get(0).setHeight(TABLE_HEIGHT - mynode.getCaptionHeight()); mynode.getCell(0,0).setText("Parent Node Text"); diagram.add(mynode); TableNode mynode2 = diagram.getFactory().createTableNode(0, 0, TABLE_WIDTH, TABLE_HEIGHT, 1, 1); mynode2.setBrush(new GradientBrush(Color.WHITE, Color.RED, 90)); mynode2.setCaption("Child Node #1"); mynode2.getRows().get(0).setHeight(TABLE_HEIGHT - mynode.getCaptionHeight()-1); mynode2.getCell(0,0).setText("Child Node #1 Text"); diagram.add(mynode2);
diagram.getFactory().createDiagramLink(mynode, mynode2);
|