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!). Micah
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
posted 17 years ago
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?
The moustache of a titan! The ad of a flea:
create, convert, edit or print DOC and DOCX in Java