カルネージハートエクサのチームデータ編集ツール JAVAベース
マッチデータ編集機能の追加
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | */ |
| 13 | 13 | public class Main { |
| 14 | 14 | |
| 15 | - static public final String app_version = "Version 1.2"; | |
| 15 | + static public final String app_version = "Version 2.0"; | |
| 16 | 16 | static public String cheDataDir = null; |
| 17 | 17 | static public String cheMatchDataDir = null; |
| 18 | 18 | static public String cheTextDataDir = null; |
| @@ -39,6 +39,7 @@ | ||
| 39 | 39 | |
| 40 | 40 | openTeam = new javax.swing.JButton(); |
| 41 | 41 | makeMatchData = new javax.swing.JButton(); |
| 42 | + editMatchData = new javax.swing.JButton(); | |
| 42 | 43 | mainPanel = new chexaformation.TeamListPanel(); |
| 43 | 44 | |
| 44 | 45 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
| @@ -62,6 +63,14 @@ | ||
| 62 | 63 | } |
| 63 | 64 | }); |
| 64 | 65 | |
| 66 | + editMatchData.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N | |
| 67 | + editMatchData.setText(bundle.getString("editMatchData")); // NOI18N | |
| 68 | + editMatchData.addActionListener(new java.awt.event.ActionListener() { | |
| 69 | + public void actionPerformed(java.awt.event.ActionEvent evt) { | |
| 70 | + editMatchDataActionPerformed(evt); | |
| 71 | + } | |
| 72 | + }); | |
| 73 | + | |
| 65 | 74 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); |
| 66 | 75 | getContentPane().setLayout(layout); |
| 67 | 76 | layout.setHorizontalGroup( |
| @@ -71,8 +80,10 @@ | ||
| 71 | 80 | .addComponent(openTeam) |
| 72 | 81 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
| 73 | 82 | .addComponent(makeMatchData) |
| 74 | - .addContainerGap(214, Short.MAX_VALUE)) | |
| 75 | - .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE) | |
| 83 | + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
| 84 | + .addComponent(editMatchData) | |
| 85 | + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) | |
| 86 | + .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE) | |
| 76 | 87 | ); |
| 77 | 88 | layout.setVerticalGroup( |
| 78 | 89 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
| @@ -79,7 +90,8 @@ | ||
| 79 | 90 | .addGroup(layout.createSequentialGroup() |
| 80 | 91 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) |
| 81 | 92 | .addComponent(openTeam) |
| 82 | - .addComponent(makeMatchData)) | |
| 93 | + .addComponent(makeMatchData) | |
| 94 | + .addComponent(editMatchData)) | |
| 83 | 95 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
| 84 | 96 | .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)) |
| 85 | 97 | ); |
| @@ -122,12 +134,15 @@ | ||
| 122 | 134 | getString("titleMatchWindow"), |
| 123 | 135 | false); |
| 124 | 136 | che.set_fname("NEWMATCH.CHE"); |
| 137 | + che.set_match_name("マッチデータ"); | |
| 125 | 138 | che.clear_oke(); |
| 126 | - dlg.add(new MatchDataPanel(che)); | |
| 139 | + MatchDataPanel panel = new MatchDataPanel(che); | |
| 140 | + dlg.add(panel); | |
| 127 | 141 | dlg.pack(); |
| 128 | 142 | Point pos = this.getLocation(); |
| 129 | 143 | pos.x += this.getWidth(); |
| 130 | 144 | dlg.setLocation(pos); |
| 145 | + panel.update_title(); | |
| 131 | 146 | dlg.setVisible(true); |
| 132 | 147 | } else { |
| 133 | 148 | Main.mesg_box(this, |
| @@ -148,7 +163,59 @@ | ||
| 148 | 163 | } |
| 149 | 164 | } |
| 150 | 165 | }//GEN-LAST:event_makeMatchDataActionPerformed |
| 166 | + | |
| 167 | + private void editMatchDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editMatchDataActionPerformed | |
| 168 | + // TODO add your handling code here: | |
| 169 | + int nret; | |
| 170 | + JFileChooser fdlg = new JFileChooser(Main.cheMatchDataDir); | |
| 171 | + String filterTitle | |
| 172 | + = java.util.ResourceBundle.getBundle("chexaformation/resource"). | |
| 173 | + getString("filterTitleCHE"); | |
| 174 | + FileNameExtensionFilter ffilter | |
| 175 | + = new FileNameExtensionFilter(filterTitle, "CHE"); | |
| 176 | + fdlg.setFileFilter(ffilter); | |
| 177 | + nret = fdlg.showOpenDialog(getRootPane().getParent()); | |
| 178 | + if (nret == JFileChooser.APPROVE_OPTION) { | |
| 179 | + File ifile = fdlg.getSelectedFile(); | |
| 180 | + cheFile che = new cheFile(ifile.getAbsolutePath()); | |
| 181 | + Main.cheMatchDataDir = ifile.getParent(); | |
| 182 | + if (che.load() == true) { | |
| 183 | + if (che.is_teamfile() == false) { | |
| 184 | + JDialog dlg = new JDialog(this, | |
| 185 | + java.util.ResourceBundle.getBundle( | |
| 186 | + "chexaformation/resource"). | |
| 187 | + getString("titleMatchWindow"), | |
| 188 | + false); | |
| 189 | + MatchDataPanel panel = new MatchDataPanel(che); | |
| 190 | + dlg.add(panel); | |
| 191 | + dlg.pack(); | |
| 192 | + Point pos = this.getLocation(); | |
| 193 | + pos.x += this.getWidth(); | |
| 194 | + dlg.setLocation(pos); | |
| 195 | + panel.update_title(); | |
| 196 | + dlg.setVisible(true); | |
| 197 | + } else { | |
| 198 | + Main.mesg_box(this, | |
| 199 | + java.util.ResourceBundle.getBundle( | |
| 200 | + "chexaformation/resource").getString("loadCHE"), | |
| 201 | + java.util.ResourceBundle.getBundle( | |
| 202 | + "chexaformation/resource"). | |
| 203 | + getString("errNotMatchData"), | |
| 204 | + ifile.getAbsolutePath()); | |
| 205 | + } | |
| 206 | + } else { | |
| 207 | + Main.mesg_box(this, | |
| 208 | + java.util.ResourceBundle.getBundle( | |
| 209 | + "chexaformation/resource").getString("loadCHE"), | |
| 210 | + java.util.ResourceBundle.getBundle( | |
| 211 | + "chexaformation/resource").getString("faileReadCHE"), | |
| 212 | + ifile.getAbsolutePath()); | |
| 213 | + } | |
| 214 | + } | |
| 215 | + }//GEN-LAST:event_editMatchDataActionPerformed | |
| 216 | + | |
| 151 | 217 | // Variables declaration - do not modify//GEN-BEGIN:variables |
| 218 | + private javax.swing.JButton editMatchData; | |
| 152 | 219 | private chexaformation.TeamListPanel mainPanel; |
| 153 | 220 | private javax.swing.JButton makeMatchData; |
| 154 | 221 | private javax.swing.JButton openTeam; |