JavaTM 2 Platform
Standard Ed. 5.0

javax.swing.event
Ŭ·¡½º TableModelEvent

java.lang.Object 
  »óÀ§¸¦ È®Àå java.util.EventObject 
      »óÀ§¸¦ È®Àå javax.swing.event.TableModelEvent
¸ðµç ±¸ÇöµÈ ÀÎÅÍÆäÀ̽º:
Serializable

public class TableModelEvent
extends EventObject

Å×ÀÌºí ¸ðµ¨ÀÌ º¯°æµÈ °ÍÀ» ¸®½º³Ê¿¡°Ô ÅëÁöÇϱâ À§Çؼ­ »ç¿ëÇÕ´Ï´Ù. ¸ðµ¨ À̺¥Æ®´Â TableModel º¯°æÀ» ±â¼úÇØ, Çà ¹× ¿­¿¡ÀÇ ÂüÁ¶´Â ¸ðµÎ ¸ðµ¨ÀÇ ÁÂÇ¥ ü°è³»¿¡ ÀÖ½À´Ï´Ù. »ý¼ºÀÚ À¸·Î »ç¿ëµÇ´Â ÆĶó¹ÌÅÍ¿¡ µû¶ó¼­´Â TableModelevent¸¦ »ç¿ëÇØ, ¾Æ·¡ÀÇ Á¾·ùÀÇ º¯°æÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.


 TableModelEvent(source);              //  The data, ie.  all rows changed 
 TableModelEvent(source, HEADER_ROW);  //  Structure change, reallocate TableColumns
 TableModelEvent(source, 1);           //  Row 1 changed
 TableModelEvent(source, 3, 6);        //  Rows 3 to 6 inclusive changed
 TableModelEvent(source, 2, 2, 6);     //  Cell at (2, 6) changed
 TableModelEvent(source, 3, 6, ALL_COLUMNS, INSERT); // Rows (3, 6) were inserted
 TableModelEvent(source, 3, 6, ALL_COLUMNS, DELETE); // Rows (3, 6) were deleted
 
´Ù¸¥ ÆĶó¹ÌÅÍÀÇ Æí¼ºÀ» »ç¿ëÇÒ ¼öµµ ÀÖ½À´Ï´Ù¸¸, ¸ðµç °ÍÀÌ À¯¿ëÇÏ´Ù¶ó°í´Â ÇÑÁ¤ÇÏÁö ¾Ê½À´Ï´Ù. »ó¼ÓÇÏ´Â °ÍÀ¸·Î ¿¹¸¦ µé¾îÀ̺¥Æ® WILL°¡ ¹ß»ýÇß´ÂÁö, À̺¥Æ® DID°¡ ¹ß»ýÇß´ÂÁö µî, ´Ù¸¥ Á¤º¸¸¦ Ãß°¡ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ÀÌ°Í¿¡ ÀÇÇØ DELETE À̺¥Æ®¿¡¼­ÀÇ ÇàÀÇ ÁöÁ¤ÀÌÇϱ⠽¬¿öÁý´Ï´Ù¸¸, JTable ¿¡¼­´Â À̺¥Æ® ÈÄÀÇ ÅëÁö¸¸ÀÌ ÇÊ¿äÇؼ­, Swing ÆÐÅ°Áö¿¡´Â Æ÷ÇԵǾî ÀÖÁö ¾Ê½À´Ï´Ù.

°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ­ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈ­ÀÇ Áö¿øÀº ´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇÏ°í ÀÖ½À´Ï´Ù. JDK ¹öÀü 1.4 ÀÌÈÄ, ¸ðµç JavaBeans Àå±â°£ÀÇ ¿î¿ë Áö¿øÀº java.beans ÆÐÅ°Áö¿¡ Ãß°¡µÇ°í ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº XMLEncoder¸¦ ÂüÁ¶ÇϽʽÿÀ.

°ü·Ã Ç׸ñ:
TableModel

ÇÊµå °³¿ä
static int ALL_COLUMNS
          ÀÖ´Â Çà ¶Ç´Â º¹¼öÀÇ ÇàÀÇ ¸ðµç ¿­À» ÁöÁ¤ÇÕ´Ï´Ù.
protected  int column
           
static int DELETE
          Çà ¶Ç´Â ¿­ÀÇ »èÁ¦¸¦ ½Äº°ÇÕ´Ï´Ù.
protected  int firstRow
           
static int HEADER_ROW
          Çì´õÇàÀ» ½Äº°ÇÕ´Ï´Ù.
