Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

AffineTransform

Thread view: 
Thijs Muizelaar - 11 Jan 2008 10:40 GMT
For a my PhD project I'm programming a simulator in which a road network
is displayed on a small map. This happens inside an extended JPanel. The
size of the road network is larger than the size of this JPanel, so I
applied an AffineTransform, such that the road network is displayed
correctly inside the JPanel. In this network the origin and destination
of a trip is also displayed (with the letters O and D).

However, because of the large scaling, the stroke use for the lines is
too thin. The same applies to the fontsize used for O and D. Is it
possible to use the fontsize and the BasicStroke I defined in my code,
without applying the AffineTransform? I can't think of a way, because
the coordinates still have to be scaled and transformed properly. This
would make the code independent from the size of the road network that I
will use.

Thanks in advance!

Thijs
Roedy Green - 11 Jan 2008 11:08 GMT
On Fri, 11 Jan 2008 11:40:08 +0100, Thijs Muizelaar
<t.j.muizelaar@alumnus.utwente.nl> wrote, quoted or indirectly quoted
someone who said :

>However, because of the large scaling, the stroke use for the lines is
>too thin. The same applies to the fontsize used for O and D. Is it
[quoted text clipped - 3 lines]
>would make the code independent from the size of the road network that I
>will use.

I guess you have to scale up the width of your roads so they will be
fat enough to see, ditto for lettering.  You know your scale, so it is
just a matter of multiplying to figure out the width you need to draw
your road lines.
Signature

Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com

Wayne - 11 Jan 2008 15:55 GMT
> For a my PhD project I'm programming a simulator in which a road network
> is displayed on a small map. This happens inside an extended JPanel. The
[quoted text clipped - 14 lines]
>
> Thijs

You should pick a SansSerif font that uses constant-width strokes.
Also try enabling some hinting in the Graphics2D object, e.g.:

   g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_ON );

-Wayne
Roedy Green - 11 Jan 2008 16:23 GMT
>You should pick a SansSerif font that uses constant-width strokes.
>Also try enabling some hinting in the Graphics2D object, e.g.:

if you can use a commercial font, consider the Tiresias family.
http://mindprod.com/jgloss/tiresias.html

It was designed for the people with visual impairment, so is easy to
see at small font sizes.

Also have a look at http://mindprod.com/jgloss/browserfonts.html
to find a suitable font.

see also http://mindprod.com/jgloss/font.html#PROGRAMMER
for my recommended programmer fonts which are good at small sizes and
have distinctive glyphs.
Signature

Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com

Wayne - 11 Jan 2008 17:21 GMT
>> You should pick a SansSerif font that uses constant-width strokes.
>> Also try enabling some hinting in the Graphics2D object, e.g.:
>
> if you can use a commercial font, consider the Tiresias family.
> http://mindprod.com/jgloss/tiresias.html

That looks very useful.  But from your sample on your site (and my
browser resolution) it seems the kerning between "rn" needs to
be increased.  To me this looks like an 'm'.

> It was designed for the people with visual impairment, so is easy to
> see at small font sizes.

Microsoft also developed a font for this, Andale Mono (AndaleMo.ttf).
AFAIK it is free, however MS no longer distributes this font (or any
fonts) from their web site.  Search the Internet for Andale.exe;
if you don't have a Windows system just open the .exe with zip
and extract the TTF file.  It is very easy to read and all characters
and symbols are easy to differentiate.

-Wayne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.