• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

custom Layout Managers

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OrbitLayout says really cool!!
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic