|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CustomRenderer
An interface for describing the drawing of custom shapes that cannot be captured via a single GeneralPath. This interface would generally be used when the Attribute SHAPE_ATTR=custom and CUSTOM_ATTR is set to the name of a user provided class which would be an extension of GrappaShape and implements this interface. Note that if the custom shape desired by the user can be expressed as a single general path, then there is no need to use this interface or provide the methods it requires.
Method Summary | |
---|---|
void |
draw(java.awt.Graphics2D g2d)
The method called when the element needs to be drawn. |
void |
drawImage(java.awt.Graphics2D g2d)
The method called when the element needs to draw its background image. |
void |
fill(java.awt.Graphics2D g2d)
The method called when the element needs to be filled. |
Method Detail |
---|
void draw(java.awt.Graphics2D g2d)
public void draw(java.awt.Graphics2D g2d) { g2d.draw(this); }
g2d
- the Graphics2D context to be used for drawingvoid fill(java.awt.Graphics2D g2d)
public void fill(java.awt.Graphics2D g2d) { g2d.fill(this); }
g2d
- the Graphics2D context to be used for drawingvoid drawImage(java.awt.Graphics2D g2d)
public void drawImage(java.awt.Graphics2D g2d) { Rectangle sbox = this.getBounds(); Shape clip = g2d.getClip(); g2d.clip(this); g2d.drawImage(element.getGrappaNexus().getImage(), sbox.x, sbox.y, sbox.width, sbox.height, null); g2d.setClip(clip); }
g2d
- the Graphics2D context to be used for drawing
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |