source: trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java@ 6149

Last change on this file since 6149 was 6149, checked in by jmt12, 20 years ago

Opps.

  • Property svn:keywords set to Author Date Id Revision
File size: 23.1 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the Gatherer application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * <BR><BR>
9 *
10 * Author: John Thompson, Greenstone Digital Library, University of Waikato
11 *
12 * <BR><BR>
13 *
14 * Copyright (C) 1999 New Zealand Digital Library Project
15 *
16 * <BR><BR>
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * <BR><BR>
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * <BR><BR>
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 *########################################################################
36 */
37package org.greenstone.gatherer.collection;
38
39import java.awt.*;
40import java.awt.event.*;
41import java.io.*;
42import java.util.ArrayList;
43import javax.swing.*;
44import javax.swing.event.*;
45import org.greenstone.gatherer.checklist.CheckList;
46import org.greenstone.gatherer.checklist.Entry;
47import org.greenstone.gatherer.Dictionary;
48import org.greenstone.gatherer.Gatherer;
49import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
50import org.greenstone.gatherer.collection.Collection;
51import org.greenstone.gatherer.gui.ModalDialog;
52import org.greenstone.gatherer.gui.SimpleMenuBar;
53import org.greenstone.gatherer.shell.GShell;
54import org.greenstone.gatherer.shell.GShellEvent;
55import org.greenstone.gatherer.shell.GShellListener;
56import org.greenstone.gatherer.util.ArrayTools;
57import org.greenstone.gatherer.util.GSDLSiteConfig;
58import org.greenstone.gatherer.util.StaticStrings;
59import org.greenstone.gatherer.util.Utility;
60
61/** This class provides the functionality to export current collections from the GSDLHOME/collect/ directory to CDROM. The user chooses the collection from a list, where each entry also displays details about itself, confirms the delete of a collection by checking a checkbox then presses the ok button to actually delete the collection.
62 Copied from DeleteCollectionPrompt
63 * @author John Thompson, Greenstone Digital Library, University of Waikato
64 * @version 2.3
65 */
66public class ExportCollectionPrompt
67 extends ModalDialog
68 implements GShellListener {
69
70 private OKButtonListener ok_button_listener;
71 private ArrayList all_collections = null;
72 private ArrayList selected_collections = null;
73 /** The list of collections to export */
74 private CheckList list = null;
75 /** The currently selected collection for deletion. */
76 private BasicCollectionConfiguration collection = null;
77 /** The model behind the list. */
78 private DefaultListModel list_model = null;
79 /** A reference to ourself so any inner-classes can dispose of us. */
80 private ExportCollectionPrompt prompt = null;
81 /** The close button, which exits the prompt without deleting anything. */
82 private JButton cancel_button = null;
83 /** The ok button which causes the selected collection to be deleted. */
84 private JButton ok_button = null;
85 /** The label above details. */
86 private JLabel details_label = null;
87 /** The label above the list. */
88 private JLabel list_label = null;
89 /** The list of available collections. */
90 //private JList list = null;
91 /** The text area used to display details about the collection selected. */
92 private JTextArea details_textarea = null;
93 /** The text area used to display instructions for the export */
94 private JTextArea instructions_textarea;
95 /** A string array used to pass arguments to the phrase retrieval method. */
96 private JTextField title_field = null;
97 private JLabel title_label = null;
98 private String args[] = null;
99 private String cd_title = null;
100 /** whether the exporting was successful or not */
101 private boolean successful = false;
102 /** whether we are trying to export or not */
103 private boolean exporting = false;
104 /** the error message if any */
105 private StringBuffer error_message = null;
106 /** The size of the export prompt screen. */
107 public static final Dimension SIZE = new Dimension(500, 500);
108
109 /** Constructor.
110 * @see org.greenstone.gatherer.collection.ExportCollectionPrompt.CancelButtonListener
111 * @see org.greenstone.gatherer.collection.ExportCollectionPrompt.CollectionListListener
112 * @see org.greenstone.gatherer.collection.ExportCollectionPrompt.OKButtonListener
113 */
114 public ExportCollectionPrompt() {
115 super(Gatherer.g_man, true);
116 cancel_button = new JButton();
117 cancel_button.setMnemonic(KeyEvent.VK_C);
118 Dictionary.setBoth(cancel_button, "General.Close", "General.Close_Tooltip");
119 details_textarea = new JTextArea();
120 details_textarea.setEditable(false);
121 details_textarea.setFont(Gatherer.config.getFont("general.tooltip_font", false));
122 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.No_Collection");
123 details_label = new JLabel();
124 Dictionary.setText(details_label, "DeleteCollectionPrompt.Collection_Details");
125
126 instructions_textarea = new JTextArea();
127 instructions_textarea.setCaretPosition(0);
128 instructions_textarea.setEditable(false);
129 instructions_textarea.setLineWrap(true);
130 instructions_textarea.setRows(4);
131 instructions_textarea.setWrapStyleWord(true);
132 Dictionary.registerText(instructions_textarea, "ExportCollectionPrompt.Instructions");
133
134 //list = new JList();
135 //list_model = new DefaultListModel();
136 all_collections = new ArrayList();
137 list = new CheckList(true);
138 list_label = new JLabel();
139 Dictionary.setText(list_label, "DeleteCollectionPrompt.Collection_List");
140 ok_button = new JButton();
141 ok_button.setMnemonic(KeyEvent.VK_D);
142 Dictionary.setBoth(ok_button, "ExportCollectionPrompt.Export", "ExportCollectionPrompt.Export_Tooltip");
143
144 title_field = new JTextField();
145 Dictionary.setTooltip(title_field, "ExportCollectionPrompt.CD_Name_Tooltip");
146 title_label = new JLabel();
147 Dictionary.setText(title_label, "ExportCollectionPrompt.CD_Name");
148 //title_label.setPreferredSize(new Dimension(100, 40));
149 scanForCollections();
150 list.setListData(all_collections.toArray());
151
152 prompt = this;
153 setSize(SIZE);
154 Dictionary.setText(this, "ExportCollectionPrompt.Title");
155
156 setJMenuBar(new SimpleMenuBar("0")); // need to find an appropriate help page to open at
157 cancel_button.addActionListener(new CancelButtonListener());
158 list.addListSelectionListener(new CollectionListListener());
159 list.clearSelection();
160 list.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
161 ok_button_listener = new OKButtonListener();
162 ok_button.addActionListener(ok_button_listener);
163 ok_button.setEnabled(false);
164 //title.getDocument().addDocumentListener(new DocumentListener());
165 }
166
167 /** Destructor. */
168 public void destroy() {
169 all_collections.clear();
170 all_collections = null;
171 cancel_button = null;
172 details_textarea = null;
173 details_label = null;
174 list = null;
175 ok_button = null;
176 prompt = null;
177 if (selected_collections!=null) {
178 selected_collections.clear();
179 selected_collections = null;
180 }
181 title_field = null;
182 title_label = null;
183 }
184
185 /** This method causes the modal prompt to be displayed.
186 * returns true if it has exported the collections that are currently selected */
187 public boolean display() {
188 // Top pane
189 JPanel instructions_pane = new JPanel(new BorderLayout());
190 instructions_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
191 instructions_pane.add(new JScrollPane(instructions_textarea), BorderLayout.CENTER);
192
193 title_label.setBorder(BorderFactory.createEmptyBorder(0,5,0,15));
194
195 JPanel title_pane = new JPanel(new BorderLayout());
196 title_pane.add(title_label, BorderLayout.WEST);
197 title_pane.add(title_field, BorderLayout.CENTER);
198 instructions_pane.add(title_pane, BorderLayout.SOUTH);
199
200 // Central pane
201 JPanel list_pane = new JPanel(new BorderLayout());
202 list_pane.add(list_label, BorderLayout.NORTH);
203 list_pane.add(new JScrollPane(list), BorderLayout.CENTER);
204 list_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
205
206 JPanel details_pane = new JPanel(new BorderLayout());
207 details_pane.add(details_label, BorderLayout.NORTH);
208 details_pane.add(new JScrollPane(details_textarea), BorderLayout.CENTER);
209 details_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
210
211 JPanel central_pane = new JPanel(new GridLayout(2, 1));
212 central_pane.add(list_pane);
213 central_pane.add(details_pane);
214 central_pane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
215
216 // Lower pane
217 JPanel button_pane = new JPanel(new GridLayout(1, 2));
218 button_pane.add(ok_button);
219 button_pane.add(cancel_button);
220 button_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
221
222 JPanel lower_pane = new JPanel(new BorderLayout());
223 lower_pane.add(button_pane, BorderLayout.SOUTH);
224 lower_pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
225
226 // Final.
227 JPanel content_pane = (JPanel)this.getContentPane();
228 content_pane.setLayout(new BorderLayout());
229 content_pane.add(instructions_pane, BorderLayout.NORTH);
230 content_pane.add(central_pane, BorderLayout.CENTER);
231 content_pane.add(lower_pane, BorderLayout.SOUTH);
232
233 // Center and display.
234 Dimension screen_size = Gatherer.config.screen_size;
235 this.setLocation((screen_size.width - SIZE.width) / 2, (screen_size.height - SIZE.height) / 2);
236 this.setVisible(true); // blocks until the dialog is killed
237 return true;
238
239 }
240
241
242 /** This method calls the builcol.pl scripts via a GShell so as to not lock up the processor.
243 * @see org.greenstone.gatherer.Configuration
244 * @see org.greenstone.gatherer.Gatherer
245 * @see org.greenstone.gatherer.Message
246 * @see org.greenstone.gatherer.collection.Collection
247 * @see org.greenstone.gatherer.gui.BuildOptions
248 * @see org.greenstone.gatherer.shell.GShell
249 * @see org.greenstone.gatherer.shell.GShellListener
250 * @see org.greenstone.gatherer.shell.GShellProgressMonitor
251 * @see org.greenstone.gatherer.util.Utility
252 */
253 public void exportCollections() {
254 Gatherer.println("ExportCollectionPrompt.exportCollection()");
255
256 int num_collections = selected_collections.size();
257 if (num_collections == 0) return;
258 cd_title = title_field.getText();
259 cd_title = cd_title.trim();
260 cd_title = cd_title.replaceAll("\"","");
261 int num_args = num_collections + 1;
262 boolean has_title = false;
263 if (!cd_title.equals("")) {
264 num_args += 2;
265 has_title = true;
266 }
267 String args[];
268 int next_arg = 0;
269 if(Utility.isWindows()) {
270 args = new String[num_args+2];
271 args[0] = Gatherer.config.perl_path;
272 args[1] = "-S";
273 next_arg = 2;
274 } else {
275 args = new String[num_args];
276 }
277
278 args[next_arg] = Gatherer.config.getScriptPath() + "exportcol.pl";
279 next_arg++;
280 if (has_title) {
281 args[next_arg] = "-cdname"; next_arg++;
282 args[next_arg] = cd_title; next_arg++;
283 }
284 for (int i=0; i<num_collections;i++,next_arg++) {
285 args[next_arg] = ((BasicCollectionConfiguration)selected_collections.get(i)).getShortName();
286 }
287
288 Gatherer.print("export command = ");
289 for (int i=0; i<args.length; i++) {
290 Gatherer.print(args[i]+" ");
291 }
292 Gatherer.println("");
293 GShell process = new GShell(args, GShell.EXPORT, 3, this, null, GShell.GSHELL_EXPORT);
294 process.start();
295 //process.run();
296 Gatherer.println("ExportCollectionPrompt.exportCollection().return");
297 }
298
299 /** Shows an export complete prompt.
300 * @param success A <strong>boolean</strong> indicating if the collection was successfully deleted.
301 * @see org.greenstone.gatherer.collection.Collection
302 */
303 public void resultPrompt(boolean success, String extra) {
304 args = new String[2];
305 StringBuffer coll_names = new StringBuffer();
306 for (int i=0; i<selected_collections.size();i++) {
307 if (i>0) {
308 coll_names.append(", ");
309 }
310 BasicCollectionConfiguration complete_collection = (BasicCollectionConfiguration)selected_collections.get(i);
311 coll_names.append(complete_collection.getName() + StaticStrings.SPACE_CHARACTER + StaticStrings.OPEN_PARENTHESIS_CHARACTER + complete_collection.getShortName() + StaticStrings.CLOSE_PARENTHESIS_CHARACTER);
312 complete_collection = null;
313 }
314
315 args[0] = coll_names.toString();
316 args[1] = Gatherer.config.gsdl_path+"tmp"+File.separator;
317 if(cd_title.equals("")) {
318 args[1] += "exported_collections";
319 } else {
320 args[1] += "exported_"+cd_title.replaceAll("\\s","");
321 }
322 ResultDialog result_dialog = new ResultDialog(success, extra);
323 result_dialog.setVisible(true); // Blocks
324 result_dialog.dispose();
325 result_dialog = null;
326 /*
327 if (success) {
328 JOptionPane.showMessageDialog(prompt,Dictionary.get("ExportCollectionPrompt.Successful_Export", args)+"\n\n"+Dictionary.get("ExportCollectionPrompt.Output")+"\n"+extra, Dictionary.get("ExportCollectionPrompt.Successful_Title"),JOptionPane.INFORMATION_MESSAGE);
329 }
330 else {
331 JOptionPane.showMessageDialog(prompt,Dictionary.get("ExportCollectionPrompt.Failed_Export", args)+"\n\n"+Dictionary.get("ExportCollectionPrompt.Output")+"\n"+extra, Dictionary.get("ExportCollectionPrompt.Failed_Title"),JOptionPane.WARNING_MESSAGE);
332 }
333 */
334 }
335
336 /** Method to scan the collect directory retrieving and reloading each collection it finds, while building the list of known collections.
337 * @see org.greenstone.gatherer.Configuration
338 * @see org.greenstone.gatherer.Gatherer
339 * @see org.greenstone.gatherer.util.ArrayTools
340 * @see org.greenstone.gatherer.util.Utility
341 */
342 private void scanForCollections() {
343 // Start at the collect dir.
344 String collect_directory_name = Utility.getCollectionDir(Gatherer.config.gsdl_path);
345 File collect_directory = new File(collect_directory_name);
346 if(collect_directory.exists()) {
347 // Now for each child directory see if it contains a .col file and
348 // if so try to load it..
349 File collections[] = collect_directory.listFiles();
350 ArrayTools.sort(collections);
351 for(int i = 0; collections != null && i < collections.length; i++) {
352 if(!collections[i].getName().equals(StaticStrings.MODEL_COLLECTION_NAME)) {
353 File config_file = Utility.findConfigFile(collections[i]);
354 if (config_file != null) {
355 BasicCollectionConfiguration config = new BasicCollectionConfiguration(config_file);
356 if (!config.getName().equals(StaticStrings.EMPTY_STR)) {
357 all_collections.add(config);
358 }
359 config = null;
360 }
361 }
362 }
363 }
364 // Otherwise the collect directory doesn't actually exist, so there ain't much we can do.
365 }
366
367
368 /** All implementation of GShellListener must include this method so the listener can be informed of messages from the GShell.
369 * @param event A <strong>GShellEvent</strong> that contains, amoung other things, the message.
370 */
371 public synchronized void message(GShellEvent event) {
372 // Ignore the messages from RecPlug with 'show_progress' set (used for progress bars)
373 String message = event.getMessage();
374 if (message.startsWith("exportcol.pl>")) {
375 message = message.substring(13);
376 //Gatherer.println("message = "+event.getMessage());
377 error_message.append(message);
378 error_message.append("\n");
379 }
380 }
381
382 /** All implementation of GShellListener must include this method so the listener can be informed when a GShell begins its task. Implementation side-effect, not actually used.
383 * @param event A <strong>GShellEvent</strong> that contains details of the initial state of the <strong>GShell</strong> before task comencement.
384 */
385 public synchronized void processBegun(GShellEvent event) {
386 // We don't care.
387 }
388 /** All implementation of GShellListener must include this method so the listener can be informed when a GShell completes its task.
389 * @param event A <strong>GShellEvent</strong> that contains details of the final state of the <strong>GShell</strong> after task completion.
390 */
391 public synchronized void processComplete(GShellEvent event) {
392 successful = false;
393 if(event.getStatus() == GShell.OK) {
394 if(event.getType() == GShell.EXPORT) {
395 successful = true;
396 }
397 }
398 ok_button_listener.processComplete();
399 }
400
401 /** A button listener implementation, which listens for actions on the close button and disposes of the dialog when detected. */
402 private class CancelButtonListener
403 implements ActionListener {
404 /** Any implementation of ActionListener must include this method so we can be informed when the button is actioned.
405 * @param event An <strong>ActionEvent</strong> containing all the relevant information garnered from the event itself.
406 */
407 public void actionPerformed(ActionEvent event) {
408 prompt.dispose();
409 }
410 }
411
412 /** This private class listens for selection events in from the list and then displays the appropriate details for that collection.
413 */
414 private class CollectionListListener
415 implements ListSelectionListener {
416 /** Any implementation of ListSelectionListener must include this method so we can be informed when the list selection changes.
417 * @param event a <strong>ListSelectionEvent</strong> containing all the relevant information garnered from the event itself
418 */
419 public void valueChanged(ListSelectionEvent event) {
420 ok_button.setEnabled(false);
421 if(!list.isSelectionEmpty()) {
422 collection = (BasicCollectionConfiguration) ((Entry)list.getSelectedValue()).getObject();
423 args = new String[5];
424 args[0] = collection.getName();
425 args[1] = collection.getShortName();
426 args[2] = collection.getCreator();
427 args[3] = collection.getMaintainer();
428 args[4] = collection.getDescription();
429 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.Details", args);
430 details_textarea.setCaretPosition(0);
431 ok_button.setEnabled(true);
432 }
433 else {
434 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.No_Collection");
435 ok_button.setEnabled(false);
436 }
437 }
438 }
439
440 /** The OK button listener implementation. */
441 private class OKButtonListener
442 implements ActionListener {
443 private Component glass_pane;
444 private MouseListener mouse_blocker_listener;
445 private ProgressDialog progress_dialog;
446
447 /** Any implementation of ActionListener must include this method so we can be informed when the button is actioned.
448 * @param event An <strong>ActionEvent</strong> containing all the relevant information garnered from the event itself.
449 * @see org.greenstone.gatherer.Configuration
450 * @see org.greenstone.gatherer.Gatherer
451 * @see org.greenstone.gatherer.util.Utility
452 */
453 public void actionPerformed(ActionEvent event) {
454 ///ystem.err.println("OK Clicked");
455 // Make sure there are some colls specified
456 selected_collections = list.getSelected();
457 error_message = new StringBuffer();
458
459 // Set the cursor to hourglass
460 glass_pane = getGlassPane();
461 mouse_blocker_listener = new MouseAdapter() {};
462 glass_pane.addMouseListener(mouse_blocker_listener);
463 glass_pane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
464 glass_pane.setVisible(true);
465
466 // Export the selected collection.
467 ///ystem.err.println("Export collections");
468 exportCollections();
469
470 // Show progress dialog
471 ///ystem.err.println("Showing progress dialog");
472 progress_dialog = new ProgressDialog();
473 progress_dialog.setVisible(true);
474 }
475
476 public void processComplete() {
477 ///ystem.err.println("Process complete");
478 // Dispose of progress dialog
479 progress_dialog.setVisible(false);
480 progress_dialog.dispose();
481 progress_dialog = null;
482
483 // unset the cursor
484 glass_pane.setVisible(false);
485 glass_pane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
486 glass_pane.removeMouseListener(mouse_blocker_listener);
487 glass_pane = null;
488 mouse_blocker_listener= null;
489
490 if (successful) {
491 resultPrompt(true, error_message.toString());
492 } else {
493 resultPrompt(false, error_message.toString());
494 }
495 error_message = null;
496 }
497
498 private class ProgressDialog
499 extends ModalDialog {
500
501 private Dimension size = new Dimension(400,65);
502
503 public ProgressDialog() {
504 super(Gatherer.g_man, Dictionary.get("ExportCollectionPrompt.Title"), true);
505 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
506 setSize(size);
507 JPanel content_pane = (JPanel) getContentPane();
508 JLabel progress_label = new JLabel();
509 Dictionary.setText(progress_label, "ExportCollectionPrompt.Progress_Label");
510 JProgressBar progress_bar = new JProgressBar();
511 progress_bar.setIndeterminate(true);
512 content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
513 content_pane.setLayout(new BorderLayout());
514 content_pane.add(progress_label, BorderLayout.NORTH);
515 content_pane.add(progress_bar, BorderLayout.CENTER);
516 // Position
517 Rectangle frame_bounds = Gatherer.g_man.getBounds();
518 setLocation(frame_bounds.x + (frame_bounds.width - size.width) / 2, frame_bounds.y + (frame_bounds.height - size.height) / 2);
519 }
520 }
521 }
522
523 private class ResultDialog
524 extends ModalDialog {
525
526 private Dimension size = new Dimension(400,300);
527 private ResultDialog self;
528
529 public ResultDialog(boolean success, String extra) {
530 super(Gatherer.g_man, Dictionary.get("ExportCollectionPrompt.Successful_Title"), true);
531
532 this.self = this;
533
534 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
535 setSize(size);
536
537 JPanel content_pane = (JPanel) getContentPane();
538 JLabel result_label = new JLabel();
539 if(success) {
540 Dictionary.registerText(result_label, "ExportCollectionPrompt.Successful_Export");
541 }
542 else {
543 Dictionary.registerText(result_label, "ExportCollectionPrompt.Failed_Export");
544 }
545
546 JPanel button_pane = new JPanel();
547 JButton close_button = new JButton("Close");
548 close_button.addActionListener(new CloseButtonListener());
549
550 JPanel output_pane = new JPanel();
551 JLabel output_label = new JLabel();
552 Dictionary.registerText(output_label, "ExportCollectionPrompt.Output");
553
554 JTextArea output_textarea = new JTextArea(extra);
555 output_textarea.setCaretPosition(0);
556 output_textarea.setEditable(false);
557 output_textarea.setLineWrap(true);
558 output_textarea.setWrapStyleWord(true);
559
560 button_pane.setLayout(new BorderLayout());
561 button_pane.add(close_button, BorderLayout.EAST);
562
563 output_pane.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
564 output_pane.setLayout(new BorderLayout());
565 output_pane.add(output_label, BorderLayout.NORTH);
566 output_pane.add(new JScrollPane(output_textarea), BorderLayout.CENTER);
567
568 content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
569 content_pane.setLayout(new BorderLayout());
570 content_pane.add(result_label, BorderLayout.NORTH);
571 content_pane.add(output_pane, BorderLayout.CENTER);
572 content_pane.add(button_pane, BorderLayout.SOUTH);
573
574 // Position
575 Rectangle frame_bounds = Gatherer.g_man.getBounds();
576 setLocation(frame_bounds.x + (frame_bounds.width - size.width) / 2, frame_bounds.y + (frame_bounds.height - size.height) / 2);
577 }
578
579 private class CloseButtonListener
580 implements ActionListener {
581 public void actionPerformed(ActionEvent event) {
582 self.setVisible(false);
583 }
584 }
585 }
586}
587
588
589
590
Note: See TracBrowser for help on using the repository browser.