JavaTM 2
Platform
Std.  Ed.  v1. 4.0

java.awt
Ŭ·¡½º Rectangle

java.lang.Object 
  |
  +--java.awt.geom.RectangularShape 
        |
        +--java.awt.geom.Rectangle2D 
              |
              +--java.awt.Rectangle
¸ðµç ±¸Çö ÀÎÅÍÆäÀ̽º:
Cloneable , Serializable , Shape
Á÷°èÀÇ ±âÁ¸ÀÇ ¼­ºê Ŭ·¡½º:
DefaultCaret

public class Rectangle
extends Rectangle2D
implements Shape , Serializable

Rectangle ´Â Rectangle ¿ÀºêÁ§Æ®ÀÇ ÁÂÇ¥ °ø°£¿¡¼­ÀÇ Á»óÀÇ Á¡ (x,  y), ¹× ±× Æø°ú ³ôÀÌ¿¡ ÀÇÇØ µÑ·¯½ÎÀÌ´Â ÁÂÇ¥ °ø°£³»ÀÇ area¸¦ ÁöÁ¤ÇÕ´Ï´Ù.

Rectangle ¿ÀºêÁ§Æ®ÀÇ width ¹× height ´Â public ÇʵåÀÔ´Ï´Ù. Rectangle ¸¦ ÀÛ¼ºÇÏ´Â constructor , ¹× Rectangle ¸¦ º¯°æÇÒ ¼ö ÀÖ´Â ¸Þ¼Òµå¿¡´Â width ³ª height ÀÇ °ªÀ¸·Î ÇØ¼­ ºÎÀÇ °ªÀ» ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

Æø°ú ³ôÀ̰¡ ºÎÀÇ °ªÀÇ Rectangle ´Â ÇÏ´ÃÀÌ´Ù°í º¸¿©Áý´Ï´Ù. Rectangle °¡ ºñ¾úÀ» °æ¿ì,isEmpty ¸Þ¼Òµå´Â true ¸¦ µ¹·ÁÁÝ´Ï´Ù. ÇÏ´ÃÀÇ Rectangle ¿¡´Â Á¡À» ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. ´Ù¸¸,width ¹× height ÀÇ °ªÀº À¯È¿ÇÕ´Ï´Ù. ÇÏ´ÃÀÇ Rectangle ´Â ÁÂÇ¥ °ø°£¿¡ ÀÖ¾î À§Ä¡¸¦ °¡Á®, ÇÏ´ÃÀÇ Rectangle ÀÇ »çÀÌÁî ¶Ç´Â À§Ä¡¸¦ º¯°æÇÏ´Â ¸Þ¼Òµåµµ À¯È¿ÇÕ´Ï´Ù. º¹¼öÀÇ Rectangle ¿¡ ´ëÇÑ ¸Þ¼Òµå´Â ÀÌ·¯ÇÑ Rectangle ¿ÀºêÁ§Æ®¾È¿¡ width ¶Ç´Â height ÀÇ °ªÀ¸·Î ÇØ¼­ ºÎÀÇ °ªÀ» °¡Áö´Â Rectangle ¿ÀºêÁ§Æ®°¡ 1 °³À̱⵵ ÇÑ °æ¿ì, µ¿ÀÛÀÌ ÇÁ·ÎÅØ¼ÇµÇÁö ¾Ê½À´Ï´Ù. ÀÌ·¯ÇÑ ¸Þ¼Òµå¿¡´Â intersects,intersection, ¹× union °¡ ÀÖ½À´Ï´Ù.

µµÀÔµÈ ¹öÁ¯:
JDK1. 0
°ü·Ã Ç׸ñ:
Á÷·ÄÈ­ µÈ Çü½Ä

ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä
 
Ŭ·¡½º java.awt.geom. Rectangle2D À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º
Rectangle2D.Double , Rectangle2D.Float
 
ÇʵåÀÇ °³¿ä
 int height
          Rectangle ÀÇ ³ôÀÌÀÔ´Ï´Ù.
 int width
          Rectangle ÀÇ ÆøÀÔ´Ï´Ù.
 int x
          Rectangle ÀÇ x ÁÂÇ¥ÀÔ´Ï´Ù.
 int y
          Rectangle ÀÇ y ÁÂÇ¥ÀÔ´Ï´Ù.
 
Ŭ·¡½º java.awt.geom. Rectangle2D ¿¡¼­ »ó¼Ó¹ÞÀº Çʵå
OUT_BOTTOM , OUT_LEFT , OUT_RIGHT , OUT_TOP
 
»ý¼ºÀÚÀÇ °³¿ä
Rectangle ()
          Á»󱸼®ÀÌ ÁÂÇ¥ °ø°£ÀÇ (0,  0)¿¡ ÀÖ¾î, Æø°ú ³ôÀ̰¡ ¾çÂÊ ¸ðµÎ 0 ÀÇ »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
Rectangle (Dimension  d)
          Á»󱸼®ÀÌ (0,  0)·Î, Æø°ú ³ôÀ̰¡ Dimension Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
Rectangle (int width, int height)
          Á»󱸼®ÀÌ ÁÂÇ¥ °ø°£ÀÇ (0,  0)¿¡ ÀÖ¾î, Æø°ú ³ôÀ̰¡ width Àμö ¹× height Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
