JavaTM 2
Platform
Std.  Ed.  v1. 4.0

java.awt
Ŭ·¡½º GradientPaint

java.lang.Object 
  |
  +--java.awt.GradientPaint
¸ðµç ±¸Çö ÀÎÅÍÆäÀ̽º:
Paint , Transparency

public class GradientPaint
extends Object
implements Paint

GradientPaint Ŭ·¡½º´Â Ä®¶óÀÇ ¼±Çü ±×¶óµ¥ÀÌ¼ÇÆÄźÀ¸·Î Shape ¸¦ ÀüºÎ Ä¥ÇÏ´Â ¼ö´ÜÀ» Á¦°øÇÕ´Ï´Ù. Color C1 ¸¦ °¡Áö´Â Point P1, ¹× Color C2 ¸¦ °¡Áö´Â Point P2 °¡ À¯Àú °ø°£¿¡¼­ ÁöÁ¤µÇ¸é(ÀÚ), P1 ¿Í P2 ¸¦ ¿¬°áÇÏ´Â ¼±»óÀÇ Color °¡ C1 ·ÎºÎÅÍ C2 ·Î ¼­¼­È÷ º¯È­ÇØ °¥ °ÍÀÔ´Ï´Ù. P1 ¿Í P2 ¸¦ ¿¬°áÇÏ´Â ¼±ÀÇ ¿¬Àå¼±»ó¿¡ ¾ø´Â Á¡ P ´Â P1 ¿Í P2 ¸¦ ¿¬°áÇÏ´Â ¼±ÀÇ ¿¬Àå¼±»ó¿¡ ÀÖ´Â P ÀÇ ¼öÁ÷ÀÇ Åõ¿µÀÎ Á¡ P'ÀÇ »öÀ» °¡Áý´Ï´Ù. P1, P2 ¼¼±×¸ÕÆ®(segment)ÀÇ ¿ÜÃø¿¡ ÀÖ´Â ¿¬Àå¼±»óÀÇ Á¡Àº ´ÙÀ½ÀÇ 2 °³ÀÇ ¹æ¹ýÀÇ ¾î´ÀÂÊÀ̵çÀ¸·Î ÷°¡ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù.

°ü·Ã Ç׸ñ:
Paint , Graphics2D.setPaint(java.awt.Paint)

ÇʵåÀÇ °³¿ä
 
ÀÎÅÍÆäÀ̽º java.awt. Transparency ¿¡¼­ »ó¼Ó¹ÞÀº Çʵå
BITMASK , OPAQUE , TRANSLUCENT
 
»ý¼ºÀÚÀÇ °³¿ä
GradientPaint (float x1, float y1, Color  color1, float x2, float y2, Color  color2)
          ½ÉÇÃÇÑ ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.
GradientPaint (float x1, float y1, Color  color1, float x2, float y2, Color  color2, boolean cyclic)
          boolean ÆÄ¶ó¹ÌÅÍ¿¡ ÀÀÇØ, ¼øÈ¯½Ä ¶Ç´Â ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.
GradientPaint (Point2D  pt1, Color  color1, Point2D  pt2, Color  color2)
          ½ÉÇÃÇÑ ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.
GradientPaint (Point2D  pt1, Color  color1, Point2D  pt2, Color  color2, boolean cyclic)
          boolean ÆÄ¶ó¹ÌÅÍ¿¡ ÀÀÇØ, ¼øÈ¯½Ä ¶Ç´Â ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.
 
¸Þ¼ÒµåÀÇ °³¿ä
 PaintContext createContext (ColorModel  cm, Rectangle  deviceBounds, Rectangle2D  userBounds, AffineTransform  xform, RenderingHints  hints)
          Ä®¶ó ÆÐÅÏÀ» »ý¼ºÇϱâ À§Çؼ­ »ç¿ëµÇ´Â ¹®¸ÆÀ» ÀÛ¼ºÇØ µ¹·ÁÁÝ´Ï´Ù.
 Color getColor1 ()
          Á¡ P1 ¿¡ ÀÇÇØ °íÁ¤µÈ »ö C1 ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 Color getColor2 ()
          Á¡ P2 ¿¡ ÀÇÇØ °íÁ¤µÈ »ö C2 ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 Point2D getPoint1 ()
          ÃÖÃÊÀÇ »öÀ» °íÁ¤ÇÏ´Â Á¡ P1 ÀÇ Ä«ÇǸ¦ µ¹·ÁÁÝ´Ï´Ù.
 Point2D getPoint2 ()
          2 ¹øÂ°ÀÇ »öÀ» °íÁ¤ÇÏ´Â Á¡ P2 ÀÇ Ä«ÇǸ¦ µ¹·ÁÁÝ´Ï´Ù.
 int getTransparency ()
          ÀÌ GradientPaint ÀÇ Åõ¸íµµ ¸ðµå¸¦ µ¹·ÁÁÝ´Ï´Ù.
 boolean isCyclic ()
          ±×¶óµ¥À̼ÇÀÌ C1 ¿Í C2 ÀÇ 2 »öÀ» ¹Ýº¹ÇØ ¼øÈ¯ÇÏ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 
