[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[jfriends] Re: [jfriends] Re:£Ê£â£õ£é£ì£ä£å£ò£²¤ÎGridCont rol ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ë¤Ä¤¤¤Æ
>¤ä¤Ï¤ê¡¢¤³¤³¤Ï¤¢¤¤é¤á¤ÆdataSet¤ò»È¤¦¤Ù¤¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡¦¡¦¡¦
>¤½¤Î°Ù¤Ë¤ÏDB¥¢¥¯¥»¥¹¤«¤é½ñ¤Ä¾¤µ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤Î¤Ç¡¢¤Ç¤¤ì¤ÐÈò¤±¤¿¤¤¤Î¤Ç¤¹¤¬¡£
>¥Ç¡¼¥¿¤ò¥°¥ê¥Ã¥É¤Ëɽ¼¨¤·¤¿¤¤¤À¤±¤Ç¡¢¥°¥ê¥Ã¥É¾å¤ÇÊÔ½¸¤·¤¿¤¤¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢
>dataSet¤ò»È¤¦É¬ÍפϤʤ¤¤Î¤Ç¤¹¤¬¡£¤¦¡¼¤à¡£
¤à¤«¤· GridControl ¤ò»È¤Ã¤ÆÇ¤°Õ¤Î¥Ç¡¼¥¿¤òɽ¼¨¤¹¤ë¥³¡¼¥É¤ò½ñ¤¤¤¿¤Î¤Ç¤¹¤¬
¤¹¤Ã¤«¤ê˺¤ì¤Þ¤·¤¿¡£
¼ê¸µ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¸«¤¿¤é¤³¤ó¤Ê¥³¡¼¥É¤ò½ñ¤¤¤Æ¤¤¤Þ¤·¤¿¡£
¤Þ¤º jbInit() ¤Ç¤Ï¡¢
gridControl1.setAutoEdit(false);
gridControl1.setAutoInsert(false);
gridControl1.setColumnCaptions(new String[] {"Éô½ê̾", "¼õÎÎ", "µìÈÇÇÑ´þ"});
gridControl1.setEditInPlace(false);
¥»¥Ã¥È¤¹¤ë¥á¥½¥Ã¥É¤Ç¤Ï¡¢
private void setDeliverList(Deliver[] delivers) {
gridControl1.removeAllRows();
if (delivers != null) {
String[][] gitems = // ¨Ãͤǽñ¤¤¤Æ¤¢¤ë¤Î¤Ç°¤¤¥³¡¼¥É¤Î¸«ËܤǤ¹¡£
new String[delivers.length][3]; // ¤³¤Î¤È¤¤Ï¥«¥é¥à¿ô¤¬3¤À¤Ã¤¿¤ß¤¿¤¤¡£
for (int i=0; i<delivers.length; i++) {
gridControl1.addRow();
gitems[i][0] = new String(delivers[i].getSectionName());
if (delivers[i].getFinishDate() != null) {
gitems[i][1] = delivers[i].getFinishDate();
} else {
gitems[i][1] = new String("");
}
if (delivers[i].getDisposeDate() != null) {
gitems[i][2] = delivers[i].getFinishDate();
} else {
gitems[i][2] = new String("");
}
}
gridControl1.setItems(gitems);
}
}
¤¢¤Þ¤ê Grid ¤È¤Ï´Ø·¸Ìµ¤¤¤Î¤Ç¤¹¤¬¡¢delivers ¤Ï ¥¯¥é¥¹ Deliver ¤ÎÇÛÎó¤Ç¡¢
Deliver ¤Ï¤³¤ó¤Ê¥¯¥é¥¹¤Ç¤¹¡£(»ä¤Î½ñ¤¤¤¿¥¯¥é¥¹¤Ê¤Î¤Ç¥Ø¥í¥Ø¥í¤Ç¤¹)
¤³¤Î GridControl ¤Ë¤Ï¡¢¡ÖÇÛÉÛͽÄê°ìÍ÷¡×¤ß¤¿¤¤¤Ê¤â¤Î¤òɽ¼¨¤·¤¿¤«¤Ã¤¿¤è¤¦¤Ç¤¹¡£
/**
* ÇÛÉÕͽÄꥪ¥Ö¥¸¥§¥¯¥È
* @xxxxxxxxxx mtc9000.data.Flow
*/
public class Deliver extends Task implements Serializable {
int revision_no;
String dispose_date; // µìÈÇÇÑ´þÆü
public Deliver() {
}
/**
* ¥³¥Ô¡¼¥³¥ó¥¹¥È¥é¥¯¥¿¡¼¤Ç¤¹¡£
* @xxxxxxxxxx deliver ¥³¥Ô¡¼¸µ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤¹¡£
* @xxxxxxxxxx ¥³¥Ô¡¼¸µ¤ÈƱ¤¸Ãͤò»ý¤Ã¤¿¿·¤¿¤Ê¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤¹¡£
*/
public Deliver(Deliver deliver) {
super(deliver);
this.revision_no = deliver.revision_no;
this.dispose_date = deliver.dispose_date;
}
/**
* ³Æ¥Õ¥£¡¼¥ë¥É¤ò¤½¤ì¤¾¤ì½é´ü²½¤¹¤ë¥³¥ó¥¹¥È¥é¥¯¥¿¡¼¤Ç¤¹¡£
* @xxxxxxxxxx no ¤³¤ÎÇÛÉÕͽÄê¸ÇͤÎÈÖ¹æ¤Ç¤¹¡£task_no ¤ò½é´ü²½¤·¤Þ¤¹¡£
* @xxxxxxxxxx due ͽÄêÆü¤Ç¤¹¡£
* @xxxxxxxxxx finish ¼Â»ÜÆü¤Ç¤¹¡£
* @xxxxxxxxxx code_name ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼԤΥ桼¥¶¡¼ID¤Ç¤¹¡£
* @xxxxxxxxxx user_name ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼÔ̾¤Ç¤¹¡£
* @xxxxxxxxxx mail_address ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼԤΥ᡼¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£
* @xxxxxxxxxx section_name ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼԤνê°¤¹¤ëÉô½ê̾¤Ç¤¹¡£
* @xxxxxxxxxx reason Íýͳ¤Ç¤¹¡£
* @xxxxxxxxxx status ͽÄê¤Î½èÍý¾õ¶·¤Ç¤¹¡£(½èÍýÃæ/½èÍý½ªÎ»/̵¸ú)
* @xxxxxxxxxx revision ¤³¤ÎͽÄ꤬½ê°¤¹¤ëÈǤΠnode_no ¤Ç¤¹¡£
* @xxxxxxxxxx dispose_date µìÈÇÇÑ´þÆü¤Ç¤¹¡£
*/
public Deliver( int no,
String due,
String finish,
String code_name,
String user_name,
String mail_address,
String section_name,
String reason,
int status,
int revision,
String dispose_date)
{
super.setTaskNo(no);
super.setDueDate(due);
super.setFinishDate(finish);
super.setCodeName(code_name);
super.setUserName(user_name);
super.setMailAddress(mail_address);
super.setSectionName(section_name);
super.setReason(reason);
super.setStatus(status);//1998.8.31y.e
this.revision_no = revision;
this.dispose_date = dispose_date;//1998.6.29
}
public int getRevisionNo() {
return revision_no;
}
public void setRevisionNo(int Value) {
revision_no = Value;
}
public String getDisposeDate() {
return dispose_date;
}
public void setDisposeDate(String Value) {
dispose_date = Value;
}
}
´ðÄ쥯¥é¥¹¤Î Task ¤Ï¤³¤ó¤Ê¥¯¥é¥¹¤Ç¤¹¡£
/**
* ¤¹¤Ù¤Æ¤ÎͽÄꥪ¥Ö¥¸¥§¥¯¥È(ºîÀ®/¿³ºº/¾µÇ§/À©Äê¡¢ÇÛÉÕ)¤Î¸µ¤Ë¤Ê¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£
* @xxxxxxxxxx mtc9000.data.Flow
* @xxxxxxxxxx mtc9000.data.Deliver
*/
public abstract class Task implements Serializable {
/**
* ½èÍý¾õ¶·¥Õ¥é¥°:½èÍýÃæ
* @xxxxxxxxxx mtc9000.data.Task#setStatus()
* @xxxxxxxxxx mtc9000.data.Task#getStatus()
*/
public static final int PROCESSING = 0;
/**
* ½èÍý¾õ¶·¥Õ¥é¥°:½èÍý½ªÎ»
* @xxxxxxxxxx mtc9000.data.Task#setStatus()
* @xxxxxxxxxx mtc9000.data.Task#getStatus()
*/
public static final int DONE = 1;
/**
* ½èÍý¾õ¶·¥Õ¥é¥°:̵¸ú
* @xxxxxxxxxx mtc9000.data.Task#setStatus()
* @xxxxxxxxxx mtc9000.data.Task#getStatus()
*/
public static final int DISABLED = -1;
int task_no;
String class_string = null;
String due_date = null;
String finish_date = null;
String code_name = null;
String user_name = null; // Ķ¸È©^^; 1998.6.19 y.e
String mail_address = null; // ĶĶ¸È©^^; 1998.9.2y.e
String section_name = null; // Ķ¸È©^^; 1998.6.19 y.e
String reason = null;
int status = PROCESSING;
public Task() {
class_string = this.getClass().getName();
}
/**
* ¥³¥Ô¡¼¥³¥ó¥¹¥È¥é¥¯¥¿¡¼¤Ç¤¹¡£
* @xxxxxxxxxx task ¥³¥Ô¡¼¸µ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤¹¡£
* @xxxxxxxxxx ¥³¥Ô¡¼¸µ¤ÈƱ¤¸Ãͤò»ý¤Ã¤¿¿·¤¿¤Ê¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤¹¡£
*/
public Task(Task task) {
this.task_no = task.task_no;
class_string = this.getClass().getName();
this.due_date = task.due_date;
this.finish_date = task.finish_date;
this.code_name = task.code_name;
this.user_name = task.user_name;
this.mail_address = task.mail_address;
this.section_name = task.section_name;
this.reason = task.reason;
this.status = task.status;//1998.8.31y.e
}
/**
* ³Æ¥Õ¥£¡¼¥ë¥É¤ò¤½¤ì¤¾¤ì½é´ü²½¤¹¤ë¥³¥ó¥¹¥È¥é¥¯¥¿¡¼¤Ç¤¹¡£
* @xxxxxxxxxx no ¤³¤Î Task ¸ÇͤÎÈÖ¹æ¤Ç¤¹¡£task_no ¤ò½é´ü²½¤·¤Þ¤¹¡£
* @xxxxxxxxxx due ͽÄêÆü¤Ç¤¹¡£
* @xxxxxxxxxx finish ¼Â»ÜÆü¤Ç¤¹¡£
* @xxxxxxxxxx code_name ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼԤΥ桼¥¶¡¼ID¤Ç¤¹¡£
* @xxxxxxxxxx user_name ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼÔ̾¤Ç¤¹¡£
* @xxxxxxxxxx mail_address ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼԤΥ᡼¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£
* @xxxxxxxxxx section_name ¤³¤ÎͽÄê¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿ÍøÍѼԤνê°¤¹¤ëÉô½ê̾¤Ç¤¹¡£
* @xxxxxxxxxx reason Íýͳ¤Ç¤¹¡£
* @xxxxxxxxxx status ͽÄê¤Î½èÍý¾õ¶·¤Ç¤¹¡£(½èÍýÃæ/½èÍý½ªÎ»/̵¸ú)
*/
public Task( int no,
String due,
String finish,
String code_name,
String user_name,
String mail_address,
String section_name,
String reason,
int status)
{
class_string = this.getClass().getName();
this.task_no = no;
this.due_date = due;
this.finish_date = finish;
this.code_name = code_name;
this.user_name = user_name;
this.mail_address = mail_address;
this.section_name = section_name;
this.reason = reason;
this.status = status;//1998.8.31y.e
}
// ¥µ¥Ö¥¯¥é¥¹¤òưŪ¤ËÀ¸À® 1998.6.19 y.e
public static Task create(String class_string) {
Task task = null;
if (class_string != null && !class_string.equals("")) {
try {
task = (Task)Class.forName(class_string).newInstance();
}
catch (Exception e) {
System.out.println("Class '" + class_string + "' create error.");
e.printStackTrace();
}
}
return task;
}
public String toString() {
if (user_name != null) {
if (section_name != null) {
return user_name + " (" + section_name + ")";
} else {
return user_name;
}
} else {
return code_name;
}
}
public int getTaskNo() {
return task_no;
}
public void setTaskNo(int Value) {
task_no = Value;
}
public String getDueDate() {
return due_date;
}
public void setDueDate(String Value) {
due_date = Value;
}
public String getFinishDate() {
return finish_date;
}
public void setFinishDate(String Value) {
finish_date = Value;
}
public String getCodeName() {
return code_name;
}
public void setCodeName(String Value) {
code_name = Value;
}
public String getUserName() {
return user_name;
}
public void setUserName(String Value) {
user_name = Value;
}
public String getMailAddress() {
return mail_address;
}
public void setMailAddress(String Value) {
mail_address = Value;
}
public String getSectionName() {
return section_name;
}
public void setSectionName(String Value) {
section_name = Value;
}
public String getReason() {
return reason;
}
public void setReason(String Value) {
reason = Value;
}
public int getStatus() {
return status;
}
public void setStatus(int Value) {
status = Value;
}
}
º£²ó¤Ï»ä¤ÎÃÑÉô¤ò¸øÉ½¤·¤Æ¤ß¤Þ¤·¤¿¡£^^;
GridControl ¤Î¥³¡¼¥Ç¥£¥ó¥°¤È Task¡¢Deliver ¥¯¥é¥¹¤Ï¤¤¤Á¤ª¤¦Ìµ´Ø·¸¤Ç¤¹¡£
¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
¡ô ÃÑÉô¤ò¸ø³«¤·¤Æ»ä°Ê³°¤ÎÊý¤ËÎɤ¤¤³¤È¤¬¤¢¤ë¤Î¤Ç¤·¤ç¤¦¤«...^^;
¡ô¡ô ¤µ¤¤¤¤ó [jfriends] ¤¬ [jbuilder] ²½¤·¤Æ¤¤¤ë...^^;;;
------------------------------------------------------------------
±óÆ£Ì÷Ç· (¤¨¤ó¤É¤¦ ¤ä¤¹¤æ¤) <yasuyuki@xxxxxxxxxx>
http://www.javaopen.org/jfriends/ (Java¸ß½õ²ñ¥Û¡¼¥à¥Ú¡¼¥¸)
³ô¼°²ñ¼Ò¥¿¥¤¥à¥¤¥ó¥¿¡¼¥á¥Ç¥£¥¢ ¾ðÊóÄÌ¿®¥µ¡¼¥Ó¥¹Éô TEL 03-5362-9009
¢©162-0065 ¿·½É¶è½»µÈÄ®3-11 ¿·½É¥¹¥Ñ¥¤¥¢¥Ó¥ë FAX 03-5362-9008