Rectangle (int x, int y, int width, int height)
          Á»󱸼®ÀÌ (x,  y)·Î¼­ ÁöÁ¤µÇ¾î Æø°ú ³ôÀ̰¡ width Àμö ¹× height Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
Rectangle (Point  p)
          Á»󱸼®ÀÌ ÁöÁ¤µÈ Point ·Î, Æø°ú ³ôÀ̰¡ ¾çÂÊ ¸ðµÎ 0 ÀÎ »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
Rectangle (Point  p, Dimension  d)
          Á»󱸼®ÀÌ Point Àμö·Î ÁöÁ¤µÇ¾î Æø°ú »çÀÌÁî°¡ Dimension Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
Rectangle (Rectangle  r)
          ÁöÁ¤µÈ Rectangle ÀÇ °ª¿¡ ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ÃʱâÈ­µÈ »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.
 
¸Þ¼ÒµåÀÇ °³¿ä
 void add (int newx, int newy)
          Á¤¼öÇüÀÇ Àμö newx ¹× newy ¿¡ ÀÇÇØ ÁöÁ¤µÇ´Â Á¡À» ÀÌ Rectangle ¿¡ Ãß°¡ÇÕ´Ï´Ù.
 void add (Point  pt)
          ÀÌ Rectangle ¿¡, ÁöÁ¤µÈ Point ¸¦ Ãß°¡ÇÕ´Ï´Ù.
 void add (Rectangle  r)
          Rectangle ¸¦ ÀÌ Rectangle ¿¡ Ãß°¡ÇÕ´Ï´Ù.
 boolean contains (int x, int y)
          ÀÌ Rectangle °¡, ÁöÁ¤µÈ À§Ä¡ (x,  y)¿¡ ÀÖ´Â Á¡À» Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 boolean contains (int X, int Y, int W, int H)
          ÁöÁ¤µÈ À§Ä¡ (X,  Y)¿¡ ÀÖ¾î, ÁöÁ¤µÈ »çÀÌÁî (W,  H)ÀÎ Rectangle ¸¦, ÀÌ Rectangle °¡ ¿ÏÀüÇÏ°Ô Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 boolean contains (Point  p)
          ÀÌ Rectangle °¡ ÁöÁ¤µÈ Point ¸¦ Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 boolean contains (Rectangle  r)
          ÀÌ Rectangle °¡, ÁöÁ¤µÈ Rectangle ¸¦ ¿ÏÀüÇÏ°Ô Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 Rectangle2D createIntersection (Rectangle2D  r)
          ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle2D ¿ÍÀÇ °øÅë ºÎºÐÀ» ³ªÅ¸³»´Â »õ·Î¿î Rectangle2D ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù.
 Rectangle2D createUnion (Rectangle2D  r)
          ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle2D ¿ÍÀÇ °áÇÕ ºÎºÐÀ» ³ªÅ¸³»´Â »õ·Î¿î Rectangle2D ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù.
 boolean equals (Object  obj)
          2 °³ÀÇ ±¸ÇüÀÌ °°Àº°¡ ¾î¶²°¡¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 Rectangle getBounds ()
          ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦ µ¹·ÁÁÝ´Ï´Ù.
 Rectangle2D getBounds2D ()
          ÀÌ ±¸ÇüÀÇ °íÁ¤¹Ðµµ ¹Ù¿îµò±×º¹½º¸¦ µ¹·ÁÁÝ´Ï´Ù.
 double getHeight ()
          °æ°èÀÇ Rectangle areaÀÇ ³ôÀ̸¦ double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.
 Point getLocation ()
          ÀÌ Rectangle ÀÇ À§Ä¡¸¦ µ¹·ÁÁÝ´Ï´Ù.
 Dimension getSize ()
          µ¹·ÁÁÖ¾îÁø Dimension ·Î ³ªÅ¸³»Áø, ÀÌ Rectangle ÀÇ »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù.
 double getWidth ()
          °æ°èÀÇ Rectangle areaÀÇ ÆøÀ» double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.
 double getX ()
          °æ°èÀÇ Rectangle areaÀÇ X ÁÂÇ¥¸¦ double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.
 double getY ()
          °æ°èÀÇ Rectangle areaÀÇ Y ÁÂÇ¥¸¦ double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.
 void grow (int h, int v)
          Rectangle ¸¦ ¼öÆò ¹æÇâ°ú ¼öÁ÷ ¹æÇâÀÇ ¾çÂÊ ¸ðµÎ·Î »çÀÌÁî º¯°æÇÕ´Ï´Ù.
 boolean inside (int X, int Y)
          Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â contains(int, int) ¸¦ »ç¿ë
 Rectangle intersection (Rectangle  r)
          ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle ¿ÍÀÇ °øÅë ºÎºÐÀ» »êÃâÇÕ´Ï´Ù.
 boolean intersects (Rectangle  r)
          ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle °¡ ±³Â÷ÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 boolean isEmpty ()
          ÀÌ Rectangle °¡ ÇÏ´ÃÀÏÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 void move (int x, int y)
          Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â setLocation(int, int) ¸¦ »ç¿ë
 int outcode (double x, double y)
          ÁöÁ¤µÈ ÁÂÇ¥°¡ ÀÌ Rectangle ¿¡ ´ëÇÑ »ó´ë À§Ä¡¿¡¼­ ¾îµð¿¡ À§Ä¡ÇÏ´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
 void reshape (int x, int y, int width, int height)
          Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â setBounds(int, int, int, int) ¸¦ »ç¿ë
 void resize (int width, int height)
          Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â setSize(int, int) ¸¦ »ç¿ë
 void setBounds (int x, int y, int width, int height)
          ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦,x,y,width, ¹× height ·Î ÁöÁ¤µÈ °ªÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù.
 void setBounds (Rectangle  r)
          ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦, ÁöÁ¤µÈ Rectangle ¿¡ ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ¼³Á¤ÇÕ´Ï´Ù.
 void setLocation (int x, int y)
          ÀÌ Rectangle °¡ ÁöÁ¤µÈ À§Ä¡·Î À̵¿ÇÕ´Ï´Ù.
 void setLocation (Point  p)
          ÀÌ Rectangle °¡ ÁöÁ¤µÈ À§Ä¡·Î À̵¿ÇÕ´Ï´Ù.
 void setRect (double x, double y, double width, double height)
          ÀÌ Rectangle ÀÇ °æ°è°¡ ÁöÁ¤µÈ x,y,width, ¹× height ·Î ¼³Á¤ÇÕ´Ï´Ù.
 void setSize (Dimension  d)
          ÀÌ Rectangle ÀÇ »çÀÌÁ, ÁöÁ¤µÈ Dimension ¿¡ ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ¼³Á¤ÇÕ´Ï´Ù.
 void setSize (int width, int height)
          ÀÌ Rectangle ÀÇ Å©±â°¡ ÁöÁ¤µÈ Æø°ú ³ôÀÌ·Î ¼³Á¤ÇÕ´Ï´Ù.
 String toString ()
          ÀÌ Rectangle ¹× ±× °ªÀ» ³ªÅ¸³»´Â String Ç¥ÇöÀ» µ¹·ÁÁÝ´Ï´Ù.
 void translate (int x, int y)
          x ÁÂÇ¥Ãà¿¡ µû¶ó ¿ìÃøÇâ¿¡, y ÁÂÇ¥Ãà¿¡ µû¶ó ¾Æ·¡¹æÇâ¿¡, ÁöÁ¤µÈ °Å¸®¸¸ ÀÌ Rectangle ¸¦ À̵¿ÇÕ´Ï´Ù.
 Rectangle union (Rectangle  r)
          ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle ¿ÍÀÇ °áÇÕ ºÎºÐÀ» »êÃâÇÕ´Ï´Ù.
 