static int INSERT
          »õ·Î¿î Çà ¶Ç´Â ¿­ÀÇ Ãß°¡¸¦ ½Äº°ÇÕ´Ï´Ù.
protected  int lastRow
           
protected  int type
           
static int UPDATE
          ±âÁ¸ÀÇ µ¥ÀÌÅÍ¿¡ ´ëÇÑ º¯°æÀ» ½Äº°ÇÕ´Ï´Ù.
 
Ŭ·¡½º java.util. EventObject ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå
source
 
»ý¼ºÀÚ °³¿ä
TableModelEvent (TableModel  source)
          Å×ÀÌºí³»ÀÇ ¸ðµç Çà µ¥ÀÌÅÍ°¡ º¯°æµÇ°í ÀÖ½À´Ï´Ù.
TableModelEvent (TableModel  source, int row)
          ÀÌ µ¥ÀÌÅÍÀÇ ÇàÀº °»½ÅµÇ°í ÀÖ½À´Ï´Ù.
TableModelEvent (TableModel  source, int firstRow, int lastRow)
          Çà [firstRow, lastRow] µ¥ÀÌÅÍ°¡ °»½ÅµÇ°í ÀÖ½À´Ï´Ù.
TableModelEvent (TableModel  source, int firstRow, int lastRow, int column)
          [firstRow, lastRow] ¹üÀ§ÀÇ ¿­ column ¼¿ÀÌ °»½ÅµÇ°í ÀÖ½À´Ï´Ù.
TableModelEvent (TableModel  source, int firstRow, int lastRow, int column, int type)
          (firstRow, column)·ÎºÎÅÍ (lastRow, column)±îÁöÀÇ ¼¿ÀÌ º¯°æµÇ°í ÀÖ½À´Ï´Ù.
 
¸Þ¼­µå °³¿ä
 int getColumn ()
          À̺¥Æ®ÀÇ ¿­À» ¸®ÅÏÇÕ´Ï´Ù.
 int getFirstRow ()
          º¯°æµÈ ÃÖÃÊÀÇ ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù.
 int getLastRow ()
          º¯°æµÈ ¸¶Áö¸· ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù.
 int getType ()
          À̺¥Æ®ÀÇ Å¸ÀÔÀ» ¸®ÅÏÇÕ´Ï´Ù.
 
Ŭ·¡½º java.util. EventObject ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼­µå
getSource, toString
 
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼­µå
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

ÇʵåÀÇ »ó¼¼

INSERT

public static final int INSERT
»õ·Î¿î Çà ¶Ç´Â ¿­ÀÇ Ãß°¡¸¦ ½Äº°ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
Á¤¼ö Çʵ尪

UPDATE

public static final int UPDATE
±âÁ¸ÀÇ µ¥ÀÌÅÍ¿¡ ´ëÇÑ º¯°æÀ» ½Äº°ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
Á¤¼ö Çʵ尪

DELETE

public static final int DELETE
Çà ¶Ç´Â ¿­ÀÇ »èÁ¦¸¦ ½Äº°ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
Á¤¼ö Çʵ尪

HEADER_ROW

public static final int HEADER_ROW
Çì´õÇàÀ» ½Äº°ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
Á¤¼ö Çʵ尪

ALL_COLUMNS

public static final int ALL_COLUMNS
¾î´À Çà ¶Ç´Â º¹¼öÀÇ ÇàÀÇ ¸ðµç ¿­À» ÁöÁ¤ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
Á¤¼ö Çʵ尪

type

protected int type

firstRow

protected int firstRow

lastRow

protected int lastRow

column

protected int column
»ý¼ºÀÚ »ó¼¼

TableModelEvent

public TableModelEvent(TableModel  source)
Å×ÀÌºí³»ÀÇ ¸ðµç Çà µ¥ÀÌÅÍ°¡ º¯°æµÇ°í ÀÖ½À´Ï´Ù. ¸®½º³Ê´Â ÇàÀ» º£À̽º·Î ÇÑ ¸ðµç »óŸ¦ ÆıâÇØ, TableModel¿¡ ÀçÂ÷ ¹®ÀǸ¦ ÇØ, »õ·Î¿î Çà¼ö¿Í ¸ðµç ÀûÀýÇÑ °ªÀ» ÃëµæÇÕ´Ï´Ù. JTableÀº ÀÌ À̺¥Æ®¸¦ ¹Þ´Â´Ù°í °¡½Ã ¿µ¿ª Àüü¸¦ ·»´õ¸µ ´Ù½Ã ÇØ, °¡½ÃÀÇ ¼¿ÀÇ °ªÀ» ¸ðµ¨¿¡ ¹®ÀÇÇÕ´Ï´Ù. ·Ä¸í, ŸÀÔ ¹× ¼ø¼­ µî, Å×À̺íÀÇ ±¸Á¶´Â º¯°æµÇÁö ¾Ê½À´Ï´Ù.


