|
/**
7 C9 X* d. l9 M( A6 \ * CNXObject.java:所有开发的ug/Java主程序类的基类;6 r0 u2 u/ p! N U8 G1 i
*/3 H8 ?6 M8 _' R3 S: u
r# `! m7 {$ ]
//package com.hunix.UGjava.nxopen;
' @0 v2 r* I! V' T) m
; k8 v" q7 m# M7 ?6 ^8 Z' himport nxopen.*;) q5 F, `! \ p5 b# Y" K$ Y" f
import nxopen.uf.*;
1 u& ^2 P- j' W( M& v4 A @9 q' H6 Pimport nxopen.features.*;
9 i9 A/ j: u: C- j* g3 Simport java.io.*;
9 t- u4 q$ J! G6 vimport java.net.*;
M ^3 f- J% W8 `import java.rmi.*;
8 W$ L% E! v K1 cimport java.rmi.registry.*;
8 z- g p# O, y% Ppublic abstract class CNXObject {
! f3 R# r! z0 v5 D+ t6 b
0 p; r; p0 a, u& n {9 u public CNXObject() throws NXException,RemoteException{
' h {: M; l2 \2 f5 R theSession = (Session)SessionFactory.get("Session");, G" f8 v# |! j% R. L
theUFSession = (UFSession)SessionFactory.get("UFSession");$ L7 ^4 C0 E |. H
theUI = (UI)SessionFactory.get("UI");
2 M6 U ?! M; O2 c' _( V }
3 P" i& R8 x* l" v public void writeListingWindow(String content)throws NXException,RemoteException{% ]6 b& `7 \1 J- X" O
if(theUFSession==null){
8 e& ^3 {) i# i4 Z% `, ?3 M+ Q return;4 w% ?( b" u% [* X: p$ T9 d
}" i/ M$ Z( } X& x* |
if(!theUFSession.ui().isListingWindowOpen()){
u' A2 I9 m$ {4 `; Y theUFSession.ui().openListingWindow();
1 j# }" F9 L4 q( X. w/ e }" e* F/ Z! p3 S2 { w4 T
theUFSession.ui().writeListingWindow(content);
- \. n( z# q& H. s3 S }/ |4 A$ V7 l( R
public void closeListingWindow()throws NXException,RemoteException{
! W& c" a+ a7 k. C if(theUFSession==null){
- s5 Z4 I& G7 E1 g+ r; ]) S3 R8 r% M return;% i( V+ t0 l; w2 o. {8 Q% I }
}3 y' ]: N) a3 R! I
theUFSession.ui().closeListingWindow();8 b8 e2 p5 `/ i e
}
" H; |, w# E" O" P- N# [4 N7 F. B public Session getSession(){
) a/ c8 H; V; Y return theSession;
# d& O& U [- c9 z) @0 F }
# ^, R+ [) A* T; O. U$ t* x public UFSession getUFSession(){, E% t; ?! R" \
return theUFSession;- T) A" ]# ^8 ~
}
{5 f `7 r0 I8 g# @& | public UI getUI(){. `$ s$ F* W% o4 T! C
return theUI;
4 M" x8 K2 A- _8 b }; a9 O# f9 w7 I
public static final int getUnloadOption() { $ ~5 G# [; j5 Q) v
return BaseSession.LibraryUnloadOption.IMMEDIATELY;
' j* b1 |& ]* u! v }
1 I9 Z9 \, L9 Q4 s! T
1 e8 X, K+ @2 a4 P& }% G4 B public abstract String toString();- s* g. n4 ]$ V- m( q5 @, M
; t# m7 S P3 |0 b) j) D Session theSession=null ;
7 T0 b; b* k/ A UFSession theUFSession=null ;2 s0 N1 D; w1 \1 o! c
UI theUI=null;
& ?" |6 w4 D- O0 @" \, \}
# S! M* N( f: m+ P6 I |
|