Ŭ·¡½º java.awt.geom. Rectangle2D ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
add , add , add , contains , contains , getPathIterator , getPathIterator , hashCode , intersect , intersects , intersectsLine , intersectsLine , outcode , setFrame , setRect , union
 
Ŭ·¡½º java.awt.geom. RectangularShape ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
clone , contains , contains , getCenterX , getCenterY , getFrame , getMaxX , getMaxY , getMinX , getMinY , intersects , setFrame , setFrame , setFrameFromCenter , setFrameFromCenter , setFrameFromDiagonal , setFrameFromDiagonal
 
Ŭ·¡½º java.lang. Object ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
finalize , getClass , notify , notifyAll , wait , wait , wait
 
ÀÎÅÍÆäÀ̽º java.awt. Shape ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
contains , contains , contains , contains , getPathIterator , getPathIterator , intersects , intersects
 

ÇʵåÀÇ »ó¼¼

x

public int x
Rectangle ÀÇ x ÁÂÇ¥ÀÔ´Ï´Ù.

°ü·Ã Ç׸ñ:
setLocation(int, int) , getLocation()

y

public int y
Rectangle ÀÇ y ÁÂÇ¥ÀÔ´Ï´Ù.

°ü·Ã Ç׸ñ:
setLocation(int, int) , getLocation()

width

public int width
Rectangle ÀÇ ÆøÀÔ´Ï´Ù.

µµÀÔµÈ ¹öÁ¯:
JDK1. 0.
°ü·Ã Ç׸ñ:
setSize(int, int) , getSize()

height

public int height
Rectangle ÀÇ ³ôÀÌÀÔ´Ï´Ù.

°ü·Ã Ç׸ñ:
setSize(int, int) , getSize()
»ý¼ºÀÚÀÇ »ó¼¼

Rectangle

public Rectangle()
Á»󱸼®ÀÌ ÁÂÇ¥ °ø°£ÀÇ (0,  0)¿¡ ÀÖ¾î, Æø°ú ³ôÀ̰¡ ¾çÂÊ ¸ðµÎ 0 ÀÇ »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.


Rectangle

public Rectangle(Rectangle  r)
ÁöÁ¤µÈ Rectangle ÀÇ °ª¿¡ ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ÃʱâÈ­µÈ »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - »õ·Ó°Ô ±¸ÃàµÇ´Â Rectangle ÀÇ ÃʱâÄ¡ÀÇ Ä«ÇÇ¿øÀÌ µÇ´Â Rectangle
µµÀÔµÈ ¹öÁ¯:
JDK1. 1

