Results 1 to 5 of 5
  1. #1
    Koopa's Avatar
    Koopa is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default Creating Curved Text to represent Geographical label

    Hello everyone!!! I'm new to this site and I'm here to ask you some suggestions for my problem. I have to do some labelling an a 2D map (I'm using OpenJump, anyone?) and I want to draw curved labels that follow the line of the geometry correlated. I mean, if I'm printing the label of a river, I want it to follow the river line... Understood? Here's an example:

    Are there any classes that already can do it in Java? I found something with GlyphVector but I don't know if it's the right choice.

    PS: I'm not new to Java and 2D drawing.
    :cool:

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,407
    Rep Power
    20

  3. #3
    Koopa's Avatar
    Koopa is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    Thank you Darryl! I'll try and see what I'm able to do. I'm aiming to achieve an automatic tool that, given a list of 2D coordinate, returns the path where to draw the string on!
    PS: I'm form Italy, so... my English is not as good as yours :o
    :cool:

  4. #4
    Koopa's Avatar
    Koopa is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    The example you gave me (I'm referring to TextStroke.java on the page linked above) is interesting. I'm thinking of:
    1. Set the Stroke of my graphics as this TextStroke
    2. Finding the right 2DPoint where to start labelling
    3. Create a new Polyline following the line of the river
    4. Draw the "invisible" polyline (I'm only interested in the text drawing that comes from the stroke)

    Could this be a good choice?
    :cool:

  5. #5
    Koopa's Avatar
    Koopa is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    I think that the Stroke way can't help me. My system coordinate works with double and with Stroke I can only draw simple figures and shapes like lines, polylines (with int parameters), ecc.
    Isn't there a way to do the same but not as a stroke, just similar to TextLayout?
    :cool:

Similar Threads

  1. Copying a text value from a textbox to a label
    By Weeman5872 in forum New To Java
    Replies: 3
    Last Post: 01-16-2011, 02:32 PM
  2. [SOLVED] How to get text area to line up with label.
    By Nicholas Jordan in forum AWT / Swing
    Replies: 8
    Last Post: 12-28-2010, 12:21 AM
  3. Replies: 9
    Last Post: 07-21-2009, 02:41 AM
  4. POI changing text to a form label
    By natt in forum Advanced Java
    Replies: 2
    Last Post: 09-19-2008, 10:49 AM
  5. Creating a label with an image
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •