Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 8591 Details for
Bug 54927
VerticalPlacement should take a flag in it's constructor that determines whether the height of the nodes should be changed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
source
VerticalPlacement.java (text/plain), 1.63 KB, created by
Sean Woodhouse
on 2004-03-15 20:15:26 EST
(
hide
)
Description:
source
Filename:
MIME Type:
Creator:
Sean Woodhouse
Created:
2004-03-15 20:15:26 EST
Size:
1.63 KB
patch
obsolete
>/* > * Created on Mar 9, 2004 > * > * To change the template for this generated file go to > * Window - Preferences - Java - Code Generation - Code and Comments > */ >package net.agentis.eclipse.common.draw2d.graph; > >import org.eclipse.draw2d.geometry.Insets; >import org.eclipse.draw2d.graph.*; >import org.eclipse.draw2d.internal.graph.GraphVisitor; > >/** > * NOTE: This class is a direct rip off of org.eclipse.draw2d.internal.graph.VerticalPlacement. > * I had to copy the class in order to add a flag which determines whether the height of each node > * should be set to the largest node in the row. > */ >public class VerticalPlacement extends GraphVisitor { > public boolean resizeHeight; > > /** > * @param resizeHeight if set to true, the heigh of each node will be resized to the height of the largest node in the row > */ > public VerticalPlacement(boolean resizeHeight) { > this.resizeHeight = resizeHeight; > } > > public void visit(DirectedGraph g) { > Insets pad; > int currentY = 0; > for (int row = 0; row < g.ranks.size(); row++) { > int rowHeight = 0, rowAscent = 0, rowDescent = 0; > Rank rank = g.ranks.getRank(row); > for (int n = 0; n < rank.size(); n++) { > Node node = rank.getNode(n); > pad = g.getPadding(node); > rowHeight = Math.max(node.height, rowHeight); > rowAscent = Math.max(pad.top, rowAscent); > rowDescent = Math.max(pad.bottom, rowDescent); > } > currentY += rowAscent; > for (int n = 0; n < rank.size(); n++) { > Node node = rank.getNode(n); > node.y = currentY; > if (resizeHeight) { > node.height = rowHeight; > } > } > currentY += rowHeight + rowDescent; > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 54927
: 8591