scalable layouts : Java Glossary

go to home page S words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all) ©1996-2009 2008-04-04 Roedy Green, Canadian Mind Products
scalable layouts
Java has a problem when Applets or applications are run on very small or very big screen, or very low resolution or very high resolution screens. The essential problem is Java is based around physical pixels. Ideally, applications should scale to maintain an acceptable viewing size. The layouts should rearrange and shrink, removing optional fields or labels, and otherwise simplify in low-real estate situations and expand when screen real estate is abundant.
PostScript Tools
Problem Areas Learning More
Solutions Links

PostScript

PostScript was invented long before Java, yet supports resolution independence with a floating point API that is scaled to physical pixels. This lets you render the same image on a 640 × 480 screen or a 1024 dpi typsetter without modification. Even it has to bow to the physical pixel reality with font rendering hints and special rounding to pixel boundaries. At one point Java was about to adopt Bravo PostScript rendering, then the project faded away without explanation.

Problem Areas

What are the problem areas for autoscaling?

Solutions

There are no totally satisfactory solutions, however, there are a number of band-aids. Karsten Lentzsch of JGoodies has done most of the research and documenting of the problem. Read his white papers and use his tools.

There are some techniques you can work with:

Tools

import java.awt.Dimension;
import java.awt.Toolkit;

...

// Get screen size in pixels, width by height.
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

// Get screen resolution in dots per inch.
// The Americans who develop Java have not noticed the world has gone metric.
int dpi = Toolkit.getDefaultToolkit().getScreenResolution();

Learning More

Sun’s Javadoc on getScreenSize class : available:
Sun’s Javadoc on getScreenResolution class : available:

CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/scalable.html J:\mindprod\jgloss\scalable.html
CMP logofeedback Please email your feedback for publication, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.191.106]
You are visitor number 11.