1 package fr.ifremer.tutti.ui.swing.content.operation.catches;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 import fr.ifremer.tutti.ui.swing.TuttiHelpBroker;
28 import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
29 import fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.AccidentalBatchUI;
30 import fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create.CreateAccidentalBatchUI;
31 import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchUI;
32 import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.create.CreateMarineLitterBatchUI;
33 import fr.ifremer.tutti.ui.swing.content.operation.catches.species.EditSpeciesBatchPanelUI;
34 import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesOrBenthosBatchUISupport;
35 import fr.ifremer.tutti.ui.swing.util.TuttiUI;
36 import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
37 import fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment;
38 import fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMapEditorUI;
39 import java.awt.BorderLayout;
40 import java.awt.Component;
41 import java.awt.Container;
42 import java.awt.GridBagConstraints;
43 import java.awt.Insets;
44 import java.awt.LayoutManager;
45 import java.util.ArrayList;
46 import java.util.HashMap;
47 import java.util.List;
48 import java.util.Map;
49 import java.util.TreeMap;
50 import javax.swing.JButton;
51 import javax.swing.JMenu;
52 import javax.swing.JMenuBar;
53 import javax.swing.JMenuItem;
54 import javax.swing.JPanel;
55 import javax.swing.JTabbedPane;
56 import javax.swing.JToolBar;
57 import jaxx.runtime.JAXXBinding;
58 import jaxx.runtime.JAXXContext;
59 import jaxx.runtime.JAXXObject;
60 import jaxx.runtime.JAXXObjectDescriptor;
61 import jaxx.runtime.JAXXUtil;
62 import jaxx.runtime.JAXXValidator;
63 import jaxx.runtime.SwingUtil;
64 import jaxx.runtime.binding.DefaultJAXXBinding;
65 import jaxx.runtime.context.DefaultJAXXContext;
66 import jaxx.runtime.swing.CardLayout2Ext;
67 import jaxx.runtime.swing.TabInfo;
68 import jaxx.runtime.swing.TabInfoPropertyChangeListener;
69 import jaxx.runtime.swing.Table;
70 import jaxx.runtime.swing.help.JAXXHelpUI;
71 import jaxx.runtime.validator.swing.SwingValidator;
72 import jaxx.runtime.validator.swing.SwingValidatorUtil;
73 import jaxx.runtime.validator.swing.meta.Validator;
74 import jaxx.runtime.validator.swing.meta.ValidatorField;
75 import jaxx.runtime.validator.swing.ui.ImageValidationUI;
76 import org.apache.commons.logging.Log;
77 import org.apache.commons.logging.LogFactory;
78 import org.jdesktop.swingx.JXTitledPanel;
79 import static org.nuiton.i18n.I18n.t;
80
81 public class EditCatchesUI extends JPanel implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<EditCatchesUIModel, EditCatchesUIHandler>, JAXXObject, JAXXValidator {
82
83
84
85
86
87 public static final String BINDING_ACCIDENTAL_TAB_FISHING_OPERATION_REMINDER_LABEL_RIGHT_DECORATION = "accidentalTabFishingOperationReminderLabel.rightDecoration";
88 public static final String BINDING_CATCHES_CARACTERISTICS_ATTACHMENTS_BUTTON_ENABLED = "catchesCaracteristicsAttachmentsButton.enabled";
89 public static final String BINDING_MARINE_LITTER_TAB_FISHING_OPERATION_REMINDER_LABEL_RIGHT_DECORATION = "marineLitterTabFishingOperationReminderLabel.rightDecoration";
90 public static final String BINDING_SAVE_BUTTON_ENABLED = "saveButton.enabled";
91
92
93
94
95
96 private static final String $jaxxObjectDescriptor = "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";
97 private static final Log log = LogFactory.getLog(EditCatchesUI.class);
98 private static final long serialVersionUID = 1L;
99
100
101
102
103
104 protected List<Object> $activeBindings = new ArrayList<Object>();
105 protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
106 protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
107 protected Map<String, Object> $objectMap = new HashMap<String, Object>();
108 protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
109 private boolean allComponentsCreated;
110 protected final JAXXContext delegateContext = new DefaultJAXXContext();
111
112
113
114
115
116 protected CaracteristicMapEditorUI accidentalCaracteristicMapEditor;
117 protected JXTitledPanel accidentalCaracteristicMapEditorReminderLabel;
118 protected TabInfo accidentalTab;
119 protected AccidentalBatchUI accidentalTabContent;
120 protected CreateAccidentalBatchUI accidentalTabCreateBatch;
121 protected JXTitledPanel accidentalTabCreateBatchReminderLabel;
122 protected JXTitledPanel accidentalTabFishingOperationReminderLabel;
123 protected JPanel accidentalTabPanel;
124 protected CardLayout2Ext accidentalTabPanelLayout;
125 protected TabInfo benthosTab;
126 protected EditSpeciesBatchPanelUI benthosTabPanel;
127 protected TuttiHelpBroker broker;
128 protected JButton cancelButton;
129 protected ButtonAttachment catchesCaracteristicsAttachmentsButton;
130 protected TabInfo catchesCaracteristicsTab;
131 protected JXTitledPanel catchesCaracteristicsTabPane;
132 protected JToolBar catchesCaracteristicsTabToolBar;
133 protected JButton cleanSpeciesBatchButton;
134 protected JButton computeSpeciesBatchButton;
135 protected Table createFishingOperationActions;
136 protected EditCatchesUI editCatchesTopPanel = this;
137 protected JMenuItem exportFishingOperationReportButton;
138 protected JMenuItem exportFishingOperationReportForSumatraButton;
139 protected JMenuItem exportMultiPostButton;
140 protected final EditCatchesUIHandler handler = createHandler();
141 protected JMenuItem importMultiPostButton;
142 protected TabInfo marineLitterTab;
143 protected MarineLitterBatchUI marineLitterTabContent;
144 protected CreateMarineLitterBatchUI marineLitterTabCreateBatch;
145 protected JXTitledPanel marineLitterTabCreateBatchReminderLabel;
146 protected JXTitledPanel marineLitterTabFishingOperationReminderLabel;
147 protected JPanel marineLitterTabPanel;
148 protected CardLayout2Ext marineLitterTabPanelLayout;
149 protected JMenuBar menu;
150 protected JMenu menuAction;
151 protected EditCatchesUIModel model;
152 protected JButton saveButton;
153 protected TabInfo speciesTab;
154 protected EditSpeciesBatchPanelUI speciesTabPanel;
155 protected JPanel svgCanvasPanel;
156 protected JTabbedPane tabPane;
157 @Validator( validatorId = "validator")
158 protected SwingValidator<EditCatchesUIModel> validator;
159 protected List<String> validatorIds = new ArrayList<String>();
160
161
162
163
164
165
166 public EditSpeciesBatchPanelUI getEditSpeciesBatchPanelUI(SpeciesOrBenthosBatchUISupport batchUISupport) { return handler.getEditSpeciesBatchPanelUI(batchUISupport); }
167
168
169
170
171
172 public EditCatchesUI(FishingOperationsUI parentUI) {
173 TuttiUIUtil.setParentUI(this, parentUI);
174 $initialize();
175 }
176
177 public EditCatchesUI(LayoutManager param0, boolean param1) {
178 super(param0 ,param1);
179 $initialize();
180 }
181
182 public EditCatchesUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
183 super(param1 ,param2);
184 JAXXUtil.initContext(this, parentContext);
185 $initialize();
186 }
187
188 public EditCatchesUI(LayoutManager param0) {
189 super(param0);
190 $initialize();
191 }
192
193 public EditCatchesUI(JAXXContext parentContext, LayoutManager param1) {
194 super(param1);
195 JAXXUtil.initContext(this, parentContext);
196 $initialize();
197 }
198
199 public EditCatchesUI() {
200 $initialize();
201 }
202
203 public EditCatchesUI(JAXXContext parentContext) {
204 JAXXUtil.initContext(this, parentContext);
205 $initialize();
206 }
207
208 public EditCatchesUI(boolean param0) {
209 super(param0);
210 $initialize();
211 }
212
213 public EditCatchesUI(JAXXContext parentContext, boolean param1) {
214 super(param1);
215 JAXXUtil.initContext(this, parentContext);
216 $initialize();
217 }
218
219
220
221
222
223 public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
224 return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
225 }
226
227
228
229
230
231 @Override
232 public void applyDataBinding(String $binding) {
233 if (allComponentsCreated && $bindings.containsKey($binding)) {
234 getDataBinding($binding).applyDataBinding();
235 }
236 processDataBinding($binding);
237 }
238
239 @Override
240 public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
241 super.firePropertyChange(propertyName, oldValue, newValue);
242 }
243
244 @Override
245 public Map<String, Object> get$objectMap() {
246 return $objectMap;
247 }
248
249 @Override
250 public JAXXBinding getDataBinding(String bindingId) {
251 return $bindings.get(bindingId);
252 }
253
254 @Override
255 public JAXXBinding[] getDataBindings() {
256 return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
257 }
258
259 @Override
260 public Object getObjectById(String id) {
261 return $objectMap.get(id);
262 }
263
264 @Override
265 public void processDataBinding(String $binding, boolean $force) {
266 if (!$force && $activeBindings.contains($binding)) {
267 return;
268 }
269 $activeBindings.add($binding);
270 try {
271 if (allComponentsCreated && $bindings.containsKey($binding)) {
272 getDataBinding($binding).processDataBinding();
273 }
274 } finally {
275 $activeBindings.remove($binding);
276 }
277 }
278
279 @Override
280 public void processDataBinding(String $binding) {
281 processDataBinding($binding, false);
282 }
283
284 @Override
285 public void registerDataBinding(JAXXBinding binding) {
286 $bindings.put(binding.getId(), binding);
287 }
288
289 @Override
290 public void removeDataBinding(String $binding) {
291 if (allComponentsCreated && $bindings.containsKey($binding)) {
292 getDataBinding($binding).removeDataBinding();
293 }
294 }
295
296
297
298
299
300 @Override
301 public <T> T getContextValue(Class<T> clazz) {
302 return delegateContext.getContextValue(clazz, null);
303 }
304
305 @Override
306 public <T> T getContextValue(Class<T> clazz, String name) {
307 return delegateContext.getContextValue(clazz, name);
308 }
309
310 @Override
311 public JAXXContext getDelegateContext() {
312 return delegateContext;
313 }
314
315 @Override
316 public <O extends Container> O getParentContainer(Class<O> clazz) {
317 return SwingUtil.getParentContainer(this, clazz);
318 }
319
320 @Override
321 public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
322 return SwingUtil.getParentContainer(source, clazz);
323 }
324
325 @Override
326 public <T> void removeContextValue(Class<T> clazz) {
327 delegateContext.removeContextValue(clazz, null);
328 }
329
330 @Override
331 public <T> void removeContextValue(Class<T> clazz, String name) {
332 delegateContext.removeContextValue(clazz, name);
333 }
334
335 @Override
336 public <T> void setContextValue(T o) {
337 delegateContext.setContextValue(o, null);
338 }
339
340 @Override
341 public <T> void setContextValue(T o, String name) {
342 delegateContext.setContextValue(o, name);
343 }
344
345
346
347
348
349 @Override
350 public SwingValidator<?> getValidator(String validatorId) {
351 return (SwingValidator<?>) (validatorIds.contains(validatorId) ? getObjectById(validatorId) : null);
352 }
353
354 @Override
355 public List<String> getValidatorIds() {
356 return validatorIds;
357 }
358
359 @Override
360 public void registerValidatorFields() {
361 SwingValidatorUtil.detectValidatorFields(this);
362 }
363
364
365
366
367
368 public CaracteristicMapEditorUI getAccidentalCaracteristicMapEditor() {
369 return accidentalCaracteristicMapEditor;
370 }
371
372 public JXTitledPanel getAccidentalCaracteristicMapEditorReminderLabel() {
373 return accidentalCaracteristicMapEditorReminderLabel;
374 }
375
376 public TabInfo getAccidentalTab() {
377 return accidentalTab;
378 }
379
380 public AccidentalBatchUI getAccidentalTabContent() {
381 return accidentalTabContent;
382 }
383
384 public CreateAccidentalBatchUI getAccidentalTabCreateBatch() {
385 return accidentalTabCreateBatch;
386 }
387
388 public JXTitledPanel getAccidentalTabCreateBatchReminderLabel() {
389 return accidentalTabCreateBatchReminderLabel;
390 }
391
392 public JXTitledPanel getAccidentalTabFishingOperationReminderLabel() {
393 return accidentalTabFishingOperationReminderLabel;
394 }
395
396 public JPanel getAccidentalTabPanel() {
397 return accidentalTabPanel;
398 }
399
400 public CardLayout2Ext getAccidentalTabPanelLayout() {
401 return accidentalTabPanelLayout;
402 }
403
404 public TabInfo getBenthosTab() {
405 return benthosTab;
406 }
407
408 public EditSpeciesBatchPanelUI getBenthosTabPanel() {
409 return benthosTabPanel;
410 }
411
412 public TuttiHelpBroker getBroker() {
413 return broker;
414 }
415
416 public JButton getCancelButton() {
417 return cancelButton;
418 }
419
420 public ButtonAttachment getCatchesCaracteristicsAttachmentsButton() {
421 return catchesCaracteristicsAttachmentsButton;
422 }
423
424 public TabInfo getCatchesCaracteristicsTab() {
425 return catchesCaracteristicsTab;
426 }
427
428 public JXTitledPanel getCatchesCaracteristicsTabPane() {
429 return catchesCaracteristicsTabPane;
430 }
431
432 public JToolBar getCatchesCaracteristicsTabToolBar() {
433 return catchesCaracteristicsTabToolBar;
434 }
435
436 public JButton getCleanSpeciesBatchButton() {
437 return cleanSpeciesBatchButton;
438 }
439
440 public JButton getComputeSpeciesBatchButton() {
441 return computeSpeciesBatchButton;
442 }
443
444 public Table getCreateFishingOperationActions() {
445 return createFishingOperationActions;
446 }
447
448 public JMenuItem getExportFishingOperationReportButton() {
449 return exportFishingOperationReportButton;
450 }
451
452 public JMenuItem getExportFishingOperationReportForSumatraButton() {
453 return exportFishingOperationReportForSumatraButton;
454 }
455
456 public JMenuItem getExportMultiPostButton() {
457 return exportMultiPostButton;
458 }
459
460 public EditCatchesUIHandler getHandler() {
461 return handler;
462 }
463
464 public JMenuItem getImportMultiPostButton() {
465 return importMultiPostButton;
466 }
467
468 public TabInfo getMarineLitterTab() {
469 return marineLitterTab;
470 }
471
472 public MarineLitterBatchUI getMarineLitterTabContent() {
473 return marineLitterTabContent;
474 }
475
476 public CreateMarineLitterBatchUI getMarineLitterTabCreateBatch() {
477 return marineLitterTabCreateBatch;
478 }
479
480 public JXTitledPanel getMarineLitterTabCreateBatchReminderLabel() {
481 return marineLitterTabCreateBatchReminderLabel;
482 }
483
484 public JXTitledPanel getMarineLitterTabFishingOperationReminderLabel() {
485 return marineLitterTabFishingOperationReminderLabel;
486 }
487
488 public JPanel getMarineLitterTabPanel() {
489 return marineLitterTabPanel;
490 }
491
492 public CardLayout2Ext getMarineLitterTabPanelLayout() {
493 return marineLitterTabPanelLayout;
494 }
495
496 public JMenuBar getMenu() {
497 return menu;
498 }
499
500 public JMenu getMenuAction() {
501 return menuAction;
502 }
503
504 public EditCatchesUIModel getModel() {
505 return model;
506 }
507
508 public JButton getSaveButton() {
509 return saveButton;
510 }
511
512 public TabInfo getSpeciesTab() {
513 return speciesTab;
514 }
515
516 public EditSpeciesBatchPanelUI getSpeciesTabPanel() {
517 return speciesTabPanel;
518 }
519
520 public JPanel getSvgCanvasPanel() {
521 return svgCanvasPanel;
522 }
523
524 public JTabbedPane getTabPane() {
525 return tabPane;
526 }
527
528 public SwingValidator<EditCatchesUIModel> getValidator() {
529 return validator;
530 }
531
532
533
534
535
536 @Override
537 public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
538 broker.installUI(component, helpId);
539 }
540
541 @Override
542 public void showHelp(String helpId) {
543 getBroker().showHelp(this, helpId);
544 }
545
546
547
548
549
550 protected void addChildrenToAccidentalCaracteristicMapEditorReminderLabel() {
551 if (!allComponentsCreated) {
552 return;
553 }
554 accidentalCaracteristicMapEditorReminderLabel.add(accidentalCaracteristicMapEditor);
555 }
556
557 protected void addChildrenToAccidentalTabCreateBatchReminderLabel() {
558 if (!allComponentsCreated) {
559 return;
560 }
561 accidentalTabCreateBatchReminderLabel.add(accidentalTabCreateBatch);
562 }
563
564 protected void addChildrenToAccidentalTabFishingOperationReminderLabel() {
565 if (!allComponentsCreated) {
566 return;
567 }
568 accidentalTabFishingOperationReminderLabel.add(accidentalTabContent);
569 }
570
571 protected void addChildrenToAccidentalTabPanel() {
572 if (!allComponentsCreated) {
573 return;
574 }
575 accidentalTabPanel.add(accidentalTabFishingOperationReminderLabel, EditCatchesUIHandler.MAIN_CARD);
576 accidentalTabPanel.add(accidentalTabCreateBatchReminderLabel, EditCatchesUIHandler.CREATE_BATCH_CARD);
577 accidentalTabPanel.add(accidentalCaracteristicMapEditorReminderLabel, EditCatchesUIHandler.EDIT_CARACTERISTICS_CARD);
578 }
579
580 protected void addChildrenToCatchesCaracteristicsTabPane() {
581 if (!allComponentsCreated) {
582 return;
583 }
584 catchesCaracteristicsTabPane.add(svgCanvasPanel);
585 }
586
587 protected void addChildrenToCatchesCaracteristicsTabToolBar() {
588 if (!allComponentsCreated) {
589 return;
590 }
591 catchesCaracteristicsTabToolBar.add(menu);
592 catchesCaracteristicsTabToolBar.add(catchesCaracteristicsAttachmentsButton);
593 }
594
595 protected void addChildrenToCreateFishingOperationActions() {
596 if (!allComponentsCreated) {
597 return;
598 }
599 createFishingOperationActions.add(cancelButton, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));
600 createFishingOperationActions.add(saveButton, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));
601 createFishingOperationActions.add(cleanSpeciesBatchButton, new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));
602 createFishingOperationActions.add(computeSpeciesBatchButton, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));
603 }
604
605 protected void addChildrenToEditCatchesTopPanel() {
606 if (!allComponentsCreated) {
607 return;
608 }
609 add(catchesCaracteristicsTabToolBar);
610 add(tabPane, BorderLayout.CENTER);
611 add(createFishingOperationActions, BorderLayout.SOUTH);
612 }
613
614 protected void addChildrenToMarineLitterTabCreateBatchReminderLabel() {
615 if (!allComponentsCreated) {
616 return;
617 }
618 marineLitterTabCreateBatchReminderLabel.add(marineLitterTabCreateBatch);
619 }
620
621 protected void addChildrenToMarineLitterTabFishingOperationReminderLabel() {
622 if (!allComponentsCreated) {
623 return;
624 }
625 marineLitterTabFishingOperationReminderLabel.add(marineLitterTabContent);
626 }
627
628 protected void addChildrenToMarineLitterTabPanel() {
629 if (!allComponentsCreated) {
630 return;
631 }
632 marineLitterTabPanel.add(marineLitterTabFishingOperationReminderLabel, EditCatchesUIHandler.MAIN_CARD);
633 marineLitterTabPanel.add(marineLitterTabCreateBatchReminderLabel, EditCatchesUIHandler.CREATE_BATCH_CARD);
634 }
635
636 protected void addChildrenToMenu() {
637 if (!allComponentsCreated) {
638 return;
639 }
640 menu.add(menuAction);
641 }
642
643 protected void addChildrenToMenuAction() {
644 if (!allComponentsCreated) {
645 return;
646 }
647 menuAction.add(exportFishingOperationReportButton);
648 menuAction.add(exportFishingOperationReportForSumatraButton);
649 menuAction.add(importMultiPostButton);
650 menuAction.add(exportMultiPostButton);
651 }
652
653 protected void addChildrenToTabPane() {
654 if (!allComponentsCreated) {
655 return;
656 }
657 tabPane.add(catchesCaracteristicsTabPane);
658 tabPane.add(speciesTabPanel);
659 tabPane.add(benthosTabPanel);
660 tabPane.add(marineLitterTabPanel);
661 tabPane.add(accidentalTabPanel);
662 catchesCaracteristicsTab.addPropertyChangeListener(new TabInfoPropertyChangeListener(tabPane, 0));
663 speciesTab.addPropertyChangeListener(new TabInfoPropertyChangeListener(tabPane, 1));
664 benthosTab.addPropertyChangeListener(new TabInfoPropertyChangeListener(tabPane, 2));
665 marineLitterTab.addPropertyChangeListener(new TabInfoPropertyChangeListener(tabPane, 3));
666 tabPane.setTitleAt(3, t("tutti.label.tab.marineLitter"));
667 accidentalTab.addPropertyChangeListener(new TabInfoPropertyChangeListener(tabPane, 4));
668 }
669
670 protected void addChildrenToValidator() {
671 if (!allComponentsCreated) {
672 return;
673 }
674 validator.setUiClass(ImageValidationUI.class);
675 validator.setBean(model);
676 }
677
678 protected void createAccidentalCaracteristicMapEditor() {
679 $objectMap.put("accidentalCaracteristicMapEditor", accidentalCaracteristicMapEditor = new CaracteristicMapEditorUI(accidentalTabContent));
680
681 accidentalCaracteristicMapEditor.setName("accidentalCaracteristicMapEditor");
682 }
683
684 protected void createAccidentalCaracteristicMapEditorReminderLabel() {
685 $objectMap.put("accidentalCaracteristicMapEditorReminderLabel", accidentalCaracteristicMapEditorReminderLabel = new JXTitledPanel());
686
687 accidentalCaracteristicMapEditorReminderLabel.setName("accidentalCaracteristicMapEditorReminderLabel");
688 }
689
690 protected void createAccidentalTab() {
691 $objectMap.put("accidentalTab", accidentalTab = new TabInfo());
692 }
693
694 protected void createAccidentalTabContent() {
695 $objectMap.put("accidentalTabContent", accidentalTabContent = new AccidentalBatchUI(this));
696
697 accidentalTabContent.setName("accidentalTabContent");
698 }
699
700 protected void createAccidentalTabCreateBatch() {
701 $objectMap.put("accidentalTabCreateBatch", accidentalTabCreateBatch = new CreateAccidentalBatchUI(this));
702
703 accidentalTabCreateBatch.setName("accidentalTabCreateBatch");
704 }
705
706 protected void createAccidentalTabCreateBatchReminderLabel() {
707 $objectMap.put("accidentalTabCreateBatchReminderLabel", accidentalTabCreateBatchReminderLabel = new JXTitledPanel());
708
709 accidentalTabCreateBatchReminderLabel.setName("accidentalTabCreateBatchReminderLabel");
710 }
711
712 protected void createAccidentalTabFishingOperationReminderLabel() {
713 $objectMap.put("accidentalTabFishingOperationReminderLabel", accidentalTabFishingOperationReminderLabel = new JXTitledPanel());
714
715 accidentalTabFishingOperationReminderLabel.setName("accidentalTabFishingOperationReminderLabel");
716 }
717
718 protected void createAccidentalTabPanel() {
719 $objectMap.put("accidentalTabPanel", accidentalTabPanel = new JPanel());
720
721 accidentalTabPanel.setName("accidentalTabPanel");
722 accidentalTabPanel.setLayout(accidentalTabPanelLayout);
723 }
724
725 protected void createAccidentalTabPanelLayout() {
726 $objectMap.put("accidentalTabPanelLayout", accidentalTabPanelLayout = new CardLayout2Ext(this, "accidentalTabPanel"));
727 }
728
729 protected void createBenthosTab() {
730 $objectMap.put("benthosTab", benthosTab = new TabInfo());
731 }
732
733 protected void createBenthosTabPanel() {
734 $objectMap.put("benthosTabPanel", benthosTabPanel = new EditSpeciesBatchPanelUI(this, SpeciesOrBenthosBatchUISupport.BENTHOS));
735
736 benthosTabPanel.setName("benthosTabPanel");
737 }
738
739 protected void createBroker() {
740 $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.editCatchBatch.help"));
741 }
742
743 protected void createCancelButton() {
744 $objectMap.put("cancelButton", cancelButton = new JButton());
745
746 cancelButton.setName("cancelButton");
747 cancelButton.setText(t("tutti.editCatchBatch.action.cancelEditCatchBatch"));
748 cancelButton.setToolTipText(t("tutti.editCatchBatch.action.cancelEditCatchBatch.tip"));
749 SwingUtil.setComponentHeight(cancelButton,50);
750 cancelButton.putClientProperty("help", "tutti.editCatchBatch.action.cancelEditCatchBatch.help");
751 cancelButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.CancelEditCatchBatchAction.class);
752 }
753
754 protected void createCatchesCaracteristicsAttachmentsButton() {
755 $objectMap.put("catchesCaracteristicsAttachmentsButton", catchesCaracteristicsAttachmentsButton = new ButtonAttachment(getHandler().getContext(), getModel()));
756
757 catchesCaracteristicsAttachmentsButton.setName("catchesCaracteristicsAttachmentsButton");
758 catchesCaracteristicsAttachmentsButton.setToolTipText(t("tutti.editCatchBatch.action.attachments.tip"));
759 catchesCaracteristicsAttachmentsButton.setFocusPainted(false);
760 }
761
762 protected void createCatchesCaracteristicsTab() {
763 $objectMap.put("catchesCaracteristicsTab", catchesCaracteristicsTab = new TabInfo());
764 }
765
766 protected void createCatchesCaracteristicsTabPane() {
767 $objectMap.put("catchesCaracteristicsTabPane", catchesCaracteristicsTabPane = new JXTitledPanel());
768
769 catchesCaracteristicsTabPane.setName("catchesCaracteristicsTabPane");
770 }
771
772 protected void createCatchesCaracteristicsTabToolBar() {
773 $objectMap.put("catchesCaracteristicsTabToolBar", catchesCaracteristicsTabToolBar = new JToolBar());
774
775 catchesCaracteristicsTabToolBar.setName("catchesCaracteristicsTabToolBar");
776 catchesCaracteristicsTabToolBar.setBorderPainted(false);
777 catchesCaracteristicsTabToolBar.setOpaque(true);
778 catchesCaracteristicsTabToolBar.setFloatable(false);
779 }
780
781 protected void createCleanSpeciesBatchButton() {
782 $objectMap.put("cleanSpeciesBatchButton", cleanSpeciesBatchButton = new JButton());
783
784 cleanSpeciesBatchButton.setName("cleanSpeciesBatchButton");
785 cleanSpeciesBatchButton.setText(t("tutti.editCatchBatch.action.cleanWeights"));
786 cleanSpeciesBatchButton.setToolTipText(t("tutti.editCatchBatch.action.cleanWeights.tip"));
787 SwingUtil.setComponentHeight(cleanSpeciesBatchButton,50);
788 cleanSpeciesBatchButton.putClientProperty("help", "tutti.editCatchBatch.action.cleanWeights.help");
789 cleanSpeciesBatchButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.CleanBatchWeightsAction.class);
790 }
791
792 protected void createComputeSpeciesBatchButton() {
793 $objectMap.put("computeSpeciesBatchButton", computeSpeciesBatchButton = new JButton());
794
795 computeSpeciesBatchButton.setName("computeSpeciesBatchButton");
796 computeSpeciesBatchButton.setText(t("tutti.editCatchBatch.action.computeWeights"));
797 computeSpeciesBatchButton.setToolTipText(t("tutti.editCatchBatch.action.computeWeights.tip"));
798 SwingUtil.setComponentHeight(computeSpeciesBatchButton,50);
799 computeSpeciesBatchButton.putClientProperty("help", "tutti.editCatchBatch.action.computeWeights.help");
800 computeSpeciesBatchButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.ComputeBatchWeightsAction.class);
801 }
802
803 protected void createCreateFishingOperationActions() {
804 $objectMap.put("createFishingOperationActions", createFishingOperationActions = new Table());
805
806 createFishingOperationActions.setName("createFishingOperationActions");
807 SwingUtil.setComponentHeight(createFishingOperationActions,50);
808 }
809
810 protected void createExportFishingOperationReportButton() {
811 $objectMap.put("exportFishingOperationReportButton", exportFishingOperationReportButton = new JMenuItem());
812
813 exportFishingOperationReportButton.setName("exportFishingOperationReportButton");
814 exportFishingOperationReportButton.setText(t("tutti.editCatchBatch.action.exportFishingOperationReport"));
815 exportFishingOperationReportButton.setToolTipText(t("tutti.editCatchBatch.action.exportFishingOperationReport.tip"));
816 exportFishingOperationReportButton.putClientProperty("help", "tutti.editCatchBatch.action.exportFishingOperationReport.help");
817 exportFishingOperationReportButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.ExportFishingOperationReportAction.class);
818 }
819
820 protected void createExportFishingOperationReportForSumatraButton() {
821 $objectMap.put("exportFishingOperationReportForSumatraButton", exportFishingOperationReportForSumatraButton = new JMenuItem());
822
823 exportFishingOperationReportForSumatraButton.setName("exportFishingOperationReportForSumatraButton");
824 exportFishingOperationReportForSumatraButton.setText(t("tutti.editCatchBatch.action.exportFishingOperationReportForSumatra"));
825 exportFishingOperationReportForSumatraButton.setToolTipText(t("tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip"));
826 exportFishingOperationReportForSumatraButton.putClientProperty("help", "tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help");
827 exportFishingOperationReportForSumatraButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.ExportFishingOperationForSumatraAction.class);
828 }
829
830 protected void createExportMultiPostButton() {
831 $objectMap.put("exportMultiPostButton", exportMultiPostButton = new JMenuItem());
832
833 exportMultiPostButton.setName("exportMultiPostButton");
834 exportMultiPostButton.setText(t("tutti.editCatchBatch.action.exportMultiPost"));
835 exportMultiPostButton.setToolTipText(t("tutti.editCatchBatch.action.exportMultiPost.tip"));
836 exportMultiPostButton.putClientProperty("help", "tutti.editCatchBatch.action.exportMultiPost.help");
837 exportMultiPostButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.ExportMultiPostCatchAction.class);
838 }
839
840 protected EditCatchesUIHandler createHandler() {
841 return new EditCatchesUIHandler();
842 }
843
844 protected void createImportMultiPostButton() {
845 $objectMap.put("importMultiPostButton", importMultiPostButton = new JMenuItem());
846
847 importMultiPostButton.setName("importMultiPostButton");
848 importMultiPostButton.setText(t("tutti.editCatchBatch.action.importMultiPost"));
849 importMultiPostButton.setToolTipText(t("tutti.editCatchBatch.action.importMultiPost.tip"));
850 importMultiPostButton.putClientProperty("help", "tutti.editCatchBatch.action.importMultiPost.help");
851 importMultiPostButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.ImportMultiPostCatchAction.class);
852 }
853
854 protected void createMarineLitterTab() {
855 $objectMap.put("marineLitterTab", marineLitterTab = new TabInfo());
856
857 marineLitterTab.setTitle(t("tutti.label.tab.marineLitter"));
858 }
859
860 protected void createMarineLitterTabContent() {
861 $objectMap.put("marineLitterTabContent", marineLitterTabContent = new MarineLitterBatchUI(this));
862
863 marineLitterTabContent.setName("marineLitterTabContent");
864 }
865
866 protected void createMarineLitterTabCreateBatch() {
867 $objectMap.put("marineLitterTabCreateBatch", marineLitterTabCreateBatch = new CreateMarineLitterBatchUI(this));
868
869 marineLitterTabCreateBatch.setName("marineLitterTabCreateBatch");
870 }
871
872 protected void createMarineLitterTabCreateBatchReminderLabel() {
873 $objectMap.put("marineLitterTabCreateBatchReminderLabel", marineLitterTabCreateBatchReminderLabel = new JXTitledPanel());
874
875 marineLitterTabCreateBatchReminderLabel.setName("marineLitterTabCreateBatchReminderLabel");
876 }
877
878 protected void createMarineLitterTabFishingOperationReminderLabel() {
879 $objectMap.put("marineLitterTabFishingOperationReminderLabel", marineLitterTabFishingOperationReminderLabel = new JXTitledPanel());
880
881 marineLitterTabFishingOperationReminderLabel.setName("marineLitterTabFishingOperationReminderLabel");
882 }
883
884 protected void createMarineLitterTabPanel() {
885 $objectMap.put("marineLitterTabPanel", marineLitterTabPanel = new JPanel());
886
887 marineLitterTabPanel.setName("marineLitterTabPanel");
888 marineLitterTabPanel.setLayout(marineLitterTabPanelLayout);
889 }
890
891 protected void createMarineLitterTabPanelLayout() {
892 $objectMap.put("marineLitterTabPanelLayout", marineLitterTabPanelLayout = new CardLayout2Ext(this, "marineLitterTabPanel"));
893 }
894
895 protected void createMenu() {
896 $objectMap.put("menu", menu = new JMenuBar());
897
898 menu.setName("menu");
899 }
900
901 protected void createMenuAction() {
902 $objectMap.put("menuAction", menuAction = new JMenu());
903
904 menuAction.setName("menuAction");
905 menuAction.setOpaque(true);
906 menuAction.setText(t("tutti.toolbar.menu.action"));
907 menuAction.setToolTipText(t("tutti.toolbar.menu.action.tip"));
908 }
909
910 protected void createModel() {
911 $objectMap.put("model", model = getContextValue(EditCatchesUIModel.class));
912 }
913
914 protected void createSaveButton() {
915 $objectMap.put("saveButton", saveButton = new JButton());
916
917 saveButton.setName("saveButton");
918 saveButton.setText(t("tutti.editCatchBatch.action.saveCatchBatch"));
919 saveButton.setToolTipText(t("tutti.editCatchBatch.action.saveCatchBatch.tip"));
920 SwingUtil.setComponentHeight(saveButton,50);
921 saveButton.putClientProperty("help", "tutti.editCatchBatch.action.saveCatchBatch.help");
922 saveButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.operation.catches.actions.SaveCatchBatchAction.class);
923 }
924
925 protected void createSpeciesTab() {
926 $objectMap.put("speciesTab", speciesTab = new TabInfo());
927 }
928
929 protected void createSpeciesTabPanel() {
930 $objectMap.put("speciesTabPanel", speciesTabPanel = new EditSpeciesBatchPanelUI(this, SpeciesOrBenthosBatchUISupport.SPECIES));
931
932 speciesTabPanel.setName("speciesTabPanel");
933 }
934
935 protected void createSvgCanvasPanel() {
936 $objectMap.put("svgCanvasPanel", svgCanvasPanel = new JPanel());
937
938 svgCanvasPanel.setName("svgCanvasPanel");
939 svgCanvasPanel.setLayout(new BorderLayout());
940 }
941
942 protected void createTabPane() {
943 $objectMap.put("tabPane", tabPane = new JTabbedPane());
944
945 tabPane.setName("tabPane");
946 }
947
948 protected void createValidator() {
949 $objectMap.put("validator", validator = SwingValidator.newValidator(EditCatchesUIModel.class, "validate"));
950 }
951
952
953
954
955
956 private void $completeSetup() {
957 allComponentsCreated = true;
958 if (log.isDebugEnabled()) {
959 log.debug(this);
960 }
961 addChildrenToEditCatchesTopPanel();
962 addChildrenToValidator();
963 addChildrenToCatchesCaracteristicsTabToolBar();
964 addChildrenToMenu();
965 addChildrenToMenuAction();
966 addChildrenToTabPane();
967 addChildrenToCatchesCaracteristicsTabPane();
968 addChildrenToMarineLitterTabPanel();
969 addChildrenToMarineLitterTabFishingOperationReminderLabel();
970 addChildrenToMarineLitterTabCreateBatchReminderLabel();
971 addChildrenToAccidentalTabPanel();
972 addChildrenToAccidentalTabFishingOperationReminderLabel();
973 addChildrenToAccidentalTabCreateBatchReminderLabel();
974 addChildrenToAccidentalCaracteristicMapEditorReminderLabel();
975 addChildrenToCreateFishingOperationActions();
976
977
978 JAXXUtil.applyDataBinding(this, $bindings.keySet());
979
980
981 menu.setBorder(null);
982 menu.setBackground(javax.swing.UIManager.getColor("MenuBar.background"));
983 menuAction.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.toolbar.menu.action.mnemonic"),'Z'));
984 exportFishingOperationReportButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.exportFishingOperationReport.mnemonic"),'Z'));
985 exportFishingOperationReportButton.setIcon(SwingUtil.createActionIcon("export"));
986 exportFishingOperationReportForSumatraButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.mnemonic"),'Z'));
987 exportFishingOperationReportForSumatraButton.setIcon(SwingUtil.createActionIcon("export"));
988 importMultiPostButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.importMultiPost.mnemonic"),'Z'));
989 importMultiPostButton.setIcon(SwingUtil.createActionIcon("import"));
990 exportMultiPostButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.exportMultiPost.mnemonic"),'Z'));
991 exportMultiPostButton.setIcon(SwingUtil.createActionIcon("export"));
992 catchesCaracteristicsTabPane.setRightDecoration(catchesCaracteristicsTabToolBar);
993 cancelButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.cancelEditCatchBatch.mnemonic"),'Z'));
994 cancelButton.setIcon(SwingUtil.createActionIcon("cancel"));
995 saveButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.saveCatchBatch.mnemonic"),'Z'));
996 saveButton.setIcon(SwingUtil.createActionIcon("save"));
997 cleanSpeciesBatchButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.cleanWeights.mnemonic"),'Z'));
998 cleanSpeciesBatchButton.setIcon(SwingUtil.createActionIcon("clean"));
999 computeSpeciesBatchButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCatchBatch.action.computeWeights.mnemonic"),'Z'));
1000 computeSpeciesBatchButton.setIcon(SwingUtil.createActionIcon("generate"));
1001
1002
1003 TuttiHelpBroker _broker = getBroker();
1004 registerHelpId(_broker, editCatchesTopPanel, "tutti.editCatchBatch.help");
1005 registerHelpId(_broker, exportFishingOperationReportButton, "tutti.editCatchBatch.action.exportFishingOperationReport.help");
1006 registerHelpId(_broker, exportFishingOperationReportForSumatraButton, "tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help");
1007 registerHelpId(_broker, importMultiPostButton, "tutti.editCatchBatch.action.importMultiPost.help");
1008 registerHelpId(_broker, exportMultiPostButton, "tutti.editCatchBatch.action.exportMultiPost.help");
1009 registerHelpId(_broker, cancelButton, "tutti.editCatchBatch.action.cancelEditCatchBatch.help");
1010 registerHelpId(_broker, saveButton, "tutti.editCatchBatch.action.saveCatchBatch.help");
1011 registerHelpId(_broker, cleanSpeciesBatchButton, "tutti.editCatchBatch.action.cleanWeights.help");
1012 registerHelpId(_broker, computeSpeciesBatchButton, "tutti.editCatchBatch.action.computeWeights.help");
1013 _broker.prepareUI(this);
1014
1015 validatorIds = SwingValidatorUtil.detectValidators(this);
1016 SwingValidatorUtil.installUI(this);
1017 }
1018
1019 private void $initialize() {
1020 if (allComponentsCreated) {
1021 return;
1022 }
1023 if (log.isDebugEnabled()) {
1024 log.debug(this);
1025 }
1026 handler.beforeInit(this);
1027 $objectMap.put("editCatchesTopPanel", editCatchesTopPanel);
1028 createModel();
1029 createValidator();
1030 createMarineLitterTabPanelLayout();
1031 createAccidentalTabPanelLayout();
1032 createBroker();
1033 createCatchesCaracteristicsTabToolBar();
1034 createMenu();
1035 createMenuAction();
1036 createExportFishingOperationReportButton();
1037 createExportFishingOperationReportForSumatraButton();
1038 createImportMultiPostButton();
1039 createExportMultiPostButton();
1040 createCatchesCaracteristicsAttachmentsButton();
1041 createTabPane();
1042 createCatchesCaracteristicsTabPane();
1043 createSvgCanvasPanel();
1044 createSpeciesTabPanel();
1045 createBenthosTabPanel();
1046 createMarineLitterTabPanel();
1047 createMarineLitterTabFishingOperationReminderLabel();
1048 createMarineLitterTabContent();
1049 createMarineLitterTabCreateBatchReminderLabel();
1050 createMarineLitterTabCreateBatch();
1051 createAccidentalTabPanel();
1052 createAccidentalTabFishingOperationReminderLabel();
1053 createAccidentalTabContent();
1054 createAccidentalTabCreateBatchReminderLabel();
1055 createAccidentalTabCreateBatch();
1056 createAccidentalCaracteristicMapEditorReminderLabel();
1057 createAccidentalCaracteristicMapEditor();
1058 createCreateFishingOperationActions();
1059 createCancelButton();
1060 createSaveButton();
1061 createCleanSpeciesBatchButton();
1062 createComputeSpeciesBatchButton();
1063 createCatchesCaracteristicsTab();
1064 createSpeciesTab();
1065 createBenthosTab();
1066 createMarineLitterTab();
1067 createAccidentalTab();
1068
1069 setName("editCatchesTopPanel");
1070 setLayout(new BorderLayout());
1071 editCatchesTopPanel.putClientProperty("help", "tutti.editCatchBatch.help");
1072
1073
1074 $registerDefaultBindings();
1075 $completeSetup();
1076 handler.afterInit(this);
1077 }
1078
1079 private void $registerDefaultBindings() {
1080
1081 registerDataBinding(new DefaultJAXXBinding(this, BINDING_CATCHES_CARACTERISTICS_ATTACHMENTS_BUTTON_ENABLED, true) {
1082
1083 @Override
1084 public void applyDataBinding() {
1085 if (model != null) {
1086 model.addPropertyChangeListener("objectId", this);
1087 }
1088 }
1089
1090 @Override
1091 public void processDataBinding() {
1092 if (model != null) {
1093 catchesCaracteristicsAttachmentsButton.setEnabled(model.getObjectId() != null);
1094 }
1095 }
1096
1097 @Override
1098 public void removeDataBinding() {
1099 if (model != null) {
1100 model.removePropertyChangeListener("objectId", this);
1101 }
1102 }
1103 });
1104 registerDataBinding(new DefaultJAXXBinding(this, BINDING_MARINE_LITTER_TAB_FISHING_OPERATION_REMINDER_LABEL_RIGHT_DECORATION, true) {
1105
1106 @Override
1107 public void applyDataBinding() {
1108 if (marineLitterTabContent != null) {
1109 marineLitterTabContent.addPropertyChangeListener("marineLitterBatchTabToolBar", this);
1110 }
1111 }
1112
1113 @Override
1114 public void processDataBinding() {
1115 if (marineLitterTabContent != null) {
1116 marineLitterTabFishingOperationReminderLabel.setRightDecoration(marineLitterTabContent.getMarineLitterBatchTabToolBar());
1117 }
1118 }
1119
1120 @Override
1121 public void removeDataBinding() {
1122 if (marineLitterTabContent != null) {
1123 marineLitterTabContent.removePropertyChangeListener("marineLitterBatchTabToolBar", this);
1124 }
1125 }
1126 });
1127 registerDataBinding(new DefaultJAXXBinding(this, BINDING_ACCIDENTAL_TAB_FISHING_OPERATION_REMINDER_LABEL_RIGHT_DECORATION, true) {
1128
1129 @Override
1130 public void applyDataBinding() {
1131 if (accidentalTabContent != null) {
1132 accidentalTabContent.addPropertyChangeListener("accidentalBatchTabToolBar", this);
1133 }
1134 }
1135
1136 @Override
1137 public void processDataBinding() {
1138 if (accidentalTabContent != null) {
1139 accidentalTabFishingOperationReminderLabel.setRightDecoration(accidentalTabContent.getAccidentalBatchTabToolBar());
1140 }
1141 }
1142
1143 @Override
1144 public void removeDataBinding() {
1145 if (accidentalTabContent != null) {
1146 accidentalTabContent.removePropertyChangeListener("accidentalBatchTabToolBar", this);
1147 }
1148 }
1149 });
1150 registerDataBinding(new DefaultJAXXBinding(this, BINDING_SAVE_BUTTON_ENABLED, true) {
1151
1152 @Override
1153 public void applyDataBinding() {
1154 if (model != null) {
1155 model.addPropertyChangeListener("modify", this);
1156 }
1157 }
1158
1159 @Override
1160 public void processDataBinding() {
1161 if (model != null) {
1162 saveButton.setEnabled(model.isModify());
1163 }
1164 }
1165
1166 @Override
1167 public void removeDataBinding() {
1168 if (model != null) {
1169 model.removePropertyChangeListener("modify", this);
1170 }
1171 }
1172 });
1173 }
1174
1175 }