TableModelEvent

public TableModelEvent(TableModel  source,
                       int row)
ÀÌ µ¥ÀÌÅÍÀÇ ÇàÀº °»½ÅµÇ°í ÀÖ½À´Ï´Ù. ±¸Á¶°¡ ´Ù¸¥ ¿ÏÀüÇÏ°Ô »õ·Î¿î Å×À̺íÀÇ ÃâÇöÀ» ³ªÅ¸³»·Á¸é, row°ªÀ¸·Î Çؼ­ HEADER_ROW¸¦ »ç¿ëÇÕ´Ï´Ù. JTableÀº ÀÌ À̺¥Æ®¸¦ ¹Þ¾Æ, autoCreateColumnsFromModel Ç÷¡±×°¡ ¼¼Æ® µÇ¸é, TableColumn°¡ ÀÖÀ¸¸é ¸ðµÎ ÆıâÇØ, ¸ðµ¨·Î Ç¥½ÃµÇ´Â Â÷·Ê·Î µðÆúÆ®ÀÇ ¿­À» ´Ù½Ã ÇÒ´ç ÇÕ´Ï´Ù. ÀÌ°ÍÀº, JTable·Î setModel(TableModel)¸¦ È£ÃâÇÏ´Â °Í°ú °°½À´Ï´Ù.


TableModelEvent

public TableModelEvent(TableModel  source,
                       int firstRow,
                       int lastRow)
Çà [firstRow, lastRow] µ¥ÀÌÅÍ°¡ °»½ÅµÇ°í ÀÖ½À´Ï´Ù.


TableModelEvent

public TableModelEvent(TableModel  source,
                       int firstRow,
                       int lastRow,
                       int column)
[firstRow, lastRow] ¹üÀ§ÀÇ ¿­ column ¼¿ÀÌ °»½ÅµÇ°í ÀÖ½À´Ï´Ù.


TableModelEvent

public TableModelEvent(TableModel  source,
                       int firstRow,
                       int lastRow,
                       int column,
                       int type)
(firstRow, column)(À¸)·ÎºÎÅÍ (lastRow, column)±îÁöÀÇ ¼¿ÀÌ º¯°æµÇ°í ÀÖ½À´Ï´Ù. column´Â ¸ðµ¨ÀÇ ÁÂÇ¥ ü°è¿¡¼­ÀÇ ¼¿ÀÇ ¿­À妽º¸¦ ÂüÁ¶ÇÕ´Ï´Ù. column°¡ ALL_COLUMNSÀÎ °æ¿ì´Â ÁöÁ¤ÇÑ Çà ¹üÀ§³»ÀÇ ¸ðµç ¼¿ÀÌ º¯°æµÇ¾ú´Ù°í º¸¿©Áý´Ï´Ù.

type´Â INSERT, UPDATE ¹× DELETE ¾î¶² °ÍÀΰ¡ÀÏ ÇÊ¿ä°¡ ÀÖ½À´Ï´Ù.

¸Þ¼­µåÀÇ »ó¼¼

getFirstRow

public int getFirstRow()
º¯°æµÈ ÃÖÃÊÀÇ ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. HEADER_ROW´Â ¿­ÀÇ À̸§, ŸÀÔ ¹× ¼ø¼­µîÀÇ ¸ÞŸµ¥ÀÌŸ¸¦ÀǹÌÇÕ´Ï´Ù.


getLastRow

public int getLastRow()
º¯°æµÈ ¸¶Áö¸· ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù.


getColumn

public int getColumn()
À̺¥Æ®ÀÇ ¿­À» ¸®ÅÏÇÕ´Ï´Ù. ¹Ýȯ°ªÀÌ ALL_COLUMNSÀÎ °æ¿ì´Â ÁöÁ¤µÈ ÀºÇà³»ÀÇ ¸ðµç ¿­ÀÌ º¯°æµÈ °ÍÀ»ÀǹÌÇÕ´Ï´Ù.


getType

public int getType()
À̺¥Æ®ÀÇ Å¸ÀÔÀ» ¸®ÅÏÇÕ´Ï´Ù. INSERT, UPDATE ¹× DELETE ¾î¶² °ÍÀΰ¡ÀÔ´Ï´Ù.


JavaTM 2 Platform
Standard Ed. 5.0

Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.