|
/**
/ O) K* [" P: s3 c: M- C1 t! Y * CNXObject.java:所有开发的ug/Java主程序类的基类;6 R) g! W) b7 O
*/
) T. ?* a; G" O; M y
1 l" u# V' ^. b; K//package com.hunix.UGjava.nxopen;2 T$ |1 h( j" L! G9 X; [. ?
. M# f: K! _1 D* q7 j
import nxopen.*;
6 R8 l3 s$ N( \' L, jimport nxopen.uf.*;" I0 F, b4 V* ~: `% v: U0 n4 y& b
import nxopen.features.*;
' `& H7 D2 a3 d9 |; ]import java.io.*;
# x9 i: z1 U7 I8 `' A0 _import java.net.*;
J' g4 a [/ u! G yimport java.rmi.*;
- ]0 ~& R# w9 Fimport java.rmi.registry.*;% j' \; Q9 t' u9 }. V
public abstract class CNXObject {
1 w. g0 v6 g6 j* v3 g" o6 k; Y- N% U
public CNXObject() throws NXException,RemoteException{" W& i& G l, u- E0 V/ V
theSession = (Session)SessionFactory.get("Session");
; H8 X4 ?% H, U theUFSession = (UFSession)SessionFactory.get("UFSession");
: j3 \- ^2 V) A q- V' s$ ^ theUI = (UI)SessionFactory.get("UI");( A! T1 A$ c7 E5 A' g
}
! ?! h5 r1 d8 A- ] public void writeListingWindow(String content)throws NXException,RemoteException{4 i- K; a z4 p; @. j* ]
if(theUFSession==null){3 g1 m. [5 G8 x1 m) }$ B
return;
5 v* F) W5 V- a" t/ h }
: V2 R% t1 D& R2 C* M& n4 A5 D7 j if(!theUFSession.ui().isListingWindowOpen()){+ p: }" ]! f4 n5 c& x8 F
theUFSession.ui().openListingWindow();
* O4 M+ [/ n2 H- p7 P. h- }, C I }
2 V7 F! Q! _- Q$ G4 e theUFSession.ui().writeListingWindow(content);9 R+ `, P! ~0 O" l2 ]' R& F4 E, V
}
9 S9 }2 E' E6 j; H8 A public void closeListingWindow()throws NXException,RemoteException{
- w; x% Z% V. z$ i3 N if(theUFSession==null){2 p) K* X( M6 O1 b8 K
return;8 L* y* p! q) j& _
}
& C" [% I8 j+ H3 X8 }6 c5 A theUFSession.ui().closeListingWindow();- d% S! \7 H9 ]4 {) v* Y
}% B1 G' K) A- L8 S# H/ ^
public Session getSession(){
& O, R7 t( H5 q return theSession;6 u5 }4 F% a" o, x5 v& I+ U
}
3 ?) C; F( m, _9 D6 A6 q7 f public UFSession getUFSession(){$ q. _2 _" Z! X) z% Q/ L! I3 |) s: n S0 {
return theUFSession;: m* H7 A, g$ _! ~
}. l6 X8 X# n( K+ P6 w# v) V
public UI getUI(){
; t, r/ i/ r' p) o' i; Q* ?6 A' S return theUI;
! W1 S( C! I/ X/ @- Z }* j, {3 m" u# Y) O5 ~, ]& L5 l) r
public static final int getUnloadOption() { * E9 |" K3 k7 K. N
return BaseSession.LibraryUnloadOption.IMMEDIATELY;
( V1 F; i; [* T' V( w }9 ~9 w/ Z+ Q* Y& |1 j
! z2 h; C. I6 t/ J# }) S( I public abstract String toString();
( K+ Q! x# f" }( W& k1 i , y( R$ m6 O0 z
Session theSession=null ;- ? R- I+ B+ H* Z
UFSession theUFSession=null ;
! x3 F M* ]7 ]* x# @8 p UI theUI=null;
* U) q* o) x2 C1 Z" f; E}! R% m( }$ q/ ^/ W! l% [7 ~
|
|