Rectangle

public Rectangle(int x,
                 int y,
                 int width,
                 int height)
Á»󱸼®ÀÌ (x,  y)·Î¼­ ÁöÁ¤µÇ¾î Æø°ú ³ôÀ̰¡ width Àμö ¹× height Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
width - Rectangle ÀÇ Æø
height - Rectangle ÀÇ ³ôÀÌ

Rectangle

public Rectangle(int width,
                 int height)
Á»󱸼®ÀÌ ÁÂÇ¥ °ø°£ÀÇ (0,  0)¿¡ ÀÖ¾î, Æø°ú ³ôÀ̰¡ width Àμö ¹× height Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
width - Rectangle ÀÇ Æø
height - Rectangle ÀÇ ³ôÀÌ

Rectangle

public Rectangle(Point  p,
                 Dimension  d)
Á»󱸼®ÀÌ Point Àμö·Î ÁöÁ¤µÇ¾î Æø°ú »çÀÌÁî°¡ Dimension Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
p - Rectangle ÀÇ Á»󱸼®ÀÌ µÇ´Â Point
d - Rectangle ÀÇ Æø°ú ³ôÀ̸¦ ³ªÅ¸³»´Â Dimension

Rectangle

public Rectangle(Point  p)
Á»󱸼®ÀÌ ÁöÁ¤µÈ Point ·Î, Æø°ú ³ôÀ̰¡ ¾çÂÊ ¸ðµÎ 0 ÀÎ »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
p - Rectangle ÀÇ Á»󱸼®ÀÌ µÇ´Â Point

Rectangle

public Rectangle(Dimension  d)
Á»󱸼®ÀÌ (0,  0)·Î, Æø°ú ³ôÀ̰¡ Dimension Àμö·Î ÁöÁ¤µÇ´Â »õ·Î¿î Rectangle ¸¦ ±¸ÃàÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
d - Æø°ú ³ôÀ̸¦ ÁöÁ¤ÇÏ´Â Dimension
¸Þ¼ÒµåÀÇ »ó¼¼

getX

public double getX()
°æ°èÀÇ Rectangle areaÀÇ X ÁÂÇ¥¸¦ double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º RectangularShape ³»ÀÇ getX
¹Ýȯ°ª:
°æ°èÀÇ Rectangle areaÀÇ x ÁÂÇ¥

getY

public double getY()
°æ°èÀÇ Rectangle areaÀÇ Y ÁÂÇ¥¸¦ double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º RectangularShape ³»ÀÇ getY
¹Ýȯ°ª:
°æ°èÀÇ Rectangle areaÀÇ y ÁÂÇ¥

getWidth

public double getWidth()
°æ°èÀÇ Rectangle areaÀÇ ÆøÀ» double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º RectangularShape ³»ÀÇ getWidth
¹Ýȯ°ª:
°æ°èÀÇ Rectangle areaÀÇ Æø

getHeight

public double getHeight()
°æ°èÀÇ Rectangle areaÀÇ ³ôÀ̸¦ double Á¤¹Ðµµ·Î µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º RectangularShape ³»ÀÇ getHeight
¹Ýȯ°ª:
°æ°èÀÇ Rectangle areaÀÇ ³ôÀÌ

getBounds

public Rectangle  getBounds()
ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦ µ¹·ÁÁÝ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ getBounds ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º Shape ³»ÀÇ getBounds
¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º RectangularShape ³»ÀÇ getBounds
¹Ýȯ°ª:
»õ·Î¿î Rectangle. ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¿¡ µ¿ÀÏÇÑ
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
Component.getBounds() , setBounds(Rectangle) , setBounds(int, int, int, int)

getBounds2D

public Rectangle2D  getBounds2D()
ÀÌ ±¸ÇüÀÇ °íÁ¤¹Ðµµ ¹Ù¿îµò±×º¹½º¸¦ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º Shape ³»ÀÇ getBounds2D
¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Rectangle2D ³»ÀÇ getBounds2D
¹Ýȯ°ª:
Shape ÀÇ °íÁ¤¹Ðµµ ¹Ù¿îµò±×º¹½º¸¦ ³ªÅ¸³»´Â Rectangle2D ÀÇ ÀνºÅϽº
µµÀÔµÈ ¹öÁ¯:
1.2
°ü·Ã Ç׸ñ:
Shape.getBounds()

setBounds

public void setBounds(Rectangle  r)
ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦, ÁöÁ¤µÈ Rectangle ¿¡ ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ¼³Á¤ÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setBounds ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - ÁöÁ¤µÈ Rectangle
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
getBounds() , Component.setBounds(java.awt.Rectangle)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦,x,y,width, ¹× height ·Î ÁöÁ¤µÈ °ªÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setBounds ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
width - ÀÌ Rectangle ÀÇ »õ·Î¿î Æø
height - ÀÌ Rectangle ÀÇ »õ·Î¿î ³ôÀÌ
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
getBounds() , Component.setBounds(int, int, int, int)

setRect

public void setRect(double x,
                    double y,
                    double width,
                    double height)