Ŭ·¡½º java.lang. Object ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

»ý¼ºÀÚÀÇ »ó¼¼

GradientPaint

public GradientPaint(float x1,
                     float y1,
                     Color  color1,
                     float x2,
                     float y2,
                     Color  color2)
½ÉÇÃÇÑ ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
color1 - ÃÖÃÊ·Î ÁöÁ¤µÈ Point ÀÇ Color
color2 - 2 ¹øÂ°·Î ÁöÁ¤µÈ Point ÀÇ Color
¿¹¿Ü:
NullPointerException - ¾î´ÀÂÊÀ̵ç 1 °³ÀÇ Ä®¶ó°¡ null ÀÇ °æ¿ì

GradientPaint

public GradientPaint(Point2D  pt1,
                     Color  color1,
                     Point2D  pt2,
                     Color  color2)
½ÉÇÃÇÑ ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
pt1 - À¯Àú °ø°£¿¡¼­ ÃÖÃÊ·Î ÁöÁ¤µÈ Point
color1 - ÃÖÃÊ·Î ÁöÁ¤µÈ Point ÀÇ Color
pt2 - À¯Àú °ø°£¿¡¼­ 2 ¹øÂ°·Î ÁöÁ¤µÈ Point
color2 - 2 ¹øÂ°·Î ÁöÁ¤µÈ Point ÀÇ Color
¿¹¿Ü:
NullPointerException - ¾î´ÀÂÊÀ̵ç 1 °³ÀÇ Ä®¶ó ¶Ç´Â Á¡ÀÌ null ÀÇ °æ¿ì

GradientPaint

public GradientPaint(float x1,
                     float y1,
                     Color  color1,
                     float x2,
                     float y2,
                     Color  color2,
                     boolean cyclic)
boolean ÆÄ¶ó¹ÌÅÍ¿¡ ÀÀÇØ, ¼øÈ¯½Ä ¶Ç´Â ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
color1 - ÃÖÃÊ·Î ÁöÁ¤µÈ Point ÀÇ Color
color2 - 2 ¹øÂ°·Î ÁöÁ¤µÈ Point ÀÇ Color
cyclic - ±×¶óµ¥ÀÌ¼ÇÆÄźÀÌ 2 °³ÀÇ »öÀ» ¹Ýº¹ÇØ ¼øÈ¯ÇÏ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false

GradientPaint

public GradientPaint(Point2D  pt1,
                     Color  color1,
                     Point2D  pt2,
                     Color  color2,
                     boolean cyclic)
boolean ÆÄ¶ó¹ÌÅÍ¿¡ ÀÀÇØ, ¼øÈ¯½Ä ¶Ç´Â ºñ¼øÈ¯½ÄÀÇ GradientPaint ¿ÀºêÁ§Æ®¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
pt1 - À¯Àú °ø°£¿¡¼­ ÃÖÃÊ·Î ÁöÁ¤µÈ Point
color1 - ÃÖÃÊ·Î ÁöÁ¤µÈ Point ÀÇ Color
pt2 - À¯Àú °ø°£¿¡¼­ 2 ¹øÂ°·Î ÁöÁ¤µÈ Point
color2 - 2 ¹øÂ°·Î ÁöÁ¤µÈ Point ÀÇ Color
cyclic - ±×¶óµ¥ÀÌ¼ÇÆÄźÀÌ 2 °³ÀÇ »öÀ» ¹Ýº¹ÇØ ¼øÈ¯ÇÏ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
¿¹¿Ü:
NullPointerException - ¾î´ÀÂÊÀ̵ç 1 °³ÀÇ Ä®¶ó ¶Ç´Â Á¡ÀÌ null ÀÇ °æ¿ì
¸Þ¼ÒµåÀÇ »ó¼¼

getPoint1

public Point2D  getPoint1()
ÃÖÃÊÀÇ »öÀ» °íÁ¤ÇÏ´Â Á¡ P1 ÀÇ Ä«ÇǸ¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
ÀÌ GradientPaint ÀÇ ÃÖÃÊÀÇ »öÀ» °íÁ¤ÇÏ´Â Á¡ÀÇ Ä«ÇǸ¦ ³ªÅ¸³»´Â Point2D ¿ÀºêÁ§Æ®

