customize gridlayout [message #1014345] |
Mon, 25 February 2013 16:24 |
Mokhtar Alshubei Messages: 121 Registered: November 2011 Location: Germany |
Senior Member |
|
|
Hi,
so far, I have copied the impl. of GridlyoutAlgo to my class and added one parameter to the constructor. From that, I could restrict the row and col number of my gridlayout to what i want. But i got stuck when I looked to the folowing method:
@Override
protected synchronized void applyLayoutInternal(InternalNode[] entitiesToLayout,
InternalRelationship[] relationshipsToConsider, double boundsX,
double boundsY, double boundsWidth, double boundsHeight) {
int index = 0;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
if ((i * cols + j) < numChildren) {
// find new position for child
InternalNode sn = entitiesToLayout[index++];
double xmove = boundsX + j * colWidth + offsetX;
double ymove = boundsY + i * rowHeight + offsetY;
sn.setInternalLocation(xmove, ymove);
sn.setInternalSize(Math.max(w, MIN_ENTITY_SIZE), Math.max(h, MIN_ENTITY_SIZE));
}
}
fireProgressEvent(2 + i, totalProgress);
}
updateLayoutLocations(entitiesToLayout);
fireProgressEvent(totalProgress, totalProgress);
}
The nodes of my graph are of type CandidateNode (subclass of GraphNode + some fields). How can I now access those "some fields" inside this method????
InternalNode.getGraphData() doesn't seem to work.
Thanks,
Mok
|
|
|
|
Powered by
FUDForum. Page generated in 0.04668 seconds