テキストの各行をキーと値に分離し、複数テキストファイルを読み込み、キーを突き合わせ照合し、その結果を表示するGUIユーテリティです。
リビジョン | 542f226c3b45ac859c1bd14906361eef947a4573 (tree) |
---|---|
日時 | 2011-10-19 02:22:22 |
作者 | seraphy <seraphy@192....> |
コミッター | seraphy |
・レイアウト、リソースの修正
@@ -10,12 +10,12 @@ | ||
10 | 10 | <Layout> |
11 | 11 | <DimensionLayout dim="0"> |
12 | 12 | <Group type="103" groupAlignment="0" attributes="0"> |
13 | - <Component id="dataViewTableSP" alignment="0" pref="464" max="32767" attributes="0"/> | |
13 | + <Component id="dataViewTableSP" alignment="0" pref="435" max="32767" attributes="0"/> | |
14 | 14 | </Group> |
15 | 15 | </DimensionLayout> |
16 | 16 | <DimensionLayout dim="1"> |
17 | 17 | <Group type="103" groupAlignment="0" attributes="0"> |
18 | - <Component id="dataViewTableSP" alignment="0" pref="380" max="32767" attributes="0"/> | |
18 | + <Component id="dataViewTableSP" alignment="0" pref="391" max="32767" attributes="0"/> | |
19 | 19 | </Group> |
20 | 20 | </DimensionLayout> |
21 | 21 | </Layout> |
@@ -283,39 +283,36 @@ | ||
283 | 283 | <Properties> |
284 | 284 | <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
285 | 285 | <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> |
286 | - <EmptyBorder bottom="1" left="1" right="32" top="1"/> | |
286 | + <EmptyBorder bottom="1" left="1" right="24" top="1"/> | |
287 | 287 | </Border> |
288 | 288 | </Property> |
289 | 289 | <Property name="name" type="java.lang.String" value="statusPanel" noResource="true"/> |
290 | + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> | |
291 | + <Dimension value="[404, 22]"/> | |
292 | + </Property> | |
290 | 293 | </Properties> |
291 | 294 | |
292 | 295 | <Layout> |
293 | 296 | <DimensionLayout dim="0"> |
294 | 297 | <Group type="103" groupAlignment="0" attributes="0"> |
295 | - <Group type="102" attributes="0"> | |
298 | + <Group type="102" alignment="1" attributes="0"> | |
299 | + <Component id="statusMessageLabel" pref="225" max="32767" attributes="0"/> | |
296 | 300 | <EmptySpace max="-2" attributes="0"/> |
297 | - <Group type="103" groupAlignment="0" attributes="0"> | |
298 | - <Group type="102" attributes="0"> | |
299 | - <Component id="statusMessageLabel" min="-2" max="-2" attributes="0"/> | |
300 | - <EmptySpace pref="260" max="32767" attributes="0"/> | |
301 | - <Component id="statusAnimationLabel" min="-2" max="-2" attributes="0"/> | |
302 | - <EmptySpace min="-2" pref="151" max="-2" attributes="0"/> | |
303 | - </Group> | |
304 | - <Component id="progressBar" alignment="1" min="-2" max="-2" attributes="0"/> | |
305 | - </Group> | |
301 | + <Component id="progressBar" min="-2" max="-2" attributes="0"/> | |
302 | + <EmptySpace max="-2" attributes="0"/> | |
303 | + <Component id="statusAnimationLabel" min="-2" pref="19" max="-2" attributes="0"/> | |
306 | 304 | </Group> |
307 | 305 | </Group> |
308 | 306 | </DimensionLayout> |
309 | 307 | <DimensionLayout dim="1"> |
310 | 308 | <Group type="103" groupAlignment="0" attributes="0"> |
311 | - <Group type="102" alignment="1" attributes="0"> | |
312 | - <Component id="progressBar" min="-2" max="-2" attributes="0"/> | |
313 | - <EmptySpace max="32767" attributes="0"/> | |
314 | - <Group type="103" groupAlignment="3" attributes="0"> | |
315 | - <Component id="statusMessageLabel" alignment="3" min="-2" max="-2" attributes="0"/> | |
316 | - <Component id="statusAnimationLabel" alignment="3" min="-2" max="-2" attributes="0"/> | |
309 | + <Group type="102" attributes="0"> | |
310 | + <Group type="103" groupAlignment="0" attributes="0"> | |
311 | + <Component id="statusAnimationLabel" alignment="0" min="-2" pref="18" max="-2" attributes="0"/> | |
312 | + <Component id="progressBar" alignment="0" min="-2" max="-2" attributes="0"/> | |
313 | + <Component id="statusMessageLabel" alignment="0" min="-2" pref="19" max="-2" attributes="0"/> | |
317 | 314 | </Group> |
318 | - <EmptySpace min="-2" pref="3" max="-2" attributes="0"/> | |
315 | + <EmptySpace max="32767" attributes="0"/> | |
319 | 316 | </Group> |
320 | 317 | </Group> |
321 | 318 | </DimensionLayout> |
@@ -384,6 +381,6 @@ | ||
384 | 381 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
385 | 382 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
386 | 383 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> |
387 | - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-77,0,0,1,-48"/> | |
384 | + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-77,0,0,1,-77"/> | |
388 | 385 | </AuxValues> |
389 | 386 | </Form> |
@@ -282,11 +282,11 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
282 | 282 | mainPanel.setLayout(mainPanelLayout); |
283 | 283 | mainPanelLayout.setHorizontalGroup( |
284 | 284 | mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
285 | - .addComponent(dataViewTableSP, javax.swing.GroupLayout.DEFAULT_SIZE, 464, Short.MAX_VALUE) | |
285 | + .addComponent(dataViewTableSP, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE) | |
286 | 286 | ); |
287 | 287 | mainPanelLayout.setVerticalGroup( |
288 | 288 | mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
289 | - .addComponent(dataViewTableSP, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) | |
289 | + .addComponent(dataViewTableSP, javax.swing.GroupLayout.DEFAULT_SIZE, 391, Short.MAX_VALUE) | |
290 | 290 | ); |
291 | 291 | |
292 | 292 | menuBar.setName("menuBar"); // NOI18N |
@@ -428,8 +428,9 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
428 | 428 | |
429 | 429 | menuBar.add(helpMenu); |
430 | 430 | |
431 | - statusPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 32)); | |
431 | + statusPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 24)); | |
432 | 432 | statusPanel.setName("statusPanel"); // NOI18N |
433 | + statusPanel.setPreferredSize(new java.awt.Dimension(404, 22)); | |
433 | 434 | |
434 | 435 | statusMessageLabel.setName("statusMessageLabel"); // NOI18N |
435 | 436 |
@@ -442,25 +443,21 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
442 | 443 | statusPanel.setLayout(statusPanelLayout); |
443 | 444 | statusPanelLayout.setHorizontalGroup( |
444 | 445 | statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
445 | - .addGroup(statusPanelLayout.createSequentialGroup() | |
446 | - .addContainerGap() | |
447 | - .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
448 | - .addGroup(statusPanelLayout.createSequentialGroup() | |
449 | - .addComponent(statusMessageLabel) | |
450 | - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 260, Short.MAX_VALUE) | |
451 | - .addComponent(statusAnimationLabel) | |
452 | - .addGap(151, 151, 151)) | |
453 | - .addComponent(progressBar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) | |
446 | + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup() | |
447 | + .addComponent(statusMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE) | |
448 | + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
449 | + .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
450 | + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
451 | + .addComponent(statusAnimationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
454 | 452 | ); |
455 | 453 | statusPanelLayout.setVerticalGroup( |
456 | 454 | statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
457 | - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup() | |
458 | - .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
459 | - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
460 | - .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | |
461 | - .addComponent(statusMessageLabel) | |
462 | - .addComponent(statusAnimationLabel)) | |
463 | - .addGap(3, 3, 3)) | |
455 | + .addGroup(statusPanelLayout.createSequentialGroup() | |
456 | + .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
457 | + .addComponent(statusAnimationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE) | |
458 | + .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
459 | + .addComponent(statusMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
460 | + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) | |
464 | 461 | ); |
465 | 462 | |
466 | 463 | keyMatcherBinder.bindDataViewTableModel(dataViewTableModel); |
@@ -555,6 +552,8 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
555 | 552 | loader.load(sourceFile, dlgModel.getCharset()); |
556 | 553 | } |
557 | 554 | |
555 | + Thread.sleep(5000); | |
556 | + | |
558 | 557 | return collector; |
559 | 558 | } |
560 | 559 |
@@ -564,8 +563,15 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
564 | 563 | */ |
565 | 564 | @Override protected void failed(Throwable ex) { |
566 | 565 | logger.log(Level.SEVERE, "データのインポートに失敗しました。", ex); |
566 | + statusMessageLabel.setText("failed."); | |
567 | 567 | ErrorDialog.showErrorDialog(ex); |
568 | 568 | } |
569 | + | |
570 | + @Override | |
571 | + protected void cancelled() { | |
572 | + logger.log(Level.INFO, "データのインポートをキャンセルしました。"); | |
573 | + statusMessageLabel.setText("cancelled."); | |
574 | + } | |
569 | 575 | |
570 | 576 | /** |
571 | 577 | * 成功した場合 |
@@ -575,7 +581,7 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
575 | 581 | dataViewTableModel.addLineDataList(collector); |
576 | 582 | checkEnableSave(); |
577 | 583 | checkEnableNew(); |
578 | - JOptionPane.showMessageDialog(getFrame(), "done."); | |
584 | + statusMessageLabel.setText("done."); | |
579 | 585 | } |
580 | 586 | } |
581 | 587 |
@@ -639,6 +645,8 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
639 | 645 | |
640 | 646 | checkEnableSave(); |
641 | 647 | checkEnableNew(); |
648 | + | |
649 | + statusMessageLabel.setText("initialized."); | |
642 | 650 | } |
643 | 651 | |
644 | 652 | /** |
@@ -670,9 +678,11 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
670 | 678 | DocArchive archive = new FileDocArchive(selFile); |
671 | 679 | dataViewTableModel.load(archive); |
672 | 680 | dataViewTableModel.setDirty(false); |
681 | + statusMessageLabel.setText("loaded."); | |
673 | 682 | |
674 | 683 | } catch (Exception ex) { |
675 | 684 | logger.log(Level.SEVERE, "データのロードに失敗しました。" + selFile, ex); |
685 | + statusMessageLabel.setText("failed."); | |
676 | 686 | ErrorDialog.showErrorDialog(ex); |
677 | 687 | } |
678 | 688 |
@@ -697,9 +707,11 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
697 | 707 | DocArchive archive = new FileDocArchive(selFile); |
698 | 708 | dataViewTableModel.save(archive); |
699 | 709 | dataViewTableModel.setDirty(false); |
710 | + statusMessageLabel.setText("saved."); | |
700 | 711 | |
701 | 712 | } catch (Exception ex) { |
702 | 713 | logger.log(Level.SEVERE, "saveで例外が発生しました。" + selFile, ex); |
714 | + statusMessageLabel.setText("failed."); | |
703 | 715 | ErrorDialog.showErrorDialog(ex); |
704 | 716 | } |
705 | 717 | } |
@@ -58,8 +58,8 @@ onLoad.Action.text= | ||
58 | 58 | onLoad.Action.shortDescription= |
59 | 59 | onNew.Action.shortDescription= |
60 | 60 | onNew.Action.text= |
61 | -confirm.discard.title=CONFIRM | |
62 | -confirm.discard.message=Are you sure you want to discard your changes? | |
61 | +confirm.discard.title=\u78ba\u8a8d | |
62 | +confirm.discard.message=\u5909\u66f4\u3092\u7834\u68c4\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? | |
63 | 63 | onNew.Action.accelerator=shortcut N |
64 | 64 | onLoad.Action.accelerator=shortcut O |
65 | 65 | onSave.Action.accelerator=shortcut S |