ShowSignDialog.java
上传用户:njlgjx
上传日期:2022-08-07
资源大小:9105k
文件大小:8k
源码类别:

图形图象

开发平台:

Java

  1. /*
  2.  * ShowSignDialog.java
  3.  *
  4.  * Created on 2008年6月28日, 下午2:29
  5.  */
  6. package com.mwq.map.frame;
  7. import com.mwq.map.dao.Dao;
  8. import com.mwq.map.tool.InstancePool;
  9. import com.mwq.map.tool.MapProcessor;
  10. import com.mwq.map.tool.ScreenSize;
  11. import java.util.Vector;
  12. /**
  13.  *
  14.  * @author  Administrator
  15.  */
  16. public class ShowSignDialog extends javax.swing.JDialog {
  17.     private static final Dao dao = Dao.getInstance();
  18.     private static final MapProcessor mapProcessor = InstancePool.getMapProcessor();
  19.     /** Creates new form ShowSignDialog */
  20.     public ShowSignDialog(java.awt.Frame parent, boolean modal) {
  21.         super(parent, modal);
  22.         initComponents();
  23.         initInfo();
  24.         ScreenSize.centered(this);
  25.     }
  26.     private void initInfo() {
  27.         Vector sign = dao.selectClickSignV(mapProcessor.getRightClickToMapX(), mapProcessor.getRightClickToMapY());
  28.         titleTextField.setText(sign.get(2).toString());
  29.         sortTextField.setText(sign.get(4).toString());
  30.         dateTextField.setText(sign.get(7).toString());
  31.         remarkTextArea.setText(sign.get(8).toString());
  32.     }
  33.     /** This method is called from within the constructor to
  34.      * initialize the form.
  35.      * WARNING: Do NOT modify this code. The content of this method is
  36.      * always regenerated by the Form Editor.
  37.      */
  38.     @SuppressWarnings("unchecked")
  39.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  40.     private void initComponents() {
  41.         titleLabel = new javax.swing.JLabel();
  42.         titleTextField = new javax.swing.JTextField();
  43.         sortLabel = new javax.swing.JLabel();
  44.         sortTextField = new javax.swing.JTextField();
  45.         dateLabel = new javax.swing.JLabel();
  46.         dateTextField = new javax.swing.JTextField();
  47.         remarkLabel = new javax.swing.JLabel();
  48.         remarkScrollPane = new javax.swing.JScrollPane();
  49.         remarkTextArea = new javax.swing.JTextArea();
  50.         exitButton = new javax.swing.JButton();
  51.         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  52.         setTitle("标记信息");
  53.         setResizable(false);
  54.         titleLabel.setText("标记名称:");
  55.         titleTextField.setFocusable(false);
  56.         sortLabel.setText("所属类型:");
  57.         sortTextField.setFocusable(false);
  58.         dateLabel.setText("创建日期:");
  59.         dateTextField.setFocusable(false);
  60.         remarkLabel.setText("标记说明:");
  61.         remarkTextArea.setColumns(20);
  62.         remarkTextArea.setLineWrap(true);
  63.         remarkTextArea.setRows(5);
  64.         remarkTextArea.setFocusable(false);
  65.         remarkScrollPane.setViewportView(remarkTextArea);
  66.         exitButton.setText("退出");
  67.         exitButton.addActionListener(new java.awt.event.ActionListener() {
  68.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  69.                 exitButtonActionPerformed(evt);
  70.             }
  71.         });
  72.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  73.         getContentPane().setLayout(layout);
  74.         layout.setHorizontalGroup(
  75.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  76.             .addGroup(layout.createSequentialGroup()
  77.                 .addContainerGap()
  78.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  79.                     .addGroup(layout.createSequentialGroup()
  80.                         .addComponent(titleLabel)
  81.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  82.                         .addComponent(titleTextField))
  83.                     .addGroup(layout.createSequentialGroup()
  84.                         .addComponent(sortLabel)
  85.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  86.                         .addComponent(sortTextField))
  87.                     .addGroup(layout.createSequentialGroup()
  88.                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  89.                             .addComponent(dateLabel)
  90.                             .addComponent(remarkLabel))
  91.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  92.                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  93.                             .addComponent(dateTextField)
  94.                             .addComponent(exitButton, javax.swing.GroupLayout.Alignment.TRAILING)
  95.                             .addComponent(remarkScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE))))
  96.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  97.         );
  98.         layout.setVerticalGroup(
  99.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  100.             .addGroup(layout.createSequentialGroup()
  101.                 .addContainerGap()
  102.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  103.                     .addComponent(titleLabel)
  104.                     .addComponent(titleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  105.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  106.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  107.                     .addComponent(sortLabel)
  108.                     .addComponent(sortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  109.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  110.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  111.                     .addComponent(dateLabel)
  112.                     .addComponent(dateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  113.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  114.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  115.                     .addComponent(remarkLabel)
  116.                     .addComponent(remarkScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
  117.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  118.                 .addComponent(exitButton)
  119.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  120.         );
  121.         pack();
  122.     }// </editor-fold>                        
  123. private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {                                           
  124. // TODO add your handling code here:
  125.     this.dispose();
  126. }                                          
  127.     /**
  128.      * @param args the command line arguments
  129.      */
  130.     public static void main(String args[]) {
  131.         java.awt.EventQueue.invokeLater(new Runnable() {
  132.             public void run() {
  133.                 ShowSignDialog dialog = new ShowSignDialog(new javax.swing.JFrame(), true);
  134.                 dialog.addWindowListener(new java.awt.event.WindowAdapter() {
  135.                     public void windowClosing(java.awt.event.WindowEvent e) {
  136.                         System.exit(0);
  137.                     }
  138.                 });
  139.                 dialog.setVisible(true);
  140.             }
  141.         });
  142.     }
  143.     // Variables declaration - do not modify                     
  144.     private javax.swing.JLabel dateLabel;
  145.     private javax.swing.JTextField dateTextField;
  146.     private javax.swing.JButton exitButton;
  147.     private javax.swing.JLabel remarkLabel;
  148.     private javax.swing.JScrollPane remarkScrollPane;
  149.     private javax.swing.JTextArea remarkTextArea;
  150.     private javax.swing.JLabel sortLabel;
  151.     private javax.swing.JTextField sortTextField;
  152.     private javax.swing.JLabel titleLabel;
  153.     private javax.swing.JTextField titleTextField;
  154.     // End of variables declaration                   
  155. }