テキストの各行をキーと値に分離し、複数テキストファイルを読み込み、キーを突き合わせ照合し、その結果を表示するGUIユーテリティです。
Revisão | 425e45115dd4a6bc3ff078bf4f496a6cbd9b8658 (tree) |
---|---|
Hora | 2011-10-22 22:55:30 |
Autor | seraphy <seraphy@192....> |
Commiter | seraphy |
・行フィルタの実装、追加
@@ -100,7 +100,77 @@ public enum DisplayMode implements RowFilter { | ||
100 | 100 | return true; |
101 | 101 | } |
102 | 102 | } |
103 | - return true; | |
103 | + return false; | |
104 | + } | |
105 | + }, | |
106 | + UNIQUE() { | |
107 | + @Override | |
108 | + public boolean isAcceptable(RowValues values) { | |
109 | + if (values == null) { | |
110 | + throw new IllegalArgumentException(); | |
111 | + } | |
112 | + int mx = values.getDataWidth(); | |
113 | + int validColumns = 0; | |
114 | + for (int idx = 0; idx < mx; idx++) { | |
115 | + int cnt = values.getCount(idx); | |
116 | + if (cnt > 0) { | |
117 | + // 1件以上のデータがあるカラムをカウントする. | |
118 | + validColumns++; | |
119 | + } | |
120 | + } | |
121 | + // データ列の個数が1であればユニーク | |
122 | + return validColumns == 1; | |
123 | + } | |
124 | + }, | |
125 | + UNUNIQUE() { | |
126 | + @Override | |
127 | + public boolean isAcceptable(RowValues values) { | |
128 | + if (values == null) { | |
129 | + throw new IllegalArgumentException(); | |
130 | + } | |
131 | + int mx = values.getDataWidth(); | |
132 | + int validColumns = 0; | |
133 | + for (int idx = 0; idx < mx; idx++) { | |
134 | + int cnt = values.getCount(idx); | |
135 | + if (cnt > 0) { | |
136 | + // 1件以上のデータがあるカラムをカウントする. | |
137 | + validColumns++; | |
138 | + } | |
139 | + } | |
140 | + // データ列の個数が1でなければアンユニーク | |
141 | + return validColumns != 1; | |
142 | + } | |
143 | + }, | |
144 | + UNIQUE_ALL() { | |
145 | + @Override | |
146 | + public boolean isAcceptable(RowValues values) { | |
147 | + if (values == null) { | |
148 | + throw new IllegalArgumentException(); | |
149 | + } | |
150 | + int mx = values.getDataWidth(); | |
151 | + int numOfData = 0; | |
152 | + for (int idx = 0; idx < mx; idx++) { | |
153 | + int cnt = values.getCount(idx); | |
154 | + numOfData += cnt; | |
155 | + } | |
156 | + // データ数が1であればユニーク | |
157 | + return numOfData == 1; | |
158 | + } | |
159 | + }, | |
160 | + UNUNIQUE_ALL() { | |
161 | + @Override | |
162 | + public boolean isAcceptable(RowValues values) { | |
163 | + if (values == null) { | |
164 | + throw new IllegalArgumentException(); | |
165 | + } | |
166 | + int mx = values.getDataWidth(); | |
167 | + int numOfData = 0; | |
168 | + for (int idx = 0; idx < mx; idx++) { | |
169 | + int cnt = values.getCount(idx); | |
170 | + numOfData += cnt; | |
171 | + } | |
172 | + // データ数が1でなければアンユニーク | |
173 | + return numOfData != 1; | |
104 | 174 | } |
105 | 175 | }, |
106 | 176 | ; |
@@ -15,7 +15,7 @@ | ||
15 | 15 | </DimensionLayout> |
16 | 16 | <DimensionLayout dim="1"> |
17 | 17 | <Group type="103" groupAlignment="0" attributes="0"> |
18 | - <Component id="dataViewTableSP" alignment="0" pref="392" 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> |
@@ -208,10 +208,12 @@ | ||
208 | 208 | <ComponentRef name="viewButtonGroup"/> |
209 | 209 | </Property> |
210 | 210 | <Property name="mnemonic" type="int" value="65"/> |
211 | - <Property name="selected" type="boolean" value="true"/> | |
212 | 211 | <Property name="text" type="java.lang.String" resourceKey="allRadioButtonMenuItem.text"/> |
213 | 212 | <Property name="name" type="java.lang.String" value="allRadioButtonMenuItem" noResource="true"/> |
214 | 213 | </Properties> |
214 | + <BindingProperties> | |
215 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${all}" target="allRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
216 | + </BindingProperties> | |
215 | 217 | </MenuItem> |
216 | 218 | <MenuItem class="javax.swing.JRadioButtonMenuItem" name="matchedRadioButtonMenuItem"> |
217 | 219 | <Properties> |
@@ -222,6 +224,9 @@ | ||
222 | 224 | <Property name="text" type="java.lang.String" resourceKey="matchedRadioButtonMenuItem.text"/> |
223 | 225 | <Property name="name" type="java.lang.String" value="matchedRadioButtonMenuItem" noResource="true"/> |
224 | 226 | </Properties> |
227 | + <BindingProperties> | |
228 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${matched}" target="matchedRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
229 | + </BindingProperties> | |
225 | 230 | </MenuItem> |
226 | 231 | <MenuItem class="javax.swing.JRadioButtonMenuItem" name="unmatchedRadioButtonMenuItem"> |
227 | 232 | <Properties> |
@@ -232,6 +237,9 @@ | ||
232 | 237 | <Property name="text" type="java.lang.String" resourceKey="unmatchedRadioButtonMenuItem.text"/> |
233 | 238 | <Property name="name" type="java.lang.String" value="unmatchedRadioButtonMenuItem" noResource="true"/> |
234 | 239 | </Properties> |
240 | + <BindingProperties> | |
241 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${unmatched}" target="unmatchedRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
242 | + </BindingProperties> | |
235 | 243 | </MenuItem> |
236 | 244 | <MenuItem class="javax.swing.JRadioButtonMenuItem" name="existsLeftRadioButtonMenuItem"> |
237 | 245 | <Properties> |
@@ -242,6 +250,9 @@ | ||
242 | 250 | <Property name="text" type="java.lang.String" resourceKey="existsLeftRadioButtonMenuItem.text"/> |
243 | 251 | <Property name="name" type="java.lang.String" value="existsLeftRadioButtonMenuItem" noResource="true"/> |
244 | 252 | </Properties> |
253 | + <BindingProperties> | |
254 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${existsFirstColumn}" target="existsLeftRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
255 | + </BindingProperties> | |
245 | 256 | </MenuItem> |
246 | 257 | <MenuItem class="javax.swing.JRadioButtonMenuItem" name="missingLeftRadioButtonMenuItem"> |
247 | 258 | <Properties> |
@@ -252,6 +263,59 @@ | ||
252 | 263 | <Property name="text" type="java.lang.String" resourceKey="missingLeftRadioButtonMenuItem.text"/> |
253 | 264 | <Property name="name" type="java.lang.String" value="missingLeftRadioButtonMenuItem" noResource="true"/> |
254 | 265 | </Properties> |
266 | + <BindingProperties> | |
267 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${missingFirstColumn}" target="missingLeftRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
268 | + </BindingProperties> | |
269 | + </MenuItem> | |
270 | + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="uniqueRadioButtonMenuItem"> | |
271 | + <Properties> | |
272 | + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> | |
273 | + <ComponentRef name="viewButtonGroup"/> | |
274 | + </Property> | |
275 | + <Property name="mnemonic" type="int" value="85"/> | |
276 | + <Property name="text" type="java.lang.String" resourceKey="uniqueRadioButtonMenuItem.text"/> | |
277 | + <Property name="name" type="java.lang.String" value="uniqueRadioButtonMenuItem" noResource="true"/> | |
278 | + </Properties> | |
279 | + <BindingProperties> | |
280 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${unique}" target="uniqueRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
281 | + </BindingProperties> | |
282 | + </MenuItem> | |
283 | + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonMenuItem1"> | |
284 | + <Properties> | |
285 | + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> | |
286 | + <ComponentRef name="viewButtonGroup"/> | |
287 | + </Property> | |
288 | + <Property name="text" type="java.lang.String" resourceKey="jRadioButtonMenuItem1.text"/> | |
289 | + <Property name="name" type="java.lang.String" value="jRadioButtonMenuItem1" noResource="true"/> | |
290 | + </Properties> | |
291 | + <BindingProperties> | |
292 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${uniqueAll}" target="jRadioButtonMenuItem1" targetPath="selected" updateStrategy="0" immediately="false"/> | |
293 | + </BindingProperties> | |
294 | + </MenuItem> | |
295 | + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="ununiqueRadioButtonMenuItem"> | |
296 | + <Properties> | |
297 | + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> | |
298 | + <ComponentRef name="viewButtonGroup"/> | |
299 | + </Property> | |
300 | + <Property name="mnemonic" type="int" value="68"/> | |
301 | + <Property name="text" type="java.lang.String" resourceKey="ununiqueRadioButtonMenuItem.text"/> | |
302 | + <Property name="name" type="java.lang.String" value="ununiqueRadioButtonMenuItem" noResource="true"/> | |
303 | + </Properties> | |
304 | + <BindingProperties> | |
305 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${ununique}" target="ununiqueRadioButtonMenuItem" targetPath="selected" updateStrategy="0" immediately="false"/> | |
306 | + </BindingProperties> | |
307 | + </MenuItem> | |
308 | + <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonMenuItem2"> | |
309 | + <Properties> | |
310 | + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> | |
311 | + <ComponentRef name="viewButtonGroup"/> | |
312 | + </Property> | |
313 | + <Property name="text" type="java.lang.String" resourceKey="jRadioButtonMenuItem2.text"/> | |
314 | + <Property name="name" type="java.lang.String" value="jRadioButtonMenuItem2" noResource="true"/> | |
315 | + </Properties> | |
316 | + <BindingProperties> | |
317 | + <BindingProperty name="selected" source="displayModeBinder" sourcePath="${ununiqueAll}" target="jRadioButtonMenuItem2" targetPath="selected" updateStrategy="0" immediately="false"/> | |
318 | + </BindingProperties> | |
255 | 319 | </MenuItem> |
256 | 320 | </SubComponents> |
257 | 321 | </Menu> |
@@ -296,7 +360,7 @@ | ||
296 | 360 | <DimensionLayout dim="0"> |
297 | 361 | <Group type="103" groupAlignment="0" attributes="0"> |
298 | 362 | <Group type="102" alignment="1" attributes="0"> |
299 | - <Component id="statusMessageLabel" pref="235" max="32767" attributes="0"/> | |
363 | + <Component id="statusMessageLabel" pref="225" max="32767" attributes="0"/> | |
300 | 364 | <EmptySpace max="-2" attributes="0"/> |
301 | 365 | <Component id="progressBar" min="-2" max="-2" attributes="0"/> |
302 | 366 | <EmptySpace max="-2" attributes="0"/> |
@@ -359,6 +423,11 @@ | ||
359 | 423 | <AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="keyMatcherBinder.bindDataViewTableModel(dataViewTableModel);"/> |
360 | 424 | </AuxValues> |
361 | 425 | </Component> |
426 | + <Component class="textkeymatcher.ui.model.DisplayModeBinder" name="displayModeBinder"> | |
427 | + <AuxValues> | |
428 | + <AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="displayModeBinder.bindDataViewTableModel(dataViewTableModel);"/> | |
429 | + </AuxValues> | |
430 | + </Component> | |
362 | 431 | </NonVisualComponents> |
363 | 432 | <Properties> |
364 | 433 | <Property name="component" type="javax.swing.JComponent" editor="org.netbeans.modules.form.ComponentChooserEditor"> |
@@ -257,6 +257,10 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
257 | 257 | unmatchedRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem(); |
258 | 258 | existsLeftRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem(); |
259 | 259 | missingLeftRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem(); |
260 | + uniqueRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem(); | |
261 | + jRadioButtonMenuItem1 = new javax.swing.JRadioButtonMenuItem(); | |
262 | + ununiqueRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem(); | |
263 | + jRadioButtonMenuItem2 = new javax.swing.JRadioButtonMenuItem(); | |
260 | 264 | helpMenu = new javax.swing.JMenu(); |
261 | 265 | javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); |
262 | 266 | statusPanel = new javax.swing.JPanel(); |
@@ -267,6 +271,7 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
267 | 271 | keyButtonGroup = new javax.swing.ButtonGroup(); |
268 | 272 | dataViewTableModel = new textkeymatcher.ui.model.DataViewTableModel(); |
269 | 273 | keyMatcherBinder = new textkeymatcher.ui.model.KeyMatcherBinder(); |
274 | + displayModeBinder = new textkeymatcher.ui.model.DisplayModeBinder(); | |
270 | 275 | |
271 | 276 | mainPanel.setName("mainPanel"); // NOI18N |
272 | 277 |
@@ -387,35 +392,92 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
387 | 392 | |
388 | 393 | viewButtonGroup.add(allRadioButtonMenuItem); |
389 | 394 | allRadioButtonMenuItem.setMnemonic('A'); |
390 | - allRadioButtonMenuItem.setSelected(true); | |
391 | 395 | allRadioButtonMenuItem.setText(resourceMap.getString("allRadioButtonMenuItem.text")); // NOI18N |
392 | 396 | allRadioButtonMenuItem.setName("allRadioButtonMenuItem"); // NOI18N |
397 | + | |
398 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${all}"), allRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
399 | + bindingGroup.addBinding(binding); | |
400 | + | |
393 | 401 | viewMenu.add(allRadioButtonMenuItem); |
394 | 402 | |
395 | 403 | viewButtonGroup.add(matchedRadioButtonMenuItem); |
396 | 404 | matchedRadioButtonMenuItem.setMnemonic('M'); |
397 | 405 | matchedRadioButtonMenuItem.setText(resourceMap.getString("matchedRadioButtonMenuItem.text")); // NOI18N |
398 | 406 | matchedRadioButtonMenuItem.setName("matchedRadioButtonMenuItem"); // NOI18N |
407 | + | |
408 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${matched}"), matchedRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
409 | + bindingGroup.addBinding(binding); | |
410 | + | |
399 | 411 | viewMenu.add(matchedRadioButtonMenuItem); |
400 | 412 | |
401 | 413 | viewButtonGroup.add(unmatchedRadioButtonMenuItem); |
402 | 414 | unmatchedRadioButtonMenuItem.setMnemonic('N'); |
403 | 415 | unmatchedRadioButtonMenuItem.setText(resourceMap.getString("unmatchedRadioButtonMenuItem.text")); // NOI18N |
404 | 416 | unmatchedRadioButtonMenuItem.setName("unmatchedRadioButtonMenuItem"); // NOI18N |
417 | + | |
418 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${unmatched}"), unmatchedRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
419 | + bindingGroup.addBinding(binding); | |
420 | + | |
405 | 421 | viewMenu.add(unmatchedRadioButtonMenuItem); |
406 | 422 | |
407 | 423 | viewButtonGroup.add(existsLeftRadioButtonMenuItem); |
408 | 424 | existsLeftRadioButtonMenuItem.setMnemonic('1'); |
409 | 425 | existsLeftRadioButtonMenuItem.setText(resourceMap.getString("existsLeftRadioButtonMenuItem.text")); // NOI18N |
410 | 426 | existsLeftRadioButtonMenuItem.setName("existsLeftRadioButtonMenuItem"); // NOI18N |
427 | + | |
428 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${existsFirstColumn}"), existsLeftRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
429 | + bindingGroup.addBinding(binding); | |
430 | + | |
411 | 431 | viewMenu.add(existsLeftRadioButtonMenuItem); |
412 | 432 | |
413 | 433 | viewButtonGroup.add(missingLeftRadioButtonMenuItem); |
414 | 434 | missingLeftRadioButtonMenuItem.setMnemonic('2'); |
415 | 435 | missingLeftRadioButtonMenuItem.setText(resourceMap.getString("missingLeftRadioButtonMenuItem.text")); // NOI18N |
416 | 436 | missingLeftRadioButtonMenuItem.setName("missingLeftRadioButtonMenuItem"); // NOI18N |
437 | + | |
438 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${missingFirstColumn}"), missingLeftRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
439 | + bindingGroup.addBinding(binding); | |
440 | + | |
417 | 441 | viewMenu.add(missingLeftRadioButtonMenuItem); |
418 | 442 | |
443 | + viewButtonGroup.add(uniqueRadioButtonMenuItem); | |
444 | + uniqueRadioButtonMenuItem.setMnemonic('U'); | |
445 | + uniqueRadioButtonMenuItem.setText(resourceMap.getString("uniqueRadioButtonMenuItem.text")); // NOI18N | |
446 | + uniqueRadioButtonMenuItem.setName("uniqueRadioButtonMenuItem"); // NOI18N | |
447 | + | |
448 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${unique}"), uniqueRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
449 | + bindingGroup.addBinding(binding); | |
450 | + | |
451 | + viewMenu.add(uniqueRadioButtonMenuItem); | |
452 | + | |
453 | + viewButtonGroup.add(jRadioButtonMenuItem1); | |
454 | + jRadioButtonMenuItem1.setText(resourceMap.getString("jRadioButtonMenuItem1.text")); // NOI18N | |
455 | + jRadioButtonMenuItem1.setName("jRadioButtonMenuItem1"); // NOI18N | |
456 | + | |
457 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${uniqueAll}"), jRadioButtonMenuItem1, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
458 | + bindingGroup.addBinding(binding); | |
459 | + | |
460 | + viewMenu.add(jRadioButtonMenuItem1); | |
461 | + | |
462 | + viewButtonGroup.add(ununiqueRadioButtonMenuItem); | |
463 | + ununiqueRadioButtonMenuItem.setMnemonic('D'); | |
464 | + ununiqueRadioButtonMenuItem.setText(resourceMap.getString("ununiqueRadioButtonMenuItem.text")); // NOI18N | |
465 | + ununiqueRadioButtonMenuItem.setName("ununiqueRadioButtonMenuItem"); // NOI18N | |
466 | + | |
467 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${ununique}"), ununiqueRadioButtonMenuItem, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
468 | + bindingGroup.addBinding(binding); | |
469 | + | |
470 | + viewMenu.add(ununiqueRadioButtonMenuItem); | |
471 | + | |
472 | + viewButtonGroup.add(jRadioButtonMenuItem2); | |
473 | + jRadioButtonMenuItem2.setText(resourceMap.getString("jRadioButtonMenuItem2.text")); // NOI18N | |
474 | + jRadioButtonMenuItem2.setName("jRadioButtonMenuItem2"); // NOI18N | |
475 | + | |
476 | + binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, displayModeBinder, org.jdesktop.beansbinding.ELProperty.create("${ununiqueAll}"), jRadioButtonMenuItem2, org.jdesktop.beansbinding.BeanProperty.create("selected")); | |
477 | + bindingGroup.addBinding(binding); | |
478 | + | |
479 | + viewMenu.add(jRadioButtonMenuItem2); | |
480 | + | |
419 | 481 | menuBar.add(viewMenu); |
420 | 482 | |
421 | 483 | helpMenu.setMnemonic('H'); |
@@ -463,6 +525,8 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
463 | 525 | |
464 | 526 | keyMatcherBinder.bindDataViewTableModel(dataViewTableModel); |
465 | 527 | |
528 | + displayModeBinder.bindDataViewTableModel(dataViewTableModel); | |
529 | + | |
466 | 530 | setComponent(mainPanel); |
467 | 531 | setMenuBar(menuBar); |
468 | 532 | setStatusBar(statusPanel); |
@@ -757,8 +821,11 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
757 | 821 | private javax.swing.JTable dataViewTable; |
758 | 822 | private textkeymatcher.ui.model.DataViewTableModel dataViewTableModel; |
759 | 823 | private javax.swing.JScrollPane dataViewTableSP; |
824 | + private textkeymatcher.ui.model.DisplayModeBinder displayModeBinder; | |
760 | 825 | private javax.swing.JRadioButtonMenuItem existsLeftRadioButtonMenuItem; |
761 | 826 | private javax.swing.JMenu helpMenu; |
827 | + private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItem1; | |
828 | + private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItem2; | |
762 | 829 | private javax.swing.JPopupMenu.Separator jSeparator1; |
763 | 830 | private javax.swing.JPopupMenu.Separator jSeparator2; |
764 | 831 | private javax.swing.ButtonGroup keyButtonGroup; |
@@ -781,7 +848,9 @@ public class TextKeyMatcherView extends FrameView implements ExitListener { | ||
781 | 848 | private javax.swing.JPanel statusPanel; |
782 | 849 | private javax.swing.JRadioButtonMenuItem textIgnoreCaseRadioButtonMenuItem; |
783 | 850 | private javax.swing.JRadioButtonMenuItem textNormalRadioButtonMenuItem; |
851 | + private javax.swing.JRadioButtonMenuItem uniqueRadioButtonMenuItem; | |
784 | 852 | private javax.swing.JRadioButtonMenuItem unmatchedRadioButtonMenuItem; |
853 | + private javax.swing.JRadioButtonMenuItem ununiqueRadioButtonMenuItem; | |
785 | 854 | private javax.swing.ButtonGroup viewButtonGroup; |
786 | 855 | private javax.swing.JMenu viewMenu; |
787 | 856 | private org.jdesktop.beansbinding.BindingGroup bindingGroup; |
@@ -252,6 +252,10 @@ public class DataViewTableModel extends KeyMatchedRowView implements TextKeyMatc | ||
252 | 252 | renumbering(rowMap); |
253 | 253 | } |
254 | 254 | |
255 | + /** | |
256 | + * ディスプレイモードによる行フィルタを適用する.<br> | |
257 | + * @param displayMode ディスプレイモード | |
258 | + */ | |
255 | 259 | public void setDisplayMode(DisplayMode displayMode) { |
256 | 260 | if (displayMode == null) { |
257 | 261 | throw new IllegalArgumentException(); |
@@ -261,10 +265,16 @@ public class DataViewTableModel extends KeyMatchedRowView implements TextKeyMatc | ||
261 | 265 | |
262 | 266 | if (displayMode != oldValue) { |
263 | 267 | propCng.firePropertyChange(PROPERTY_DISPLAY_MODE, oldValue, displayMode); |
268 | + | |
269 | + // 行フィルタを適用しなおす | |
264 | 270 | renumbering(rowMap); |
265 | 271 | } |
266 | 272 | } |
267 | 273 | |
274 | + /** | |
275 | + * 現在適用されているディスプレイモード(行フィルタ)を取得する. | |
276 | + * @return ディスプレイモード | |
277 | + */ | |
268 | 278 | public DisplayMode getDisplayMode() { |
269 | 279 | return displayMode; |
270 | 280 | } |
@@ -83,18 +83,30 @@ public class DisplayModeBinder extends AbstractBean { | ||
83 | 83 | boolean oldUnmatched = oldValue == DisplayMode.UNMATCHED; |
84 | 84 | boolean oldExistsFirst = oldValue == DisplayMode.EXISTS_FIRST_COLUMN; |
85 | 85 | boolean oldMissingFirst = oldValue == DisplayMode.MISSING_FIRST_COLUMN; |
86 | + boolean oldUnique = oldValue == DisplayMode.UNIQUE; | |
87 | + boolean oldUnunique = oldValue == DisplayMode.UNUNIQUE; | |
88 | + boolean oldUniqueAll = oldValue == DisplayMode.UNIQUE_ALL; | |
89 | + boolean oldUnuniqueAll = oldValue == DisplayMode.UNUNIQUE_ALL; | |
86 | 90 | |
87 | 91 | boolean newAll = newValue == DisplayMode.ALL; |
88 | 92 | boolean newMatched = newValue == DisplayMode.MATCHED; |
89 | 93 | boolean newUnmatched = newValue == DisplayMode.UNMATCHED; |
90 | 94 | boolean newExistsFirst = newValue == DisplayMode.EXISTS_FIRST_COLUMN; |
91 | 95 | boolean newMissingFirst = newValue == DisplayMode.MISSING_FIRST_COLUMN; |
96 | + boolean newUnique = newValue == DisplayMode.UNIQUE; | |
97 | + boolean newUnunique = newValue == DisplayMode.UNUNIQUE; | |
98 | + boolean newUniqueAll = newValue == DisplayMode.UNIQUE_ALL; | |
99 | + boolean newUnuniqueAll = newValue == DisplayMode.UNUNIQUE_ALL; | |
92 | 100 | |
93 | 101 | firePropertyChange("all", oldAll, newAll); |
94 | 102 | firePropertyChange("matched", oldMatched, newMatched); |
95 | 103 | firePropertyChange("unmatched", oldUnmatched, newUnmatched); |
96 | 104 | firePropertyChange("existsFirstColumn", oldExistsFirst, newExistsFirst); |
97 | 105 | firePropertyChange("missingFirstColumn", oldMissingFirst, newMissingFirst); |
106 | + firePropertyChange("unique", oldUnique, newUnique); | |
107 | + firePropertyChange("ununique", oldUnunique, newUnunique); | |
108 | + firePropertyChange("uniqueAll", oldUniqueAll, newUniqueAll); | |
109 | + firePropertyChange("ununiqueAll", oldUnuniqueAll, newUnuniqueAll); | |
98 | 110 | } |
99 | 111 | |
100 | 112 | public void setAll(boolean enable) { |
@@ -146,4 +158,44 @@ public class DisplayModeBinder extends AbstractBean { | ||
146 | 158 | public boolean isMissingFirstColumn() { |
147 | 159 | return getDisplayMode() == DisplayMode.MISSING_FIRST_COLUMN; |
148 | 160 | } |
161 | + | |
162 | + public void setUnique(boolean enable) { | |
163 | + if (enable) { | |
164 | + setDisplayMode(DisplayMode.UNIQUE); | |
165 | + } | |
166 | + } | |
167 | + | |
168 | + public boolean isUnique() { | |
169 | + return getDisplayMode() == DisplayMode.UNIQUE; | |
170 | + } | |
171 | + | |
172 | + public void setUnunique(boolean enable) { | |
173 | + if (enable) { | |
174 | + setDisplayMode(DisplayMode.UNUNIQUE); | |
175 | + } | |
176 | + } | |
177 | + | |
178 | + public boolean isUnunique() { | |
179 | + return getDisplayMode() == DisplayMode.UNUNIQUE; | |
180 | + } | |
181 | + | |
182 | + public void setUniqueAll(boolean enable) { | |
183 | + if (enable) { | |
184 | + setDisplayMode(DisplayMode.UNIQUE_ALL); | |
185 | + } | |
186 | + } | |
187 | + | |
188 | + public boolean isUniqueAll() { | |
189 | + return getDisplayMode() == DisplayMode.UNIQUE_ALL; | |
190 | + } | |
191 | + | |
192 | + public void setUnuniqueAll(boolean enable) { | |
193 | + if (enable) { | |
194 | + setDisplayMode(DisplayMode.UNUNIQUE_ALL); | |
195 | + } | |
196 | + } | |
197 | + | |
198 | + public boolean isUnuniqueAll() { | |
199 | + return getDisplayMode() == DisplayMode.UNUNIQUE_ALL; | |
200 | + } | |
149 | 201 | } |
@@ -65,3 +65,7 @@ onLoad.Action.accelerator=shortcut O | ||
65 | 65 | onSave.Action.accelerator=shortcut S |
66 | 66 | aboutMenuItem.text=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831...(A) |
67 | 67 | dataViewTable.gridColor=153, 153, 153 |
68 | +uniqueRadioButtonMenuItem.text=Unique | |
69 | +ununiqueRadioButtonMenuItem.text=Ununique | |
70 | +jRadioButtonMenuItem1.text=Unique (Strict) | |
71 | +jRadioButtonMenuItem2.text=Ununique (Strict) |
@@ -1,8 +1,8 @@ | ||
1 | 1 | |
2 | 2 | fileMenu.text=\u30d5\u30a1\u30a4\u30eb(F) |
3 | -dataMenu.text=\u30c7\u30fc\u30bf(D) | |
4 | -keyMenu.text=\u30ad\u30fc(K) | |
5 | -viewMenu.text=\u8868\u793a(V) | |
3 | +dataMenu.text=\u30c7\u30fc\u30bf\u64cd\u4f5c(D) | |
4 | +keyMenu.text=\u30ad\u30fc\u8b58\u5225(K) | |
5 | +viewMenu.text=\u884c\u30d5\u30a3\u30eb\u30bf(V) | |
6 | 6 | helpMenu.text=\u30d8\u30eb\u30d7(H) |
7 | 7 | newMenuItem.text=\u65b0\u898f(N) |
8 | 8 | openMenuItem.text=\u958b\u304f(O) |
@@ -56,3 +56,7 @@ onLoad.Action.accelerator=shortcut O | ||
56 | 56 | onSave.Action.accelerator=shortcut S |
57 | 57 | aboutMenuItem.text=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831...(A) |
58 | 58 | dataViewTable.gridColor=153, 153, 153 |
59 | +uniqueRadioButtonMenuItem.text=\u30e6\u30cb\u30fc\u30af(U) | |
60 | +ununiqueRadioButtonMenuItem.text=\u975e\u30e6\u30cb\u30fc\u30af(D) | |
61 | +jRadioButtonMenuItem1.text=\u30e6\u30cb\u30fc\u30af(\u81ea\u5217\u3082\u5bfe\u8c61) | |
62 | +jRadioButtonMenuItem2.text=\u975e\u30e6\u30cb\u30fc\u30af(\u81ea\u5217\u3082\u5bfe\u8c61) |
@@ -37,11 +37,11 @@ dataMenu.text=\u30c7\u30fc\u30bf | ||
37 | 37 | loadDataMenuItem.text=\u30c7\u30fc\u30bf\u306e\u53d6\u8fbc\u307f |
38 | 38 | removeMenuItem.text=\u524a\u9664 |
39 | 39 | mergeMenuItem.text=\u7d50\u5408 |
40 | -keyMenu.text=\u30ad\u30fc | |
40 | +keyMenu.text=\u30ad\u30fc\u8b58\u5225 | |
41 | 41 | textNormalRadioButtonMenuItem.text=\u6587\u5b57\u5217 |
42 | 42 | textIgnoreCaseRadioButtonMenuItem.text=\u6587\u5b57\u5217(\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u7121\u8996) |
43 | 43 | numberRadioButtonMenuItem.text=\u6570\u5024 |
44 | -viewMenu.text=\u8868\u793a | |
44 | +viewMenu.text=\u884c\u30d5\u30a3\u30eb\u30bf | |
45 | 45 | allRadioButtonMenuItem.text=\u3059\u3079\u3066 |
46 | 46 | matchedRadioButtonMenuItem.text=\u4e00\u81f4\u306e\u307f |
47 | 47 | unmatchedRadioButtonMenuItem.text=\u4e0d\u4e00\u81f4\u98f2\u307f |
@@ -64,3 +64,8 @@ onNew.Action.accelerator=shortcut N | ||
64 | 64 | onLoad.Action.accelerator=shortcut O |
65 | 65 | onSave.Action.accelerator=shortcut S |
66 | 66 | aboutMenuItem.text=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831... |
67 | +uniqueRadioButtonMenuItem.text=\u30e6\u30cb\u30fc\u30af | |
68 | +ununiqueRadioButtonMenuItem.text=\u975e\u30e6\u30cb\u30fc\u30af | |
69 | +dataViewTable.gridColor=153, 153, 153 | |
70 | +jRadioButtonMenuItem1.text=\u30e6\u30cb\u30fc\u30af(\u81ea\u5217\u3082\u5bfe\u8c61) | |
71 | +jRadioButtonMenuItem2.text=\u975e\u30e6\u30cb\u30fc\u30af(\u81ea\u5217\u3082\u5bfe\u8c61) |