de.cau.cs.kieler.kiml.ui.util
Class DebugCanvas

java.lang.Object
  extended by de.cau.cs.kieler.kiml.ui.util.DebugCanvas

public class DebugCanvas
extends Object

A canvas for drawing debug information on the active diagram.

Rating red

Nested Class Summary
static class DebugCanvas.Color
          color definitions.
static class DebugCanvas.DrawingMode
          the available drawing modes.
 
Constructor Summary
DebugCanvas(KNode parentNode, DebugCanvas.DrawingMode drawingMode)
          Constructs a debug canvas.
 
Method Summary
 void clear()
          Clears the canvas and the figure buffer.
 void drawBuffer()
          Draws the buffered figures and clears the buffer.
 void drawCircle(float x, float y, float d, DebugCanvas.Color color)
          Draws a non-filled circle on the canvas.
 void drawEllipse(float x, float y, float w, float h, DebugCanvas.Color color)
          Draws a non-filled ellipse on the canvas.
 void drawFilledCircle(float x, float y, float d, DebugCanvas.Color color)
          Draws a filled circle on the canvas.
 void drawFilledEllipse(float x, float y, float w, float h, DebugCanvas.Color color)
          Draws a filled ellipse on the canvas.
 void drawFilledRectangle(float x, float y, float w, float h, DebugCanvas.Color color)
          Draws a filled rectangle on the canvas.
 void drawLine(float x1, float y1, float x2, float y2, DebugCanvas.Color color)
          Draws a line on the canvas.
 void drawRectangle(float x, float y, float w, float h, DebugCanvas.Color color)
          Draws a non-filled rectangle one the canvas.
 void drawString(String string, float x, float y, DebugCanvas.Color color)
          Draws a string on the canvas.
 float getCustomXOffset()
          Returns the custom x-Offset for this canvas.
 float getCustomYOffset()
          Returns the custom y-Offset for this canvas.
 void setCustomXOffset(float x)
          Sets a custom x-Offset for this canvas.
 void setCustomYOffset(float y)
          Sets a custom y-Offset for this canvas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugCanvas

public DebugCanvas(KNode parentNode,
                   DebugCanvas.DrawingMode drawingMode)
Constructs a debug canvas.

Parameters:
parentNode - the parentNode this canvas is relative to
drawingMode - the drawing mode
Method Detail

setCustomXOffset

public void setCustomXOffset(float x)
Sets a custom x-Offset for this canvas.

Parameters:
x - the x-Offset

getCustomXOffset

public float getCustomXOffset()
Returns the custom x-Offset for this canvas.

Returns:
the x-Offset

setCustomYOffset

public void setCustomYOffset(float y)
Sets a custom y-Offset for this canvas.

Parameters:
y - the y-Offset

getCustomYOffset

public float getCustomYOffset()
Returns the custom y-Offset for this canvas.

Returns:
the y-Offset

drawFilledRectangle

public void drawFilledRectangle(float x,
                                float y,
                                float w,
                                float h,
                                DebugCanvas.Color color)
Draws a filled rectangle on the canvas.

Parameters:
x - the x-coordinate
y - the y-coordinate
w - the width
h - the height
color - the color

drawRectangle

public void drawRectangle(float x,
                          float y,
                          float w,
                          float h,
                          DebugCanvas.Color color)
Draws a non-filled rectangle one the canvas.

Parameters:
x - the x-coordinate
y - the y-coordinate
w - the width
h - the height
color - the color

drawFilledEllipse

public void drawFilledEllipse(float x,
                              float y,
                              float w,
                              float h,
                              DebugCanvas.Color color)
Draws a filled ellipse on the canvas.

Parameters:
x - the x-coordinate
y - the y-coordinate
w - the width
h - the height
color - the color

drawEllipse

public void drawEllipse(float x,
                        float y,
                        float w,
                        float h,
                        DebugCanvas.Color color)
Draws a non-filled ellipse on the canvas.

Parameters:
x - the x-coordinate
y - the y-coordinate
w - the width
h - the height
color - the color

drawFilledCircle

public void drawFilledCircle(float x,
                             float y,
                             float d,
                             DebugCanvas.Color color)
Draws a filled circle on the canvas.

Parameters:
x - the x-coordinate
y - the y-coordinate
d - the diameter
color - the color

drawCircle

public void drawCircle(float x,
                       float y,
                       float d,
                       DebugCanvas.Color color)
Draws a non-filled circle on the canvas.

Parameters:
x - the x-coordinate
y - the y-coordinate
d - the diameter
color - the color

drawLine

public void drawLine(float x1,
                     float y1,
                     float x2,
                     float y2,
                     DebugCanvas.Color color)
Draws a line on the canvas.

Parameters:
x1 - the x-coordinate of the start point
y1 - the y-coordinate of the start point
x2 - the x-coordinate of the end point
y2 - the y-coordinate of the end point
color - the color

drawString

public void drawString(String string,
                       float x,
                       float y,
                       DebugCanvas.Color color)
Draws a string on the canvas.

Parameters:
string - the string
x - the x-coordinate
y - the y-coordinate
color - the color

clear

public void clear()
Clears the canvas and the figure buffer.


drawBuffer

public void drawBuffer()
Draws the buffered figures and clears the buffer.