From d10b26eb0e94fee81b9ece04cdadf1cd7110a52c Mon Sep 17 00:00:00 2001 From: kohgylw Date: Mon, 6 Aug 2018 21:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BB=A4=E8=AE=BE=E7=BD=AE=E7=94=9F=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/kohgylw/kiftd/mc/UIRunner.java | 10 ++++- .../kiftd/ui/module/SettingWindow.java | 41 ++++++++++-------- .../maven/kohgylw/kiftd/pom.properties | 2 +- .../classes/kohgylw/kiftd/mc/UIRunner$1.class | Bin 1625 -> 1625 bytes .../classes/kohgylw/kiftd/mc/UIRunner$2.class | Bin 0 -> 900 bytes .../classes/kohgylw/kiftd/mc/UIRunner.class | Bin 3406 -> 3206 bytes .../kiftd/ui/module/SettingWindow$1.class | Bin 845 -> 845 bytes .../kiftd/ui/module/SettingWindow$2.class | Bin 3311 -> 3504 bytes .../kiftd/ui/module/SettingWindow$3.class | Bin 1007 -> 1007 bytes .../kiftd/ui/module/SettingWindow.class | Bin 8086 -> 8077 bytes 10 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 target/classes/kohgylw/kiftd/mc/UIRunner$2.class diff --git a/src/main/java/kohgylw/kiftd/mc/UIRunner.java b/src/main/java/kohgylw/kiftd/mc/UIRunner.java index 401b431..6fd468b 100644 --- a/src/main/java/kohgylw/kiftd/mc/UIRunner.java +++ b/src/main/java/kohgylw/kiftd/mc/UIRunner.java @@ -4,6 +4,7 @@ import kohgylw.kiftd.printer.*; import kohgylw.kiftd.ui.module.*; import kohgylw.kiftd.server.ctl.*; import kohgylw.kiftd.server.enumeration.LogLevel; +import kohgylw.kiftd.server.pojo.ServerSetting; import kohgylw.kiftd.server.util.ConfigureReader; import kohgylw.kiftd.server.util.ServerTimeUtil; import kohgylw.kiftd.ui.callback.*; @@ -65,7 +66,14 @@ public class UIRunner { return ConfigureReader.instance().getBuffSize(); } }); - ServerUIModule.setUpdateSetting((ss)->ConfigureReader.instance().doUpdate(ss)); + ServerUIModule.setUpdateSetting(new UpdateSetting() { + + @Override + public boolean update(ServerSetting s) { + // TODO 自动生成的方法存根 + return ConfigureReader.instance().doUpdate(s); + } + }); if(ConfigureReader.instance().getPropertiesStatus()==ConfigureReader.LEGAL_PROPERTIES) { ui.updateServerStatus(); } diff --git a/src/main/java/kohgylw/kiftd/ui/module/SettingWindow.java b/src/main/java/kohgylw/kiftd/ui/module/SettingWindow.java index 0c59f47..462ce5c 100644 --- a/src/main/java/kohgylw/kiftd/ui/module/SettingWindow.java +++ b/src/main/java/kohgylw/kiftd/ui/module/SettingWindow.java @@ -2,6 +2,7 @@ package kohgylw.kiftd.ui.module; import java.io.*; +import kohgylw.kiftd.printer.Printer; import kohgylw.kiftd.server.enumeration.LogLevel; import kohgylw.kiftd.server.pojo.ServerSetting; import kohgylw.kiftd.ui.callback.*; @@ -36,49 +37,51 @@ public class SettingWindow extends KiftdDynamicWindow { SettingWindow.window.setResizable(false); SettingWindow.window.setLayout(new BoxLayout(SettingWindow.window.getContentPane(), 3)); final JPanel titlebox = new JPanel(new FlowLayout(1)); - titlebox.setBorder(new EmptyBorder(0, 0, (int)(-15*proportion), 0)); + titlebox.setBorder(new EmptyBorder(0, 0, (int) (-15 * proportion), 0)); final JLabel title = new JLabel("服务器设置 Server Setting"); - title.setFont(new Font("宋体", 1, (int)(20*proportion))); + title.setFont(new Font("宋体", 1, (int) (20 * proportion))); titlebox.add(title); SettingWindow.window.add(titlebox); final JPanel settingbox = new JPanel(new GridLayout(5, 1)); settingbox.setBorder(new EtchedBorder()); final JPanel mlbox = new JPanel(new FlowLayout(1)); - mlbox.setBorder(new EmptyBorder(0, 0, (int)(-5*proportion), 0)); + mlbox.setBorder(new EmptyBorder(0, 0, (int) (-5 * proportion), 0)); final JLabel mltitle = new JLabel("必须登入(must login):"); (SettingWindow.mlinput = new JComboBox()).addItem(ML_OPEN); SettingWindow.mlinput.addItem(ML_CLOSE); - SettingWindow.mlinput.setPreferredSize(new Dimension((int)(170*proportion), (int)(20*proportion))); + SettingWindow.mlinput.setPreferredSize(new Dimension((int) (170 * proportion), (int) (20 * proportion))); mlbox.add(mltitle); mlbox.add(SettingWindow.mlinput); final JPanel portbox = new JPanel(new FlowLayout(1)); - portbox.setBorder(new EmptyBorder(0, 0, (int)(-20*proportion), 0)); + portbox.setBorder(new EmptyBorder(0, 0, (int) (-20 * proportion), 0)); final JLabel porttitle = new JLabel("端口(port):"); - (SettingWindow.portinput = new JTextField()).setPreferredSize(new Dimension((int)(120*proportion), (int)(25*proportion))); + (SettingWindow.portinput = new JTextField()) + .setPreferredSize(new Dimension((int) (120 * proportion), (int) (25 * proportion))); portbox.add(porttitle); portbox.add(SettingWindow.portinput); final JPanel bufferbox = new JPanel(new FlowLayout(1)); - bufferbox.setBorder(new EmptyBorder(0, 0, (int)(-20*proportion), 0)); + bufferbox.setBorder(new EmptyBorder(0, 0, (int) (-20 * proportion), 0)); final JLabel buffertitle = new JLabel("缓存大小(buffer):"); - (SettingWindow.bufferinput = new JTextField()).setPreferredSize(new Dimension((int)(170*proportion), (int)(25*proportion))); + (SettingWindow.bufferinput = new JTextField()) + .setPreferredSize(new Dimension((int) (170 * proportion), (int) (25 * proportion))); final JLabel bufferUnit = new JLabel("KB"); bufferbox.add(buffertitle); bufferbox.add(SettingWindow.bufferinput); bufferbox.add(bufferUnit); final JPanel logbox = new JPanel(new FlowLayout(1)); - logbox.setBorder(new EmptyBorder(0, 0, (int)(-20*proportion), 0)); + logbox.setBorder(new EmptyBorder(0, 0, (int) (-20 * proportion), 0)); final JLabel logtitle = new JLabel("日志等级(port):"); (SettingWindow.logLevelinput = new JComboBox()).addItem("记录全部(ALL)"); SettingWindow.logLevelinput.addItem("仅异常(EXCEPTION)"); SettingWindow.logLevelinput.addItem("不记录(NONE)"); - SettingWindow.logLevelinput.setPreferredSize(new Dimension((int)(170*proportion), (int)(20*proportion))); + SettingWindow.logLevelinput.setPreferredSize(new Dimension((int) (170 * proportion), (int) (20 * proportion))); logbox.add(logtitle); logbox.add(SettingWindow.logLevelinput); final JPanel filePathBox = new JPanel(new FlowLayout(1)); - filePathBox.setBorder(new EmptyBorder((int)(-5*proportion), 0, (int)(-5*proportion), 0)); + filePathBox.setBorder(new EmptyBorder((int) (-5 * proportion), 0, (int) (-5 * proportion), 0)); final JLabel filePathtitle = new JLabel("文件系统路径(file system path):"); SettingWindow.changeFileSystemPath = new JButton("选择(Choose)"); - changeFileSystemPath.setPreferredSize(new Dimension((int)(140*proportion), (int)(32*proportion))); + changeFileSystemPath.setPreferredSize(new Dimension((int) (140 * proportion), (int) (32 * proportion))); filePathBox.add(filePathtitle); filePathBox.add(SettingWindow.changeFileSystemPath); settingbox.add(portbox); @@ -88,11 +91,11 @@ public class SettingWindow extends KiftdDynamicWindow { settingbox.add(filePathBox); SettingWindow.window.add(settingbox); final JPanel buttonbox = new JPanel(new FlowLayout(1)); - buttonbox.setBorder(new EmptyBorder((int)(5*proportion), 0, (int)(-20*proportion), 0)); + buttonbox.setBorder(new EmptyBorder((int) (5 * proportion), 0, (int) (-20 * proportion), 0)); SettingWindow.update = new JButton("应用(Update)"); SettingWindow.cancel = new JButton("取消(Cancel)"); - update.setPreferredSize(new Dimension((int)(150*proportion), (int)(32*proportion))); - cancel.setPreferredSize(new Dimension((int)(150*proportion), (int)(32*proportion))); + update.setPreferredSize(new Dimension((int) (150 * proportion), (int) (32 * proportion))); + cancel.setPreferredSize(new Dimension((int) (150 * proportion), (int) (32 * proportion))); buttonbox.add(SettingWindow.update); buttonbox.add(SettingWindow.cancel); SettingWindow.window.add(buttonbox); @@ -153,7 +156,7 @@ public class SettingWindow extends KiftdDynamicWindow { window.setVisible(false); } } catch (Exception exc) { - + Printer.instance.print("错误:无法应用设置"); } } else { window.setVisible(false); @@ -186,9 +189,9 @@ public class SettingWindow extends KiftdDynamicWindow { if (SettingWindow.st != null) { SettingWindow.bufferinput.setText(SettingWindow.st.getBufferSize() / 1024 + ""); SettingWindow.portinput.setText(SettingWindow.st.getPort() + ""); - File fsp = new File(SettingWindow.st.getFileSystemPath()); - if (fsp.isDirectory()) { - changeFileSystemPathChooser.setSelectedFile(fsp); + chooserPath = new File(SettingWindow.st.getFileSystemPath()); + if (chooserPath.isDirectory()) { + changeFileSystemPathChooser.setSelectedFile(chooserPath); } switch (st.getLogLevel()) { case Event: { diff --git a/target/classes/META-INF/maven/kohgylw/kiftd/pom.properties b/target/classes/META-INF/maven/kohgylw/kiftd/pom.properties index 1c8a373..6fdb10e 100644 --- a/target/classes/META-INF/maven/kohgylw/kiftd/pom.properties +++ b/target/classes/META-INF/maven/kohgylw/kiftd/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Thu Aug 02 09:00:13 CST 2018 +#Mon Aug 06 21:57:36 CST 2018 version=1.0.2-SNAPSHOT groupId=kohgylw m2e.projectName=kiftd diff --git a/target/classes/kohgylw/kiftd/mc/UIRunner$1.class b/target/classes/kohgylw/kiftd/mc/UIRunner$1.class index 6be4c69ad26302a197b26d69da565237ba67621a..ef8f9e617f829bb94ddced84639be54daba68813 100644 GIT binary patch delta 55 zcmcb~bCYL7BnzYDxYCf{dqXVjXk&T7YKFgXoKnoV8`ByA=?0g_IW HmD$Vyy8#ai delta 55 zcmcb~bCYL7BnzX&yDC*NmrXVjdm&T7Y~KRFFZnoeE{B&{bu0g{fB HmD$Vyx-ky} diff --git a/target/classes/kohgylw/kiftd/mc/UIRunner$2.class b/target/classes/kohgylw/kiftd/mc/UIRunner$2.class new file mode 100644 index 0000000000000000000000000000000000000000..6928030ecbe046a252d32e539e45f0bbfc2c74c4 GIT binary patch literal 900 zcmaJh`~ZFwV%8X`iD*|^?ab_aGv7RZ{r>S2z;kpg6c{#UdNTf~KDaY^oCNONcSrrh zGz>-5+_g|*s89JRcNGuE?ptpv{KP_;VP_GRO4sK~dEB45qmzIqVknYChGT|uGLdof z8D$zQV$P)MlG~mPW%80?t95~&bHq^U=|EJ$uwuhPrG_F_ZB$WbD7K8l>Oh9#O*;2P z^p1N_G8fdSR>sgjImzBb$S_Yppi$}%cE4j<7Ve8 uHb2pS0VYN{!@SP$jVxXz$Aj2x;~xDNaX<5afF`{qJj4##BpHq-Bb`6X&)-%6 literal 0 HcmV?d00001 diff --git a/target/classes/kohgylw/kiftd/mc/UIRunner.class b/target/classes/kohgylw/kiftd/mc/UIRunner.class index 577162090e59e608a0a1426c3d41f48c41719f4d..6bc2243a1b0d929184d7a76e9e5ba14b5b7ab977 100644 GIT binary patch delta 720 zcmZ9INlz3}6otQ{>8k3Y423AtjX_bS#>fJ3;Q~z@AS_gzNP`15QXtx(cDINiwj<6c zJV%_B7#AeU28l+0fD3+u`~&w!|ua94VS|+Bfw?W;Y zMWblc3Fns9Sj5a)H)J7LqK=JdgmlubEljX-6zRl`igd)hnV-lnyjvgs$ShK#6whO-7k zYSLJppJ6~_L6@7}w5xBxtHEVwByy#$BXxy|}Lv60X z4Iv!T9ye-poD;b^cZ8Vd?%SO7xqCi0;OQRQoMu3DNH)ASdC$aZ1ON!h%MRn2O~Thu(-bAbB^a zOip#?6S0=6546s(e}?!pUE>(5ra3w#iU1W-%Lz$cEbaxeV+j!oSwWa;wy=(^Y-Aht zG*Kz40eLXTN@hfnbjuq>9jaN zLY+3k{w|If9M%YBob$_$lG2zMize4aJ36Bs>zi7ozQ6JsjX9x}4tHLAyg6R=hqEr4 zOg6Q}YQvjNY>r#>&@GzA_=Ze-SqUj5?CSFVqf0)_j4(FnFm^-fVZ;RqC<7H2bwiiR$;4s4xCv%}`#mzA#6AND3hr zi=ae#OrxGMR;ZY{!@mlh)q<{7pUe{ffN(wX@e%dioSPnF3yiXLl$|5&?!%ZpLi4aZ zd#IGX0>A8Wi3n*d=rA%cm5f-qN#Vn(a<%EP)K$h$g!jcYA)Y3|uVAXQ-qWz>U zU^)|$b{*4lIkj5nZPp0;UP+MUrql&T(m9r5C>ojIznY9>zZ#lQoR&#u-e$Tw$R6d; z+i`AF{&ABzXB5@q@8t4H^HRgH@ijzTmGy_i2~G;vL$B+7iqmq|td!0!33wUBH8;A> lEpEF}ANRQLM*Tcuz>OaBj6t4@G$_em@QNV{StEB@zX493t6~5E diff --git a/target/classes/kohgylw/kiftd/ui/module/SettingWindow$1.class b/target/classes/kohgylw/kiftd/ui/module/SettingWindow$1.class index 37cb396726485b9f8702f760e8084d53493b1d18..382f808a6340637272cb3d4cd55446b7b0daec22 100644 GIT binary patch delta 23 fcmX@hc9w0!2`0vj$tRiYS#ucJ8FDA{GCKeOW6lQe delta 23 fcmX@hc9w0!2`0wW$tRiYSu+{f8L}qxGCKeOV|NDT diff --git a/target/classes/kohgylw/kiftd/ui/module/SettingWindow$2.class b/target/classes/kohgylw/kiftd/ui/module/SettingWindow$2.class index 98a2cec8b983d3ff2210d3962ed50ef09a708a0e..8cd1a3ba7d57ede8c685db540d59040d5ee3fd91 100644 GIT binary patch delta 597 zcmaKo-A|HH9LGP85Inq0kqygO*4mQh4Qs2_rd_nwh2=%-y4o0_qV&Lk6f0w`R;!C< zJ!oNBW)k!Q2r3aNy@|bSZr#~cFBhp@*{N1w0P+3jr)pKu0(UM1`aIuHM?W*(B1kiAMM z>{8qwiOp^Q9cY$$Bw_yUcaIqlMm{Ol=M7T)3QVJf*EyD{^odQ z!D2+>m6_dGYIM95K*HRrD4yVcpDPsdg!EL@FNP-VJBbGMyP-jCG9HoqYQOQg?Gz?@ zu+oc-2wO?eNK*Y}+*=c;O31?JJbUI@P+LstXk(Fq0z*aOngSz9>JH@@v!)6>PGbB= zb7D%zYvxF!p;jn#u~Dpjf}Ww8v)JipJLlLzlxEIzlnc1INIRD}$z=ju5qYk1ngMQc zgAr6l86?rd5GjV4;x;Aj2$Q>1xW@wb`NSBDjEkp0orqq|Bv~fJse(+7yn4;NWnbE) qLo03&9aBt;s$~N;6vWOfg3pS`Wug0qw}Mzj*BtY_r+)1#1o{JV53Gv- delta 426 zcmXw!&r8#B7{_1VedYUY`_63+MvcJ|$!&NG35eC diff --git a/target/classes/kohgylw/kiftd/ui/module/SettingWindow$3.class b/target/classes/kohgylw/kiftd/ui/module/SettingWindow$3.class index 756f7355f88122fea325f4a8c852b19d798b2c74..e531fbdb321abc4d54e362dcb9d2c23bf322ed90 100644 GIT binary patch delta 27 jcmaFQ{+@k9AT#62$wAECoa-347}hfgGi;o^jM)NG-aBSSnB16Ujqc3eG!6n;I=& z&;;z^6lH}p*XDA%Dc6yt5ClU}Hd9@25hU>zIrkx4F_C?<;vve`}!4ftud^aPvfCBRwo_=-okNIv6i;T8of z@F@RL$SOtRB`AsZUO`Hvf~~TXQmN-LIYgPfNx7V)LWX%<&QsYVm)Ry$RLKI>vd9y% z#C8?U4)qW_RT@t!KToLwYE(5(t0qF~0MDo}&#Gh8s*~(e=crQ`*sUTwr)GFwEwV=~ zu~)6IPbX8aGilIyH0mOnbQ#UMniq5p`*j^J>IN!b(jC04dwE40Ue&|2=m}oae{ewm zORHX@P5)23qv&uvyzXqE%gN?zCrHF8=c-vwTJU^h-|iaGjG6i5kmm*u@*DB|ZUQOw zoulW0tJ9`Eul8)9)*k^=86XXvQsDv9&(y z`Kf+et51DLV$6JMS!@YWc3vyth7fP2RFw#^h~b zR6<)W*fYgeVx_I}tu|RDnR971J>#~|2|MlYsAiHqOtGKuX=R3fW-;7kkU56oCst-E*Gr^M0PwRduK; z`PP5Kqrg%*;X(-kvnU~OxokYe(OY9X%wH+X5&E!dq*K|CTK zd!&(qq&PWb3BeO>YioUD)%MM?SZmBBN9WT0o|>H)%dKl~e{I(emmCxPbCkL8;DqG& z?@X(6I>Xf22K+cY!~;Bxk3|%a!%`lhl3c0@&`2Iz$>%L=*+U`62y&VtK4URou!OHD zW|9*A;8E@q5)WZXqf|=mV3m}~YL-a@%jI=e$eWbQaVq32m2!#4I%S;4Ws;RLMU_e* zqSARn`Keap+?1cT6GXr@3BUmq*k4$PWAJQy2e^H#j|Rfdi5{s zbQbG%4$tW#p4VX-bUBSWLX)mxgI>!<-N*}i8_jwTWiM*OCViY1J<3b^7hcwP*{r8| zMbEIsQM~H7X>~H#?gTjFlyb?b;If&?oOEBYZ+4Xg2F#tTsC$To{6Gpnn#JA*_fN#} zGs*mF_IWEL(Omb2WzfucLy}~IzK|*OdCWFno@AJAUr18TnB|%+H*2|clbap3mZt1? zWudu~U7i$S0b;i_)+bFj7%@5iXnAdLKz8>M-^Y}_bqvbe);J{Z2m=x=K5xBYnZ;b3 zwkWX(Sa{7je@*AG?eBA|j}WmNtY?%azNCe5_A