diff --git a/src/BusinessCardManagement.java b/src/BusinessCardManagement.java index 56edf21..a6e4385 100644 --- a/src/BusinessCardManagement.java +++ b/src/BusinessCardManagement.java @@ -17,9 +17,9 @@ import javax.swing.filechooser.FileNameExtensionFilter; public class BusinessCardManagement { - + public final Charset CHARSET = java.nio.charset.Charset.forName("Shift_JIS"); - + private Screen screen; private ScreenTemplates screenTemplates; private W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123; @@ -96,10 +96,10 @@ this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); } - public void updateFromState3(String scId, String wid, int state, String editcompany_, String editrepresentative_, String editposition_, String editestablish_, String editaddress1_, String editaddress2_, String editbusiness1_, String editbusiness2_, String editcompanydetail_, String editURL_, String editcontactPerson1_, String editposition1_, String edittel1_, String editemail1_, String editcontactPerson2_, String editposition2_, String edittel2_, String editemail2_, String editcontactPerson3_, String editposition3_, String edittel3_, String editemail3_, String editcontactPerson4_, String editposition4_, String edittel4_, String editemail4_) { + public void updateFromState3(String scId, String wid, int state, String company_, String representative_, String position_, String establish_, String address1_, String address2_, String business1_, String business2_, String companydetail_, String URL_, String contactPerson1_, String position1_, String tel1_, String email1_, String contactPerson2_, String position2_, String tel2_, String email2_, String contactPerson3_, String position3_, String tel3_, String email3_, String contactPerson4_, String position4_, String tel4_, String email4_) { Map temp_if16; - if ((((state==0)&&!editcompany_.equals(""))&&this.value.containsKey(editcompany_))) { - this.value.put(editcompany_,new BusinessCardManagementElement(editrepresentative_, editposition_, editestablish_, editaddress1_, editaddress2_, editbusiness1_, editbusiness2_, editcompanydetail_, editURL_, editcontactPerson1_, editposition1_, edittel1_, editemail1_, editcontactPerson2_, editposition2_, edittel2_, editemail2_, editcontactPerson3_, editposition3_, edittel3_, editemail3_, editcontactPerson4_, editposition4_, edittel4_, editemail4_)); + if ((((state==0)&&!company_.equals(""))&&this.value.containsKey(company_))) { + this.value.put(company_,new BusinessCardManagementElement(representative_, position_, establish_, address1_, address2_, business1_, business2_, companydetail_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_)); temp_if16 = this.value; } else { temp_if16 = this.value; @@ -134,7 +134,7 @@ this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); } - + final int COMPANY_NAME_INDEX = 0; final int PERSON_NAME_INDEX = 1; final int POSITION_INDEX = 2; @@ -174,7 +174,7 @@ positions[i] = data.get(POSITION_INDEX); tells[i] = data.get(TELL_INDEX); } - BusinessCardManagementElement bussinessCard + BusinessCardManagementElement bussinessCard = new BusinessCardManagementElement("", "", "", address, "", "", "", "", "", names[0], positions[0], tells[0], "", names[1], positions[1], tells[1], "",names[2], positions[2], tells[2], "",names[3], positions[3], tells[3], ""); value.put(companyName, bussinessCard); } @@ -185,7 +185,7 @@ } } } - + public void load() { try { Path path = getCSVFilePath(); @@ -231,7 +231,7 @@ e.printStackTrace(); } } - + public void save(String curScreen, String wid, int state) { if (state != 0) { @@ -292,7 +292,7 @@ JOptionPane.showMessageDialog(mainPanel, "ファイルの保存に失敗しました。"); } } - + private String escapeCsv(String value) { if (value.contains(",") || value.contains("\"") || value.contains("\n")) { value = value.replace("\"", "\"\""); @@ -300,12 +300,19 @@ } return value; } - + + public void delete(String curScreen, String wid, int state, String tableWid, String key) { + if (state == 0) { + this.value.remove(key); + this.screenTemplates.getScreenTemplate(curScreen).getWidgets1().getWidget1(tableWid).updateDataFromBusinessCardManagement4(curScreen, tableWid, getValue()); + } + } + private Path getCSVFilePath() throws URISyntaxException { return Paths.get(Main.class.getProtectionDomain() .getCodeSource() .getLocation() .toURI().toString().substring(6) + "../startup.csv"); } - + } \ No newline at end of file diff --git a/src/CurScreen.java b/src/CurScreen.java index e453db2..404b62a 100644 --- a/src/CurScreen.java +++ b/src/CurScreen.java @@ -19,8 +19,8 @@ temp_if2 = this.value; } this.value = temp_if2; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState2(String scId, String wid, int state) { String temp_if3; @@ -30,8 +30,8 @@ temp_if3 = this.value; } this.value = temp_if3; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState3(String scId, String wid, int state) { String temp_if4; @@ -41,8 +41,8 @@ temp_if4 = this.value; } this.value = temp_if4; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState4(String scId, String wid, int state) { String temp_if5; @@ -52,14 +52,14 @@ temp_if5 = this.value; } this.value = temp_if5; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } - public void updateFromState5(String scId, String wid, int state, String editcompany_, String editrepresentative_, String editposition_, String editestablish_, String editaddress1_, String editaddress2_, String editbusiness1_, String editbusiness2_, String editcompanydetail_, String editURL_, Map> businessCardManagement) { + public void updateFromState5(String scId, String wid, int state, String company_, String representative_, String position_, String establish_, String address1_, String address2_, String business1_, String business2_, String companydetail_, String URL_, Map> businessCardManagement) { String temp_if7; if ((state==0)) { String temp_if6; - if ((!editcompany_.equals("")&&businessCardManagement.containsKey(editcompany_))) { + if ((!company_.equals("")&&businessCardManagement.containsKey(company_))) { temp_if6 = "企業一覧"; } else { temp_if6 = this.value; @@ -69,8 +69,8 @@ temp_if7 = this.value; } this.value = temp_if7; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState6(String scId, String wid, int state, String company, String representative, String position, String establishment, String address1, String address2, String businessdescription1, String businessdescription2, String companyoverview, String URL, Map> businessCardManagement) { String temp_if9; @@ -86,8 +86,8 @@ temp_if9 = this.value; } this.value = temp_if9; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState7(String scId, String wid, int state) { String temp_if10; @@ -97,8 +97,8 @@ temp_if10 = this.value; } this.value = temp_if10; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState8(String scId, String wid, int state) { String temp_if11; @@ -108,8 +108,8 @@ temp_if11 = this.value; } this.value = temp_if11; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState9(String scId, String wid, int state) { String temp_if12; @@ -119,8 +119,8 @@ temp_if12 = this.value; } this.value = temp_if12; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void updateFromState10(String scId, String wid, int state) { String temp_if13; @@ -130,10 +130,10 @@ temp_if13 = this.value; } this.value = temp_if13; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } - public void updateFromState11(String scId, String wid, int state) { + public void updateFromState11(String scId, String wid, int state, String tableWid, String key, String company, String representative, String position, String establishment, String address1, String address2, String business1, String business2, String companyoverview, String URL, String contactPerson1, String position1, String tel1, String email1, String contactPerson2, String position2, String tel2, String email2, String contactPerson3, String position3, String tel3, String email3, String contactPerson4, String position4, String tel4, String email4, String company_, String representative_, String position_, String establish_, String address1_, String address2_, String business1_, String business2_, String companyoverview_, String URL_, String contactPerson1_, String position1_, String tel1_, String email1_, String contactPerson2_, String position2_, String tel2_, String email2_, String contactPerson3_, String position3_, String tel3_, String email3_, String contactPerson4_, String position4_, String tel4_, String email4_) { String temp_if14; if ((state==0)) { temp_if14 = "編集画面2"; @@ -141,8 +141,36 @@ temp_if14 = this.value; } this.value = temp_if14; - Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); - this.screen.updateFromCurScreen(this.value, screenTemplate); + ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); + if ((state==0)) { + screenTemplate.getWidgets1().getWidget1(company).updateText(company_); + screenTemplate.getWidgets1().getWidget1(representative).updateText(representative_); + screenTemplate.getWidgets1().getWidget1(position).updateText(position_); + screenTemplate.getWidgets1().getWidget1(establishment).updateText(establish_); + screenTemplate.getWidgets1().getWidget1(address1).updateText(address1_); + screenTemplate.getWidgets1().getWidget1(address2).updateText(address2_); + screenTemplate.getWidgets1().getWidget1(business1).updateText(business1_); + screenTemplate.getWidgets1().getWidget1(business2).updateText(business2_); + screenTemplate.getWidgets1().getWidget1(companyoverview).updateText(companyoverview_); + screenTemplate.getWidgets1().getWidget1(URL).updateText(URL_); +// screenTemplate.getWidgets1().getWidget1(contactPerson1).updateText(contactPerson1_); +// screenTemplate.getWidgets1().getWidget1(position1).updateText(position1_); +// screenTemplate.getWidgets1().getWidget1(tel1).updateText(tel1_); +// screenTemplate.getWidgets1().getWidget1(email1).updateText(email1_); +// screenTemplate.getWidgets1().getWidget1(contactPerson2).updateText(contactPerson2_); +// screenTemplate.getWidgets1().getWidget1(position2).updateText(position2_); +// screenTemplate.getWidgets1().getWidget1(tel2).updateText(tel2_); +// screenTemplate.getWidgets1().getWidget1(email2).updateText(email2_); +// screenTemplate.getWidgets1().getWidget1(contactPerson3).updateText(contactPerson3_); +// screenTemplate.getWidgets1().getWidget1(position3).updateText(position3_); +// screenTemplate.getWidgets1().getWidget1(tel3).updateText(tel3_); +// screenTemplate.getWidgets1().getWidget1(email3).updateText(email3_); +// screenTemplate.getWidgets1().getWidget1(contactPerson4).updateText(contactPerson4_); +// screenTemplate.getWidgets1().getWidget1(position4).updateText(position4_); +// screenTemplate.getWidgets1().getWidget1(tel4).updateText(tel4_); +// screenTemplate.getWidgets1().getWidget1(email4).updateText(email4_); + } + this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } public void changeCurScreen(String nextScId) { this.value = nextScId; diff --git a/src/Main.java b/src/Main.java index c514058..1cb2994 100644 --- a/src/Main.java +++ b/src/Main.java @@ -90,7 +90,7 @@ this.w2d109ad3739d4744a1874ac179fc38b9 = new W2d109ad3739d4744a1874ac179fc38b9(screenTemplates); this.w4ca84254d30c423ab8e449171a5b5123 = new W4ca84254d30c423ab8e449171a5b5123(screenTemplates); this.businessCardManagement = new BusinessCardManagement(screen, screenTemplates, w4ca84254d30c423ab8e449171a5b5123, searchScreen, searchCriteriaScreen, result, companyList, w2d109ad3739d4744a1874ac179fc38b9); - this.screenTemplates.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search2, search3, search5, search6, result); + this.screenTemplates.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search2, search3, search5, search6, result, w2d109ad3739d4744a1874ac179fc38b9, w4ca84254d30c423ab8e449171a5b5123); changeCurScreen("企業一覧"); } public Map getScreenTemplates() { diff --git a/src/Result.java b/src/Result.java index 7f7015d..d0c71db 100644 --- a/src/Result.java +++ b/src/Result.java @@ -3,7 +3,7 @@ public class Result { private Screen screen; private ScreenTemplates screenTemplates; - private String value = "Result"; + private String value = "result"; public Result(Screen screen, ScreenTemplates screenTemplates) { this.screen = screen; this.screenTemplates = screenTemplates; diff --git a/src/ScreenTemplate.java b/src/ScreenTemplate.java index 019cf37..1470069 100644 --- a/src/ScreenTemplate.java +++ b/src/ScreenTemplate.java @@ -31,9 +31,9 @@ public ScreenTemplate() { this.widgets = new Widgets1(); } - public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search2, Search3 search3, Search5 search5, Search6 search6, Result result) { + public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search2, Search3 search3, Search5 search5, Search6 search6, Result result, W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9, W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123) { this.curScreen = curScreen; this.presenter = presenter; - this.widgets.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search2, search3, search5, search6, result); + this.widgets.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search2, search3, search5, search6, result, w2d109ad3739d4744a1874ac179fc38b9, w4ca84254d30c423ab8e449171a5b5123); } } \ No newline at end of file diff --git a/src/ScreenTemplates.java b/src/ScreenTemplates.java index fa49e71..cadc030 100644 --- a/src/ScreenTemplates.java +++ b/src/ScreenTemplates.java @@ -220,7 +220,7 @@ temp_json28.put("height", 40); Map temp_json29 = new HashMap<>(); temp_json29.put("type", "textInput"); - temp_json29.put("text", "textInput"); + temp_json29.put("text", ""); temp_json29.put("visible", true); temp_json29.put("x", 360); temp_json29.put("y", 345); @@ -263,7 +263,7 @@ temp_json13.put("wcada3c4a537b4c7eae76954b6ed08ea8", temp_json15); temp_json13.put("we631b90a7c5749ed863429194cbc4187", temp_json16); temp_json13.put("we1c1c127a4d84410a65936d971bf99bd", temp_json17); - temp_json13.put("Result", temp_json18); + temp_json13.put("result", temp_json18); temp_json13.put("w2789e405544b4a32a669b65e6a6af685", temp_json21); temp_json13.put("w14fd3296e1064497a0c4ced93b47f21d", temp_json22); temp_json13.put("w725d1e48b8584a70bad1fbdc07ea8280", temp_json23); @@ -723,27 +723,27 @@ temp_json66_.put("height", 40); Map temp_json34 = new HashMap<>(); temp_json34.put("w92f10414281e4aba83b435456a1315b1", temp_json35); - temp_json34.put("editaddress2", temp_json36); + temp_json34.put("w8c31c847e9234ce287aa9d1963013a2e", temp_json36); temp_json34.put("w71f9e06eb3654cc2bb57ce3482579e11", temp_json37); temp_json34.put("w0012f272bae6486d9a4b6f7f379e3376", temp_json38); - temp_json34.put("w8c31c847e9234ce287aa9d1963013a2e", temp_json39); + temp_json34.put("address2", temp_json39); temp_json34.put("w1b21177a72594ea88b43b06879d4016d", temp_json40); - temp_json34.put("w19757f15861d421ea16a733d17ca930a", temp_json41); - temp_json34.put("editestablish", temp_json42); - temp_json34.put("editrepresentative", temp_json43); + temp_json34.put("businessdescription1", temp_json41); + temp_json34.put("establishment", temp_json42); + temp_json34.put("representative", temp_json43); temp_json34.put("w1e9211f35e1747c188121e0382d07821", temp_json44); - temp_json34.put("editaddress1", temp_json45); + temp_json34.put("wa7ba992f63b14310afd6ead389ba0d6c", temp_json45); temp_json34.put("w9d98825713d34965940a8540eb7ce845", temp_json46); - temp_json34.put("editURL", temp_json47); - temp_json34.put("editposition", temp_json48); + temp_json34.put("URL", temp_json47); + temp_json34.put("position", temp_json48); temp_json34.put("w910fc382356a422e9e326aea7f50de07", temp_json49); - temp_json34.put("editbusiness2", temp_json50); - temp_json34.put("wc3fd7fd241cb47458217856332d4f368", temp_json51); + temp_json34.put("wc3fd7fd241cb47458217856332d4f368", temp_json50); + temp_json34.put("businessdescription2", temp_json51); temp_json34.put("w11dd0f050a5044d384b10351b83ad390", temp_json52); - temp_json34.put("editcompany", temp_json53); - temp_json34.put("editcompanydetail", temp_json54); - temp_json34.put("editbusiness1", temp_json55); - temp_json34.put("wa7ba992f63b14310afd6ead389ba0d6c", temp_json56); + temp_json34.put("company", temp_json53); + temp_json34.put("companyoverview", temp_json54); + temp_json34.put("w19757f15861d421ea16a733d17ca930a", temp_json55); + temp_json34.put("address1", temp_json56); temp_json34.put("w792b9bfaac4d4fc7a3d0f9350d9a0005", temp_json57); temp_json34.put("editManagerNameLabel01", temp_json35_); temp_json34.put("editManagerPosition01", temp_json36_); @@ -761,22 +761,22 @@ temp_json34.put("editManagerPosition04", temp_json48_); temp_json34.put("editManagerNumber04", temp_json49_); temp_json34.put("editManagerMail04", temp_json50_); - temp_json34.put("editManagerNameInput01", temp_json51_); - temp_json34.put("editManagerPositionInput01", temp_json52_); - temp_json34.put("editManagerNumberInput01", temp_json53_); - temp_json34.put("editManagerMailInput01", temp_json54_); - temp_json34.put("editManagerNameInput02", temp_json55_); - temp_json34.put("editManagerPositionInput02", temp_json56_); + temp_json34.put("contactPerson1", temp_json51_); + temp_json34.put("position1", temp_json52_); + temp_json34.put("tel1", temp_json53_); + temp_json34.put("email1", temp_json54_); + temp_json34.put("contactPerson2", temp_json55_); + temp_json34.put("position2", temp_json56_); temp_json34.put("editddManagerNumberInput02", temp_json57_); - temp_json34.put("editManagerMailInput02", temp_json58_); - temp_json34.put("editManagerNameInput03", temp_json59_); - temp_json34.put("editManagerPositionInput03", temp_json60_); - temp_json34.put("editManagerNumberInput03", temp_json61_); - temp_json34.put("editManagerMailInput03", temp_json62_); - temp_json34.put("editManagerNameInput04", temp_json63_); - temp_json34.put("editManagerPositionInput04", temp_json64_); - temp_json34.put("editManagerNumberInput04", temp_json65_); - temp_json34.put("editManagerMailInput04", temp_json66_); + temp_json34.put("email2", temp_json58_); + temp_json34.put("contactPerson3", temp_json59_); + temp_json34.put("position3", temp_json60_); + temp_json34.put("tel3", temp_json61_); + temp_json34.put("email3", temp_json62_); + temp_json34.put("contactPerson4", temp_json63_); + temp_json34.put("position4", temp_json64_); + temp_json34.put("tel4", temp_json65_); + temp_json34.put("email4", temp_json66_); Map temp_json33 = new HashMap<>(); temp_json33.put("screenId", "編集画面2"); temp_json33.put("layout", false); @@ -1363,22 +1363,22 @@ temp_json68.put("addManagerPosition04", temp_json16_); temp_json68.put("addManagerNumber04", temp_json17_); temp_json68.put("addManagerMail04", temp_json18_); - temp_json68.put("addManagerNameInput01", temp_json19_); - temp_json68.put("addManagerPositionInput01", temp_json20_); - temp_json68.put("addManagerNumberInput01", temp_json21_); - temp_json68.put("addManagerMailInput01", temp_json22_); - temp_json68.put("addManagerNameInput02", temp_json23_); - temp_json68.put("addManagerPositionInput02", temp_json24_); - temp_json68.put("addManagerNumberInput02", temp_json25_); - temp_json68.put("addManagerMailInput02", temp_json26_); - temp_json68.put("addManagerNameInput03", temp_json27_); - temp_json68.put("addManagerPositionInput03", temp_json28_); - temp_json68.put("addManagerNumberInput03", temp_json29_); - temp_json68.put("addManagerMailInput03", temp_json30_); - temp_json68.put("addManagerNameInput04", temp_json31_); - temp_json68.put("addManagerPositionInput04", temp_json32_); - temp_json68.put("addManagerNumberInput04", temp_json33_); - temp_json68.put("addManagerMailInput04", temp_json34_); + temp_json68.put("contactPerson1", temp_json19_); + temp_json68.put("position1", temp_json20_); + temp_json68.put("tel1", temp_json21_); + temp_json68.put("email1", temp_json22_); + temp_json68.put("contactPerson2", temp_json23_); + temp_json68.put("position2", temp_json24_); + temp_json68.put("tel2", temp_json25_); + temp_json68.put("email2", temp_json26_); + temp_json68.put("contactPerson3", temp_json27_); + temp_json68.put("position3", temp_json28_); + temp_json68.put("tel3", temp_json29_); + temp_json68.put("email3", temp_json30_); + temp_json68.put("contactPerson4", temp_json31_); + temp_json68.put("position4", temp_json32_); + temp_json68.put("tel4", temp_json33_); + temp_json68.put("email4", temp_json34_); Map temp_json67 = new HashMap<>(); temp_json67.put("screenId", "登録画面1"); temp_json67.put("layout", false); @@ -1408,11 +1408,11 @@ public Map getValue() { return new HashMap<>(this.value); } - public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search2, Search3 search3, Search5 search5, Search6 search6, Result result) { + public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search2, Search3 search3, Search5 search5, Search6 search6, Result result, W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9, W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123) { this.presenter = presenter; this.curScreen = curScreen; for (ScreenTemplate screenTemplate: value.values()) { - screenTemplate.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search2, search3, search5, search6, result); + screenTemplate.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search2, search3, search5, search6, result, w2d109ad3739d4744a1874ac179fc38b9, w4ca84254d30c423ab8e449171a5b5123); } } public ScreenTemplate getScreenTemplate(String scId) { diff --git a/src/StartupManagementWindow.java b/src/StartupManagementWindow.java index fddb6c7..12da34e 100644 --- a/src/StartupManagementWindow.java +++ b/src/StartupManagementWindow.java @@ -13,7 +13,7 @@ presenter = new SwingPresenter(main, mainPanel); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - setSize(870, 640); + setSize(1600, 900); setVisible(true); } diff --git a/src/SwingPresenter.java b/src/SwingPresenter.java index faeba41..618682b 100644 --- a/src/SwingPresenter.java +++ b/src/SwingPresenter.java @@ -1,3 +1,12 @@ +import javax.swing.*; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; import java.awt.Component; import java.awt.FlowLayout; import java.awt.event.MouseEvent; @@ -6,19 +15,6 @@ import java.util.List; import java.util.Map; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextField; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; - public class SwingPresenter { private Main main; private JPanel mainPanel; @@ -51,7 +47,7 @@ boolean visible = (boolean) ((Map) widgets.get(key)).get("visible"); int state = (int) ((Map) widgets.get(key)).get("state"); if (type.equals("textInput")) { - JTextField textField = new JTextField(10); + JTextField textField = new JTextField(text,10); mainPanel.add(textField); components.put(key, textField); textField.getDocument().addDocumentListener(new DocumentListener() { @@ -176,15 +172,27 @@ rowCount++; } DefaultTableModel tableModel = new DefaultTableModel(tableData, columnsData); - JTable table = new JTable(tableModel) { + JTable table = new JTable(tableModel); + table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + ListSelectionModel selectionModel = table.getSelectionModel(); + selectionModel.addListSelectionListener(new ListSelectionListener() { @Override - public boolean isCellEditable(int row, int col) { - return false; + public void valueChanged(ListSelectionEvent e) { + if (!e.getValueIsAdjusting()) { + int selectedRow = table.getSelectedRow(); + main.mouseEvent(key, selectedRow); + if (selectedRow != -1) { + main.textEvent(key, table.getValueAt(selectedRow, 0).toString()); + } else { + main.textEvent(key, null); + } + } } - }; + }); + JScrollPane scroll = new JScrollPane(table); mainPanel.add(scroll); - components.put(key, scroll); + components.put(key, table); } } } else { @@ -199,7 +207,7 @@ int width = (int) ((Map) widgets.get(key)).get("width"); int state = (int) ((Map) widgets.get(key)).get("state"); if (type.equals("textInput")) { - JTextField textField = new JTextField(10); + JTextField textField = new JTextField(text,10); textField.setLocation(x, y); textField.setSize(width, height); mainPanel.add(textField); @@ -330,17 +338,29 @@ rowCount++; } DefaultTableModel tableModel = new DefaultTableModel(tableData, columnsData); - JTable table = new JTable(tableModel) { + JTable table = new JTable(tableModel); + table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + ListSelectionModel selectionModel = table.getSelectionModel(); + selectionModel.addListSelectionListener(new ListSelectionListener() { @Override - public boolean isCellEditable(int row, int col) { - return false; + public void valueChanged(ListSelectionEvent e) { + if (!e.getValueIsAdjusting()) { + int selectedRow = table.getSelectedRow(); + main.mouseEvent(key, selectedRow); + if (selectedRow != -1) { + main.textEvent(key, table.getValueAt(selectedRow, 0).toString()); + } else { + main.textEvent(key, null); + } + } } - }; + }); + JScrollPane scroll = new JScrollPane(table); scroll.setLocation(x, y); scroll.setSize(width, height); mainPanel.add(scroll); - components.put(key, scroll); + components.put(key, table); } } } @@ -376,17 +396,21 @@ public void setTable(String scId, String wid, Map> data) { if (!curScreenId.equals(scId)) return; - if (!(components.get(wid) instanceof JScrollPane)) return; - JScrollPane pane = (JScrollPane) components.get(wid); - JTable table = (JTable) pane.getViewport().getView(); - TableModel tableModel = table.getModel(); + if (!(components.get(wid) instanceof JTable)) return; + JTable table = (JTable) components.get(wid); + DefaultTableModel tableModel = (DefaultTableModel) table.getModel(); + tableModel.setRowCount(0); int i = 0; for(String dataKey : data.keySet()) { Map rowData = data.get(dataKey); - int j = 0; - for(String cellvalue : rowData.keySet()) { - tableModel.setValueAt(rowData.get(cellvalue), i, j); - j++; + tableModel.addRow(new Object[tableModel.getColumnCount()]); + for (int j = 0; j < tableModel.getColumnCount(); j++) { + String column = tableModel.getColumnName(j); + if (rowData.get(column) == null) { + tableModel.setValueAt(dataKey, i, j); + } else { + tableModel.setValueAt(rowData.get(column), i, j); + } } i++; } diff --git a/src/Widget.java b/src/Widget.java index fd160d5..fc33ee5 100644 --- a/src/Widget.java +++ b/src/Widget.java @@ -93,26 +93,29 @@ this.visible = visible; this.presenter.setVisible(wid, visible); } + public void changeText(String text) { + this.text = text; + } // public void updateFromWidget(String self, String scId, String wid, Map widget, String curScreen) { // this.value = widget; // } - public void updateDataFromState(String screenId, String widId, int state, String searchCriteriaScreen, String search1, String search2, String search3, String search5, String search6, String result, String address1_, String address2_, String businessdescription1_, String businessdescription2_, String companyoverview_, Map> businessCardManagement) { + public void updateDataFromState(String screenId, String widId, int state, String search1, String search2, String search3, String search5, String search6, String result, String address1_, String address2_, String businessdescription1_, String businessdescription2_, String companyoverview_, Map> businessCardManagement) { Map> temp_if0; if ((state==0)) { Map temp_json92 = new HashMap<>(); - temp_json92.put("address1", text); - temp_json92.put("address2", text); - temp_json92.put("businessDescription1", text); - temp_json92.put("businessDescription2", text); - temp_json92.put("companyOverview", text); + temp_json92.put("住所1", search5); + temp_json92.put("住所2", search6); + temp_json92.put("事業内容1", search1); + temp_json92.put("事業内容2", search2); + temp_json92.put("会社概要", search3); Map> temp_search0 = new HashMap<>(); for (String key: businessCardManagement.keySet()) { boolean isMatch = true; for (String qKey: temp_json92.keySet()) { Map value = businessCardManagement.get(key); for (String valKey: value.keySet()) { - if (valKey.equals(qKey)) { - if (value.get(valKey).equals(temp_json92.get(qKey))) { + if (temp_json92.get(qKey) != null && !temp_json92.get(qKey).equals("") && valKey.equals(qKey)) { + if (!value.get(valKey).equals(temp_json92.get(qKey))) { isMatch = false; } break; diff --git a/src/Widget1.java b/src/Widget1.java index 6ed190e..1ce5546 100644 --- a/src/Widget1.java +++ b/src/Widget1.java @@ -50,6 +50,8 @@ private Search5 search5; private Search6 search6; private Result result; + private W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9; + private W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123; public Widget1(String type, String text, boolean visible, int x, int y, int width, int height, int state, Map> data, List columns, String primaryKeyName, SwingPresenter presenter) { this.type = type; @@ -115,6 +117,9 @@ public String getPrimaryKeyName() { return primaryKeyName; } + public void updateText(String text) { + this.text = text; + } public void updateTextFromText(String self, String self2, String wid, String text, String curScreen) { this.text = text; } @@ -130,6 +135,10 @@ this.data = businessCardManagement; this.presenter.setTable(scId, wid, businessCardManagement); } + public void updateDataFromBusinessCardManagement4(String scId, String wid, Map> businessCardManagement) { + this.data = businessCardManagement; + this.presenter.setTable(scId, wid, businessCardManagement); + } public void updateStateFromState(String self, String self2, String wid, int state, String curScreen) { this.state = state; if ((curScreen.equals("企業一覧")&&wid.equals("w191cc519b2344758b8d9878328b41cd9"))) { // 「検索」ボタン @@ -138,10 +147,13 @@ if ((curScreen.equals("企業一覧")&&wid.equals("w0498c4eb3524489494c288e2fc7a3211"))) { // 「登録」ボタン this.curScreen.updateFromState2(curScreen, wid, this.state); } - if ((curScreen.equals("企業一覧")&&wid.equals("wa6aa4bcbb7a64e9eaf75758eae59310a"))) { // 「編集」ボタン - this.curScreen.updateFromState11(curScreen, wid, this.state); - } if ((curScreen.equals("企業一覧")&&wid.equals("wa1b27f08c9fd4c08b7dda38625c04f3b"))) { // 「削除」ボタン + String w2d109ad3739d4744a1874ac179fc38b9 = this.w2d109ad3739d4744a1874ac179fc38b9.getValue(); + this.widget1 = screen.getWidgets().getWidget(w2d109ad3739d4744a1874ac179fc38b9); + String w2d109ad3739d4744a1874ac179fc38b9_ = this.widget1.getText(); + if (w2d109ad3739d4744a1874ac179fc38b9_ != null) { + this.businessCardManagement.delete(curScreen, wid, this.state, w2d109ad3739d4744a1874ac179fc38b9, w2d109ad3739d4744a1874ac179fc38b9_); + } } if ((curScreen.equals("企業一覧")&&wid.equals("importButton"))) { // 「データ読み込み」ボタン this.businessCardManagement.imports(curScreen, wid, this.state); @@ -149,6 +161,81 @@ if ((curScreen.equals("企業一覧")&&wid.equals("saveButton"))) { // 「保存」ボタン this.businessCardManagement.save(curScreen, wid, this.state); } + if ((curScreen.equals("企業一覧")&&wid.equals("wa6aa4bcbb7a64e9eaf75758eae59310a"))) { // 「編集」ボタン + String w2d109ad3739d4744a1874ac179fc38b9 = this.w2d109ad3739d4744a1874ac179fc38b9.getValue(); + this.widget1 = screen.getWidgets().getWidget(w2d109ad3739d4744a1874ac179fc38b9); + String w2d109ad3739d4744a1874ac179fc38b9_ = this.widget1.getText(); + if (w2d109ad3739d4744a1874ac179fc38b9_ != null) { + String company = this.company.getValue(); + String representative = this.representative.getValue(); + String position = this.position.getValue(); + String establishment = this.establishment.getValue(); + String address1 = this.address1.getValue(); + String address2 = this.address2.getValue(); + String business1 = this.businessdescription1.getValue(); + String business2 = this.businessdescription2.getValue(); + String companyoverview = this.companyoverview.getValue(); + String URL = this.URL.getValue(); + String contactPerson1 = this.contactPerson1.getValue(); + String position1 = this.position1.getValue(); + String tel1 = this.tel1.getValue(); + String email1 = this.email1.getValue(); + String contactPerson2 = this.contactPerson2.getValue(); + String position2 = this.position2.getValue(); + String tel2 = this.tel2.getValue(); + String email2 = this.email2.getValue(); + String contactPerson3 = this.contactPerson3.getValue(); + String position3 = this.position3.getValue(); + String tel3 = this.tel3.getValue(); + String email3 = this.email3.getValue(); + String contactPerson4 = this.contactPerson4.getValue(); + String position4 = this.position4.getValue(); + String tel4 = this.tel4.getValue(); + String email4 = this.email4.getValue(); + String representative_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getRepresentative(); + String position_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getPosition(); + String establishment_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getEstablishment(); + String address1_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getAddress1(); + String address2_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getAddress2(); + String business1_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getBusinessDescription1(); + String business2_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getBusinessDescription2(); + String companyoverview_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getCompanyOverview(); + String URL_ = this.businessCardManagement.getBusinessCardManagementElement(w2d109ad3739d4744a1874ac179fc38b9_).getURL(); + this.widget1 = screen.getWidgets().getWidget(contactPerson1); + String contactPerson1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position1); + String position1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel1); + String tel1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email1); + String email1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson2); + String contactPerson2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position2); + String position2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel2); + String tel2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email2); + String email2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson3); + String contactPerson3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position3); + String position3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel3); + String tel3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email3); + String email3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson4); + String contactPerson4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position4); + String position4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel4); + String tel4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email4); + String email4_ = this.widget1.getText(); + this.curScreen.updateFromState11(curScreen, wid, this.state, w2d109ad3739d4744a1874ac179fc38b9, w2d109ad3739d4744a1874ac179fc38b9_, company, representative, position, establishment, address1, address2, business1, business2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, w2d109ad3739d4744a1874ac179fc38b9_, representative_, position_, establishment_, address1_, address2_, business1_, business2_, companyoverview_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_); + } + } if ((curScreen.equals("検索画面")&&wid.equals("w7de33900c55f4379983056aee325c057"))) { // 「検索項目の入力」ボタン this.curScreen.updateFromState10(curScreen, wid, this.state); } @@ -205,54 +292,38 @@ String companydetail_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(URL); String URL_ = this.widget1.getText(); - String contactPerson1_ = ""; - String position1_ = ""; - String tel1_ = ""; - String email1_ = ""; - String contactPerson2_ = ""; - String position2_ = ""; - String tel2_ = ""; - String email2_ = ""; - String contactPerson3_ = ""; - String position3_ = ""; - String tel3_ = ""; - String email3_ = ""; - String contactPerson4_ = ""; - String position4_ = ""; - String tel4_ = ""; - String email4_ = ""; -// this.widget1 = screen.getWidgets().getWidget(contactPerson1); -// String contactPerson1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position1); -// String position1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel1); -// String tel1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email1); -// String email1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson2); -// String contactPerson2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position2); -// String position2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel2); -// String tel2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email2); -// String email2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson3); -// String contactPerson3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position3); -// String position3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel3); -// String tel3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email3); -// String email3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson4); -// String contactPerson4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position4); -// String position4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel4); -// String tel4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email4); -// String email4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson1); + String contactPerson1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position1); + String position1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel1); + String tel1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email1); + String email1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson2); + String contactPerson2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position2); + String position2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel2); + String tel2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email2); + String email2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson3); + String contactPerson3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position3); + String position3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel3); + String tel3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email3); + String email3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson4); + String contactPerson4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position4); + String position4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel4); + String tel4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email4); + String email4_ = this.widget1.getText(); this.businessCardManagement.updateFromState3(curScreen, wid, this.state, company_, representative_, position_, establish_, address1_, address2_, business1_, business2_, companydetail_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_); } if ((curScreen.equals("編集画面2")&&wid.equals("w11dd0f050a5044d384b10351b83ad390"))) { // 「編集」ボタン @@ -267,6 +338,21 @@ String companyoverview = this.companyoverview.getValue(); String URL = this.URL.getValue(); String contactPerson1 = this.contactPerson1.getValue(); + String position1 = this.position1.getValue(); + String tel1 = this.tel1.getValue(); + String email1 = this.email1.getValue(); + String contactPerson2 = this.contactPerson2.getValue(); + String position2 = this.position2.getValue(); + String tel2 = this.tel2.getValue(); + String email2 = this.email2.getValue(); + String contactPerson3 = this.contactPerson3.getValue(); + String position3 = this.position3.getValue(); + String tel3 = this.tel3.getValue(); + String email3 = this.email3.getValue(); + String contactPerson4 = this.contactPerson4.getValue(); + String position4 = this.position4.getValue(); + String tel4 = this.tel4.getValue(); + String email4 = this.email4.getValue(); this.widget1 = screen.getWidgets().getWidget(company); String company_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(representative); @@ -288,6 +374,37 @@ this.widget1 = screen.getWidgets().getWidget(URL); String URL_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(contactPerson1); + String contactPerson1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position1); + String position1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel1); + String tel1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email1); + String email1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson2); + String contactPerson2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position2); + String position2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel2); + String tel2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email2); + String email2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson3); + String contactPerson3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position3); + String position3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel3); + String tel3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email3); + String email3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson4); + String contactPerson4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position4); + String position4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel4); + String tel4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email4); + String email4_ = this.widget1.getText(); Map> businessCardManagement = this.businessCardManagement.getValue(); this.curScreen.updateFromState5(curScreen, wid, this.state, company_, representative_, position_, establish_, address1_, address2_, business1_, business2_, companydetail_, URL_, businessCardManagement); } @@ -341,54 +458,38 @@ String companyoverview_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(URL); String URL_ = this.widget1.getText(); - String contactPerson1_ = ""; - String position1_ = ""; - String tel1_ = ""; - String email1_ = ""; - String contactPerson2_ = ""; - String position2_ = ""; - String tel2_ = ""; - String email2_ = ""; - String contactPerson3_ = ""; - String position3_ = ""; - String tel3_ = ""; - String email3_ = ""; - String contactPerson4_ = ""; - String position4_ = ""; - String tel4_ = ""; - String email4_ = ""; -// this.widget1 = screen.getWidgets().getWidget(contactPerson1); -// String contactPerson1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position1); -// String position1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel1); -// String tel1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email1); -// String email1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson2); -// String contactPerson2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position2); -// String position2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel2); -// String tel2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email2); -// String email2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson3); -// String contactPerson3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position3); -// String position3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel3); -// String tel3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email3); -// String email3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson4); -// String contactPerson4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position4); -// String position4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel4); -// String tel4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email4); -// String email4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson1); + String contactPerson1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position1); + String position1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel1); + String tel1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email1); + String email1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson2); + String contactPerson2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position2); + String position2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel2); + String tel2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email2); + String email2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson3); + String contactPerson3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position3); + String position3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel3); + String tel3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email3); + String email3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson4); + String contactPerson4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position4); + String position4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel4); + String tel4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email4); + String email4_ = this.widget1.getText(); this.businessCardManagement.updateFromState(curScreen, wid, this.state, company_, representative_, position_, establishment_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_); } if ((curScreen.equals("登録画面1")&&wid.equals("w7c6cfb14ed4f410aa33a440e6ab2e4bf"))) { // 「登録」ボタン @@ -439,53 +540,37 @@ this.widget1 = screen.getWidgets().getWidget(URL); String URL_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(contactPerson1); - String contactPerson1_ = ""; - String position1_ = ""; - String tel1_ = ""; - String email1_ = ""; - String contactPerson2_ = ""; - String position2_ = ""; - String tel2_ = ""; - String email2_ = ""; - String contactPerson3_ = ""; - String position3_ = ""; - String tel3_ = ""; - String email3_ = ""; - String contactPerson4_ = ""; - String position4_ = ""; - String tel4_ = ""; - String email4_ = ""; -// String contactPerson1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position1); -// String position1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel1); -// String tel1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email1); -// String email1_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson2); -// String contactPerson2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position2); -// String position2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel2); -// String tel2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email2); -// String email2_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson3); -// String contactPerson3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position3); -// String position3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel3); -// String tel3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email3); -// String email3_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(contactPerson4); -// String contactPerson4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(position4); -// String position4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(tel4); -// String tel4_ = this.widget1.getText(); -// this.widget1 = screen.getWidgets().getWidget(email4); -// String email4_ = this.widget1.getText(); + String contactPerson1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position1); + String position1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel1); + String tel1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email1); + String email1_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson2); + String contactPerson2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position2); + String position2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel2); + String tel2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email2); + String email2_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson3); + String contactPerson3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position3); + String position3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel3); + String tel3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email3); + String email3_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(contactPerson4); + String contactPerson4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(position4); + String position4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(tel4); + String tel4_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(email4); + String email4_ = this.widget1.getText(); this.businessCardManagement.updateFromState2(curScreen, wid, this.state, company_, representative_, position_, establishment_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_); } if ((curScreen.equals("登録画面1")&&wid.equals("w7c6cfb14ed4f410aa33a440e6ab2e4bf"))) { // 「登録」ボタン @@ -529,7 +614,6 @@ this.curScreen.updateFromState7(curScreen, wid, this.state); } if ((curScreen.equals("検索項目画面")&&wid.equals("w725d1e48b8584a70bad1fbdc07ea8280"))) { // 「検索」ボタン - String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String search1 = this.search1.getValue(); String search2 = this.search2.getValue(); String search3 = this.search3.getValue(); @@ -541,8 +625,6 @@ String businessdescription1 = this.businessdescription1.getValue(); String businessdescription2 = this.businessdescription2.getValue(); String companyoverview = this.companyoverview.getValue(); - this.widget1 = screen.getWidgets().getWidget(searchCriteriaScreen); - String searchCriteriaScreen_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(search1); String search1_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(search2); @@ -553,8 +635,6 @@ String search5_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(search6); String search6_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(result); - String result_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(address1); String address1_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(address2); @@ -565,11 +645,13 @@ String businessdescription2_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(companyoverview); String companyoverview_ = this.widget1.getText(); + this.widget1 = screen.getWidgets().getWidget(result); + String result_ = this.widget1.getText(); Map> businessCardManagement = this.businessCardManagement.getValue(); - this.widget1.updateDataFromState(curScreen, wid, this.state, searchCriteriaScreen_, search1_, search2_, search3_, search5_, search6_, result_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, businessCardManagement); + this.widget1.updateDataFromState(curScreen, result, this.state, search1_, search2_, search3_, search5_, search6_, result_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, businessCardManagement); } } - public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search2, Search3 search3, Search5 search5, Search6 search6, Result result) { + public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search2, Search3 search3, Search5 search5, Search6 search6, Result result, W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9, W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123) { this.screen = screen; this.curScreen = curScreen; this.presenter = presenter; @@ -607,5 +689,7 @@ this.search5 = search5; this.search6 = search6; this.result = result; + this.w2d109ad3739d4744a1874ac179fc38b9 = w2d109ad3739d4744a1874ac179fc38b9; + this.w4ca84254d30c423ab8e449171a5b5123 = w4ca84254d30c423ab8e449171a5b5123; } } diff --git a/src/Widgets1.java b/src/Widgets1.java index bf58ccc..4f72d35 100644 --- a/src/Widgets1.java +++ b/src/Widgets1.java @@ -42,11 +42,11 @@ public Widget1 getWidget1(String wid) { return this.value.get(wid); } - public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search, Search3 search3, Search5 search5, Search6 search6, Result result) { + public void setReferences(Screen screen, CurScreen curScreen, SwingPresenter presenter, BusinessCardManagement businessCardManagement, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, ContactPerson1 contactPerson1, Position1 position1, Tel1 tel1, Email1 email1, ContactPerson2 contactPerson2, Position2 position2, Tel2 tel2, Email2 email2, ContactPerson3 contactPerson3, Position3 position3, Tel3 tel3, Email3 email3, ContactPerson4 contactPerson4, Position4 position4, Tel4 tel4, Email4 email4, SearchCriteriaScreen searchCriteriaScreen, Search1 search1, Search2 search, Search3 search3, Search5 search5, Search6 search6, Result result, W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9, W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123) { this.curScreen = curScreen; this.presenter = presenter; for (Widget1 widget: value.values()) { - widget.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search, search3, search5, search6, result); + widget.setReferences(screen, curScreen, presenter, businessCardManagement, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, contactPerson1, position1, tel1, email1, contactPerson2, position2, tel2, email2, contactPerson3, position3, tel3, email3, contactPerson4, position4, tel4, email4, searchCriteriaScreen, search1, search, search3, search5, search6, result, w2d109ad3739d4744a1874ac179fc38b9, w4ca84254d30c423ab8e449171a5b5123); } } } \ No newline at end of file