• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom Layout Managers

 
Micah Wedemeyer
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Barry Andrews
Ranch Hand
Posts: 528
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OrbitLayout says really cool!!
 
Vinod Venugopal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Micah Wedemeyer
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic