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 online
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

 
   
Copyright 2000-2010 Droplets, Inc. All rights reserved.
Protected by U.S. Patent No. 6,687,745; U.S. Patent No. 7,502,838 ; Aust. Pat. 769099; Israel Patent No. 148635; Korea Patent No. 10-079976; Patents Pending in the U.S. and/or other countries.
Droplets and the Droplets logo are trademarks of Droplets, Inc. in the United States and/or other countries.