⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 columnheader.java

📁 一个简单的visio程序。
💻 JAVA
字号:

package webide.itools;

import  java.beans.Beans;

public class ColumnHeader
{
  /*---------------------------------------------------------------------*/
  /*Private Data Members-------------------------------------------------*/
  private String text;
  private String Key;
  private String Tag;
  private int Index;
  private double Top;
  private double Left;
  private ColumnHeaders   columnheaders;
  private  boolean ideState =false;
  private String saveName;
  private int width = 95;
  private boolean pressed = false;
  private int alignment = 0;
  /*----------------------------------------------------------------------*/
  /*Constructor-----------------------------------------------------------*/
  public ColumnHeader()
  {
    this.text="";
    this.Key="";
    this.Tag="";
    this.Index=-1;
    this.columnheaders=null;
  }


  public ColumnHeader(String text,String key,String tag,int index,int width,int aligment,ColumnHeaders t)
  {
   this.text=new String(text);
   this.Key=new String(key);
   this.Tag=new String(tag);
   this.Index=index;
   this.alignment = alignment;
   this.width = width;
   this.columnheaders=t;
  }

  public ColumnHeader(int index,String key,String text,int width,int alignment,ColumnHeaders t)
  {
   this(text,key,"",index,width,alignment,t);
  }

  /*----------------------------------------------------------------------*/
  /*Get / Set Properties Method ------------------------------------------*/

   //alignment	
  public void setAlignment(int alignment){
	  this.alignment = alignment;
	  try{
		  PaintColumnHeaders();
	  }catch(Exception e){
	  }

  }

  public int getAlignment(){
	  return alignment;
  }

   // Text
   public void setText(String value) throws Exception
   {
     if (this.columnheaders==null) throw new Exception("91:Object variable or with block variable not set");
     if (value==null) throw new Exception("94:Invalid use of Null");
     this.text=new String(value);
     PaintColumnHeaders();
    }

   public String getText()
    {
      return this.text;
    }

  // Index     // read only at run time
   public void setIndex(int value) throws Exception
   {
     this.Index=value;
   }

   public int getIndex()
   {
    return this.Index;
   }

   // Key

   public void setKey(String value) throws Exception
   {
    if (this.columnheaders==null) throw new Exception("91:Object variable or with block variable not set");
     if (value==null) throw new Exception("94:Invalid use of Null");
    int returnvalue=columnheaders.findUnique(value,this.Index);
    if (returnvalue==0) this.Key=new String(value);
    else
      {
        boolean designtime=Beans.isDesignTime();
        if (designtime) throw new Exception();
        if (returnvalue==1) throw new Exception("35600:Index out of bounds");
        else if (returnvalue==2)  throw new Exception("35602:Key is not unique in collection");
      }
   }

   public String getKey()
   {
    return new String(this.Key);
   }


   // Tag

   public void setTag(String value) throws Exception
   {
    if (this.columnheaders==null) throw new Exception("91:Object variable or with block variable not set");
    this.Tag=new String(value);
   }

   public String getTag()
   {
    return new String(this.Tag);
   }



   public void setname(String name)
   {
	 this.saveName=name;
   }

   public String getname()
   {
	 // Error return this.saveName
     return "ColumnHeader"+this.Index;
   }

   // Top // read-only

   public void setTop(double value) throws Exception
   {
	 // empty
   }


   public double getTop()
   {
    return this.Top;
   }

   // Left // read-only

   public void setLeft(double value) throws Exception
   {
	// empty
   }

   public double getLeft()
   {
    return this.Left;
   }


   public ColumnHeader getObject()
   {
     return this;
   }
/*------------------------------------------------------------------------------------------*/
   public void ChangeIndex(int newindex)
   {
     this.Index=newindex;
   }

  public void  ChangeObject(ColumnHeaders newvalue)
  {
    this.columnheaders=newvalue;
  }

  private void PaintColumnHeaders() throws Exception
  {
    if (this.columnheaders==null) throw new Exception("91:Object variable or with block variable not set");
    this.columnheaders.PaintListView();
  }



 public void changeLeft(double value) throws Exception
   {
     if (this.columnheaders==null) throw new Exception("91:Object variable or with block variable not set");
     this.Left=value;
   }

 public void changeTop(double value) throws Exception
   {
    if (this.columnheaders==null) throw new Exception("91:Object variable or with block variable not set");
    this.Top=value;
   }

 public void ChangeIDEState(boolean value)
 {
    this.ideState=value;
 }

 public String ReturnName()
 {
   return this.saveName;
 }

 public void setSubItemIndex(int s) throws Exception {
 }

 public int getSubItemIndex(){
	 return (this.Index - 1);
 }

 public void setWidth(int w){
	 this.width = w;
	 try{
		 PaintColumnHeaders();
	 }catch(Exception e){
	 }
 }

 public int getWidth(){
	 return width;
 }

 public void setPressed(boolean b){
	 this.pressed = b;
 }

 public boolean getPressed(){
	 return this.pressed;
 }

 /*-------------------------------------------------------------------------*/
 /*--- Not Any Method ------------------------------------------------------*/
} // end of Class ColumnHeader

⌨️ 快捷键说明

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