yu.ac.bg.etf.javaqx.qswing.graphics
Class Graphics

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.core.AbstractDisposable
      extended byyu.ac.bg.etf.javaqx.qswing.graphics.Graphics
All Implemented Interfaces:
Disposable

public abstract class Graphics
extends AbstractDisposable

Abstract Graphics Object.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Constructor Summary
protected Graphics()
          Constructs new Graphics object.
 
Method Summary
abstract  void draw(Shape shape)
          Draws the shape.
abstract  void drawImage(Image image, int x, int y)
          Draw the image.
abstract  void drawLine(int x1, int y1, int x2, int y2)
          Draws the line.
abstract  void drawOval(int x, int y, int width, int height)
          Draws the oval.
abstract  void drawRect(int x, int y, int width, int height)
          Draws the rectangle.
abstract  void drawString(java.lang.String str, int x, int y)
          Draws the string.
abstract  void fill(Shape shape)
          Fills the shape.
abstract  void fillOval(int x, int y, int width, int height)
          Fills the oval.
abstract  void fillRect(int x, int y, int width, int height)
          Fills the rectangle.
abstract  Color getColor()
          Returns color of the graphics.
abstract  Font getFont()
          Returns font of the graphics.
abstract  FontMetrics getFontMetrics()
          Returns font metrics of the current font.
abstract  Paint getPaint()
          Returns paint.
abstract  Stroke getStroke()
          Returns stroke.
abstract  void setColor(Color color)
          Sets color for the graphics.
abstract  void setFont(Font font)
          Sets font for the graphics.
abstract  void setPaint(Paint paint)
          Sets paint.
abstract  void setStroke(Stroke stroke)
          Sets stroke.
 java.lang.String toString()
          
 
Methods inherited from class yu.ac.bg.etf.javaqx.core.AbstractDisposable
addDisposeListener, dispose, disposedCheck, disposedErrorString, disposeObject, finalize, isDisposed, removeDisposeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Graphics

protected Graphics()
Constructs new Graphics object.

Method Detail

getColor

public abstract Color getColor()
Returns color of the graphics.

Returns:
color of the graphics

setColor

public abstract void setColor(Color color)
Sets color for the graphics.

Parameters:
color - the new color

getFont

public abstract Font getFont()
Returns font of the graphics.

Returns:
font of the graphics

setFont

public abstract void setFont(Font font)
Sets font for the graphics.

Parameters:
font - the new font

getFontMetrics

public abstract FontMetrics getFontMetrics()
Returns font metrics of the current font.

Returns:
font metrics of the current font

getPaint

public abstract Paint getPaint()
Returns paint.

Returns:
paint

setPaint

public abstract void setPaint(Paint paint)
Sets paint.

Parameters:
paint - the paint

getStroke

public abstract Stroke getStroke()
Returns stroke.

Returns:
stroke

setStroke

public abstract void setStroke(Stroke stroke)
Sets stroke.

Parameters:
stroke - the stroke

draw

public abstract void draw(Shape shape)
Draws the shape.

Parameters:
shape - the shape

drawLine

public abstract void drawLine(int x1,
                              int y1,
                              int x2,
                              int y2)
Draws the line.

Parameters:
x1 - the x coordinate of the first point
y1 - the y coordinate of the first point
x2 - the x coordinate of the second point
y2 - the y coordinate of the second point

drawRect

public abstract void drawRect(int x,
                              int y,
                              int width,
                              int height)
Draws the rectangle.

Parameters:
x - the x coordinate of the rectangle
y - the y coordinate of the rectangle
width - the width of the rectangle
height - the height of the rectangle

drawOval

public abstract void drawOval(int x,
                              int y,
                              int width,
                              int height)
Draws the oval.

Parameters:
x - the x coordinate of the oval
y - the y coordinate of the oval
width - the width of the oval
height - the height of the oval

drawImage

public abstract void drawImage(Image image,
                               int x,
                               int y)
Draw the image.

Parameters:
image - the image
x - the x coordinate of the image
y - the y coordinate of the image

drawString

public abstract void drawString(java.lang.String str,
                                int x,
                                int y)
Draws the string.

Parameters:
str - the string
x - the x coordinate of the string
y - the y coordinate of the string

fill

public abstract void fill(Shape shape)
Fills the shape.

Parameters:
shape - the shape

fillRect

public abstract void fillRect(int x,
                              int y,
                              int width,
                              int height)
Fills the rectangle.

Parameters:
x - the x coordinate of the rectangle
y - the y coordinate of the rectangle
width - the width of the rectangle
height - the height of the rectangle

fillOval

public abstract void fillOval(int x,
                              int y,
                              int width,
                              int height)
Fills the oval.

Parameters:
x - the x coordinate of the oval
y - the y coordinate of the oval
width - the width of the oval
height - the height of the oval

toString

public java.lang.String toString()



Copyright © 2007 ETF and contributors. All Rights Reserved.