diff --git a/src/BusinessCardManagement.java b/src/BusinessCardManagement.java index 19e90d8..24c217b 100644 --- a/src/BusinessCardManagement.java +++ b/src/BusinessCardManagement.java @@ -46,15 +46,15 @@ this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); Map temp_if15; - if ((((state==0)&&!text.equals(""))&&!(this.value.containsKey(text)))) { - this.value.put(text,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, businessdescription1_, representative_, URL_, companyoverview_, businessdescription2_)); + if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { + this.value.put(company_,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, businessdescription1_, representative_, URL_, companyoverview_, businessdescription2_)); temp_if15 = this.value; } else { temp_if15 = this.value; } this.value = temp_if15; } - public void updateFromState2(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) { + public void updateFromState2(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_) { String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String result = this.result.getValue(); this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); @@ -68,8 +68,8 @@ this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); Map temp_if14; - if ((((state==0)&&!text.equals(""))&&!(this.value.containsKey(text)))) { - this.value.put(text,new BusinessCardManagementElement(address2, address1, establishment, position, "", representative, URL, "", "")); + if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { + this.value.put(company_,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, "", representative_, URL_, "", "")); temp_if14 = this.value; } else { temp_if14 = this.value; @@ -90,15 +90,15 @@ this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); Map temp_if16; - if ((((state==0)&&!text.equals(""))&&this.value.containsKey(text))) { - this.value.put(text,new BusinessCardManagementElement(editaddress2_, editaddress1_, editestablish_, editposition_, editbusiness1_, editrepresentative_, editURL_, editcompanydetail_, editbusiness2_)); + if ((((state==0)&&!editcompany_.equals(""))&&this.value.containsKey(editcompany_))) { + this.value.put(editcompany_,new BusinessCardManagementElement(editaddress2_, editaddress1_, editestablish_, editposition_, editbusiness1_, editrepresentative_, editURL_, editcompanydetail_, editbusiness2_)); temp_if16 = this.value; } else { temp_if16 = this.value; } this.value = temp_if16; } - public void addBusinessCardManagement(String representative, String position, String establishment, String address1, String address2, String businessDescription1, String businessDescription2, String companyOverview, String URL, String companyName) { + public void addBusinessCardManagement(String scId, String wid, String representative, String position, String establishment, String address1, String address2, String businessDescription1, String businessDescription2, String companyOverview, String URL, String companyName) { String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String result = this.result.getValue(); this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); @@ -110,7 +110,7 @@ String w4ca84254d30c423ab8e449171a5b5123 = this.w4ca84254d30c423ab8e449171a5b5123.getValue(); String searchScreen = this.searchScreen.getValue(); this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); - this.widget.updateDataFromBusinessCardManagement2(tscId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); - this.value.put(companyName,new BusinessCardManagementElement(address2, address1, establishment, position, businessDescription1, representative, uRL, companyOverview, businessDescription2)); + this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); + this.value.put(companyName,new BusinessCardManagementElement(address2, address1, establishment, position, businessDescription1, representative, URL, companyOverview, businessDescription2)); } } \ No newline at end of file diff --git a/src/BusinessCardManagementElement.java b/src/BusinessCardManagementElement.java index b109a40..354b98a 100644 --- a/src/BusinessCardManagementElement.java +++ b/src/BusinessCardManagementElement.java @@ -2,7 +2,7 @@ public class BusinessCardManagementElement { private String representative; - private String uRL; + private String URL; private String address1; private String companyOverview; private String address2; @@ -33,7 +33,7 @@ return this.URL; } public void changeURLOfBusinessCardManagement(String companyName, String newURL) { - this.uRL = newURL; + this.URL = newURL; } public String getAddress1() { return this.address1; @@ -84,7 +84,7 @@ this.position = position; this.businessDescription1 = businessDescription1; this.representative = representative; - this.uRL = uRL; + this.URL = uRL; this.companyOverview = companyOverview; this.businessDescription2 = businessDescription2; } diff --git a/src/CurScreen.java b/src/CurScreen.java index f9349a6..5304da1 100644 --- a/src/CurScreen.java +++ b/src/CurScreen.java @@ -55,11 +55,11 @@ Map screenTemplate = screenTemplates.getScreenTemplate(this.value).getValue(); this.screen.updateFromCurScreen(this.value, screenTemplate); } - public void updateFromState5(String scId, String wid, int state, String editcompany_, String editcompany, String editrepresentative_, String editrepresentative, String editposition_, String editposition, String editestablish_, String editestablish, String editaddress1_, String editaddress1, String editaddress2_, String editaddress2, String editbusiness1_, String editbusiness1, String editbusiness2_, String editbusiness2, String editcompanydetail_, String editcompanydetail, String editURL_, String editURL) { + public void updateFromState5(String scId, String wid, int state, String editcompany_, String editcompany, String editrepresentative_, String editrepresentative, String editposition_, String editposition, String editestablish_, String editestablish, String editaddress1_, String editaddress1, String editaddress2_, String editaddress2, String editbusiness1_, String editbusiness1, String editbusiness2_, String editbusiness2, String editcompanydetail_, String editcompanydetail, String editURL_, String editURL, Map> businessCardManagement) { String temp_if7; if ((state==0)) { String temp_if6; - if ((!text.equals("")&&businessCardManagement.containsKey(text))) { + if ((!editcompany_.equals("")&&businessCardManagement.containsKey(editcompany_))) { temp_if6 = "企業一覧"; } else { temp_if6 = this.value; @@ -76,7 +76,7 @@ String temp_if9; if ((state==0)) { String temp_if8; - if ((!text.equals("")&&!(businessCardManagement.containsKey(text)))) { + if ((!company.equals("")&&!(businessCardManagement.containsKey(company)))) { temp_if8 = "企業一覧"; } else { temp_if8 = "企業一覧"; diff --git a/src/Main.java b/src/Main.java index e170261..6fc14ee 100644 --- a/src/Main.java +++ b/src/Main.java @@ -45,7 +45,6 @@ this.screenTemplates = new ScreenTemplates(presenter); this.screen = new Screen(screenTemplates, true, presenter); this.curScreen = new CurScreen(screen, screenTemplates); - this.screenTemplates.setCurScreen(curScreen); this.screen.setCurScreen(curScreen); this.search1 = new Search1(screen); this.search6 = new Search6(screen); @@ -79,6 +78,7 @@ this.company = new Company(screen); this.address1 = new Address1(screen); this.representative = new Representative(screen); + this.screenTemplates.setReferences(screen, businessCardManagement, curScreen, editcompany, editaddress1, editbusiness1, editestablish, editbusiness2, editposition, editcompanydetail, editURL, editaddress2, editrepresentative, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, search6, searchCriteriaScreen, search3, search5, search1, result, search2); changeCurScreen("企業一覧"); } public Map getBusinessCardManagementElement(String companyName) { @@ -279,8 +279,8 @@ public void changeBusinessDescription2OfBusinessCardManagement(String companyName, String newBusinessDescription2) { this.businessCardManagement.getBusinessCardManagementElement(companyName).changeBusinessDescription2OfBusinessCardManagement(companyName, newBusinessDescription2); } - public void addBusinessCardManagement(String representative, String position, String establishment, String address1, String address2, String businessDescription1, String businessDescription2, String companyOverview, String URL, String companyName) { - this.businessCardManagement.addBusinessCardManagement(representative, position, establishment, address1, address2, businessDescription1, businessDescription2, companyOverview, URL, companyName); + public void addBusinessCardManagement(String scId, String wid, String representative, String position, String establishment, String address1, String address2, String businessDescription1, String businessDescription2, String companyOverview, String URL, String companyName) { + this.businessCardManagement.addBusinessCardManagement(scId, wid, representative, position, establishment, address1, address2, businessDescription1, businessDescription2, companyOverview, URL, companyName); } public void changeCurScreen(String nextScId) { this.curScreen.changeCurScreen(nextScId); diff --git a/src/ScreenTemplate.java b/src/ScreenTemplate.java index f669592..0546fc6 100644 --- a/src/ScreenTemplate.java +++ b/src/ScreenTemplate.java @@ -29,7 +29,7 @@ public ScreenTemplate(SwingPresenter presenter) { this.widgets = new Widgets1(presenter); } - public void setCurScreen(CurScreen curScreen) { - this.widgets.setCurScreen(curScreen); + public void setReferences(Screen screen, BusinessCardManagement businessCardManagement, CurScreen curScreen, Editcompany editcompany, Editaddress1 editaddress1, Editbusiness1 editbusiness1, Editestablish editestablish, Editbusiness2 editbusiness2, Editposition editposition, Editcompanydetail editcompanydetail, EditURL editURL, Editaddress2 editaddress2, Editrepresentative editrepresentative, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, Search6 search6, SearchCriteriaScreen searchCriteriaScreen, Search3 search3, Search5 search5, Search1 search1, Result result, Search2 search) { + this.widgets.setReferences(screen, businessCardManagement, curScreen, editcompany, editaddress1, editbusiness1, editestablish, editbusiness2, editposition, editcompanydetail, editURL, editaddress2, editrepresentative, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, search6, searchCriteriaScreen, search3, search5, search1, result, search); } } \ No newline at end of file diff --git a/src/ScreenTemplates.java b/src/ScreenTemplates.java index ce636b9..ffc2079 100644 --- a/src/ScreenTemplates.java +++ b/src/ScreenTemplates.java @@ -794,10 +794,10 @@ public Map getValue() { return new HashMap<>(this.value); } - public void setCurScreen(CurScreen curScreen) { + public void setReferences(Screen screen, BusinessCardManagement businessCardManagement, CurScreen curScreen, Editcompany editcompany, Editaddress1 editaddress1, Editbusiness1 editbusiness1, Editestablish editestablish, Editbusiness2 editbusiness2, Editposition editposition, Editcompanydetail editcompanydetail, EditURL editURL, Editaddress2 editaddress2, Editrepresentative editrepresentative, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, Search6 search6, SearchCriteriaScreen searchCriteriaScreen, Search3 search3, Search5 search5, Search1 search1, Result result, Search2 search) { this.curScreen = curScreen; for (ScreenTemplate screenTemplate: value.values()) { - screenTemplate.setCurScreen(curScreen); + screenTemplate.setReferences(screen, businessCardManagement, curScreen, editcompany, editaddress1, editbusiness1, editestablish, editbusiness2, editposition, editcompanydetail, editURL, editaddress2, editrepresentative, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, search6, searchCriteriaScreen, search3, search5, search1, result, search); } } public ScreenTemplate getScreenTemplate(String scId) { diff --git a/src/Widget.java b/src/Widget.java index 52a8f3b..f9098ec 100644 --- a/src/Widget.java +++ b/src/Widget.java @@ -79,9 +79,9 @@ this.visible = visible; this.presenter.setVisible(wid, visible); } - public void updateFromWidget(String self, String scId, String wid, Map widget, String curScreen) { - this.value = widget; - } +// 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) { Map> temp_if0; if ((state==0)) { diff --git a/src/Widget1.java b/src/Widget1.java index 8127c1a..2048cf8 100644 --- a/src/Widget1.java +++ b/src/Widget1.java @@ -43,7 +43,8 @@ private Result result; private Search2 search2; - public Widget1(String type, String text, boolean visible, int x, int y, int width, int height, int state, Map> data, Screen screen, BusinessCardManagement businessCardManagement, CurScreen curScreen, SwingPresenter presenter) { + public Widget1(String type, String text, boolean visible, int x, int y, int width, int height, int state, Map> data, SwingPresenter presenter) { + this.type = type; this.text = text; this.visible = visible; this.x = x; @@ -126,7 +127,6 @@ if ((curScreen.equals("検索画面結果")&&wid.equals("w0becbeb6b2d54c03a69d63e3facd2eaa"))) { this.curScreen.updateFromState7(curScreen, wid, this.state); } - String text = this.text; String editcompany = this.editcompany.getValue(); String editrepresentative = this.editrepresentative.getValue(); String editposition = this.editposition.getValue(); @@ -157,11 +157,12 @@ String editcompanydetail_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(editURL); String editURL_ = this.widget1.getText(); + Map> businessCardManagement = this.businessCardManagement.getValue(); if ((curScreen.equals("編集画面2")&&wid.equals("w11dd0f050a5044d384b10351b83ad390"))) { this.businessCardManagement.updateFromState3(curScreen, wid, this.state, editcompany_, editcompany, editrepresentative_, editrepresentative, editposition_, editposition, editestablish_, editestablish, editaddress1_, editaddress1, editaddress2_, editaddress2, editbusiness1_, editbusiness1, editbusiness2_, editbusiness2, editcompanydetail_, editcompanydetail, editURL_, editURL); } if ((curScreen.equals("編集画面2")&&wid.equals("w11dd0f050a5044d384b10351b83ad390"))) { - this.curScreen.updateFromState5(curScreen, wid, this.state, editcompany_, editcompany, editrepresentative_, editrepresentative, editposition_, editposition, editestablish_, editestablish, editaddress1_, editaddress1, editaddress2_, editaddress2, editbusiness1_, editbusiness1, editbusiness2_, editbusiness2, editcompanydetail_, editcompanydetail, editURL_, editURL); + this.curScreen.updateFromState5(curScreen, wid, this.state, editcompany_, editcompany, editrepresentative_, editrepresentative, editposition_, editposition, editestablish_, editestablish, editaddress1_, editaddress1, editaddress2_, editaddress2, editbusiness1_, editbusiness1, editbusiness2_, editbusiness2, editcompanydetail_, editcompanydetail, editURL_, editURL, businessCardManagement); } if ((curScreen.equals("検索項目画面")&&wid.equals("w614b5ee1e161473d8f859fbfb5c8074e"))) { this.curScreen.updateFromState4(curScreen, wid, this.state); @@ -175,7 +176,6 @@ if ((curScreen.equals("登録画面1")&&wid.equals("wf10ab1752fe44c4d97ffb2ca2afdeba0"))) { this.curScreen.updateFromState(curScreen, wid, this.state); } - Map> businessCardManagement = this.businessCardManagement.getValue(); String company = this.company.getValue(); String representative = this.representative.getValue(); String position = this.position.getValue(); @@ -232,7 +232,29 @@ this.widget1.updateDataFromState(curScreen, wid, this.state, searchCriteriaScreen, search1, search2, search3, search5, search6, result, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, businessCardManagement); } } - public void setCurScreen(CurScreen curScreen) { + public void setReferences(Screen screen, BusinessCardManagement businessCardManagement, CurScreen curScreen, Editcompany editcompany, Editaddress1 editaddress1, Editbusiness1 editbusiness1, Editestablish editestablish, Editbusiness2 editbusiness2, Editposition editposition, Editcompanydetail editcompanydetail, EditURL editURL, Editaddress2 editaddress2, Editrepresentative editrepresentative, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, Search6 search6, SearchCriteriaScreen searchCriteriaScreen, Search3 search3, Search5 search5, Search1 search1, Result result, Search2 search) { + this.screen = screen; + this.businessCardManagement = businessCardManagement; this.curScreen = curScreen; + this.editcompany = editcompany; + this.editaddress1 = editaddress1; + this.editbusiness1 = editbusiness1; + this.editestablish = editestablish; + this.editbusiness2 = editbusiness2; + this.editposition = editposition; + this.editcompanydetail = editcompanydetail; + this.editURL = editURL; + this.editaddress2 = editaddress2; + this.editrepresentative = editrepresentative; + this.company = company; + this.representative = representative; + this.position = position; + this.establishment = establishment; + this.address1 = address1; + this.address2 = address2; + this.businessdescription1 = businessdescription1; + this.businessdescription2 = businessdescription2; + this.companyoverview = companyoverview; + this.URL = URL; } } \ No newline at end of file diff --git a/src/Widgets1.java b/src/Widgets1.java index 3490cfb..0f401cd 100644 --- a/src/Widgets1.java +++ b/src/Widgets1.java @@ -33,16 +33,16 @@ if (((Map) value.get(key)).get("width") != null) width = (int) ((Map) value.get(key)).get("width"); int state = 0; if (((Map) value.get(key)).get("state") != null) state = (int) ((Map) value.get(key)).get("state"); - this.value.put(key, new Widget1(type, text,true, x, y, width, height, 0, null, null, null, curScreen, presenter)); + this.value.put(key, new Widget1(type, text, true, x, y, width, height, 0, null, presenter)); } } public Widget1 getWidget1(String wid) { return this.value.get(wid); } - public void setCurScreen(CurScreen curScreen) { + public void setReferences(Screen screen, BusinessCardManagement businessCardManagement, CurScreen curScreen, Editcompany editcompany, Editaddress1 editaddress1, Editbusiness1 editbusiness1, Editestablish editestablish, Editbusiness2 editbusiness2, Editposition editposition, Editcompanydetail editcompanydetail, EditURL editURL, Editaddress2 editaddress2, Editrepresentative editrepresentative, Company company, Representative representative, Position position, Establishment establishment, Address1 address1, Address2 address2, Businessdescription1 businessdescription1, Businessdescription2 businessdescription2, Companyoverview companyoverview, URL URL, Search6 search6, SearchCriteriaScreen searchCriteriaScreen, Search3 search3, Search5 search5, Search1 search1, Result result, Search2 search) { this.curScreen = curScreen; for (Widget1 widget: value.values()) { - widget.setCurScreen(curScreen); + widget.setReferences(screen, businessCardManagement, curScreen, editcompany, editaddress1, editbusiness1, editestablish, editbusiness2, editposition, editcompanydetail, editURL, editaddress2, editrepresentative, company, representative, position, establishment, address1, address2, businessdescription1, businessdescription2, companyoverview, URL, search6, searchCriteriaScreen, search3, search5, search1, result, search); } } } \ No newline at end of file