getColor1

public Color  getColor1()
Á¡ P1 ¿¡ ÀÇÇØ °íÁ¤µÈ »ö C1 ¸¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
P1 ¿¡ ÀÇÇØ °íÁ¤µÈ »öÀ» ³ªÅ¸³»´Â Color ¿ÀºêÁ§Æ®

getPoint2

public Point2D  getPoint2()
2 ¹øÂ°ÀÇ »öÀ» °íÁ¤ÇÏ´Â Á¡ P2 ÀÇ Ä«ÇǸ¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
ÀÌ GradientPaint ÀÇ 2 ¹øÂ°ÀÇ »öÀ» °íÁ¤ÇÏ´Â Á¡ÀÇ Ä«ÇǸ¦ ³ªÅ¸³»´Â Point2D ¿ÀºêÁ§Æ®

getColor2

public Color  getColor2()
Á¡ P2 ¿¡ ÀÇÇØ °íÁ¤µÈ »ö C2 ¸¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
P2 ¿¡ ÀÇÇØ °íÁ¤µÈ »öÀ» ³ªÅ¸³»´Â Color ¿ÀºêÁ§Æ®

isCyclic

public boolean isCyclic()
±×¶óµ¥À̼ÇÀÌ C1 ¿Í C2 ÀÇ 2 »öÀ» ¹Ýº¹ÇØ ¼øÈ¯ÇÏ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
±×¶óµ¥À̼ÇÀÌ 2 »öÀ» ¹Ýº¹ÇØ ¼øÈ¯ÇÏ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false

createContext

public PaintContext  createContext(ColorModel  cm,
                                  Rectangle  deviceBounds,
                                  Rectangle2D  userBounds,
                                  AffineTransform  xform,
                                  RenderingHints  hints)
Ä®¶ó ÆÐÅÏÀ» »ý¼ºÇϱâ À§Çؼ­ »ç¿ëµÇ´Â ¹®¸ÆÀ» ÀÛ¼ºÇØ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º Paint ³»ÀÇ createContext
ÆÄ¶ó¹ÌÅÍ:
cm - Paint µ¥ÀÌÅ͸¦ ¹Þ´Â ColorModel . À̰ÍÀº ´ÜÁö ÈùÆ®·Î¼­ »ç¿ëµÇ´Â
deviceBounds - Ç¥Çö µÇ´Â graphics primitiveÀÇ µð¹ÙÀ̽º °ø°£¿¡¼­ÀÇ ¹Ù¿îµò±×º¹½º
userBounds - Ç¥Çö µÇ´Â graphics primitiveÀÇ À¯Àú °ø°£¿¡¼­ÀÇ ¹Ù¿îµò±×º¹½º
xform - À¯Àú °ø°£À¸·ÎºÎÅÍ µð¹ÙÀ̽º °ø°£¿¡ÀÇ AffineTransform
hints - ¹®¸Æ ¿ÀºêÁ§Æ®°¡ Ç¥ÇöÀÇ ¼±ÅûçÇ×À» ¼±ÅÃÇÒ °æ¿ì¿¡ »ç¿ëÇÏ´Â ÈùÆ®
¹Ýȯ°ª:
Ä®¶ó ÆÐÅÏÀ» »ý¼ºÇÏ´Â PaintContext
°ü·Ã Ç׸ñ:
PaintContext

getTransparency

public int getTransparency()
ÀÌ GradientPaint ÀÇ Åõ¸íµµ ¸ðµå¸¦ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º Transparency ³»ÀÇ getTransparency
¹Ýȯ°ª:
ÀÌ GradientPaint ¿ÀºêÁ§Æ®ÀÇ Åõ¸íµµ ¸ðµå¸¦ ³ªÅ¸³»´Â Á¤¼öÄ¡
°ü·Ã Ç׸ñ:
Transparency

JavaTM 2
Platform
Std.  Ed.  v1. 4.0

¹ö±×ÀÇ º¸°í¿Í ±â´ÉÀÇ ¸®Äù½ºÆ®
ÀÌ¿ÜÀÇ API ·¹ÆÛ·±½º ¹× °³¹ßÀÚ¿ë ¹®¼­¿¡ ´ëÇØ¼­´Â Java 2 SDK SE °³¹ßÀÚ¿ë ¹®¼­¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. °³¹ßÀÚÀü¿ëÀÇ »ó¼¼ÇÑ ÇØ¼³, °³³äÀÇ °³¿ä, ¿ë¾îÀÇ Á¤ÀÇ, ¹ö±×ÀÇ È¸ÇÇÃ¥, ¹× ÄÚµå ½Ç·Ê°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.

Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ À־ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.