|
/**
# L1 B" t2 o& k2 F1 c * CNXObject.java:所有开发的ug/Java主程序类的基类;3 Q3 q; e; d+ I9 w
*/
1 Q& |3 @" ]8 x. I( M& h+ ]% Z8 |4 {4 A. u4 E
//package com.hunix.UGjava.nxopen;3 B" w5 X9 M j `3 U; q
5 T5 v3 m6 d* i/ }import nxopen.*;
( S& @$ O' ~3 H6 ]! qimport nxopen.uf.*;0 C! X; g* S9 ?7 \: J9 A
import nxopen.features.*;
2 E; g) q7 F+ b7 M3 @import java.io.*;* J# S) d: I2 F$ m9 s
import java.net.*;
+ p- _0 F0 ?: G4 ^ V$ |import java.rmi.*;$ H' I* Z% ?& E" k% J
import java.rmi.registry.*;) \+ J- \7 s. C9 R& g5 P0 a3 Y
public abstract class CNXObject {
( ~0 I7 Y W7 P& Z% Q
" s" \; b& S" V. s% z public CNXObject() throws NXException,RemoteException{0 L/ A0 y! q5 C9 t* Z+ Z
theSession = (Session)SessionFactory.get("Session");! Y( f! L, c( q/ d" c
theUFSession = (UFSession)SessionFactory.get("UFSession");
9 G) X4 ]" ?0 U5 h theUI = (UI)SessionFactory.get("UI");
# U3 d( H/ v5 U9 a+ Y# | }' S$ U3 I2 S5 y q" E
public void writeListingWindow(String content)throws NXException,RemoteException{
# C6 h, J- [4 H3 n if(theUFSession==null){
. e4 k. _& n( e9 m4 X- F return;
; Z: E, Y! [0 H% C }& m0 D3 I: N% ], ], i- r# V3 k% m
if(!theUFSession.ui().isListingWindowOpen()){! z6 m, C K; T Z0 H: B; X# y+ ?
theUFSession.ui().openListingWindow();. m+ {. f, `3 n0 S* n0 ]: A/ r
}
* O) J1 W" [ U: z! e theUFSession.ui().writeListingWindow(content);0 U# @/ Y4 `' e
}: T9 Y& |7 V* O+ W' x% F
public void closeListingWindow()throws NXException,RemoteException{
0 S& _0 u( M3 n0 M! c if(theUFSession==null){
( |; O9 m# P$ I& M/ p( X0 Z return;
# p& C. T1 y5 f- a! S0 l }
5 P- _2 u+ d8 Q8 k theUFSession.ui().closeListingWindow();
6 B3 `, r1 V7 f5 y$ N }) @0 G- I5 b: _
public Session getSession(){
7 }0 y4 D. @. h; r' m8 H4 N return theSession;6 S$ u! p) H+ p% l% n( _. I
}: ?5 R9 O% E9 Z! a& i
public UFSession getUFSession(){$ P2 X; \4 g. T6 r1 c- w, u
return theUFSession;
9 t* ]4 a0 H2 ^ }/ x" Q! H! p B$ T6 [1 }8 d. K
public UI getUI(){8 q4 k( Z' W5 r/ K) N
return theUI;
9 a% P3 j* w6 d }4 Q. }* L* o! j7 Z
public static final int getUnloadOption() {
2 y' l6 Z C. r) W0 r/ H n# A4 ~ return BaseSession.LibraryUnloadOption.IMMEDIATELY; ( o( `# q+ E$ t8 }9 J o7 J
}
3 ~+ t, C3 Y% }3 G
8 f& C4 J8 ^( X public abstract String toString();
: S1 W! c6 i* W0 o% r1 ~# R , B2 p* a. z1 M/ I8 b8 r
Session theSession=null ;
. \. |, k* v, U3 S8 q UFSession theUFSession=null ;% R: E4 D7 _4 e0 {2 S- H
UI theUI=null;
* z- Y. `. q i. Z: A2 X) R}. M( s$ t4 _2 B0 D% ]% h- h
|
|