ÀÌ Rectangle ÀÇ °æ°è°¡ ÁöÁ¤µÈ x,y,width, ¹× height ·Î ¼³Á¤ÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setBounds ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º Rectangle2D ³»ÀÇ setRect
ÆÄ¶ó¹ÌÅÍ:
width - Dimension ¿ÀºêÁ§Æ®ÀÇ »õ·Î¿î Æø
height - Dimension ¿ÀºêÁ§Æ®ÀÇ »õ·Î¿î ³ôÀÌ

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height)
Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â setBounds(int, int, int, int) ¸¦ »ç¿ë

ÀÌ Rectangle ÀÇ °æ°èÀÇ Rectangle area¸¦,x,y,width, ¹× height ·Î ÁöÁ¤µÈ °ªÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
width - ÀÌ Rectangle ÀÇ »õ·Î¿î Æø
height - ÀÌ Rectangle ÀÇ »õ·Î¿î ³ôÀÌ

getLocation

public Point  getLocation()
ÀÌ Rectangle ÀÇ À§Ä¡¸¦ µ¹·ÁÁÝ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ getLocation ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

¹Ýȯ°ª:
ÀÌ Rectangle ÀÇ Á»󱸼®ÀÇ Point
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
Component.getLocation() , setLocation(Point) , setLocation(int, int)

setLocation

public void setLocation(Point  p)
ÀÌ Rectangle °¡ ÁöÁ¤µÈ À§Ä¡·Î À̵¿ÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setLocation ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
p - ÀÌ Rectangle ÀÇ »õ·Î¿î À§Ä¡¸¦ ÁöÁ¤ÇÏ´Â Point
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
Component.setLocation(java.awt.Point) , getLocation()

setLocation

public void setLocation(int x,
                        int y)
ÀÌ Rectangle °¡ ÁöÁ¤µÈ À§Ä¡·Î À̵¿ÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setLocation ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
getLocation() , Component.setLocation(int, int)

move

public void move(int x,
                 int y)
Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â setLocation(int, int) ¸¦ »ç¿ë

ÀÌ Rectangle °¡ ÁöÁ¤µÈ À§Ä¡·Î À̵¿ÇÕ´Ï´Ù.


translate

public void translate(int x,
                      int y)
x ÁÂÇ¥Ãà¿¡ µû¶ó ¿ìÃøÇâ¿¡, y ÁÂÇ¥Ãà¿¡ µû¶ó ¾Æ·¡¹æÇâ¿¡, ÁöÁ¤µÈ °Å¸®¸¸ ÀÌ Rectangle ¸¦ À̵¿ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
x - x ÃàÀ¸·Î µû¶ó ÀÌ Rectangle ¸¦ À̵¿ÇÏ´Â °Å¸®
y - y ÃàÀ¸·Î µû¶ó ÀÌ Rectangle ¸¦ À̵¿ÇÏ´Â °Å¸®
°ü·Ã Ç׸ñ:
setLocation(int, int) , setLocation(java.awt.Point)

getSize

public Dimension  getSize()
µ¹·ÁÁÖ¾îÁø Dimension ·Î ³ªÅ¸³»Áø, ÀÌ Rectangle ÀÇ »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ getSize ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

¹Ýȯ°ª:
ÀÌ Rectangle ÀÇ »çÀÌÁ ³ªÅ¸³»´Â Dimension
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
Component.getSize() , setSize(Dimension) , setSize(int, int)

setSize

public void setSize(Dimension  d)
ÀÌ Rectangle ÀÇ »çÀÌÁ, ÁöÁ¤µÈ Dimension ¿¡ ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ¼³Á¤ÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setSize ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
d - Dimension ¿ÀºêÁ§Æ®ÀÇ »õ·Î¿î »çÀÌÁî
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
Component.setSize(java.awt.Dimension) , getSize()

setSize

public void setSize(int width,
                    int height)
ÀÌ Rectangle ÀÇ Å©±â°¡ ÁöÁ¤µÈ Æø°ú ³ôÀÌ·Î ¼³Á¤ÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â ¿ÏÀü¼ºÀ» À§Çؼ­(¶§¹®¿¡) ÁغñµÇ¾î À־ ,Component ÀÇ setSize ¸Þ¼Òµå¿¡ ´ëÀÀÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
width - ÀÌ Rectangle ÀÇ »õ·Î¿î Æø
height - ÀÌ Rectangle ÀÇ »õ·Î¿î ³ôÀÌ
µµÀÔµÈ ¹öÁ¯:
JDK1. 1
°ü·Ã Ç׸ñ:
Component.setSize(int, int) , getSize()

resize

public void resize(int width,
                   int height)
Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â setSize(int, int) ¸¦ »ç¿ë

ÀÌ Rectangle ÀÇ Å©±â°¡ ÁöÁ¤µÈ Æø°ú ³ôÀÌ·Î ¼³Á¤ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
width - ÀÌ Rectangle ÀÇ »õ·Î¿î Æø
height - ÀÌ Rectangle ÀÇ »õ·Î¿î ³ôÀÌ

contains

public boolean contains(Point  p)
ÀÌ Rectangle °¡ ÁöÁ¤µÈ Point ¸¦ Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
p - ÆÇÁ¤ÇÏ´Â ´ë»óÀÌ µÇ´Â Point
¹Ýȯ°ª:
Point (x,  y)°¡ ÀÌ Rectangle ÀÇ ³»ºÎ¿¡ ÀÖ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
µµÀÔµÈ ¹öÁ¯:
JDK1. 1

