mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
175 lines
6.0 KiB
Java
175 lines
6.0 KiB
Java
/* Copyright 2012 Yaqiang Wang,
|
|
* yaqiang.wang@gmail.com
|
|
*
|
|
* This library is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation; either version 2.1 of the License, or (at
|
|
* your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
|
* General Public License for more details.
|
|
*/
|
|
package org.meteoinfo.map;
|
|
|
|
import javax.swing.JTable;
|
|
|
|
/**
|
|
*
|
|
* @author Yaqiang Wang
|
|
*/
|
|
public class FrmIdentifer extends javax.swing.JDialog {
|
|
|
|
private MapView _mapView;
|
|
|
|
/**
|
|
* Creates new form FrmIdentifer
|
|
*/
|
|
public FrmIdentifer(java.awt.Frame parent, boolean modal, MapView mapView) {
|
|
super(parent, modal);
|
|
_mapView = mapView;
|
|
initComponents();
|
|
}
|
|
|
|
/**
|
|
* This method is called from within the constructor to initialize the form.
|
|
* WARNING: Do NOT modify this code. The content of this method is always
|
|
* regenerated by the Form Editor.
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
private void initComponents() {
|
|
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
jTable1 = new javax.swing.JTable();
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
|
addWindowListener(new java.awt.event.WindowAdapter() {
|
|
public void windowClosed(java.awt.event.WindowEvent evt) {
|
|
formWindowClosed(evt);
|
|
}
|
|
});
|
|
|
|
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
|
new Object [][] {
|
|
{null, null},
|
|
{null, null},
|
|
{null, null},
|
|
{null, null}
|
|
},
|
|
new String [] {
|
|
"Field", "Value"
|
|
}
|
|
) {
|
|
Class[] types = new Class [] {
|
|
java.lang.String.class, java.lang.String.class
|
|
};
|
|
|
|
public Class getColumnClass(int columnIndex) {
|
|
return types [columnIndex];
|
|
}
|
|
});
|
|
jScrollPane1.setViewportView(jTable1);
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
|
getContentPane().setLayout(layout);
|
|
layout.setHorizontalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
|
|
);
|
|
layout.setVerticalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE)
|
|
);
|
|
|
|
pack();
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
|
|
// TODO add your handling code here:
|
|
// if (_mapView != null){
|
|
// _mapView.setDrawIdentiferShape(false);
|
|
// _mapView.repaint();
|
|
// }
|
|
}//GEN-LAST:event_formWindowClosed
|
|
|
|
/**
|
|
* Set map view
|
|
* @return Map view
|
|
*/
|
|
public MapView getMapView(){
|
|
return _mapView;
|
|
}
|
|
|
|
/**
|
|
* Set map view
|
|
* @param mapView Map view
|
|
*/
|
|
public void setMapView(MapView mapView){
|
|
_mapView = mapView;
|
|
}
|
|
|
|
/**
|
|
* Get JTable
|
|
* @return JTable
|
|
*/
|
|
public JTable getTable(){
|
|
return this.jTable1;
|
|
}
|
|
|
|
/**
|
|
* Set JTable
|
|
* @param table JTable
|
|
*/
|
|
public void setTable(JTable table){
|
|
this.jTable1 = table;
|
|
}
|
|
|
|
/**
|
|
* @param args the command line arguments
|
|
*/
|
|
public static void main(String args[]) {
|
|
/* Set the Nimbus look and feel */
|
|
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
|
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
|
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
|
*/
|
|
try {
|
|
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
|
if ("Nimbus".equals(info.getName())) {
|
|
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
|
break;
|
|
}
|
|
}
|
|
} catch (ClassNotFoundException ex) {
|
|
java.util.logging.Logger.getLogger(FrmIdentifer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
} catch (InstantiationException ex) {
|
|
java.util.logging.Logger.getLogger(FrmIdentifer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
} catch (IllegalAccessException ex) {
|
|
java.util.logging.Logger.getLogger(FrmIdentifer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
|
java.util.logging.Logger.getLogger(FrmIdentifer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
}
|
|
//</editor-fold>
|
|
|
|
/* Create and display the dialog */
|
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
|
public void run() {
|
|
FrmIdentifer dialog = new FrmIdentifer(new javax.swing.JFrame(), true, new MapView());
|
|
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
|
@Override
|
|
public void windowClosing(java.awt.event.WindowEvent e) {
|
|
System.exit(0);
|
|
}
|
|
});
|
|
dialog.setVisible(true);
|
|
}
|
|
});
|
|
}
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
private javax.swing.JScrollPane jScrollPane1;
|
|
private javax.swing.JTable jTable1;
|
|
// End of variables declaration//GEN-END:variables
|
|
}
|