labs_panel.java

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

JAVA
443
字号
package com.icbcsdc.ddlexp.ui.rightPanel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;

import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLArrayType;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLConsColumn;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLIndColumn;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLNode;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLRole;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSequence;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLSynonym;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLTabColumn;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLTableType;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLUndoSeg;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLUser;
import com.icbcsdc.ddlexp.ui.GlobalParameters;
import com.icbcsdc.ddlexp.ui.TreeFrame;
import com.icbcsdc.ddlexp.ui.model.NoEditTextArea;

/*
 * 适用对象:
 * 使用于显示序列Sequence、同义词Synonym、用户User、角色Role的详细资料显示。
 *
 */

public class Labs_Panel extends RightPanel {
  private BorderLayout borderLayout = new BorderLayout();

  private JLabel labelTitle =new JLabel();
  private JLabel labelName =new JLabel();
  private JLabel label1 =new JLabel();
  private JLabel label2 =new JLabel();
  private JLabel label3 =new JLabel();
  private JLabel label4 =new JLabel();
  private JLabel label5 =new JLabel();
  
  private NoEditTextArea textareaName =new NoEditTextArea();
  private NoEditTextArea textarea1 =new NoEditTextArea();
  private NoEditTextArea textarea2 =new NoEditTextArea();
  private NoEditTextArea textarea3 =new NoEditTextArea();
  private NoEditTextArea textarea4 =new NoEditTextArea();
  private NoEditTextArea textarea5 =new NoEditTextArea();
  
  private Border border;
  private JPanel contentPane = new JPanel();
  
  private String showTitle,showName,show1,show2,show3,show4,show5;
  private String strName,str1,str2,str3,str4,str5;
  
  public Labs_Panel(TreeFrame parent,XMLNode in_node) {
      super(parent,in_node);

      switch(this.node.getType()){
      case(XMLNode.XML_SEQUENCE):
      	//序列
        XMLSequence sequence = (XMLSequence)in_node;
      	this.showTitle = "Sequence";
      	this.showName = "Sequence Name:";
      	this.show1 = "Owner:";
      	this.show3 = "MaxValue:";
      	this.show4 = "MinValue:";
       	this.show5 = "Interval:";
       	this.strName = sequence.getName();
       	this.str1 =in_node.getParent().getParent().getName();
       	this.str3 = sequence.getMaxValue();
       	this.str4 = sequence.getMinValue();
       	this.str5 = sequence.getIncrInterval();
       	
       	this.label1.setVisible(true);
       	this.label2.setVisible(false);
       	this.label3.setVisible(true);
       	this.label4.setVisible(true);
       	this.label5.setVisible(true);
       	this.textarea1.setVisible(true);
       	this.textarea2.setVisible(false);
       	this.textarea3.setVisible(true);
       	this.textarea4.setVisible(true);
       	this.textarea5.setVisible(true);
      	break;
      	
      case(XMLNode.XML_SYNONYM):
      	//同义词
        XMLSynonym synonym = (XMLSynonym)in_node;
    	this.showTitle = "Synonym";
    	this.showName = "Synonym Name:";
    	this.show1 = "Owner:";
    	this.show3 = "DB Link:";
    	this.show4 = "Table Owner:";
     	this.show5 = "Table Name:";
     	this.strName = synonym.getName();
     	this.str1 =in_node.getParent().getParent().getName();
     	this.str3 = synonym.getDblink();
     	this.str4 = synonym.getTableOwner();
     	this.str5 = synonym.getTableName();

       	this.label1.setVisible(true);
       	this.label2.setVisible(false);
       	this.label3.setVisible(true);
       	this.label4.setVisible(true);
       	this.label5.setVisible(true);
       	this.textarea1.setVisible(true);
       	this.textarea2.setVisible(false);
       	this.textarea3.setVisible(true);
       	this.textarea4.setVisible(true);
       	this.textarea5.setVisible(true);
     	break;
     	
      case(XMLNode.XML_USER):
      	//用户
      	XMLUser user = (XMLUser)in_node;
    	this.showTitle = "User";
    	this.showName = "User Name:";
    	this.show2 = "Status:";
    	this.show3 = "Default Tbs:";
     	this.show4 = "Temp Tbs:";
     	this.strName = user.getName();
     	this.str2 = user.getAccStatus();
     	this.str3 = user.getDefaultTbs();
     	this.str4 = user.getTmpTbs();
     	//user.getSqlDDL();

       	this.label1.setVisible(false);
       	this.label2.setVisible(true);
       	this.label3.setVisible(true);
       	this.label4.setVisible(true);
       	this.label5.setVisible(false);
       	this.textarea1.setVisible(false);
       	this.textarea2.setVisible(true);
       	this.textarea3.setVisible(true);
       	this.textarea4.setVisible(true);
       	this.textarea5.setVisible(false);
     	break;
     	
     case(XMLNode.XML_ROLE):
     	//角色
     	XMLRole role = (XMLRole)in_node;
	 	this.showTitle = "Role";
		this.showName = "Role Name:";
		this.show2 = "PWD Required:";
	 	this.strName = role.getName();
	 	this.str2 = role.getAuthentication();
	
	   	this.label1.setVisible(false);
	   	this.label2.setVisible(true);
	   	this.label3.setVisible(false);
	   	this.label4.setVisible(false);
	   	this.label5.setVisible(false);
	   	this.textarea1.setVisible(false);
	   	this.textarea2.setVisible(true);
	   	this.textarea3.setVisible(false);
	   	this.textarea4.setVisible(false);
	   	this.textarea5.setVisible(false);
     	break;

     case(XMLNode.XML_UNDO_SEG):
      	//回滚段
     	XMLUndoSeg undoseg = (XMLUndoSeg)in_node;
    	this.showTitle = "Undo Segment";
    	this.showName = "Undo Seg Name:";
    	this.show1 = "Owner:";
    	this.show3 = "Status:";
    	this.show4 = "Tablespace:";
     	this.strName = undoseg.getName();
     	this.str1 = undoseg.getOwner();
     	this.str3 = undoseg.getStatus();
     	this.str4 = undoseg.getTablespace();

       	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_TABLETYPE):
      	//表类型
        XMLTableType tabletype = (XMLTableType)in_node;
    	this.showTitle = "Table Type";
    	this.showName = "Type Name:";
    	this.show1 = "Owner:";
    	this.show3 = "Elem Type:";
     	this.strName = tabletype.getName();
     	this.str1 =in_node.getParent().getParent().getParent().getName();
     	this.str3 = tabletype.getElemType();

       	this.label1.setVisible(true);
       	this.label2.setVisible(false);
       	this.label3.setVisible(true);
       	this.label4.setVisible(false);
       	this.label5.setVisible(false);
       	this.textarea1.setVisible(true);
       	this.textarea2.setVisible(false);
       	this.textarea3.setVisible(true);
       	this.textarea4.setVisible(false);
       	this.textarea5.setVisible(false);
//       	Logger.log(Logger.DEBUG,tabletype.getSqlDDL());
     	break;

     case(XMLNode.XML_ARRAYTYPE):
      	//数组类型
        XMLArrayType arraytype = (XMLArrayType)in_node;
    	this.showTitle = "Array Type";
    	this.showName = "Type Name:";
    	this.show1 = "Owner:";
    	this.show3 = "Upper Bound:";
    	this.show4 = "Elem Type:";
     	this.strName = arraytype.getName();
     	this.str1 =in_node.getParent().getParent().getParent().getName();
     	this.str3 = arraytype.getUpperBound();
     	this.str4 = arraytype.getElemType();

⌨️ 快捷键说明

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