FilenameDialog.java

Go to the documentation of this file.
00001 
00010 package VisuBDD;
00011 
00012 import java.awt.*;          // Import abstract window toolkit.
00013 import java.awt.event.*;    // Import event components for awt.
00014 import java.util.*;         // Import java utilities.
00015 
00016 
00017 public class FilenameDialog extends Dialog {
00018 
00019   private java.util.List filenames;                     // Filenames to be displayed
00020   private int[] fileSequence;
00021 
00022 
00030   public FilenameDialog(java.util.List filenames, Frame mainWindow) {
00031     super(mainWindow); // call constructor uof superclass.
00032 
00033     Label tmpLabel;
00034 
00035     this.fileSequence = ((VisualizeFrame) mainWindow).getFileSequence();
00036     // Initialization of variables.
00037     setResizable(false);
00038     setBackground(Color.white);
00039     setTitle("Legend"); // Set window title.
00040     setLocation(50, 260);// Set initial window position.
00041     setLayout(new GridLayout(0, 1)); // n rows, 1 column
00042 
00043     for (int i = 0; i < filenames.size(); i++) {
00044       tmpLabel = new Label();
00045       tmpLabel.setForeground(ColorAssignment.getColor(i));
00046       tmpLabel.setText(((String) filenames.get(fileSequence[i])));
00047       add(tmpLabel);
00048     } // for
00049 
00050     pack();
00051 
00052     // Add WindowListener for closing event.
00053     addWindowListener(
00054       new WindowAdapter() {
00055         public void windowClosing(WindowEvent evt) {
00056           dispose(); // close
00057           //System.exit(0);
00058         } // windowClosing(WindowEvent evt)
00059       } // WindowAdapter
00060     ); // addWindowListener(new WindowAdapter)
00061 
00062   } // constructor
00063 } // class

Generated on Fri Jun 6 22:21:09 2008 for CrocoPat by  doxygen 1.5.1