diff --git a/src/ScreenTemplates.java b/src/ScreenTemplates.java index c4fde8d..7aaca71 100644 --- a/src/ScreenTemplates.java +++ b/src/ScreenTemplates.java @@ -117,19 +117,11 @@ temp_json9.put("screenId", "検索画面結果"); temp_json9.put("layout", false); temp_json9.put("widgets", temp_json10); - Map temp_json14 = new HashMap<>(); - temp_json14.put("type", "label"); - temp_json14.put("text", "住所2"); - temp_json14.put("visible", true); - temp_json14.put("x", 360); - temp_json14.put("y", 320); - temp_json14.put("width", 50); - temp_json14.put("height", 20); Map temp_json15 = new HashMap<>(); temp_json15.put("type", "label"); temp_json15.put("text", "担当者"); temp_json15.put("visible", true); - temp_json15.put("x", 675); + temp_json15.put("x", 360); temp_json15.put("y", 320); temp_json15.put("width", 50); temp_json15.put("height", 20); @@ -208,7 +200,7 @@ temp_json18.put("text", "table"); temp_json18.put("visible", true); temp_json18.put("x", 85); - temp_json18.put("y", 440); + temp_json18.put("y", 420); temp_json18.put("width", 1365); temp_json18.put("height", 385); temp_json18.put("data", temp_json19); @@ -224,7 +216,7 @@ temp_json21.put("height", 20); Map temp_json22 = new HashMap<>(); temp_json22.put("type", "label"); - temp_json22.put("text", "住所1"); + temp_json22.put("text", "住所"); temp_json22.put("visible", true); temp_json22.put("x", 55); temp_json22.put("y", 320); @@ -260,7 +252,7 @@ temp_json26.put("visible", true); temp_json26.put("x", 985); temp_json26.put("y", 245); - temp_json26.put("width", 200); + temp_json26.put("width", 450); temp_json26.put("height", 40); Map temp_json27 = new HashMap<>(); temp_json27.put("type", "button"); @@ -278,19 +270,11 @@ temp_json28.put("y", 245); temp_json28.put("width", 200); temp_json28.put("height", 40); - Map temp_json29 = new HashMap<>(); - temp_json29.put("type", "textInput"); - temp_json29.put("text", ""); - temp_json29.put("visible", true); - temp_json29.put("x", 360); - temp_json29.put("y", 345); - temp_json29.put("width", 200); - temp_json29.put("height", 40); Map temp_json30 = new HashMap<>(); temp_json30.put("type", "textInput"); temp_json30.put("text", ""); temp_json30.put("visible", true); - temp_json30.put("x", 675); + temp_json30.put("x", 360); temp_json30.put("y", 345); temp_json30.put("width", 200); temp_json30.put("height", 40); @@ -319,7 +303,6 @@ temp_json68_.put("width", 60); temp_json68_.put("height", 65); Map temp_json13 = new HashMap<>(); - temp_json13.put("w8fd9daaa986d40978c63408ee0a9527f", temp_json14); temp_json13.put("wcada3c4a537b4c7eae76954b6ed08ea8", temp_json15); temp_json13.put("we631b90a7c5749ed863429194cbc4187", temp_json16); temp_json13.put("we1c1c127a4d84410a65936d971bf99bd", temp_json17); @@ -332,7 +315,6 @@ temp_json13.put("search3", temp_json26); temp_json13.put("w614b5ee1e161473d8f859fbfb5c8074e", temp_json27); temp_json13.put("search1", temp_json28); - temp_json13.put("search6", temp_json29); temp_json13.put("search7", temp_json30); temp_json13.put("search4", temp_json31); temp_json13.put("search5", temp_json32); @@ -386,7 +368,7 @@ temp_json40.put("text", "URL"); temp_json40.put("visible", true); temp_json40.put("x", 1295); - temp_json40.put("y", 320); + temp_json40.put("y", 220); temp_json40.put("width", 50); temp_json40.put("height", 20); Map temp_json41 = new HashMap<>(); @@ -442,7 +424,7 @@ temp_json47.put("text", ""); temp_json47.put("visible", true); temp_json47.put("x", 1295); - temp_json47.put("y", 345); + temp_json47.put("y", 245); temp_json47.put("width", 200); temp_json47.put("height", 40); Map temp_json48 = new HashMap<>(); @@ -458,7 +440,7 @@ temp_json49.put("text", "会社概要"); temp_json49.put("visible", true); temp_json49.put("x", 1295); - temp_json49.put("y", 220); + temp_json49.put("y", 320); temp_json49.put("width", 50); temp_json49.put("height", 20); Map temp_json50 = new HashMap<>(); @@ -498,9 +480,9 @@ temp_json54.put("text", ""); temp_json54.put("visible", true); temp_json54.put("x", 1295); - temp_json54.put("y", 245); + temp_json54.put("y", 345); temp_json54.put("width", 200); - temp_json54.put("height", 40); + temp_json54.put("height", 240); Map temp_json55 = new HashMap<>(); temp_json55.put("type", "label"); temp_json55.put("text", "事業内容1"); @@ -940,7 +922,7 @@ temp_json66.put("height", 55); Map temp_json01_ = new HashMap<>(); temp_json01_.put("type", "button"); - temp_json01_.put("text", "データ読み込み"); + temp_json01_.put("text", "データ取り込み"); temp_json01_.put("visible", true); temp_json01_.put("x", 250); temp_json01_.put("y", 85); @@ -1068,7 +1050,7 @@ temp_json80.put("text", ""); temp_json80.put("visible", true); temp_json80.put("x", 1295); - temp_json80.put("y", 345); + temp_json80.put("y", 245); temp_json80.put("width", 200); temp_json80.put("height", 40); Map temp_json81 = new HashMap<>(); @@ -1076,7 +1058,7 @@ temp_json81.put("text", "URL"); temp_json81.put("visible", true); temp_json81.put("x", 1295); - temp_json81.put("y", 320); + temp_json81.put("y", 220); temp_json81.put("width", 50); temp_json81.put("height", 20); Map temp_json82 = new HashMap<>(); @@ -1084,7 +1066,7 @@ temp_json82.put("text", "会社概要"); temp_json82.put("visible", true); temp_json82.put("x", 1295); - temp_json82.put("y", 220); + temp_json82.put("y", 320); temp_json82.put("width", 50); temp_json82.put("height", 20); Map temp_json83 = new HashMap<>(); @@ -1100,9 +1082,9 @@ temp_json84.put("text", ""); temp_json84.put("visible", true); temp_json84.put("x", 1295); - temp_json84.put("y", 245); + temp_json84.put("y", 345); temp_json84.put("width", 200); - temp_json84.put("height", 40); + temp_json84.put("height", 240); Map temp_json85 = new HashMap<>(); temp_json85.put("type", "label"); temp_json85.put("text", "事業内容1"); diff --git a/src/StartupManagementWindow.java b/src/StartupManagementWindow.java index 12da34e..eb49537 100644 --- a/src/StartupManagementWindow.java +++ b/src/StartupManagementWindow.java @@ -1,23 +1,53 @@ import javax.swing.*; +import java.awt.event.*; public class StartupManagementWindow extends JFrame { private Main main; private JPanel mainPanel; public SwingPresenter presenter; + private boolean isSaved = false; + public StartupManagementWindow(Main main) { this.main = main; + setTitle("スタートアップ企業 管理アプリ"); + mainPanel = new JPanel(); this.add(mainPanel); presenter = new SwingPresenter(main, mainPanel); - setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - setSize(1600, 900); + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e){ + if(isSaved != true){ + int result = JOptionPane.showConfirmDialog( + StartupManagementWindow.this, + "未保存のデータが消えてしまいますが、終了してもよろしいでしょうか?", + "終了確認", + JOptionPane.YES_NO_OPTION, + JOptionPane.WARNING_MESSAGE + ); + + if(result == JOptionPane.YES_OPTION){ + dispose(); + } + } else { + dispose(); + } + } + }); + setSize(1550, 865); setVisible(true); } public SwingPresenter getPresenter() { return presenter; } + + public void setSaved(boolean saved){ + this.isSaved = saved; + } } diff --git a/src/Widget.java b/src/Widget.java index 154d3db..4e47ca6 100644 --- a/src/Widget.java +++ b/src/Widget.java @@ -99,7 +99,7 @@ // 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 search1, String search2, String search3, String search4, String search5, String search6, String search7, String result, Map> businessCardManagement) { + public void updateDataFromState(String screenId, String widId, int state, String search1, String search2, String search3, String search4, String search5, String search7, String result, Map> businessCardManagement) { Map> temp_if0; if ((state==0)) { Map> temp_search0 = new HashMap<>(); diff --git a/src/Widget1.java b/src/Widget1.java index dd27f99..b80c8d1 100644 --- a/src/Widget1.java +++ b/src/Widget1.java @@ -545,14 +545,12 @@ String search4_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(search5); String search5_ = this.widget1.getText(); - this.widget1 = screen.getWidgets().getWidget(search6); - String search6_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(search7); String search7_ = this.widget1.getText(); this.widget1 = screen.getWidgets().getWidget(result); String result_ = this.widget1.getText(); Map> businessCardManagement = this.businessCardManagement.getValue(); - this.widget1.updateDataFromState(curScreen, result, this.state, search1_, search2_, search3_, search4_, search5_, search6_, search7_, result_, businessCardManagement); + this.widget1.updateDataFromState(curScreen, result, this.state, search1_, search2_, search3_, search4_, search5_, search7_, result_, 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, Search4 search4, Search5 search5, Search6 search6, Search7 search7, Result result, W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9, W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123) {