|
/**
; w9 E' X7 n5 j0 L: R * CNXObject.java:所有开发的ug/Java主程序类的基类;8 Z4 Q1 W: @% Z; H
*/9 D. O- b7 ^. V
7 Y {& O) O) y4 p# u4 ^
//package com.hunix.UGjava.nxopen;
7 c, ?+ J9 g! F; X, B, b
# T3 f! A T2 H" _9 i8 G: himport nxopen.*;3 {* d9 g$ R! j
import nxopen.uf.*;% w6 F- z5 R3 b3 s) R1 b
import nxopen.features.*;' P' Q* @$ ]3 F; ]- s+ ?( w
import java.io.*;7 p! `! c0 X+ @4 p' t
import java.net.*;3 J2 \- k. O0 q
import java.rmi.*;
% }/ ?2 E! P7 kimport java.rmi.registry.*;
( X# G! T0 q0 W6 C% g* A# Y9 jpublic abstract class CNXObject {
5 {9 g1 K+ A" q R$ P* ^& a0 m* {. ]% F/ @& R
public CNXObject() throws NXException,RemoteException{0 a. p. m7 [: V/ i& _
theSession = (Session)SessionFactory.get("Session");
/ w2 X$ C% z( P4 j" Y5 u8 [4 A theUFSession = (UFSession)SessionFactory.get("UFSession");8 h# |7 N) Z t: K" Q8 `' F, b4 n
theUI = (UI)SessionFactory.get("UI");/ Y% J) C. W$ L! ` i* F
}
9 ]4 f) i( n. s$ O" i2 D& ^: k public void writeListingWindow(String content)throws NXException,RemoteException{/ j, K4 M$ y/ f6 F
if(theUFSession==null){
- ]! ^0 }( y% z( a* I" f; X+ q% |$ y return;
; W% K. n' J; x, `" Z/ _ }
5 I3 p+ Z# k$ B+ W! |# v if(!theUFSession.ui().isListingWindowOpen()){6 T" J' @4 K. F# l- a2 ?2 g3 V2 D3 ^7 `
theUFSession.ui().openListingWindow();- I3 l& X" E! T3 A' H
}
6 ~& t% v' }; X theUFSession.ui().writeListingWindow(content);1 l0 k$ W1 o5 y+ J! p3 s! n
}
+ P, U4 T! ~% j9 v) i; ]% s9 q+ S public void closeListingWindow()throws NXException,RemoteException{
; k7 _# b' J% s' p) T if(theUFSession==null){8 S& Q- b) D4 K/ M+ y
return;
2 v3 x7 z& a) r% i1 x6 h }
! \& w+ o0 k$ i+ h9 G1 y& s9 l1 W theUFSession.ui().closeListingWindow();
5 v) G+ F0 u' Z% \6 _, ~% G! C: [ }
, ^/ T# Z. }$ F/ p( J public Session getSession(){
u. }' W3 _' [6 s" p7 `) |8 f return theSession;
$ g9 ^7 _% d+ U" _# t B }: ~3 K3 t9 F# |+ b; l. A
public UFSession getUFSession(){
1 `! }' R* [/ _ K: x return theUFSession;' U; Y$ Q5 z; ]9 |0 ]
}
" X" q2 P: u! E1 X4 s( V public UI getUI(){
5 ^( F( }. \. ]' y return theUI;
) U8 b9 h) a. S' s }
* l+ K7 _+ z$ |0 E3 h- B+ J g public static final int getUnloadOption() { * ?1 D4 z1 g% ^
return BaseSession.LibraryUnloadOption.IMMEDIATELY; [' R; u- N; y& y( Q; k# o
}
& U% y P. j7 k % R7 B3 G- F; R: _) H
public abstract String toString();/ K6 G \7 V0 Y& r) y
7 Y0 Z8 X6 ]) @, f2 H2 w Session theSession=null ;
: ]* r# _0 S; A: e( B0 z UFSession theUFSession=null ;
1 o* o$ Z \9 D7 M UI theUI=null;
7 q {' b& k z6 U, Z}
: I5 K/ S$ u# ]6 n" A: u& X |
|