Graphics

php\swing\Graphics

Class Graphics

Properties


property color

php\swing\Color

Foreground color

property font

php\swing\Font

Font of text

Methods


__construct()

private

getTextWidth($str)

Return width of str for drawText + current font

Parameters:
  • $str
Returns:

int

getTextHeight()

Return height of one line text with current font

Returns:int
setPaintMode()
drawLine($x1, $y1, $x2, $y2)

Draw line

Parameters:
  • $x1int
  • $y1int
  • $x2int
  • $y2int
drawRect($x, $y, $width, $height)

Draw rect

Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
fillRect($x, $y, $width, $height)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
draw3DRect($x, $y, $width, $height, $raised)

Draws a 3-D highlighted outline of the specified rectangle.

Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
  • $raised
fill3DRect($x, $y, $width, $height, $raised)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
  • $raised
drawOval($x, $y, $width, $height)

Draw oval

Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
fillOval($x, $y, $width, $height)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
drawArc($x, $y, $width, $height, $startAngle, $arcAngle)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
  • $startAngleint
  • $arcAngleint
fillArc($x, $y, $width, $height, $startAngle, $arcAngle)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
  • $startAngleint
  • $arcAngleint
drawPolygon($xy)
Parameters:
  • $xyarray - - [[x1, y1], [x2, y2], ... ]
fillPolygon($xy)
Parameters:
  • $xyarray - - [[x1, y1], [x2, y2], ... ]
drawPolyline($xy)
Parameters:
  • $xyarray - - [[x1, y1], [x2, y2], ... ]
drawImage($image, $x = 0, $y = 0, $newWidth = null, $newHeight = null)
Parameters:
  • $imagephp\swing\Image
  • $xint
  • $yint
  • $newWidthnull, int
  • $newHeightnull, int
drawText($text, $x, $y)
Parameters:
  • $textstring
  • $xint
  • $yint
clipRect($x, $y, $width, $height)

Intersects the current clip with the specified rectangle.

Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
clearRect($x, $y, $width, $height)

Clears the specified rectangle by filling it with the background color of the current drawing surface.

Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
setXORMode($color)
Parameters:
translate($x, $y)

Translates the origin of the graphics context to the point (x, y) in the current coordinate system.

Parameters:
  • $xint
  • $yint
copyArea($x, $y, $width, $height, $dx, $dy)

Copies an area of the component by a distance specified by $dx and $dy

Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
  • $dxint
  • $dyint
create($x = null, $y = null, $w = null, $h = null)

Create new copy Graphics from this

Parameters:
  • $xint, null
  • $yint, null
  • $wint, null
  • $hint, null
Returns:

php\swing\Graphics

dispose()