File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes custom Layout Managers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "custom Layout Managers" Watch "custom Layout Managers" New topic

custom Layout Managers

Micah Wedemeyer
Ranch Hand

Joined: Jun 11, 2001
Posts: 68
Does anyone know of a good archive of custom layout managers? Right now I'm writing a layout manager of my own, but it struck me that the one I'm writing seems pretty useful, so someone else may have written it already. Otherwise, if it isn't already written, I'll open source it anywhere someone will take it.
I'm writing a layout manager called OrbitLayout that arranges components in concentric circles surrounding a central object. When adding a component, the user specifies an orbit, and the layout manager handles the rest (in theory!).
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

OrbitLayout says really cool!!
Vinod Venugopal
Ranch Hand

Joined: Dec 06, 2000
Posts: 148
Your idea is pretty innovative & I'm actually visualizing how it would look like. Are you by any chance using GridBagLayout's constraints? The design would be a good one. Pls share the design / code when u have a demo.

- Vinod<br />-------<br />SCJP2
Micah Wedemeyer
Ranch Hand

Joined: Jun 11, 2001
Posts: 68
No, no GridBag constraints. The only option when adding a component is to specify an integer orbit (or 0 if you want the component to become the center. When the manager is asked for sizing information or asked to layout the components, it determines the radii for all the orbits and places the centerpoint of each component on its orbit's radius.
I'll definitely share the code when I get it working, but for now, I have not even figured out the layout code. I have a nice formula for computing the radius, but that's about it for now. I was planning to brush up on my polar coordinates in order to make laying out the components easier. Then, when all components have their coordinates, I'll translate them back into Cartesian coordinates. Anyone know of a good primer on polar coordinates?
I agree. Here's the link:
subject: custom Layout Managers
It's not a secret anymore!