Search












 

Sometimes you don't know what UI widgets need to appear in a window until runtime.

In the Droplets Platform, the first time your application instantiates each of its window classes, it builds a description of the components in the window and sends it to the client. As an optimization, it stores the description in a cache, keyed on the window class name. This eliminates the overhead of constructing the description and sending it to the client each time the window class is instantiated -- a major performance gain.

As a consequence, when you use the same window class to create windows with different layouts, you need to provide a key other than the class name for the cache to use. You can accomplish this by overriding the getTypeName() method of the Window class:

public class MyWindow extends Window {
private static int windowNum = 0;

protected String getTypeName()

{

windowNum++;

return "w" + windowNum;
}
}

The framework calls getTypeName() once on each new window object. By returning a different string each time, you are indicating that each window object has a different set of components.

Of course, you may have only a few different layouts for all the windows of a class. By returning one of a fixed set of names, one per layout, you maximize the benefit of the cache.

<<< previous home  


Questions?
Contact us
Call 214.969.9970
Fax 214.774.4900

 


Article
java.sun.com: Droplets brings GUIs to the Internet

 
 


News
U.S. Patent Office Issues Patent for Droplets' Groundbreaking Technology 

Droplets, Inc., Awarded Government GSA Contract 

Java Servlets Get a New Lease on Life with Droplets 

Droplets Announces Linux Validation For All IBM eServer Platforms

Borland® JBuilder™ To Include Droplets User Interface Server™ and SDK

Droplets Earns Prestigious SunTone Certification from Sun Microsystems

 
   
©2004-2024 Droplets, Inc. All rights reserved. Protected by U.S. Patents 6,687,745 - 8,626,829 - 9,397,971 - 9,807,200 Australia Patent 769099, Canada Patents 2385044, 2744848, Japan Patents 5,468,186 - 5,108,967 - 5,143,926. This website does not collect any data from visitors for any purpose.