Up: Java Kali Source Code and Documentation

Class GrowPanel

Class GrowPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----GrowPanel

class GrowPanel
extends Panel
The GrowPanel object is somewhat of a kludge (OK, it's totally a kludge). The idea is that I want to force the groupPanel, which is the subpanel of the ControlPanel which contains the group buttons, to have a fixed size, so that it doesn't change size (and hence cause the entire ControlPanel's layout to change) when the particular group button panel (wallpaper/frieze/rosette) that it contains changes. So, in theory, I'd like a way of telling the layout manager to force the groupPanel to have a certain size, and that size should be computed at run-time to be the max size of the 3 group button panels. In practice, however, I cannot figure out how to compute the actual sizes of these (or any) panels until they are actually painted to the screen. SO, the kludge is to use a Panel whose size (as returned by its preferredSize() and minimumSize() methods) is always the max of its previous size and its current size. Then, as long as we start out with the largest of the 3 possibilities (wallpaper), things should be OK.

If you know of a better way to do this let me know!


Method Index

 o minimumSize()
 o preferredSize()

Methods

 o preferredSize
  public Dimension preferredSize()
Overrides:
preferredSize in class Container
 o minimumSize
  public Dimension minimumSize()
Overrides:
minimumSize in class Container


Up: Java Kali Source Code and Documentation

[HOME] The Geometry Center Home Page

Author: Mark Phillips
Comments to: webmaster@geom.umn.edu
Created: Sep 16 1996 --- Last modified: Sep 18 1996