contains

public boolean contains(int x,
                        int y)
ÀÌ Rectangle °¡, ÁöÁ¤µÈ À§Ä¡ (x,  y)¿¡ ÀÖ´Â Á¡À» Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.

¹Ýȯ°ª:
Á¡ (x,  y)ÀÌ ÀÌ Rectangle ÀÇ ³»ºÎ¿¡ ÀÖ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
µµÀÔµÈ ¹öÁ¯:
JDK1. 1

contains

public boolean contains(Rectangle  r)
ÀÌ Rectangle °¡, ÁöÁ¤µÈ Rectangle ¸¦ ¿ÏÀüÇÏ°Ô Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - ÁöÁ¤µÈ Rectangle
¹Ýȯ°ª:
Rectangle °¡ ÀÌ Rectangle ¿¡ ¿ÏÀüÇÏ°Ô Æ÷ÇԵǴ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
µµÀÔµÈ ¹öÁ¯:
JDK1. 1

contains

public boolean contains(int X,
                        int Y,
                        int W,
                        int H)
ÁöÁ¤µÈ À§Ä¡ (X,  Y)¿¡ ÀÖ¾î, ÁöÁ¤µÈ »çÀÌÁî (W,  H)ÀÎ Rectangle ¸¦, ÀÌ Rectangle °¡ ¿ÏÀüÇÏ°Ô Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
W - Rectangle ÀÇ Æø
H - Rectangle ÀÇ ³ôÀÌ
¹Ýȯ°ª:
(X,  Y,  W,  H)À¸·Î ÁöÁ¤µÇ´Â Rectangle °¡ ¿ÏÀüÇÏ°Ô ÀÌ Rectangle ³»¿¡ µé¾î°¡´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
µµÀÔµÈ ¹öÁ¯:
JDK1. 1

inside

public boolean inside(int X,
                      int Y)
Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.  JDK ¹öÁ¯ 1.1 ÀÌÈÄ´Â contains(int, int) ¸¦ »ç¿ë

ÀÌ Rectangle °¡, ÁöÁ¤µÈ À§Ä¡ (X,  Y)¿¡ ÀÖ´Â Á¡À» Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.

¹Ýȯ°ª:
Á¡ (X,  Y)ÀÌ ÀÌ Rectangle ÀÇ ³»ºÎ¿¡ ÀÖ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false

intersects

public boolean intersects(Rectangle  r)
ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle °¡ ±³Â÷ÇÒÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. °øÅë ºÎºÐÀÌ ÇÏ´ÃÀÌ ¾Æ´Ñ °æ¿ì, 2 °³ÀÇ ±¸ÇüÀº ±³Â÷ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - ÁöÁ¤µÈ Rectangle
¹Ýȯ°ª:
ÁöÁ¤µÈ Rectangle °÷ÀÇ Rectangle °¡ ¼­·Î °ãÄ¡´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false

intersection

public Rectangle  intersection(Rectangle  r)
ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle ¿ÍÀÇ °øÅë ºÎºÐÀ» »êÃâÇÕ´Ï´Ù. 2 °³ÀÇ ±¸ÇüÀÇ °øÅë ºÎºÐÀ» ³ªÅ¸³»´Â »õ·Î¿î Rectangle ¸¦ µ¹·ÁÁÝ´Ï´Ù. 2 °³ÀÇ ±¸ÇüÀÌ ±³Â÷ÇÏÁö ¾Ê´Â °æ¿ì, ÇÏ´ÃÀÇ ±¸ÇüÀÌ µ¹·ÁÁÖ¾îÁý´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - ÁöÁ¤µÈ Rectangle
¹Ýȯ°ª:
ÁöÁ¤µÈ Rectangle °÷ÀÇ Rectangle ÀÇ ¾çÂÊ ¸ðµÎ¿¡ Æ÷ÇԵǴ ÃÖ´ëÀÇ Rectangle, ¶Ç´Â ±¸ÇüÀÌ ±³Â÷ÇÏÁö ¾Ê´Â °æ¿ì´Â ÇÏ´ÃÀÇ ±¸Çü

union

public Rectangle  union(Rectangle  r)
ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle ¿ÍÀÇ °áÇÕ ºÎºÐÀ» »êÃâÇÕ´Ï´Ù. 2 °³ÀÇ ±¸ÇüÀÇ °áÇÕ ºÎºÐÀ» ³ªÅ¸³»´Â »õ·Î¿î Rectangle ¸¦ µ¹·ÁÁÝ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - ÁöÁ¤µÈ Rectangle
¹Ýȯ°ª:
ÁöÁ¤µÈ Rectangle °÷ÀÇ Rectangle ÀÇ ¾çÂÊ ¸ðµÎ¿¡ Æ÷ÇԵǴ ÃÖ¼ÒÀÇ Rectangle

add

public void add(int newx,
                int newy)
