diff --git a/src/BusinessCardManagement.java b/src/BusinessCardManagement.java index 7ffe66d..6829b4a 100644 --- a/src/BusinessCardManagement.java +++ b/src/BusinessCardManagement.java @@ -121,7 +121,7 @@ JPanel mainPanel = screen.getPresenter().getMainPanel(); JOptionPane.showMessageDialog(mainPanel, "会社名は既に存在します。"); } else { - this.value.remove(prevCompany); + this.value.remove(prevCompany); //会社名の変更 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_)); this.screen.getPresenter().setSaved(false); } diff --git a/src/CurScreen.java b/src/CurScreen.java index e1078df..b88b0ae 100644 --- a/src/CurScreen.java +++ b/src/CurScreen.java @@ -56,7 +56,7 @@ ScreenTemplate screenTemplate = screenTemplates.getScreenTemplate(this.value); this.screen.updateFromCurScreen(this.value, screenTemplate.getValue()); } - 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 companyList, String w2d109ad3739d4744a1874ac179fc38b9) { + public void updateFromState5(String scId, String wid, int state, String company_, Map> businessCardManagement, String companyList, String w2d109ad3739d4744a1874ac179fc38b9) { String temp_if7; if ((state==0)) { String temp_if6; @@ -83,12 +83,16 @@ 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) { + public void updateFromState6(String scId, String wid, int state, String company, Map> businessCardManagement) { String temp_if9; if ((state==0)) { String temp_if8; - if ((!company.equals("")&&!(businessCardManagement.containsKey(company)))) { - temp_if8 = "企業一覧"; + if ((!company.isEmpty())) { + if (!businessCardManagement.keySet().contains(company)) { + temp_if8 = "企業一覧"; + } else { + temp_if8 = this.value; + } } else { temp_if8 = this.value; } diff --git a/src/SwingPresenter.java b/src/SwingPresenter.java index aac2be5..9f63068 100644 --- a/src/SwingPresenter.java +++ b/src/SwingPresenter.java @@ -48,10 +48,11 @@ 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(text,10); - mainPanel.add(textField); - components.put(key, textField); - textField.getDocument().addDocumentListener(new DocumentListener() { + JTextArea textArea = new JTextArea(text,5,10); + textArea.setLineWrap(true); + mainPanel.add(textArea); + components.put(key, textArea); + textArea.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { Document d = e.getDocument(); @@ -214,12 +215,13 @@ 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(text,10); - textField.setLocation(x, y); - textField.setSize(width, height); - mainPanel.add(textField); - components.put(key, textField); - textField.getDocument().addDocumentListener(new DocumentListener() { + JTextArea textArea = new JTextArea(text,5,10); + textArea.setLineWrap(true); + textArea.setLocation(x, y); + textArea.setSize(width, height); + mainPanel.add(textArea); + components.put(key, textArea); + textArea.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { Document d = e.getDocument(); diff --git a/src/Widget1.java b/src/Widget1.java index b80c8d1..663c012 100644 --- a/src/Widget1.java +++ b/src/Widget1.java @@ -315,89 +315,9 @@ 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"))) { // 「編集」ボタン - 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(); - this.widget1 = screen.getWidgets().getWidget(company); - String company_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(representative); - String representative_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(position); - String position_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(establishment); - String establish_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(address1); - String address1_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(address2); - String address2_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(business1); - String business1_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(business2); - String business2_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(companyoverview); - String companydetail_ = this.widget1.getText(); - 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(); String w2d109ad3739d4744a1874ac179fc38b9 = this.w2d109ad3739d4744a1874ac179fc38b9.getValue(); - this.curScreen.updateFromState5(curScreen, wid, this.state, company_, representative_, position_, establish_, address1_, address2_, business1_, business2_, companydetail_, URL_, businessCardManagement, "企業一覧", w2d109ad3739d4744a1874ac179fc38b9); + this.curScreen.updateFromState5(curScreen, wid, this.state, company_, businessCardManagement, "企業一覧", w2d109ad3739d4744a1874ac179fc38b9); } if ((curScreen.equals("登録画面1")&&wid.equals("wf10ab1752fe44c4d97ffb2ca2afdeba0"))) { // 「一覧へ戻る」ボタン this.curScreen.updateFromState(curScreen, wid, this.state); @@ -481,41 +401,9 @@ 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"))) { // 「登録」ボタン - 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 businessdescription1 = this.businessdescription1.getValue(); - String businessdescription2 = this.businessdescription2.getValue(); - String companyoverview = this.companyoverview.getValue(); - String URL = this.URL.getValue(); - this.widget1 = screen.getWidgets().getWidget(company); - String company_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(representative); - String representative_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(position); - String position_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(establishment); - String establishment_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(address1); - String address1_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(address2); - String address2_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(businessdescription1); - String businessdescription1_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(businessdescription2); - String businessdescription2_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(companyoverview); - String companyoverview_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(URL); - String URL_ = this.widget1.getText(); Map> businessCardManagement = this.businessCardManagement.getValue(); - this.curScreen.updateFromState6(curScreen, wid, this.state, company_, representative_, position_, establishment_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, URL_, businessCardManagement); + 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_); + this.curScreen.updateFromState6(curScreen, wid, this.state, company_, businessCardManagement); } if ((curScreen.equals("検索項目画面")&&wid.equals("w614b5ee1e161473d8f859fbfb5c8074e"))) { // 「一覧へ戻る」ボタン this.curScreen.updateFromState4(curScreen, wid, this.state);