@@ -125,250 +125,6 @@ public EfaBaseFrameMultisession(JDialog parent, int mode, AdminRecord admin,
125125 public EfaBaseFrameMultisession (EfaBoathouseFrame efaBoathouseFrame , int mode ) {
126126 super (efaBoathouseFrame , mode );
127127 }
128-
129-
130- /**
131- *
132- */
133- /* mostly same elements, but slightly diffrent order of the values */
134- /*
135- protected void iniGuiMain() {
136- int yPos=0;
137- int HEADER_WIDTH=9;
138-
139- JPanel mainInputPanel = new JPanel();
140- mainInputPanel.setLayout(new GridBagLayout());
141- mainPanel.add(mainInputPanel, BorderLayout.NORTH);
142-
143- ItemTypeLabelHeader header = createHeader("CREATE_MULTISESSION", 0, null,
144- (mode == EfaBaseFrame.MODE_BOATHOUSE_START_MULTISESSION ? International.getString("Mehrere Einzelfahrten beginnen") : International.getString("Mehrere Einzelfahrten nachtragen")),
145- HEADER_WIDTH);
146- header.displayOnGui(this, mainInputPanel, 0, yPos);
147- yPos++;
148-
149- // Date, Enddate, optionally a button to append end date
150- date = new ItemTypeDate(LogbookRecord.DATE, new DataTypeDate(), IItemType.TYPE_PUBLIC, null, International.getStringWithMnemonic("Datum"));
151- date.showWeekday(true);
152- date.setFieldSize(100, FIELD_HEIGHT);
153- date.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
154- date.setFieldGrid(1, GridBagConstraints.WEST, GridBagConstraints.NONE);
155- date.setWeekdayGrid(2, GridBagConstraints.WEST, GridBagConstraints.NONE);
156- date.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
157- date.displayOnGui(this, mainInputPanel, 0, yPos);
158- date.registerItemListener(this);
159-
160- // End Date
161- enddate = new ItemTypeDate(LogbookRecord.ENDDATE, new DataTypeDate(), IItemType.TYPE_PUBLIC, null, International.getStringWithMnemonic("bis"));
162- enddate.setMustBeAfter(date, false);
163- enddate.showWeekday(true);
164- enddate.setFieldSize(100, FIELD_HEIGHT);
165- enddate.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
166- enddate.setFieldGrid(2, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL);
167- enddate.setWeekdayGrid(1, GridBagConstraints.WEST, GridBagConstraints.NONE);
168- enddate.showOptional(true);
169- if (isModeBoathouse()) {
170- enddate.setOptionalButtonText("+ " + International.getString("Enddatum"));
171- }
172- enddate.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
173- enddate.displayOnGui(this, mainInputPanel, 4, yPos);
174- enddate.registerItemListener(this);
175- if (isModeBoathouse() && !Daten.efaConfig.getValueAllowEnterEndDate()) {
176- enddate.setVisible(false);
177- }
178-
179- yPos++;
180-
181-
182- // Start Time, End Time, including according labels AND Session Type.
183-
184- // StartTime
185- starttime = new ItemTypeTime(LogbookRecord.STARTTIME, new DataTypeTime(), IItemType.TYPE_PUBLIC, null, International.getStringWithMnemonic("Abfahrt"));
186- starttime.setFieldSize(200, FIELD_HEIGHT);
187- starttime.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
188- starttime.setFieldGrid(2, GridBagConstraints.WEST, GridBagConstraints.NONE);
189- starttime.enableSeconds(false);
190- starttime.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
191- //starttime.setPadding(0, 0, VERTICAL_WHITESPACE_PADDING_GROUPS, 0);
192- starttime.displayOnGui(this, mainInputPanel, 0, yPos);
193- starttime.registerItemListener(this);
194-
195- starttimeInfoLabel = new ItemTypeLabel("GUIITEM_STARTTIME_INFOLABEL",
196- IItemType.TYPE_PUBLIC, null, "");
197- starttimeInfoLabel.setFieldGrid(5, GridBagConstraints.WEST, GridBagConstraints.NONE);
198- starttimeInfoLabel.setVisible(false);
199- //starttimeInfoLabel.setPadding(0, 0, VERTICAL_WHITESPACE_PADDING_GROUPS, 0);
200- starttimeInfoLabel.displayOnGui(this, mainInputPanel, 3, yPos);
201-
202- yPos++;
203-
204- // EndTime
205- endtime = new ItemTypeTime(LogbookRecord.ENDTIME, new DataTypeTime(), IItemType.TYPE_PUBLIC, null, International.getStringWithMnemonic("Ankunft"));
206- endtime.setFieldSize(200, FIELD_HEIGHT);
207- endtime.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
208- endtime.setFieldGrid(2, GridBagConstraints.WEST, GridBagConstraints.NONE);
209- endtime.enableSeconds(false);
210- endtime.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
211- endtime.displayOnGui(this, mainInputPanel, 0, yPos);
212- endtime.registerItemListener(this);
213-
214- endtimeInfoLabel = new ItemTypeLabel("GUIITEM_ENDTIME_INFOLABEL",
215- IItemType.TYPE_PUBLIC, null, "");
216- endtimeInfoLabel.setFieldGrid(5, GridBagConstraints.WEST, GridBagConstraints.NONE);
217- endtimeInfoLabel.setVisible(false);
218- endtimeInfoLabel.displayOnGui(this, mainInputPanel, 3, yPos);
219-
220- endtime.setVisible(mode == EfaBaseFrame.MODE_BOATHOUSE_LATEENTRY_MULTISESSION);
221- endtimeInfoLabel.setVisible(endtime.isVisible());
222-
223- yPos++;
224-
225- // Session Type
226- sessiontype = new ItemTypeStringList(LogbookRecord.SESSIONTYPE, EfaTypes.TYPE_SESSION_NORMAL,
227- EfaTypes.makeSessionTypeArray(EfaTypes.ARRAY_STRINGLIST_VALUES), EfaTypes.makeSessionTypeArray(EfaTypes.ARRAY_STRINGLIST_DISPLAY),
228- IItemType.TYPE_PUBLIC, null, International.getString("Fahrtart"));
229- sessiontype.setFieldSize(200, FIELD_HEIGHT);
230- sessiontype.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
231- sessiontype.setFieldGrid(2, GridBagConstraints.WEST, GridBagConstraints.NONE);
232- sessiontype.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
233- sessiontype.displayOnGui(this, mainInputPanel, 0, yPos);
234- sessiontype.registerItemListener(this);
235- sessiontype.setReplaceValues(Daten.efaTypes.getSessionTypeReplaceValues());
236-
237- // Session Type Info
238- sessionTypeInfo = new ItemTypeLabel("SESSIONTYPE_LABEL", IItemType.TYPE_PUBLIC, null, "");
239- sessionTypeInfo.setFieldGrid(5, GridBagConstraints.WEST, GridBagConstraints.NONE);
240- sessionTypeInfo.registerItemListener(this);
241- sessionTypeInfo.activateMouseClickListener();
242- sessionTypeInfo.displayOnGui(this, mainInputPanel, 5, yPos);
243-
244- yPos++;
245- //---------------------------------------------------------------------
246-
247- teilnehmerUndBoot=new JPanel();
248- teilnehmerUndBoot.setLayout(new GridBagLayout());
249- teilnehmerUndBoot.removeAll();
250- teilnehmerUndBoot.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
251-
252- mainInputPanel.add(teilnehmerUndBoot, new GridBagConstraints(0, yPos, HEADER_WIDTH, 1, 0, 0,
253- GridBagConstants.WEST, GridBagConstants.HORIZONTAL, new Insets(0,0,0,0), 0, 0));
254-
255-
256- // mainInputPanel.ad
257- nameAndBoat = new ItemTypeItemList("NameAndBoat", new Vector<IItemType[]>(), this,
258- IItemType.TYPE_PUBLIC, null,
259- International.getString("Teilnehmer und Boot"));
260- //crontab.setScrollPane(1000, 400);
261- nameAndBoat.setRepeatTitle(false);
262- nameAndBoat.setAppendPositionToEachElement(true);
263- nameAndBoat.setXForAddDelButtons(6); // two columns, both with name, edit field, autocomplete button
264- nameAndBoat.setItemsOrientation(ItemTypeItemList.Orientation.horizontal);
265- nameAndBoat.setFieldGrid(8, GridBagConstraints.EAST, GridBagConstraints.BOTH);
266- nameAndBoat.setFirstColumnMinWidth(getLongestLabelTextWidth(mainInputPanel));
267- nameAndBoat.setPadding(0, 0, 10, 10);
268- //nameAndBoat.setFirstColumnMinWidth(mainInputPanelGrid.getLayoutDimensions()[0][0]);
269- // Multisession means at least two persons with an individual boat are to go
270- addStandardItems(nameAndBoat,4);
271- nameAndBoat.displayOnGui(this, teilnehmerUndBoot, 0, 0);
272- nameAndBoat.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
273-
274- // Name (crew) and Boat (single boat items only)
275-
276- yPos++;
277-
278- header = createHeader("CREATE_DESTINATION", 0, null, International.getString("Ziel und weitere Angaben"),HEADER_WIDTH);
279- header.displayOnGui(this, mainInputPanel, 0, yPos);
280- yPos++;
281-
282- // Destination
283- destination = new ItemTypeStringAutoComplete(LogbookRecord.DESTINATIONNAME, "", IItemType.TYPE_PUBLIC, null,
284- International.getStringWithMnemonic("Ziel") + " / " +
285- International.getStringWithMnemonic("Strecke"), true);
286- destination.setFieldSize(400, FIELD_HEIGHT);
287- destination.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
288- destination.setFieldGrid(8, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL);
289- destination.setAutoCompleteData(autoCompleteListDestinations);
290- destination.setChecks(true, false);
291- destination.setIgnoreEverythingAfter(DestinationRecord.DESTINATION_VARIANT_SEPARATOR);
292- destination.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
293- destination.displayOnGui(this, mainInputPanel, 0, yPos);
294- destination.registerItemListener(this);
295- yPos++;
296-
297- destinationInfo = new ItemTypeString("GUIITEM_DESTINATIONINFO", "",
298- IItemType.TYPE_PUBLIC, null, International.getString("Gewässer"));
299- destinationInfo.setFieldSize(400, FIELD_HEIGHT);
300- destinationInfo.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
301- destinationInfo.setFieldGrid(8, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL);
302- destinationInfo.displayOnGui(this, mainInputPanel, 0, yPos);
303- destinationInfo.setEditable(false);
304- destinationInfo.setVisible(false);
305- yPos++;
306-
307- // Waters
308- waters = new ItemTypeStringAutoComplete(GUIITEM_ADDITIONALWATERS, "", IItemType.TYPE_PUBLIC, null,
309- International.getStringWithMnemonic("Gewässer"), true);
310- waters.setFieldSize(400, FIELD_HEIGHT);
311- waters.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
312- waters.setFieldGrid(8, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL);
313- waters.setAutoCompleteData(autoCompleteListWaters);
314- waters.setChecks(true, false);
315- waters.setIgnoreEverythingAfter(LogbookRecord.WATERS_SEPARATORS);
316- waters.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
317- waters.displayOnGui(this, mainInputPanel, 0, yPos);
318- waters.registerItemListener(this);
319- waters.setVisible(false);
320-
321- yPos++;
322-
323- // Distance
324- distance = new ItemTypeDistance(LogbookRecord.DISTANCE, null, IItemType.TYPE_PUBLIC, null,
325- DataTypeDistance.getDefaultUnitName());
326- distance.setFieldSize(200, FIELD_HEIGHT);
327- distance.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
328- distance.setFieldGrid(2, GridBagConstraints.WEST, GridBagConstraints.NONE);
329- distance.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
330- distance.displayOnGui(this, mainInputPanel, 0, yPos);
331- distance.registerItemListener(this);
332- distance.setVisible(mode == EfaBaseFrame.MODE_BOATHOUSE_LATEENTRY_MULTISESSION);
333-
334- yPos++;
335- // Comments
336- comments = new ItemTypeString(LogbookRecord.COMMENTS, null, IItemType.TYPE_PUBLIC, null, International.getStringWithMnemonic("Bemerkungen"));
337- comments.setFieldSize(400, FIELD_HEIGHT);
338- comments.setLabelGrid(1, GridBagConstraints.EAST, GridBagConstraints.NONE);
339- comments.setFieldGrid(8, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL);
340- comments.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
341- comments.setPadding(0, 0, VERTICAL_WHITESPACE_PADDING_GROUPS, 0);
342- comments.displayOnGui(this, mainInputPanel, 0, yPos);
343- comments.registerItemListener(this);
344- yPos++;
345-
346- //---------------- old *-----------------------
347-
348- // Info Label
349- infoLabel.setForeground(Color.blue);
350- infoLabel.setHorizontalTextPosition(SwingConstants.LEFT);
351- infoLabel.setText(" ");
352- mainInputPanel.add(infoLabel,
353- new GridBagConstraints(0, yPos, 8, 1, 0.0, 0.0,
354- GridBagConstraints.WEST, GridBagConstraints.NONE,
355- new Insets(10, 20, 10, 0), 0, 0));
356-
357- // Save Button
358- saveButton = new ItemTypeButton("SAVE", IItemType.TYPE_PUBLIC, null, (mode == EfaBaseFrame.MODE_BOATHOUSE_START_MULTISESSION ? International.getString("Eintrag speichern") : International.getString("Nachtrag")));
359- saveButton.setBackgroundColorWhenFocused(Daten.efaConfig.getValueEfaDirekt_colorizeInputField() ? Color.yellow : null);
360- saveButton.setIcon(getIcon(BaseDialog.IMAGE_ACCEPT));
361- saveButton.displayOnGui(this, mainPanel, BorderLayout.SOUTH);
362- saveButton.registerItemListener(this);
363-
364- createAllUnusedElements();
365-
366- destination.setValidAt(date, starttime);
367-
368- Dimension dim = mainPanel.getMinimumSize();
369- dim.height = dim.height + ADD_HEIGHT_TO_DIALOG;
370- mainPanel.setMinimumSize(dim);
371- } */
372128
373129 protected void iniGuiMain () {
374130 int yPos =0 ;
0 commit comments