World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 04-01-2008, 07:07 AM   #1
ayman
Junior Member (Java Lover)
 
Join Date: Feb 2008
Posts: 189
ayman is on a distinguished road
Default SIZE_FIT_TEXT

I have the following code
GlobeAnnotation ga = new GlobeAnnotation(annotationString,positio n,Font.decode("Arial-BOLD-11"));
ga.getAttributes().setAdjustWidthToText( Annotation.SIZE_FIT_TEXT);

The annotation divide the string into two or three lines, and doesn't expand the width to fit the test.
ayman is offline   Reply With Quote
Old 04-01-2008, 02:26 PM   #2
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

You have to set ga.getAttributes().setSize(new Dimension(xxx, 0)); - the xxx being how wide an annotation can grow before it wraps the text to another line. The FIT_TEXT option tells whether the annotation will use the exact width given in size or shrink a bit to fit exactly the text inside - the rendered text may not use the whole width.

Note that the height given in the setSize() can be zero - the default. It means the annotation will fit the rendered text length.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:06 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.