labs_panel.java

来自「导出ORACLE数据库对象DDL语句的程序」· Java 代码 · 共 443 行 · 第 1/2 页

JAVA
443
字号

       	this.label1.setVisible(true);
       	this.label2.setVisible(false);
       	this.label3.setVisible(true);
       	this.label4.setVisible(true);
       	this.label5.setVisible(false);
       	this.textarea1.setVisible(true);
       	this.textarea2.setVisible(false);
       	this.textarea3.setVisible(true);
       	this.textarea4.setVisible(true);
       	this.textarea5.setVisible(false);
     	break;

     case(XMLNode.XML_TABCOLUMN):
      	//表列
     	XMLTabColumn tabColumn = (XMLTabColumn)in_node;
     	this.showTitle = "Column:"+tabColumn.getName();
   	 	this.showName = "Column Name:";
   	 	this.show2 = "Data Type:";
   	 	this.show3 = "Not Null:";
    	this.strName = tabColumn.getName();
    	this.str2 = tabColumn.getDataType();
    	this.str3 = tabColumn.getIsNotNull();
    	
    	this.label1.setVisible(false);
    	this.label2.setVisible(true);
    	this.label3.setVisible(true);
    	this.label4.setVisible(false);
    	this.label5.setVisible(false);
    	this.textarea1.setVisible(false);
    	this.textarea2.setVisible(true);
    	this.textarea3.setVisible(true);
    	this.textarea4.setVisible(false);
    	this.textarea5.setVisible(false);
     	break;

     case(XMLNode.XML_INDCOLUMN):
      	//索引列
     	XMLIndColumn indColumn = (XMLIndColumn)in_node;
     	this.showTitle = "Column:"+indColumn.getName();
   	 	this.showName = "Column Name:";
   	 	this.show2 = "Position:";
   	 	this.show3 = "Descend:";
    	this.strName = indColumn.getName();
    	this.str2 = indColumn.getColumnPosition();
    	this.str3 = indColumn.getDescend();
    	
    	this.label1.setVisible(false);
    	this.label2.setVisible(true);
    	this.label3.setVisible(true);
    	this.label4.setVisible(false);
    	this.label5.setVisible(false);
    	this.textarea1.setVisible(false);
    	this.textarea2.setVisible(true);
    	this.textarea3.setVisible(true);
    	this.textarea4.setVisible(false);
    	this.textarea5.setVisible(false);
     	break;

     case(XMLNode.XML_CONSCOLUMN):
      	//约束列
     	XMLConsColumn consColumn = (XMLConsColumn)in_node;
     	this.showTitle = "Column:"+consColumn.getName();
   	 	this.showName = "Table Name:";
   	 	this.show2 = "Column Name:";
   	 	this.show3 = "Position:";
    	this.strName = consColumn.getTableName();
    	this.str2 = consColumn.getName();
    	this.str3 = consColumn.getColumnPosition();
    	
    	this.label1.setVisible(false);
    	this.label2.setVisible(true);
    	this.label3.setVisible(true);
    	this.label4.setVisible(false);
    	this.label5.setVisible(false);
    	this.textarea1.setVisible(false);
    	this.textarea2.setVisible(true);
    	this.textarea3.setVisible(true);
    	this.textarea4.setVisible(false);
    	this.textarea5.setVisible(false);
     	break;

      default:
      	this.showTitle = "Nothing";
     	this.label1.setVisible(false);
       	this.label2.setVisible(false);
      	this.label3.setVisible(false);
       	this.label4.setVisible(false);
       	this.label5.setVisible(false);
       	this.textarea1.setVisible(false);
       	this.textarea2.setVisible(false);
       	this.textarea3.setVisible(false);
       	this.textarea4.setVisible(false);
       	this.textarea5.setVisible(false);
      	break;
      }
      
    try {
        jbInit();
    }catch(Exception ex) {
      ex.printStackTrace();
    }
  }

  void jbInit() throws Exception {
      contentPane.setLayout(null);
      
      labelTitle.setBounds(TITLE_START_HOR,TITLE_START_VER,RIGHT_WIDTH,TITLE_HEIGHT);
      labelTitle.setFont(new Font("华文中宋",Font.PLAIN,36));
      labelTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
      
      this.labelName.setBounds(START_HOR,START_VER,HEAD_LENGTH,SHOW_HEIGHT);
      this.labelName.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);

      this.textareaName.setBounds(START_HOR + HEAD_LENGTH + 1,START_VER,CONTENT_LENGTH,SHOW_HEIGHT);
      textareaName.setEditable(false);
      textareaName.setBackground(java.awt.SystemColor.activeCaptionBorder);
      textareaName.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.SystemColor.desktop,1));
      
      this.label1.setBounds(START_HOR,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL),HEAD_LENGTH,SHOW_HEIGHT);
      this.label1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
      
      this.textarea1.setBounds(START_HOR + HEAD_LENGTH + 1,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL),CONTENT_LENGTH,SHOW_HEIGHT);
      textarea1.setEditable(false);
      textarea1.setBackground(java.awt.SystemColor.activeCaptionBorder);
      textarea1.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.SystemColor.desktop,1));

      this.label2.setBounds(START_HOR,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*2,HEAD_LENGTH,SHOW_HEIGHT);
      this.label2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
      
      textarea2.setBounds(START_HOR + HEAD_LENGTH + 1,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*2,CONTENT_LENGTH,SHOW_HEIGHT);
      textarea2.setEditable(false);
      textarea2.setBackground(java.awt.SystemColor.activeCaptionBorder);
      textarea2.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.SystemColor.desktop,1));

      this.label3.setBounds(START_HOR,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*3,HEAD_LENGTH,SHOW_HEIGHT);
      this.label3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);

      textarea3.setBounds(START_HOR + HEAD_LENGTH + 1,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*3,CONTENT_LENGTH,SHOW_HEIGHT);
      textarea3.setEditable(false);
      textarea3.setBackground(java.awt.SystemColor.activeCaptionBorder);
      textarea3.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.SystemColor.desktop,1));
	  
      this.label4.setBounds(START_HOR,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*4,HEAD_LENGTH,SHOW_HEIGHT);
      this.label4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);

      textarea4.setBounds(START_HOR + HEAD_LENGTH + 1,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*4,CONTENT_LENGTH,SHOW_HEIGHT);
      textarea4.setEditable(false);
      textarea4.setBackground(java.awt.SystemColor.activeCaptionBorder);
      textarea4.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.SystemColor.desktop,1));

      this.label5.setBounds(START_HOR,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*5,HEAD_LENGTH,SHOW_HEIGHT);
      this.label5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);

      textarea5.setBounds(START_HOR + HEAD_LENGTH + 1,START_VER + (SHOW_HEIGHT + SHOW_INTERVAL)*5,CONTENT_LENGTH,SHOW_HEIGHT);
      textarea5.setEditable(false);
      textarea5.setBackground(java.awt.SystemColor.activeCaptionBorder);
      textarea5.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.SystemColor.desktop,1));

      contentPane.add(labelTitle,null);
      contentPane.add(labelName,null);
      contentPane.add(label1,null);
      contentPane.add(label2,null);
      contentPane.add(label3,null);
      contentPane.add(label4,null);
      contentPane.add(label5,null);
      contentPane.add(textareaName,null);
      contentPane.add(textarea1,null);
      contentPane.add(textarea2,null);
      contentPane.add(textarea3,null);
      contentPane.add(textarea4,null);
      contentPane.add(textarea5,null);
      
      this.setLayout(borderLayout);
      this.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
      this.add(contentPane,BorderLayout.CENTER);
//  	  this.setPreferredSize(new Dimension(GlobalParameters.RIGHT_WIDTH,GlobalParameters.RIGHT_HEIGHT));

      this.refresh();
  }

	public JPanel getJPanel(){
	    return this;
	}; 
	    
    public void open(){
 
    }

    public void close(){
    	
    }
    
    public void refresh(){
        this.labelTitle.setText(this.showTitle);
        this.labelName.setText(this.showName);
        this.label1.setText(this.show1);
        this.label2.setText(this.show2);
        this.label3.setText(this.show3);
        this.label4.setText(this.show4);
        this.label5.setText(this.show5);
        
        this.textareaName.setText(this.strName);
        this.textarea1.setText(this.str1);
        this.textarea2.setText(this.str2);
        this.textarea3.setText(this.str3);
        this.textarea4.setText(this.str4);
        this.textarea5.setText(this.str5);
    }

	/* (non-Javadoc)
	 * @see com.icbcsdc.ddlexp.ui.rightPanel.RightPanel#expDDL()
	 */
	public void expDDL() {
		// TODO Auto-generated method stub
		
	}
	
	public void setSelect(){}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?