...
> I want to display a web like structure in 2D. It would look like a
> diagram with lines
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html#drawLine(int,%20i
nt,%20int,%20int)>
>...and text mostly.
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html#drawString(java.l
ang.String,%20int,%20int)>
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html#drawString(java.t
ext.AttributedCharacterIterator,%20int,%20int)>
> Is there a simple API to draw something like that in java?
But then, if you want something slightly more advanced,
look to Graphics2D, where you can set the Stroke etc..
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics2D.html>
..or to put that another way. Did you do the
Java Tutorial section on painting and graphics,
and read the JavaDocs before asking that
question?
Andrew T.
bbembi_de@lycos.de - 10 Nov 2006 15:06 GMT
Thanks for the info!
> ..or to put that another way. Did you do the
> Java Tutorial section on painting and graphics,
> and read the JavaDocs before asking that
> question?
well actually no.
bye bembi
Oliver Wong - 10 Nov 2006 15:14 GMT
> Thanks for the info!
>
[quoted text clipped - 4 lines]
>
> well actually no.
I appreciate your honesty. To actually do this yourself will probably be
difficult. Sure, drawing lines and text is easy, but deciding how to
position the lines and text in your image to make it look web-like will
probably be a pain. You might want to look at the following library, but I'm
not sure if it's "simple". I'm not sure that there's an off-the-shelf
solution for the specific problem you're trying to solve.
http://www.jgraph.com/screenshots.html
- Oliver
bbembi_de@lycos.de - 11 Nov 2006 23:05 GMT
Thanks,
I'll give it a try.
bye bembi