public class SizeCache extends Object
Constructor and Description |
---|
SizeCache() |
SizeCache(Control control)
Creates a cache for size computations on the given control
|
Modifier and Type | Method and Description |
---|---|
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) |
public SizeCache()
public SizeCache(Control control)
control
- the control for which sizes will be calculated,
or null to always return (0,0)public void setControl(Control newControl)
newControl
- the control whose size is being cached, or null to always return (0,0)public Control getControl()
public void flush()
public void flush(boolean recursive)
public Point computeSize(int widthHint, int heightHint)
widthHint
- the known width of the control (pixels) or SWT.DEFAULT if unknownheightHint
- the known height of the control (pixels) or SWT.DEFAULT if unknownpublic Point computeAdjustedSize(int widthHint, int heightHint)
widthHint
- the horizontal hintheightHint
- the vertical hintpublic int computeMinimumWidth()
public int computeMaximumWidth()
public Point computeMinimumSize()
public void setSize(Point newSize)
public void setSize(int width, int height)
public void setBounds(int x, int y, int width, int height)
public void setBounds(Rectangle bounds)
public void layoutIfNecessary()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.