You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
207 lines
4.0 KiB
207 lines
4.0 KiB
package de.superx.dbadmin; |
|
import java.awt.datatransfer.DataFlavor; |
|
import java.awt.datatransfer.Transferable; |
|
import java.awt.datatransfer.UnsupportedFlavorException; |
|
import java.io.IOException; |
|
import java.io.Serializable; |
|
import java.sql.Date; |
|
|
|
class OrgaEintrag2 implements Transferable, Serializable |
|
{ |
|
final public static DataFlavor ORGA_FLAVOR= new DataFlavor(OrgaEintrag2.class,"orgaEintrag2"); |
|
static DataFlavor flavors[]={ORGA_FLAVOR}; |
|
|
|
String name; |
|
String drucktext; |
|
String key_apnr; |
|
Integer ebene; |
|
String parent; |
|
Integer hierarchie; |
|
Integer lehre; |
|
Integer orgstruktur; |
|
Integer erlaubt; |
|
|
|
java.sql.Date gueltig_seit,gueltig_bis; |
|
|
|
|
|
OrgaEintrag2() |
|
{ |
|
name=null; |
|
drucktext=null; |
|
key_apnr=null; |
|
ebene=null; |
|
parent=null; |
|
lehre=null; |
|
gueltig_seit=null; |
|
gueltig_bis=null; |
|
orgstruktur=null; |
|
erlaubt=null; |
|
} |
|
OrgaEintrag2(String lname, String ldrucktext,String lkey_apnr, Integer lebene,String lparent, Integer llehre, Date gs, Date gb, Integer lorgstruktur) |
|
{ |
|
//akt. Änderung |
|
char bindestrich=150; |
|
name=lname; |
|
if (name!=null) name=name.replace(bindestrich,'-'); |
|
|
|
drucktext=ldrucktext; |
|
if (drucktext!=null) drucktext=drucktext.replace(bindestrich,'-'); |
|
key_apnr=lkey_apnr; |
|
|
|
//if (key_apnr!=null&&key_apnr.equals("E07011100x")) |
|
//test(); |
|
|
|
ebene=lebene; |
|
parent=lparent; |
|
lehre=llehre; |
|
gueltig_seit=gs; |
|
gueltig_bis=gb; |
|
orgstruktur=lorgstruktur; |
|
erlaubt=new Integer(0); |
|
int i=0; |
|
hierarchie=null; |
|
} |
|
private void test() |
|
{ |
|
int i=1; |
|
System.out.println((int)name.charAt(25)); |
|
int i2=1; |
|
} |
|
public void setHierarchie(Integer was) |
|
{ |
|
hierarchie=was; |
|
} |
|
|
|
public String getDrucktext() |
|
{ |
|
return drucktext; |
|
} |
|
public Integer getEbene() |
|
{ |
|
return ebene; |
|
} |
|
public Integer getErlaubt() |
|
{ |
|
return erlaubt; |
|
} |
|
public java.sql.Date getGueltigBis() |
|
{ |
|
return gueltig_bis; |
|
} |
|
|
|
public void setGueltigBis(java.sql.Date bis) |
|
{ |
|
gueltig_bis=bis; |
|
} |
|
|
|
public java.sql.Date getGueltigSeit() |
|
{ |
|
return gueltig_seit; |
|
} |
|
|
|
public void setGueltigSeit(java.sql.Date seit) |
|
{ |
|
gueltig_seit=seit; |
|
} |
|
|
|
public String getKeyApnr() |
|
{ |
|
return key_apnr; |
|
} |
|
public Integer getLehre() |
|
{ |
|
return lehre; |
|
} |
|
public String getName() |
|
{ |
|
return name.trim(); |
|
} |
|
public Integer getOrgstruktur() |
|
{ |
|
return orgstruktur; |
|
} |
|
public String getParent() |
|
{ |
|
return parent; |
|
} |
|
public Object getTransferData(DataFlavor df) throws UnsupportedFlavorException, IOException |
|
{ |
|
if (df.equals(ORGA_FLAVOR)){ |
|
return this; |
|
} |
|
else throw new UnsupportedFlavorException(df); |
|
} |
|
public DataFlavor[] getTransferDataFlavors(){ |
|
return flavors; |
|
} |
|
// -----------transferable |
|
public boolean isDataFlavorSupported(DataFlavor df) |
|
{ |
|
return df.equals(ORGA_FLAVOR); |
|
} |
|
public boolean isLehre() |
|
{ |
|
return lehre.intValue()==1?true:false; |
|
|
|
} |
|
private void readObject(java.io.ObjectInputStream in) |
|
throws IOException, ClassNotFoundException { |
|
in.defaultReadObject(); |
|
} |
|
public void setDrucktext(String ldrucktext) |
|
{ |
|
drucktext=ldrucktext; |
|
} |
|
public void setEbene(Integer neueEbene) |
|
{ |
|
ebene=neueEbene; |
|
} |
|
public void setErlaubt(Integer erl) |
|
{ |
|
erlaubt=erl; |
|
} |
|
public void setErlaubt(boolean was) |
|
{ |
|
erlaubt=was?new Integer(1):new Integer(0); |
|
} |
|
|
|
public boolean isErlaubt() |
|
{ |
|
return erlaubt.intValue()==0?false:true; |
|
} |
|
|
|
public void setKeyApnr(String was) |
|
{ |
|
key_apnr=was; |
|
} |
|
public void setOrgstruktur(Integer lorgstruktur) |
|
{ |
|
orgstruktur=lorgstruktur; |
|
} |
|
public void setParent(String was) |
|
{ |
|
parent=was; |
|
} |
|
public String toString() |
|
{ |
|
//akt. Änderung |
|
String result=""; |
|
if (getKeyApnr()!=null)result+=getKeyApnr().trim()+"-"; |
|
result+=name.trim(); |
|
return result; |
|
} |
|
|
|
public void setLehre(Integer lehr) |
|
{ |
|
lehre=lehr; |
|
} |
|
//-------serializable |
|
private void writeObject(java.io.ObjectOutputStream out) throws IOException { |
|
out.defaultWriteObject(); |
|
} |
|
|
|
public Integer getHierarchie() |
|
{ |
|
return hierarchie; |
|
} |
|
}
|
|
|