Horus Doc || Java GUI Reference || Doxygen's quick Index  

CorbaSampleApp Class Reference

Base class for Java samples that are CORBA clients (both applets and standalone). More...

Inheritance diagram for CorbaSampleApp::

SampleApp ConfigureApp DatabaseApp DisplayApp IDBSurfApp ImageSurfApp MdiApp OracleApp OracleSurfApp QuerySegmentations TestApp TrackingApp TVApp VideoSampleApp VxMediaPlayerApp List of all members.

Protected Methods

CorbaMediator initCorbaMediator (String[] args)
AdvancedLookupManager setAdvancedLookupManager (JFrame f)
void registerApp ()
 Register application in the NameServer, with a default App servant. More...

void registerApp (HxCorba.AppOperations app)
 Register application in the NameServer, with a given App servant. More...

void unregisterApp ()
String getRegisteredName ()
void addInitialService (String id, String name, String stubName)
 Add a initial object to StubRepository. More...

String[] getRGBModes ()
File askFilename (FileFilter filter, boolean local)
String nameFromFile (File f)
String getSamplePath ()
String getSampleProperty (String name)
String getSampleProperty (String name, String defValue)

Static Protected Attributes

final FileFilter JAVA_FILTER = new HxJava.Util.JavaImageFilter()
final FileFilter HORUS_FILTER = new HxJava.Util.HorusImageFilter()
final FileFilter SEQ_FILTER = new HxJava.Util.ImSeqFilter()

Detailed Description

Base class for Java samples that are CORBA clients (both applets and standalone).


Member Function Documentation

CorbaMediator CorbaSampleApp::initCorbaMediator String    args[] [inline, protected]
 

00032 {
00033     if(isStandalone())
00034         return new FullCorbaMediator(args);
00035     else
00036         return new AppletCorbaMediator(getApplet());
00037 }

AdvancedLookupManager CorbaSampleApp::setAdvancedLookupManager JFrame    f [inline, protected]
 

00040 {
00041     AdvancedLookupManager lookupMgr = new AdvancedLookupManager(f);
00042     ServiceRepository.instance().setLookupManager(lookupMgr);
00043     return lookupMgr;
00044 }

void CorbaSampleApp::registerApp   [inline, protected]
 

Register application in the NameServer, with a default App servant.

00048 {
00049     registerApp(new StubManagerAppServant());
00050 }

void CorbaSampleApp::registerApp HxCorba.AppOperations    app [inline, protected]
 

Register application in the NameServer, with a given App servant.

00054 {
00055     if(_appName != null) {
00056         ErrorStreamArea.println("Application already registered");
00057         return;
00058     }
00059 
00060     _appName = CorbaMediator.instance().registerApp(app, getSampleName());
00061     if(_appName == null) return;
00062 
00063     OutputStreamArea.println("Registered as "+_appName);
00064     getParentFrame().setTitle(_appName);
00065 }

void CorbaSampleApp::unregisterApp   [inline, protected]
 

00068 {
00069     if(_appName != null)
00070         CorbaMediator.instance().unregisterApp(_appName);
00071 
00072     _appName = null;
00073 }

String CorbaSampleApp::getRegisteredName   [inline, protected]
 

00077 {
00078     return _appName;
00079 }

void CorbaSampleApp::addInitialService String    id,
String    name,
String    stubName
[inline, protected]
 

Add a initial object to StubRepository.

00085 {
00086     StubRepository.instance().addStub(id, stubName,
00087         CorbaMediator.instance().getInitialObject(name));
00088 }

String [] CorbaSampleApp::getRGBModes   [inline, protected]
 

00101 {
00102     HxCorba.Registry registry = null;
00103     try {
00104         registry = ServiceRepository.instance().getRegistry();
00105     }
00106     catch(Exception e) {}
00107 
00108     return (registry == null)? new String[] { "Direct" } :
00109         registry.getValueNames("/imagefunctortable/rgb");
00110 }

File CorbaSampleApp::askFilename FileFilter    filter,
boolean    local
[inline, protected]
 

00113 {
00114     File result = null;
00115     if(local) {
00116         if(_fc == null) _fc = buildFileChooser(getSamplePath());
00117         if(filter == null) filter = _fc.getAcceptAllFileFilter();
00118 
00119         _fc.setFileFilter(filter);
00120 
00121         int returnVal = _fc.showOpenDialog(getParentFrame());
00122         if (returnVal == JFileChooser.APPROVE_OPTION)
00123             result = _fc.getSelectedFile();
00124     }
00125     else {
00126         String name = JOptionPane.showInputDialog("Filename:");
00127         if(name != null)
00128             result = new File(name);
00129     }
00130     return result;
00131 }

String CorbaSampleApp::nameFromFile File    f [inline, protected]
 

00134 {
00135     // Extract a name for the image from the selected file
00136 
00137     String resName = f.getName();
00138     int i = resName.indexOf('.');
00139     if(i != -1)
00140         resName = resName.substring(0, i);
00141 
00142     return resName;
00143 }

String CorbaSampleApp::getSamplePath   [inline, protected]
 

Reimplemented in VideoApp, and VxBasePlayerApp.

00146 {
00147     return ".";
00148 }

String CorbaSampleApp::getSampleProperty String    name [inline, protected]
 

00151 {
00152     return getSampleProperty(name, "");
00153 }

String CorbaSampleApp::getSampleProperty String    name,
String    defValue
[inline, protected]
 

00156 {
00157     if(_config == null) _config = loadConfig();
00158 
00159     return _config.getProperty("HxSamples."+getSampleName()+"."+name, defValue);
00160 }


Member Data Documentation

final FileFilter CorbaSampleApp::JAVA_FILTER = new HxJava.Util.JavaImageFilter() [static, protected]
 

final FileFilter CorbaSampleApp::HORUS_FILTER = new HxJava.Util.HorusImageFilter() [static, protected]
 

final FileFilter CorbaSampleApp::SEQ_FILTER = new HxJava.Util.ImSeqFilter() [static, protected]
 


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:17 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001