• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

カルネージハートエクサのチームデータ編集ツール JAVAベース


Commit MetaInfo

Revision10 (tree)
Time2015-06-06 03:50:58
Authormanjihq

Log Message

テキストファイル出力機能を追加

Change Summary

Incremental Difference

--- chexaFormation/trunk/src/chexaformation/cheTeamData.java (revision 9)
+++ chexaFormation/trunk/src/chexaformation/cheTeamData.java (revision 10)
@@ -609,4 +609,34 @@
609609 retstr += (data_name == null) ? "" : data_name.getName();
610610 return retstr;
611611 }
612+
613+ /**
614+ * ファイル出力用テキスト作成
615+ *
616+ * @param dname 出力に付加するデータ名(nullの時は読み込み元ファイル名)
617+ * @return 作成した文字列
618+ */
619+ public String make_text(String dname) {
620+ String retstr;
621+ int i;
622+ retstr = (dname != null) ? dname : data_name.getName();
623+ retstr += '\t';
624+ retstr += team_name;
625+ retstr += '\t';
626+ retstr += '(' + owner_name + ')';
627+ for (i = 0; i < 3; i++) {
628+ retstr += '\t';
629+ if (oke[i] != null) {
630+ retstr += oke[i].get_name();
631+ retstr += '\t';
632+ retstr += '[' + oke[i].get_bodyname() + ']';
633+ retstr += '\t';
634+ retstr += member_pos(i);
635+ } else {
636+ retstr += '\t';
637+ retstr += '\t';
638+ }
639+ }
640+ return retstr;
641+ }
612642 }
--- chexaFormation/trunk/src/chexaformation/TeamListPanel.java (revision 9)
+++ chexaFormation/trunk/src/chexaformation/TeamListPanel.java (revision 10)
@@ -7,6 +7,12 @@
77
88 import java.awt.Frame;
99 import java.io.File;
10+import java.io.FileOutputStream;
11+import java.io.IOException;
12+import java.io.OutputStreamWriter;
13+import java.io.PrintWriter;
14+import java.util.logging.Level;
15+import java.util.logging.Logger;
1016 import javax.swing.DefaultListModel;
1117 import javax.swing.JFileChooser;
1218 import javax.swing.JFrame;
@@ -104,9 +110,10 @@
104110 pos8 = new javax.swing.JLabel();
105111 loadCHE = new javax.swing.JButton();
106112 clearCHE = new javax.swing.JButton();
107- exitGUI = new javax.swing.JButton();
108113 teamIcon = new javax.swing.JLabel();
114+ textOutTeam = new javax.swing.JButton();
109115 removeCHE = new javax.swing.JButton();
116+ exitGUI = new javax.swing.JButton();
110117
111118 teamList.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
112119 teamList.setModel(teamdata);
@@ -222,14 +229,6 @@
222229 }
223230 });
224231
225- exitGUI.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
226- exitGUI.setText(bundle.getString("exitAPP")); // NOI18N
227- exitGUI.addActionListener(new java.awt.event.ActionListener() {
228- public void actionPerformed(java.awt.event.ActionEvent evt) {
229- exitGUIActionPerformed(evt);
230- }
231- });
232-
233232 teamIcon.setBackground(java.awt.Color.white);
234233 teamIcon.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
235234 teamIcon.setMaximumSize(new java.awt.Dimension(34, 34));
@@ -236,6 +235,14 @@
236235 teamIcon.setMinimumSize(new java.awt.Dimension(34, 34));
237236 teamIcon.setPreferredSize(new java.awt.Dimension(34, 34));
238237
238+ textOutTeam.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
239+ textOutTeam.setText(bundle.getString("textOut")); // NOI18N
240+ textOutTeam.addActionListener(new java.awt.event.ActionListener() {
241+ public void actionPerformed(java.awt.event.ActionEvent evt) {
242+ textOutTeamActionPerformed(evt);
243+ }
244+ });
245+
239246 removeCHE.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
240247 removeCHE.setText(bundle.getString("removeCHE")); // NOI18N
241248 removeCHE.addActionListener(new java.awt.event.ActionListener() {
@@ -244,6 +251,14 @@
244251 }
245252 });
246253
254+ exitGUI.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
255+ exitGUI.setText(bundle.getString("exitAPP")); // NOI18N
256+ exitGUI.addActionListener(new java.awt.event.ActionListener() {
257+ public void actionPerformed(java.awt.event.ActionEvent evt) {
258+ exitGUIActionPerformed(evt);
259+ }
260+ });
261+
247262 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
248263 this.setLayout(layout);
249264 layout.setHorizontalGroup(
@@ -251,25 +266,24 @@
251266 .addGroup(layout.createSequentialGroup()
252267 .addContainerGap()
253268 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
269+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE)
254270 .addGroup(layout.createSequentialGroup()
255- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE)
256- .addContainerGap())
257- .addGroup(layout.createSequentialGroup()
258271 .addComponent(loadCHE)
259272 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
260273 .addComponent(removeCHE)
261- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 146, Short.MAX_VALUE)
274+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
275+ .addComponent(textOutTeam)
276+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
262277 .addComponent(clearCHE)
263- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
264- .addComponent(exitGUI)
265- .addGap(70, 70, 70))
278+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
279+ .addComponent(exitGUI))
266280 .addGroup(layout.createSequentialGroup()
267281 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE)
268282 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
269283 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
270284 .addComponent(teamIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
271- .addComponent(positionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
272- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
285+ .addComponent(positionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
286+ .addContainerGap())
273287 );
274288 layout.setVerticalGroup(
275289 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -285,9 +299,11 @@
285299 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE))
286300 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
287301 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
288- .addComponent(clearCHE, javax.swing.GroupLayout.Alignment.TRAILING)
289- .addComponent(exitGUI, javax.swing.GroupLayout.Alignment.TRAILING)
290302 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
303+ .addComponent(clearCHE)
304+ .addComponent(exitGUI)
305+ .addComponent(textOutTeam))
306+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
291307 .addComponent(loadCHE)
292308 .addComponent(removeCHE)))
293309 .addContainerGap())
@@ -389,6 +405,52 @@
389405 }
390406 }//GEN-LAST:event_removeCHEActionPerformed
391407
408+ private void textOutTeamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textOutTeamActionPerformed
409+ int i;
410+ JFileChooser fdlg = new JFileChooser(Main.cheTextDataDir);
411+ String filterTitle
412+ = java.util.ResourceBundle.getBundle("chexaformation/resource").
413+ getString("filterTitleText");
414+ FileNameExtensionFilter ffilter
415+ = new FileNameExtensionFilter(filterTitle, "txt");
416+ fdlg.setFileFilter(ffilter);
417+ if (fdlg.showSaveDialog(getRootPane().getParent())
418+ == JFileChooser.APPROVE_OPTION) {
419+ File ifile = fdlg.getSelectedFile();
420+ if (ifile.exists() == true) {
421+ String wktitle;
422+ String wkmesg;
423+ wktitle = java.util.ResourceBundle.getBundle(
424+ "chexaformation/resource").
425+ getString("titleSaveText");
426+ wkmesg = java.util.ResourceBundle.getBundle(
427+ "chexaformation/resource").
428+ getString("confirmExistText");
429+ if (Main.confirm_box((Frame) (getRootPane().getParent()),
430+ wktitle, wkmesg, "") == false) {
431+ return;
432+ }
433+ }
434+ try {
435+ PrintWriter w = new PrintWriter(
436+ new OutputStreamWriter(
437+ new FileOutputStream(ifile.getAbsolutePath()),
438+ "UTF-8"));
439+ Main.cheTextDataDir = ifile.getParent();
440+ for (i = 0; i < teamdata.size(); i++) {
441+ cheTeamData team = (cheTeamData) teamdata.get(i);
442+ if (team != null) {
443+ w.println(team.make_text(null));
444+ }
445+ }
446+ w.close();
447+ } catch (IOException ex) {
448+ Logger.getLogger(MatchDataPanel.class.getName()).
449+ log(Level.SEVERE, null, ex);
450+ }
451+ }
452+ }//GEN-LAST:event_textOutTeamActionPerformed
453+
392454 // Variables declaration - do not modify//GEN-BEGIN:variables
393455 private javax.swing.JButton clearCHE;
394456 private javax.swing.JButton exitGUI;
@@ -409,5 +471,6 @@
409471 private javax.swing.JButton removeCHE;
410472 private javax.swing.JLabel teamIcon;
411473 private javax.swing.JList teamList;
474+ private javax.swing.JButton textOutTeam;
412475 // End of variables declaration//GEN-END:variables
413476 }
--- chexaFormation/trunk/src/chexaformation/MatchDataPanel.java (revision 9)
+++ chexaFormation/trunk/src/chexaformation/MatchDataPanel.java (revision 10)
@@ -7,6 +7,12 @@
77
88 import java.awt.Dialog;
99 import java.io.File;
10+import java.io.FileOutputStream;
11+import java.io.IOException;
12+import java.io.OutputStreamWriter;
13+import java.io.PrintWriter;
14+import java.util.logging.Level;
15+import java.util.logging.Logger;
1016 import javax.swing.DefaultListModel;
1117 import javax.swing.JDialog;
1218 import javax.swing.JFileChooser;
@@ -190,6 +196,7 @@
190196 addTeam = new javax.swing.JButton();
191197 delTeam = new javax.swing.JButton();
192198 saveMatch = new javax.swing.JButton();
199+ outTextTeam = new javax.swing.JButton();
193200 closeButton = new javax.swing.JButton();
194201
195202 titleMatch.setFont(new java.awt.Font("Monospaced", 0, 15)); // NOI18N
@@ -231,6 +238,14 @@
231238 }
232239 });
233240
241+ outTextTeam.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
242+ outTextTeam.setText(bundle.getString("textOut")); // NOI18N
243+ outTextTeam.addActionListener(new java.awt.event.ActionListener() {
244+ public void actionPerformed(java.awt.event.ActionEvent evt) {
245+ outTextTeamActionPerformed(evt);
246+ }
247+ });
248+
234249 closeButton.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
235250 closeButton.setText(bundle.getString("closeWindow")); // NOI18N
236251 closeButton.addActionListener(new java.awt.event.ActionListener() {
@@ -253,7 +268,9 @@
253268 .addComponent(delTeam)
254269 .addGap(18, 18, 18)
255270 .addComponent(saveMatch)
256- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 149, Short.MAX_VALUE)
271+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
272+ .addComponent(outTextTeam)
273+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
257274 .addComponent(closeButton))
258275 .addGroup(layout.createSequentialGroup()
259276 .addComponent(titleMatch)
@@ -275,8 +292,9 @@
275292 .addComponent(addTeam)
276293 .addComponent(delTeam)
277294 .addComponent(saveMatch)
278- .addComponent(closeButton))
279- .addContainerGap(14, Short.MAX_VALUE))
295+ .addComponent(closeButton)
296+ .addComponent(outTextTeam))
297+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
280298 );
281299 }// </editor-fold>//GEN-END:initComponents
282300
@@ -356,6 +374,55 @@
356374 JDialog dlg = (JDialog) (getRootPane().getParent());
357375 dlg.dispose();
358376 }//GEN-LAST:event_closeButtonActionPerformed
377+
378+ private void outTextTeamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outTextTeamActionPerformed
379+ int i;
380+ JFileChooser fdlg = new JFileChooser(Main.cheTextDataDir);
381+ String filterTitle
382+ = java.util.ResourceBundle.getBundle("chexaformation/resource").
383+ getString("filterTitleText");
384+ FileNameExtensionFilter ffilter
385+ = new FileNameExtensionFilter(filterTitle, "txt");
386+ fdlg.setFileFilter(ffilter);
387+ if (fdlg.showSaveDialog(getRootPane().getParent())
388+ == JFileChooser.APPROVE_OPTION) {
389+ File ifile = fdlg.getSelectedFile();
390+ if (ifile.exists() == true) {
391+ String wktitle;
392+ String wkmesg;
393+ wktitle = java.util.ResourceBundle.getBundle(
394+ "chexaformation/resource").
395+ getString("titleSaveText");
396+ wkmesg = java.util.ResourceBundle.getBundle(
397+ "chexaformation/resource").
398+ getString("confirmExistText");
399+ if (Main.confirm_box((Dialog) (getRootPane().getParent()),
400+ wktitle, wkmesg, "") == false) {
401+ return;
402+ }
403+ }
404+ try {
405+ PrintWriter w = new PrintWriter(
406+ new OutputStreamWriter(
407+ new FileOutputStream(ifile.getAbsolutePath()),
408+ "UTF-8"));
409+ Main.cheTextDataDir = ifile.getParent();
410+ normalize_teamlist();
411+ for (i = 0; i < matchdata.get_team_max(); i++) {
412+ cheTeamData team = matchdata.get_team(i);
413+ if (team != null) {
414+ File wkfile = new File(matchdata.get_fname());
415+ w.println(team.make_text(wkfile.getName()));
416+ }
417+ }
418+ w.close();
419+ } catch (IOException ex) {
420+ Logger.getLogger(MatchDataPanel.class.getName()).
421+ log(Level.SEVERE, null, ex);
422+ }
423+ }
424+ }//GEN-LAST:event_outTextTeamActionPerformed
425+
359426 // Variables declaration - do not modify//GEN-BEGIN:variables
360427 private javax.swing.JButton addTeam;
361428 private javax.swing.JButton closeButton;
@@ -362,6 +429,7 @@
362429 private javax.swing.JButton delTeam;
363430 private javax.swing.JScrollPane jScrollPane1;
364431 private javax.swing.JTextField matchName;
432+ private javax.swing.JButton outTextTeam;
365433 private javax.swing.JButton saveMatch;
366434 private javax.swing.JList teamList;
367435 private javax.swing.JLabel titleMatch;
--- chexaFormation/trunk/src/chexaformation/Main.java (revision 9)
+++ chexaFormation/trunk/src/chexaformation/Main.java (revision 10)
@@ -12,9 +12,10 @@
1212 */
1313 public class Main {
1414
15- static public final String app_version = "Version 1.1";
15+ static public final String app_version = "Version 1.2";
1616 static public String cheDataDir = null;
1717 static public String cheMatchDataDir = null;
18+ static public String cheTextDataDir = null;
1819
1920 /**
2021 * メッセージボックス表示
--- chexaFormation/trunk/src/chexaformation/cheOkeData.java (revision 9)
+++ chexaFormation/trunk/src/chexaformation/cheOkeData.java (revision 10)
@@ -188,6 +188,15 @@
188188 return okeno;
189189 }
190190
191+ /**
192+ * ボディ名称を取得
193+ *
194+ * @return ボディ名
195+ */
196+ public String get_bodyname() {
197+ return bodylist.get(realData[0x270]);
198+ }
199+
191200 @Override
192201 public String toString() {
193202 String retstr = get_name();
@@ -197,7 +206,7 @@
197206 }
198207 retstr += "(";
199208 try {
200- retstr += bodylist.get(realData[0x270]);
209+ retstr += get_bodyname();
201210 } catch (IndexOutOfBoundsException e) {
202211 retstr += "?";
203212 }