Á¤¼öÇüÀÇ Àμö newx ¹× newy ¿¡ ÀÇÇØ ÁöÁ¤µÇ´Â Á¡À» ÀÌ Rectangle ¿¡ Ãß°¡ÇÕ´Ï´Ù. ÀÌ °á°ú, ¿øÀÇ Rectangle ¿Í ÁöÁ¤µÈ Á¡ÀÇ ¾çÂÊ ¸ðµÎ¸¦ Æ÷ÇÔÇÑ ÃÖ¼ÒÀÇ Rectangle °¡ ÀÛ¼ºµË´Ï´Ù.

Á¡À» Ãß°¡ÇÑ ÈÄ¿¡, Ãß°¡µÈ Á¡À» Àμö·Î¼­ ÁöÁ¤ÇØ contains ¸¦ È£ÃâÇßÀ» °æ¿ì, ¹Ýµå½Ã true °¡ µ¹·ÁÁÖ¾îÁø´Ù°í´Â ÇÒ ¼ö ¾ø½À´Ï´Ù. contains ¸Þ¼Òµå´Â Rectangle ÀÇ ¿ì´Ü ¶Ç´Â ÇÏ´Ü¿¡ À§Ä¡ÇÏ´Â Á¡ÀÇ °æ¿ì´Â true ¸¦ µ¹·ÁÁÖÁö ¾Ê½À´Ï´Ù. ±× ¶§¹®¿¡, Ãß°¡µÈ Á¡ÀÌ È®´ë ÈÄÀÇ Rectangle ÀÇ ¿ì´Ü ¶Ç´Â ÇÏ´Ü¿¡ À§Ä¡ÇÏ´Â Á¡ÀÎ °æ¿ì¿¡´Â contains ´Â false ¸¦ µ¹·ÁÁÝ´Ï´Ù.


add

public void add(Point  pt)
ÀÌ Rectangle ¿¡, ÁöÁ¤µÈ Point ¸¦ Ãß°¡ÇÕ´Ï´Ù. ÀÌ °á°ú, ¿øÀÇ Rectangle ¿Í ÁöÁ¤µÈ Point ÀÇ ¾çÂÊ ¸ðµÎ¸¦ Æ÷ÇÔÇÑ ÃÖ¼ÒÀÇ Rectangle °¡ ÀÛ¼ºµË´Ï´Ù.

Point ¸¦ Ãß°¡ÇÑ ÈÄ¿¡, Ãß°¡µÈ Point ¸¦ Àμö·Î¼­ ÁöÁ¤ÇØ contains ¸¦ È£ÃâÇßÀ» °æ¿ì, ¹Ýµå½Ã true °¡ µ¹·ÁÁÖ¾îÁø´Ù°í´Â ÇÒ ¼ö ¾ø½À´Ï´Ù. contains ¸Þ¼Òµå´Â Rectangle ÀÇ ¿ì´Ü ¶Ç´Â ÇÏ´Ü¿¡ À§Ä¡ÇÏ´Â Á¡ÀÇ °æ¿ì´Â true ¸¦ µ¹·ÁÁÖÁö ¾Ê½À´Ï´Ù. ±× ¶§¹®¿¡, Ãß°¡µÈ Point °¡ È®´ë ÈÄÀÇ Rectangle ÀÇ ¿ì´Ü ¶Ç´Â ÇÏ´Ü¿¡ À§Ä¡ÇÏ´Â Á¡ÀÎ °æ¿ì¿¡´Â contains ´Â Point ¿¡ ´ëÇØ¼­ false ¸¦ µ¹·ÁÁÝ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
pt - ÀÌ Rectangle ¿¡ Ãß°¡µÇ´Â »õ·Î¿î Point

add

public void add(Rectangle  r)
Rectangle ¸¦ ÀÌ Rectangle ¿¡ Ãß°¡ÇÕ´Ï´Ù. ÀÌ °á°ú, 2 °³ÀÇ ±¸ÇüÀÇ °áÇÕ ºÎºÐÀÌ µÇ´Â Rectangle °¡ ÀÛ¼ºµË´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
r - ÁöÁ¤µÈ Rectangle

grow

public void grow(int h,
                 int v)
Rectangle ¸¦ ¼öÆò ¹æÇâ°ú ¼öÁ÷ ¹æÇâÀÇ ¾çÂÊ ¸ðµÎ·Î »çÀÌÁî º¯°æÇÕ´Ï´Ù.

ÀÌ ¸Þ¼Òµå´Â Á¿쿡 °¢°¢ h ´ÜÀ§¾¿, »óÇÏ¿¡ °¢°¢ v ´ÜÀ§¾¿ Ä¿Áöµµ·Ï(µíÀÌ),Rectangle ¸¦ º¯°æÇÕ´Ï´Ù.

»õ·Î¿î Rectangle ÀÇ Á»󱸼®Àº (x - h, y - v), ÆøÀº width + 2h, ³ôÀÌ´Â height + 2v °¡ µË´Ï´Ù.

