|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jaret.util.swt.SwtGraphicsHelper
public class SwtGraphicsHelper
A simple class containing several static methods for convenient painting with a SWT gc.
Constructor Summary | |
---|---|
SwtGraphicsHelper()
|
Method Summary | |
---|---|
static void |
drawArrowLine(org.eclipse.swt.graphics.GC gc,
int x1,
int y1,
int x2,
int y2,
int dist,
int height,
boolean arrowLeft,
boolean arrowRight)
|
static void |
drawArrowLineVertical(org.eclipse.swt.graphics.GC gc,
int x1,
int y1,
int x2,
int y2,
int dist,
int height,
boolean arrowUp,
boolean arrowDown)
|
static void |
drawStringCentered(org.eclipse.swt.graphics.GC gc,
String string,
int xCenter,
int yBase)
|
static void |
drawStringCentered(org.eclipse.swt.graphics.GC gc,
String string,
int left,
int right,
int y)
Draw a string centered between x,y at top y. |
static void |
drawStringCentered(org.eclipse.swt.graphics.GC gc,
String string,
int x,
int y,
int width,
int height)
Draw the string centered in the given rectangle (specified by plain values) |
static void |
drawStringCentered(org.eclipse.swt.graphics.GC gc,
String string,
org.eclipse.swt.graphics.Rectangle rect)
Draw String centered in the given rectangle. |
static void |
drawStringCenteredAroundPoint(org.eclipse.swt.graphics.GC gc,
String string,
int xCenter,
int yCenter)
|
static void |
drawStringCenteredMidX(org.eclipse.swt.graphics.GC gc,
String string,
int midx,
int y)
|
static void |
drawStringCenteredVCenter(org.eclipse.swt.graphics.GC gc,
String string,
int left,
int right,
int yCenter)
|
static void |
drawStringLeftAlignedVCenter(org.eclipse.swt.graphics.GC gc,
String string,
int x,
int y)
|
static void |
drawStringRightAlignedVCenter(org.eclipse.swt.graphics.GC gc,
String string,
int x,
int y)
|
static void |
drawStringRightAlignedVTop(org.eclipse.swt.graphics.GC gc,
String string,
int x,
int yTop)
Draws a String right aligned with the y coordinate denoting the top of the string. |
static void |
drawStringVCentered(org.eclipse.swt.graphics.GC gc,
String label,
int x,
int upperY,
int lowerY)
Draw a string vertical centered beetween upper and lower y left aligned to x. |
static void |
drawStringVertical(org.eclipse.swt.graphics.GC gc,
String string,
int x,
int y)
Draw a String vertical. |
static org.eclipse.swt.graphics.ImageData |
dropShadow(org.eclipse.swt.graphics.ImageData originalImageData,
org.eclipse.swt.graphics.Color color,
int radius,
int highlightRadius,
int opacity)
Create an image with a drop shadow. |
static int |
getStringDrawingHeight(org.eclipse.swt.graphics.GC gc,
String string)
|
static int |
getStringDrawingWidth(org.eclipse.swt.graphics.GC gc,
String string)
|
static org.eclipse.swt.graphics.ImageData |
glow(org.eclipse.swt.graphics.ImageData originalImageData,
org.eclipse.swt.graphics.Color color,
int radius,
int highlightRadius,
int opacity)
Create an image with a glow effect. |
static org.eclipse.swt.graphics.Image |
reflect(org.eclipse.swt.graphics.Image img,
org.eclipse.swt.graphics.Device device)
Create a reflection image (Idea taken from Daniel Spiewak: see http://www.eclipsezone.com/eclipse/forums/t91013.html? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwtGraphicsHelper()
Method Detail |
---|
public static void drawStringCentered(org.eclipse.swt.graphics.GC gc, String string, int left, int right, int y)
gc
- gcstring
- stringleft
- left boundright
- right boundy
- top ypublic static void drawStringCenteredMidX(org.eclipse.swt.graphics.GC gc, String string, int midx, int y)
public static void drawStringCenteredVCenter(org.eclipse.swt.graphics.GC gc, String string, int left, int right, int yCenter)
public static void drawStringRightAlignedVCenter(org.eclipse.swt.graphics.GC gc, String string, int x, int y)
public static void drawStringLeftAlignedVCenter(org.eclipse.swt.graphics.GC gc, String string, int x, int y)
public static void drawStringCentered(org.eclipse.swt.graphics.GC gc, String string, int xCenter, int yBase)
public static void drawStringCenteredAroundPoint(org.eclipse.swt.graphics.GC gc, String string, int xCenter, int yCenter)
public static void drawStringCentered(org.eclipse.swt.graphics.GC gc, String string, int x, int y, int width, int height)
gc
- string
- x
- y
- width
- height
- public static void drawStringCentered(org.eclipse.swt.graphics.GC gc, String string, org.eclipse.swt.graphics.Rectangle rect)
gc
- string
- rect
- public static int getStringDrawingWidth(org.eclipse.swt.graphics.GC gc, String string)
public static int getStringDrawingHeight(org.eclipse.swt.graphics.GC gc, String string)
public static void drawStringRightAlignedVTop(org.eclipse.swt.graphics.GC gc, String string, int x, int yTop)
gc
- GCstring
- string to drawx
- right x positionyTop
- top y positionpublic static void drawArrowLine(org.eclipse.swt.graphics.GC gc, int x1, int y1, int x2, int y2, int dist, int height, boolean arrowLeft, boolean arrowRight)
public static void drawArrowLineVertical(org.eclipse.swt.graphics.GC gc, int x1, int y1, int x2, int y2, int dist, int height, boolean arrowUp, boolean arrowDown)
public static void drawStringVCentered(org.eclipse.swt.graphics.GC gc, String label, int x, int upperY, int lowerY)
gc
- GClabel
- label to drawx
- left xupperY
- upper y boundlowerY
- lower y boundpublic static void drawStringVertical(org.eclipse.swt.graphics.GC gc, String string, int x, int y)
gc
- gcstring
- strin gto to drawx
- upper left xy
- upper left ypublic static org.eclipse.swt.graphics.ImageData dropShadow(org.eclipse.swt.graphics.ImageData originalImageData, org.eclipse.swt.graphics.Color color, int radius, int highlightRadius, int opacity)
originalImageData
- The original image. Transparency information will be ignored.color
- The color of the drop shadowradius
- The radius of the drop shadow in pixelshighlightRadius
- The radius of the highlight areaopacity
- The opacity of the drop shadow
public static org.eclipse.swt.graphics.ImageData glow(org.eclipse.swt.graphics.ImageData originalImageData, org.eclipse.swt.graphics.Color color, int radius, int highlightRadius, int opacity)
originalImageData
- The original image. Transparency information will be ignored.color
- The color of the glowradius
- The radius of the glow in pixelshighlightRadius
- The radius of the highlight areaopacity
- The opacity of the glow
public static org.eclipse.swt.graphics.Image reflect(org.eclipse.swt.graphics.Image img, org.eclipse.swt.graphics.Device device)
img
- image to reflectdevice
- device
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |