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 51048 Details for
Bug 159051
Enhance BorderLayout to center/maintain aspect ratio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Override BorderLayout.layout() with this to accomplish my proposal
layout.txt (text/plain), 1.72 KB, created by
Adam Cabler
on 2006-09-27 18:45:32 EDT
(
hide
)
Description:
Override BorderLayout.layout() with this to accomplish my proposal
Filename:
MIME Type:
Creator:
Adam Cabler
Created:
2006-09-27 18:45:32 EDT
Size:
1.72 KB
patch
obsolete
> > public void layout(IFigure container) { > Rectangle area = container.getClientArea(); > boolean centerLayout = true; //should be set in constructor > Dimension northBounds = northLayer.getPreferredSize(); > Dimension westBounds = westLayer.getPreferredSize(); > Dimension eastBounds = eastLayer.getPreferredSize(); > Dimension southBounds = southLayer.getPreferredSize(); > Dimension centerBounds = centerLayer.getPreferredSize(); > > //space=vgap=hgap > northLayer.setBounds(new Rectangle(0, 0, northBounds.width, > northBounds.height)); > southLayer.setBounds(new Rectangle(0, northBounds.height > + centerBounds.height + 2 * space, southBounds.width, > southBounds.height)); > eastLayer.setBounds(new Rectangle(westBounds.width > + centerBounds.width + 2 * space, northBounds.height > + space, eastBounds.width, eastBounds.height)); > westLayer.setBounds(new Rectangle(0, > northBounds.height + space, westBounds.width, > westBounds.height)); > centerLayer.setBounds(new Rectangle(westBounds.width + space, > northBounds.height + space, centerBounds.width, > centerBounds.height)); > > if (centerLayout) { > int xtraWidth = area.width - westBounds.width > - eastBounds.width - centerBounds.width - 2 * space; > int xtraHeight = area.height - northBounds.height > - southBounds.height - centerBounds.height - 2 > * space; > xtraWidth /= 2; > xtraHeight /= 2; > > northLayer.translate(xtraWidth, xtraHeight); > southLayer.translate(xtraWidth, xtraHeight); > eastLayer.translate(xtraWidth, xtraHeight); > westLayer.translate(xtraWidth, xtraHeight); > centerLayer.translate(xtraWidth, xtraHeight); > } > > }
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 159051
: 51048