h ¿Í v ¿¡ ºÎÀÇ °ªÀÌ ÁöÁ¤µÇ¾úÀ» °æ¿ì,Rectangle ÀÇ »çÀÌÁî´Â ÀÛ¾ÆÁý´Ï´Ù. grow ¸Þ¼Òµå´Â °á°úÀÇ width ¹× height ÀÇ °ªÀÌ ºÎ°¡ ¾Æ´ÑÁö ¾î¶²Áö¸¦ °Ë»çÇÏÁö ¾Ê½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
h - ¼öÆò ¹æÇâÀ¸·Î È®´ëÇÏ´Â ¾ç
v - ¼öÁ÷ ¹æÇâÀ¸·Î È®´ëÇÏ´Â ¾ç

isEmpty

public boolean isEmpty()
ÀÌ Rectangle °¡ ÇÏ´ÃÀÏÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. Æø°ú »çÀÌÁî°¡ 0 ÀÌÇÏÀÇ °æ¿ì,Rectangle ´Â ºñ¿ó´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º RectangularShape ³»ÀÇ isEmpty
¹Ýȯ°ª:
ÀÌ Rectangle °¡ ÇÏ´ÃÀÎ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false

outcode

public int outcode(double x,
                   double y)
ÁöÁ¤µÈ ÁÂÇ¥°¡ ÀÌ Rectangle ¿¡ ´ëÇÑ »ó´ë À§Ä¡¿¡¼­ ¾îµð¿¡ À§Ä¡ÇÏ´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÀÌ Rectangle ÀÇ °¢º¯¿¡ ´ëÇØ, ÁöÁ¤µÈ Á¡ÀÌ ÀÌ Rectangle ¿ÜÀÇ ¿·°ú °°Àº Ãø¿¡ ÀÖ´ÂÁö¸¦ ³ªÅ¸³»´Â ÇØ´çÇÏ´Â ¸¶½ºÅ©Ä¡ÀÇ ¹ÙÀ̳ʸ®ÀÇ ³í¸®ÇÕÀ» °è»êÇÕ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º Rectangle2D ³»ÀÇ outcode
¹Ýȯ°ª:
¸ðµç ÀûÀýÇÑ OUT ÄÚµåÀÇ ³í¸®ÇÕ
µµÀÔµÈ ¹öÁ¯:
1.2
°ü·Ã Ç׸ñ:
Rectangle2D.OUT_LEFT , Rectangle2D.OUT_TOP , Rectangle2D.OUT_RIGHT , Rectangle2D.OUT_BOTTOM

createIntersection

public Rectangle2D  createIntersection(Rectangle2D  r)
ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle2D ¿ÍÀÇ °øÅë ºÎºÐÀ» ³ªÅ¸³»´Â »õ·Î¿î Rectangle2D ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º Rectangle2D ³»ÀÇ createIntersection
ÆÄ¶ó¹ÌÅÍ:
r - ÀÌ Rectangle ¿Í ¼­·Î °ãÄ¡´Â Rectangle2D
¹Ýȯ°ª:
ÁöÁ¤µÈ Rectangle2D °÷ÀÇ Rectangle ÀÇ ¾çÂÊ ¸ðµÎ¿¡ Æ÷ÇԵǴ ÃÖ´ëÀÇ Rectangle2D
µµÀÔµÈ ¹öÁ¯:
1.2

createUnion

public Rectangle2D  createUnion(Rectangle2D  r)
ÀÌ Rectangle ¿Í ÁöÁ¤µÈ Rectangle2D ¿ÍÀÇ °áÇÕ ºÎºÐÀ» ³ªÅ¸³»´Â »õ·Î¿î Rectangle2D ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º Rectangle2D ³»ÀÇ createUnion
ÆÄ¶ó¹ÌÅÍ:
r - ÀÌ Rectangle ¿Í °áÇյǴ Rectangle2D
¹Ýȯ°ª:
ÁöÁ¤µÈ Rectangle2D °÷ÀÇ Rectangle ÀÇ ¾çÂÊ ¸ðµÎ¸¦ Æ÷ÇÔÇÑ ÃÖ¼ÒÀÇ Rectangle2D
µµÀÔµÈ ¹öÁ¯:
1.2

equals

public boolean equals(Object  obj)
2 °³ÀÇ ±¸ÇüÀÌ °°Àº°¡ ¾î¶²°¡¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.

Àμö°¡ null °¡ ¾Æ´Ï°í, ÀÌ Rectangle ¿Í °°Àº Á»󱸼®, ³ôÀÌ, ¹× ÆøÀ» °¡Áö´Â Rectangle ¿ÀºêÁ§Æ®ÀÎ °æ¿ì¿¡¸¸, °á°ú´Â true °¡ µË´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Rectangle2D ³»ÀÇ equals
ÆÄ¶ó¹ÌÅÍ:
obj - ÀÌ Rectangle ¿Í ºñ±³ÇÏ´Â Object
¹Ýȯ°ª:
¿ÀºêÁ§Æ®°¡ µ¿ÀÏÇÑ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false

toString

public String  toString()
ÀÌ Rectangle ¹× ±× °ªÀ» ³ªÅ¸³»´Â String Ç¥ÇöÀ» µ¹·ÁÁÝ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Object ³»ÀÇ toString
¹Ýȯ°ª:
ÀÌ Rectangle ¿ÀºêÁ§Æ®ÀÇ ÁÂÇ¥¿Í »çÀÌÁîÀÇ °ªÀ» ³ªÅ¸³»´Â String

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.