-bottom

mmpp.microedition.lcdui
Class GraphicsX

java.lang.Object
  |
  +--javax.microedition.lcdui.Graphics
        |
        +--mmpp.microedition.lcdui.GraphicsX

public class GraphicsX
extends javax.microedition.lcdui.Graphics

GraphicsX는 Graphics의 subclass로 Graphics의 확장된 API를 제공한다. 현재 구현에서 모든 Graphics개체는 GraphicsX의 instance이다. 따라서 GraphicsX개체는Graphics개체를 GraphicsX *gx = (GraphicsX)g;와 같이 type casting을 통해서 얻을 수 있다.


Field Summary
static int DEFAULT_ALPHA
           
 
Fields inherited from class javax.microedition.lcdui.Graphics
alpha, BASELINE, BOTTOM, clipX1, clipX2, clipY1, clipY2, destination, DOTTED, HCENTER, LEFT, RIGHT, SOLID, TOP, transX, transY, VCENTER, xorColor, xorMode
 
Method Summary
 javax.microedition.lcdui.Image capture(int x, int y, int width, int height)
          주어진 영역에 대하여 Graphics 객체의 내용을 Image로 만들어서 return한다.
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Polygon을 그린다. (xPoints[0], yPoints[0), (xPoints[1], yPoints[1]) .... (xPoints[n-1],yPoints[n-1])의 점들로 이루어진 Polygon을 그린다.
 void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          Polyline을 그린다. (xPoints[0], yPoints[0), (xPoints[1], yPoints[1]) .... (xPoints[n-1],yPoints[n-1])의 점들로 이루어진 Polyline을 그린다.
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Polygon을 그린다. (xPoints[0], yPoints[0), (xPoints[1], yPoints[1]) .... (xPoints[n-1],yPoints[n-1])의 점들로 이루어지고 내부가 현재 color로 채워진 Polygon을 그린다.
 int getPixel(int x, int y)
          특정 좌표의 색상 값을 RGB로 얻어낸다.
 void setAlpha(int alpha)
          현재의 graphics context에 alpha값을 설정한다. alpha 값은 alpha blending에 사용된다. alpha값은 0부터 256 사이의 값을 가질 수 있다. alpha가 0이면 투명이고 alpha가 256이면 불투명이다.
 void setPaintMode()
          현재의 graphics의 context를 xor모드에 paint모드로 변경한다.
 void setPixel(int x, int y, int RGB)
          특정 좌표의 색상 값을 RGB로 지정한다.
 void setXORMode(int RGB)
          현재의 graphics의 context를 xor모드로 바꾼다. xor모드로 같은 그림이 두번 그려지게 되면 원래의 그림이 복원된다.
 
Methods inherited from class javax.microedition.lcdui.Graphics
clipRect, drawArc, drawChar, drawChars, drawImage, drawLine, drawRect, drawRoundRect, drawString, drawSubstring, fillArc, fillRect, fillRoundRect, getBlueComponent, getClipHeight, getClipWidth, getClipX, getClipY, getColor, getFont, getGrayScale, getGreenComponent, getRedComponent, getStrokeStyle, getTranslateX, getTranslateY, setClip, setColor, setColor, setFont, setGrayScale, setStrokeStyle, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ALPHA

public static int DEFAULT_ALPHA
Method Detail

capture

public javax.microedition.lcdui.Image capture(int x,
                                              int y,
                                              int width,
                                              int height)
주어진 영역에 대하여 Graphics 객체의 내용을 Image로 만들어서 return한다.
Parameters:
x - 저장할 화면 사각형의 왼쪽 좌표
y - 저장할 화면 사각형의 위쪽 좌표
width - 저장할 화면 사각형의 너비
height - 저장할 화면 사각형의 높이
Throws:
IllegalArgumentExcepton - width 또는 height가 0보다 작거나 같을 때. clipping영역을 벗어난 곳을 caputre하려 할 때

setXORMode

public void setXORMode(int RGB)
현재의 graphics의 context를 xor모드로 바꾼다. xor모드로 같은 그림이 두번 그려지게 되면 원래의 그림이 복원된다. 이 모드에서 현재 color는 argument로 주어진 color로 바뀌고 다른색들의 값은 어떤 값으로 바뀔지 지정할 수 없다. graphics모드가 xor모드로 바뀌게 되면 alpha는 default alpha로 자동은 변경된다.
Parameters:
RGB - XOR로 현재 color를 대체할 color
See Also:
setPaintMode(), setAlpha(int)

setPaintMode

public void setPaintMode()
현재의 graphics의 context를 xor모드에 paint모드로 변경한다.
See Also:
setXORMode(int), setAlpha(int)

setAlpha

public void setAlpha(int alpha)
현재의 graphics context에 alpha값을 설정한다. alpha 값은 alpha blending에 사용된다. alpha값은 0부터 256 사이의 값을 가질 수 있다. alpha가 0이면 투명이고 alpha가 256이면 불투명이다. 기본값은 DEFAULT_ALPHA로 256이다
Parameters:
alpha - 0부터 256사이의 정수 값
Throws:
java.lang.IllegalArgumentException - alpha값이 0~256사이의 값이 아닐 때

getPixel

public int getPixel(int x,
                    int y)
특정 좌표의 색상 값을 RGB로 얻어낸다.
Parameters:
x - pixel의 x좌표
y - pixel의 y좌표
Throws:
java.lang.IllegalArgumentException - clipping영역 밖의 점을 얻으려 할 때

setPixel

public void setPixel(int x,
                     int y,
                     int RGB)
특정 좌표의 색상 값을 RGB로 지정한다.
Parameters:
x - pixel의 x좌표
y - pixel의 y좌표
RGB - pixel에 사용할 color

drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
Polyline을 그린다. (xPoints[0], yPoints[0), (xPoints[1], yPoints[1]) .... (xPoints[n-1],yPoints[n-1])의 점들로 이루어진 Polyline을 그린다.
Parameters:
xPoints - 점들의 x좌표 배열
yPoints - 점들의 y좌표 배열
nPoints - 점의 갯수

drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Polygon을 그린다. (xPoints[0], yPoints[0), (xPoints[1], yPoints[1]) .... (xPoints[n-1],yPoints[n-1])의 점들로 이루어진 Polygon을 그린다.
Parameters:
xPoints - 점들의 x좌표 배열
yPoints - 점들의 y좌표 배열
nPoints - 점의 갯수

fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Polygon을 그린다. (xPoints[0], yPoints[0), (xPoints[1], yPoints[1]) .... (xPoints[n-1],yPoints[n-1])의 점들로 이루어지고 내부가 현재 color로 채워진 Polygon을 그린다.
Parameters:
xPoints - 점들의 x좌표 배열
yPoints - 점들의 y좌표 배열
nPoints - 점의 갯수

-bottom