public class RectangleGroupStrategy extends AbstractGroupStrategy
Constructor and Description |
---|
RectangleGroupStrategy()
Deprecated.
use constructor with PGroup element instead
|
RectangleGroupStrategy(PGroup g)
Constructs a RectangleGroupStrategy with the given toggle and style.
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.swt.graphics.Rectangle |
computeTrim(int x,
int y,
int width,
int height) |
void |
dispose() |
org.eclipse.swt.graphics.Color |
getBorderColor()
Returns the color of the one pixel border drawn around the body when the
group is expanded.
|
org.eclipse.swt.graphics.Rectangle |
getClientArea() |
protected org.eclipse.swt.graphics.Rectangle |
getTextBounds() |
org.eclipse.swt.graphics.Rectangle |
getToolItemArea() |
void |
initialize() |
boolean |
isToggleLocation(int x,
int y) |
void |
paint(org.eclipse.swt.graphics.GC gc)
Paints the actual group widget.
|
void |
setBackground(org.eclipse.swt.graphics.Color[] colors,
int[] percents)
Specify a gradient of colours to be drawn in the background of the group.
|
void |
setBackground(org.eclipse.swt.graphics.Color[] colors,
int[] percents,
boolean vertical)
Specify a gradient of colours to be drawn in the background of the group.
|
void |
setBorderColor(org.eclipse.swt.graphics.Color borderColor)
Sets the border color.
|
void |
update() |
getGroup
public RectangleGroupStrategy()
public RectangleGroupStrategy(PGroup g)
toggleStrategy
- style
- public void initialize()
initialize
in class AbstractGroupStrategy
AbstractGroupStrategy.initialize()
public void paint(org.eclipse.swt.graphics.GC gc)
AbstractGroupStrategy
paint
in class AbstractGroupStrategy
AbstractGroupStrategy.paint(org.eclipse.swt.graphics.GC)
public org.eclipse.swt.graphics.Rectangle getToolItemArea()
getToolItemArea
in class AbstractGroupStrategy
public boolean isToggleLocation(int x, int y)
isToggleLocation
in class AbstractGroupStrategy
AbstractGroupStrategy.isToggleLocation(int, int)
protected org.eclipse.swt.graphics.Rectangle getTextBounds()
public org.eclipse.swt.graphics.Rectangle getClientArea()
getClientArea
in class AbstractGroupStrategy
AbstractGroupStrategy.getClientArea()
public org.eclipse.swt.graphics.Rectangle computeTrim(int x, int y, int width, int height)
computeTrim
in class AbstractGroupStrategy
AbstractGroupStrategy.computeTrim(int, int, int, int)
public void dispose()
dispose
in class AbstractGroupStrategy
AbstractGroupStrategy.dispose()
public void setBackground(org.eclipse.swt.graphics.Color[] colors, int[] percents)
For example, to draw a gradient that varies from dark blue to blue and then to white and stays white for the right half of the label, use the following call to setBackground:
setBackground(new Color[] {display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_BLUE), display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_WHITE) }, new int[] {25, 50, 100 });
colors
- an array of Color that specifies the colors to appear in
the gradient in order of appearance from left to right; The value
null
clears the background gradient; the value
null
can be used inside the array of Color to specify the
background color.percents
- an array of integers between 0 and 100 specifying the
percent of the width of the widget at which the color should change; the
size of the percents array must be one less than the size of the colors
array.public void setBackground(org.eclipse.swt.graphics.Color[] colors, int[] percents, boolean vertical)
For example, to draw a gradient that varies from dark blue to white in the vertical, direction use the following call to setBackground:
setBackground(new Color[] {display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_WHITE) }, new int[] {100 }, true);
colors
- an array of Color that specifies the colors to appear in
the gradient in order of appearance from left/top to right/bottom; The
value null
clears the background gradient; the value
null
can be used inside the array of Color to specify the
background color.percents
- an array of integers between 0 and 100 specifying the
percent of the width/height of the widget at which the color should
change; the size of the percents array must be one less than the size of
the colors array.vertical
- indicate the direction of the gradient. True is vertical
and false is horizontal.public org.eclipse.swt.graphics.Color getBorderColor()
public void setBorderColor(org.eclipse.swt.graphics.Color borderColor)
borderColor
- the border color, or null for no borderpublic void update()
update
in class AbstractGroupStrategy