Re: Drawing a honeycomb
- From: MikeB <MPBrede@xxxxxxxxx>
- Date: Mon, 6 Apr 2009 12:14:07 -0700 (PDT)
On Apr 6, 1:55 pm, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
On Mon, 6 Apr 2009 11:29:41 -0700 (PDT), MikeB <MPBr...@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
I want to create a pane that, instead of a table of rows and columns,
have a honeycomb appearance, in other words an array of hexagonal
cells. I need to put information inside each cell, but I'm even stuck
at how to construct the borders of the cells. Ideally, the borders
should be sizable so that the user can adjus tthe size (and by
implication, the number of cells that will appear in the pane, or when
he resizes the pane.
You might have a start athttp://mindprod.com/products.html#SCREWS
It draws a hexagonal screw head.
A hexagon is defined as a line connecting vertices of the 6 rotations
of the angle pi/3 radians = 60 degrees where it intersects the circle.
Basically you convert polar to Cartesian co-ordinates.
Seehttp://mindprod.com/jgloss/coordinates.htmlhttp://mindprod.com/jgloss/polar.htmlhttp://mindprod.com/jgloss/radian.html
Tackle this in stages.
1. draw a hexagon on a Canvas of JPanel.
2. draw a row of 4 hexagons
3. draw two rows of 4 meshing hexagons.
4. draw a grid of n x m hexagons.
5. draw a grid of hexagons with text on them.
6. resize the panel making all the hexagons grow
7. resize the panel adding hexagons.
8. resize the panel allowing both kinds of growth. How will you
specify it? sliders? Simply dragging the panel bigger will not do.
9. don't draw cells that don't fit 100 in the panel.
10. sex it up with some edge effects and subtle colour variations.
Search the web for some honeycomb images to get some ideas.
--
Roedy Green Canadian Mind Productshttp://mindprod.com
"At this point, 29 percent of fish and seafood species have collapsed - that is,
their catch has declined by 90 percent. It is a very clear trend, and it is accelerating.
If the long-term trend continues, all fish and seafood species are projected to collapse
within my lifetime -- by 2048."
~ Dr. Boris Worm of Dalhousie University
Roedy, Thanks a million. Just what I needed.
.
- Follow-Ups:
- Re: Drawing a honeycomb
- From: John B. Matthews
- Re: Drawing a honeycomb
- References:
- Drawing a honeycomb
- From: MikeB
- Re: Drawing a honeycomb
- From: Roedy Green
- Drawing a honeycomb
- Prev by Date: Re: Newbie question
- Next by Date: Re: Newbie question
- Previous by thread: Re: Drawing a honeycomb
- Next by thread: Re: Drawing a honeycomb
- Index(es):
Relevant Pages
|