customize gridlayout [message #1014355] |
Mon, 25 February 2013 11:42  |
Eclipse User |
|
|
|
sorry first that i posted this in another forum...
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:
Code: [Select all] [Show/ hide]
@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
[Updated on: Mon, 25 February 2013 11:43] by Moderator
|
|
|
|
Re: customize gridlayout [message #1014446 is a reply to message #1014358] |
Mon, 25 February 2013 15:59  |
Eclipse User |
|
|
|
Hi Zoltán,
yes that helped and now I can have the row and column original objects and I hope I can use this info to shoot the figures to their places, having gaps if must.
Thank you!
Mok
|
|
|
Powered by
FUDForum. Page generated in 0.03357 seconds