• 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

Revisão12 (tree)
Hora2015-06-09 18:01:27
Autormanjihq

Mensagem de Log

マッチファイルを基準ファイル無しで新規作成出来るようにした

Mudança Sumário

Diff

--- chexaFormation/trunk/src/chexaformation/mainForm.java (revision 11)
+++ chexaFormation/trunk/src/chexaformation/mainForm.java (revision 12)
@@ -7,6 +7,10 @@
77
88 import java.awt.Point;
99 import java.io.File;
10+import java.io.IOException;
11+import java.io.InputStream;
12+import java.util.logging.Level;
13+import java.util.logging.Logger;
1014 import javax.swing.JDialog;
1115 import javax.swing.JFileChooser;
1216 import javax.swing.filechooser.FileNameExtensionFilter;
@@ -113,55 +117,33 @@
113117 }//GEN-LAST:event_openTeamActionPerformed
114118
115119 private void makeMatchDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_makeMatchDataActionPerformed
116- int nret;
117- JFileChooser fdlg = new JFileChooser(Main.cheMatchDataDir);
118- String filterTitle
119- = java.util.ResourceBundle.getBundle("chexaformation/resource").
120- getString("filterTitleCHE");
121- FileNameExtensionFilter ffilter
122- = new FileNameExtensionFilter(filterTitle, "CHE");
123- fdlg.setFileFilter(ffilter);
124- nret = fdlg.showOpenDialog(getRootPane().getParent());
125- if (nret == JFileChooser.APPROVE_OPTION) {
126- File ifile = fdlg.getSelectedFile();
127- cheFile che = new cheFile(ifile.getAbsolutePath());
128- Main.cheMatchDataDir = ifile.getParent();
129- if (che.load() == true) {
130- if (che.is_teamfile() == false) {
131- JDialog dlg = new JDialog(this,
132- java.util.ResourceBundle.getBundle(
133- "chexaformation/resource").
134- getString("titleMatchWindow"),
135- false);
136- che.set_fname("NEWMATCH.CHE");
137- che.set_match_name("マッチデータ");
138- che.clear_oke();
139- MatchDataPanel panel = new MatchDataPanel(che);
140- dlg.add(panel);
141- dlg.pack();
142- Point pos = this.getLocation();
143- pos.x += this.getWidth();
144- dlg.setLocation(pos);
145- panel.update_title();
146- dlg.setVisible(true);
147- } else {
148- Main.mesg_box(this,
149- java.util.ResourceBundle.getBundle(
150- "chexaformation/resource").getString("loadCHE"),
151- java.util.ResourceBundle.getBundle(
152- "chexaformation/resource").
153- getString("errNotMatchData"),
154- ifile.getAbsolutePath());
155- }
156- } else {
157- Main.mesg_box(this,
158- java.util.ResourceBundle.getBundle(
159- "chexaformation/resource").getString("loadCHE"),
160- java.util.ResourceBundle.getBundle(
161- "chexaformation/resource").getString("faileReadCHE"),
162- ifile.getAbsolutePath());
120+ byte matchdata[] = new byte[336];
121+ cheFile che = null;
122+ try {
123+ InputStream ifs = getClass().getResourceAsStream("match.bin");
124+ if (ifs.read(matchdata) == matchdata.length) {
125+ che = new cheFile(matchdata);
163126 }
127+ } catch (IOException ex) {
128+ Logger.getLogger(mainForm.class.getName()).
129+ log(Level.SEVERE, null, ex);
164130 }
131+ if (che != null) {
132+ JDialog dlg = new JDialog(this,
133+ java.util.ResourceBundle.getBundle(
134+ "chexaformation/resource").
135+ getString("titleMatchWindow"),
136+ false);
137+ che.set_match_name("マッチデータ");
138+ MatchDataPanel panel = new MatchDataPanel(che);
139+ dlg.add(panel);
140+ dlg.pack();
141+ Point pos = this.getLocation();
142+ pos.x += this.getWidth();
143+ dlg.setLocation(pos);
144+ panel.update_title();
145+ dlg.setVisible(true);
146+ }
165147 }//GEN-LAST:event_makeMatchDataActionPerformed
166148
167149 private void editMatchDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editMatchDataActionPerformed
--- chexaFormation/trunk/src/chexaformation/cheFile.java (revision 11)
+++ chexaFormation/trunk/src/chexaformation/cheFile.java (revision 12)
@@ -111,6 +111,24 @@
111111 /**
112112 * コンストラクタ
113113 *
114+ * @param d マッチデータパラメータ
115+ */
116+ public cheFile(byte d[]) {
117+ fname = "NEWMATCH.CHE";
118+ team_max = 16;
119+ oke_max = 32;
120+ bteamfile = false;
121+ match_data = new byte[336];
122+ if (d.length >= 336) {
123+ System.arraycopy(d, 0, match_data, 0, 336);
124+ }
125+ team = new cheTeamData[team_max];
126+ oke = new cheOkeData[oke_max];
127+ }
128+
129+ /**
130+ * コンストラクタ
131+ *
114132 * @param s CHEファイル名
115133 */
116134 public cheFile(String s) {