![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member (Java Lover)
Join Date: Feb 2008
Posts: 189
![]() |
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. |
|
|
|
|
|
#2 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
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. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|