|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.gui.custom.DrawedRectangle
This class is a helper class for often moved and size-changed drawed Rectangles to avoid repainting if it is not needed and to keep the state consistent at any time.
| Field Summary | |
|---|---|
protected org.eclipse.swt.graphics.GC |
gc
The Graphics Context used for drawing operations |
protected boolean |
isErased
Current status of this Rectangle: visible ( isErased == false) or not visible
(isErased == true). |
protected org.eclipse.swt.graphics.Rectangle |
rect
The current coordinates of this Rectangle |
protected boolean |
redrawAfterRelease
Indicates whether this Rectangle should be redrawn after a call to release() |
protected org.eclipse.swt.graphics.Rectangle |
temp
Temporary object for reuse |
| Constructor Summary | |
|---|---|
DrawedRectangle(org.eclipse.swt.graphics.GC gc)
Constructs a new DrawedRectangle in invisible state using the given Graphics Context with the coordinates 0,0 and width/height 0 |
|
DrawedRectangle(org.eclipse.swt.graphics.Rectangle rect,
org.eclipse.swt.graphics.GC gc)
Constructs a new DrawedRectangle with the coordinates and width/height of the given Rectangle using the given Graphics Context for drawing operations |
|
DrawedRectangle(org.eclipse.swt.graphics.Rectangle rect,
org.eclipse.swt.graphics.GC gc,
boolean isErased)
Constructs a new DrawedRectangle with the coordinates and width/height of the given Rectangle using the given Graphics Context for drawing operations in the state indicated by isErased |
|
| Method Summary | |
|---|---|
void |
addBottom(int pixels)
Increase this Rectangle´s height by adding the given amount of pixels to the bottom |
void |
addLeft(int pixels)
Add the given amount of pixels to this Rectangle´s width on the left side |
void |
addRight(int pixels)
Increase this Rectangle´s width by adding the given amount of pixels to the right side |
void |
addTop(int pixels)
Increase this Rectangle´s height by adding the given amount of pixels to the top |
void |
block()
Block this Rectangle so it is not being redrawn after each change. |
void |
draw()
Make this Rectangle visible on the screen if it is not already |
protected void |
drawRectangle(org.eclipse.swt.graphics.Rectangle r)
Internal method for drawing a Rectangle on the screen |
void |
erase()
Delete this Rectangle from the screen if it is currently visible |
protected void |
eraseRectangle(org.eclipse.swt.graphics.Rectangle r)
Internal method for erasing a visible Rectangle from the screen |
void |
moveDown(int pixels)
Move this Rectangle down by the given amount of pixels |
void |
moveLeft(int pixels)
Move this Rectangle to the left by the given amount of pixels |
void |
moveRight(int pixels)
Move this Rectangle to the right by the given amount of pixels |
void |
moveUp(int pixels)
Move this Rectangle up by the given amount of pixels |
void |
release()
Release this Rectangle after it has been blocked by a call to block(). |
void |
removeBottom(int pixels)
Decrease this Rectangle´s height by removing the given amount of pixels from the bottom |
void |
removeLeft(int pixels)
Decrease this Rectangle´s widthby removing the given amount of pixels from the left side |
void |
removeRight(int pixels)
Decrease this Rectangle´s width by removing the given amount of pixels from the right side |
void |
removeTop(int pixels)
Decrease this Rectangle´s height by removing the given amount of pixels from the top |
void |
setBottom(int y)
Set the y-coordinate of this Rectangle´s bottom border |
void |
setErased(boolean erased)
Set the state of this Rectangle |
void |
setHeight(int height)
Set this Rectangle´s height |
void |
setLeft(int x)
Set the x-coordinate of this Rectangle´s left border |
void |
setRight(int x)
Set the x-coordinate of this Rectangle´s right border |
void |
setTo(int x,
int y,
int width,
int height)
Set the new coordinates, width and height for this Rectangle |
void |
setTop(int y)
Set the y-coordinate of this Rectangle´s top border |
void |
setWidth(int width)
Set this Rectangle´s width |
void |
setXPosition(int x)
Move this Rectangle to the given x-ccordinate |
void |
setYPosition(int y)
Move this Rectangle to the given y-ccordinate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.eclipse.swt.graphics.GC gc
protected boolean isErased
isErased == false) or not visible
(isErased == true).
protected org.eclipse.swt.graphics.Rectangle rect
protected boolean redrawAfterRelease
release()
protected org.eclipse.swt.graphics.Rectangle temp
| Constructor Detail |
|---|
public DrawedRectangle(org.eclipse.swt.graphics.GC gc)
gc - The Graphics Context to use for drawing operations
public DrawedRectangle(org.eclipse.swt.graphics.Rectangle rect,
org.eclipse.swt.graphics.GC gc)
rect - The Rectangle defining coordinates and width/height of this
Rectanglegc - The Graphics Context to use for drawing operations
public DrawedRectangle(org.eclipse.swt.graphics.Rectangle rect,
org.eclipse.swt.graphics.GC gc,
boolean isErased)
isErased
rect - The Rectangle defining coordinates and width/height of this
Rectanglegc - The Graphics Context to use for drawing operationsisErased - The current state of the Rectangle| Method Detail |
|---|
public void addBottom(int pixels)
pixels - The amount of pixels to addpublic void addLeft(int pixels)
pixels - The amount of pixels to addpublic void addRight(int pixels)
pixels - The amount of pixels to addpublic void addTop(int pixels)
pixels - The amount of pixels to addpublic void block()
release() will set the Rectangle
back into its usual behaviour.
release()public void draw()
protected void drawRectangle(org.eclipse.swt.graphics.Rectangle r)
r - The Rectangel to drawpublic void erase()
protected void eraseRectangle(org.eclipse.swt.graphics.Rectangle r)
r - The Rectangle to erasepublic void moveDown(int pixels)
pixels - The amount of pixels to movepublic void moveLeft(int pixels)
pixels - The amount of pixels to movepublic void moveRight(int pixels)
pixels - The amount of pixels to movepublic void moveUp(int pixels)
pixels - The amount of pixels to movepublic void release()
block().
block()public void removeBottom(int pixels)
pixels - The amount of pixels to removepublic void removeLeft(int pixels)
pixels - The amount of pixels to removepublic void removeRight(int pixels)
pixels - The amount of pixels to remove.public void removeTop(int pixels)
pixels - The amount of pixels to removepublic void setBottom(int y)
y - The new y-coordinatepublic void setErased(boolean erased)
erased - true, if this Rectangle is erased and therefore NOT
visible on the screen, false otherwise.public void setHeight(int height)
height - The new heightpublic void setLeft(int x)
x - The new x-coordinatepublic void setRight(int x)
x - The new x-coordinate
public void setTo(int x,
int y,
int width,
int height)
x - The new x-coordinatey - The new y-coordinatewidth - The new widthheight - The new heightpublic void setTop(int y)
y - The new y-coordinatepublic void setWidth(int width)
width - The new widthpublic void setXPosition(int x)
x - The new x-coordinatepublic void setYPosition(int y)
y - The new y-coordinate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||