Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.forms.widgets
Class SizeCache

java.lang.Object
  extended by 
org.eclipse.ui.forms.widgets.SizeCache

public class SizeCache
extends Object

Caches the preferred size of an SWT control

Since:
3.0

Constructor Summary
SizeCache ()
           
SizeCache ( Control control)
          Creates a cache for size computations on the given control
 
Method Summary
  Point computeAdjustedSize (int widthHint, int heightHint)
          Compute the control's size, and ensure that non-default hints are returned verbatim (this tries to compensate for SWT's hints, which aren't really the outer width of the control).
 int computeMaximumWidth ()
           
  Point computeMinimumSize ()
           
 int computeMinimumWidth ()
           
  Point computeSize (int widthHint, int heightHint)
          Computes the preferred size of the control.
 void flush ()
          Flush the cache (should be called if the control's contents may have changed since the last query)
 void flush (boolean recursive)
           
  Control getControl ()
          Returns the control whose size is being cached
 void layoutIfNecessary ()
           
 void setBounds (int x, int y, int width, int height)
           
 void setBounds ( Rectangle bounds)
           
 void setControl ( Control newControl)
          Sets the control whose size is being cached.
 void setSize (int width, int height)
           
 void setSize ( Point newSize)
           
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeCache

public SizeCache()

SizeCache

public SizeCache(
Control control)
Creates a cache for size computations on the given control

Parameters:
control - the control for which sizes will be calculated, or null to always return (0,0)
Method Detail

setControl

public void setControl(
Control newControl)
Sets the control whose size is being cached. Does nothing (will not even flush the cache) if this is the same control as last time.

Parameters:
newControl - the control whose size is being cached, or null to always return (0,0)

getControl

public 
Control getControl()
Returns the control whose size is being cached

Returns:
the control whose size is being cached, or null if this cache always returns (0,0)

flush

public void flush()
Flush the cache (should be called if the control's contents may have changed since the last query)


flush

public void flush(boolean recursive)

computeSize

public 
Point computeSize(int widthHint,
                         int heightHint)
Computes the preferred size of the control.

Parameters:
widthHint - the known width of the control (pixels) or SWT.DEFAULT if unknown
heightHint - the known height of the control (pixels) or SWT.DEFAULT if unknown
Returns:
the preferred size of the control

computeAdjustedSize

public 
Point computeAdjustedSize(int widthHint,
                                 int heightHint)
Compute the control's size, and ensure that non-default hints are returned verbatim (this tries to compensate for SWT's hints, which aren't really the outer width of the control).

Parameters:
widthHint - the horizontal hint
heightHint - the vertical hint
Returns:
the control's size

computeMinimumWidth

public int computeMinimumWidth()

computeMaximumWidth

public int computeMaximumWidth()

computeMinimumSize

public 
Point computeMinimumSize()

setSize

public void setSize(
Point newSize)

setSize

public void setSize(int width,
                    int height)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)

setBounds

public void setBounds(
Rectangle bounds)

layoutIfNecessary

public void layoutIfNecessary()

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire