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

SampleApp Class Reference

The root of all sample applications. More...

Inheritance diagram for SampleApp::

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

Public Methods

void init ()
 init is called when this is used as an applet. More...


Static Public Methods

void main (String args[])
 main is called when this is used as an application. More...


Protected Methods

void doMain (String args[])
void quitSample ()
String getSampleName ()
abstract boolean buildSample (JFrame parent, JApplet applet, String[] args)
JFrame getParentFrame ()
JApplet getApplet ()
boolean isStandalone ()

Detailed Description

The root of all sample applications.

SampleApp takes care of the common "problem" of running as applet or application. It makes sure there is a _parent (a JFrame) for the application to use as a "main window".


Member Function Documentation

void SampleApp::init   [inline]
 

init is called when this is used as an applet.

00033 {
00034     getContentPane().add(createContents());
00035 
00036     OutputStreamArea out = new AppletOutputStreamArea(_msgArea);
00037     ErrorStreamArea err = new AppletErrorStreamArea(_msgArea);
00038 
00039     _butStart.addActionListener(new AppletStarter());
00040     _msgArea.setLineWrap(true);
00041     _msgArea.setEditable(false);
00042 
00043     _applet = this;
00044 }

void SampleApp::main String    args[] [inline, static]
 

main is called when this is used as an application.

This function has to be overloaded in the "leaf node" application itself.

Reimplemented in DatabaseApp, DisplayApp, IDBSurfApp, ImageSurfApp, MdiApp, MediaApp, MiaSurfApp, OracleApp, OracleSurfApp, QuerySegmentations, TestApp, TrackingApp, TVApp, VideoApp, VideoBrowser, VideoBrowserDemos, VxBasePlayerApp, VxMediaPlayerApp, VxPlayerApp, and ConfigureApp.

00050 {
00051     System.out.println("You have to implement the main method in your demo class.");
00052     System.out.println("In that main method you have to create an instance of your demo class");
00053     System.out.println("and call its method doMain.");
00054 }

void SampleApp::doMain String    args[] [inline, protected]
 

00063 {
00064     doRun(args);
00065 }

void SampleApp::quitSample   [inline, protected]
 

Reimplemented in DisplayApp, and VideoBrowserDemos.

00068 {
00069     if(isStandalone())
00070         System.exit(0);
00071     else
00072         _parent.dispose();
00073 }

String SampleApp::getSampleName   [inline, protected]
 

Reimplemented in VideoBrowserDemos, and VxBasePlayerApp.

00081 {
00082     return getClass().getName();
00083 }

abstract boolean SampleApp::buildSample JFrame    parent,
JApplet    applet,
String    args[]
[protected, pure virtual]
 

Reimplemented in DatabaseApp, DisplayApp, IDBSurfApp, ImageSurfApp, MdiApp, MediaApp, MiaSurfApp, OracleApp, OracleSurfApp, QuerySegmentations, TestApp, TrackingApp, TVApp, VideoApp, VideoBrowser, VideoBrowserDemos, VxBasePlayerApp, VxMediaPlayerApp, and ConfigureApp.

JFrame SampleApp::getParentFrame   [inline, protected]
 

00090 {
00091     return _parent;
00092 }

JApplet SampleApp::getApplet   [inline, protected]
 

00095 {
00096     return _applet;
00097 }

boolean SampleApp::isStandalone   [inline, protected]
 

00100 {
00101     return (_applet == null);
00102 }


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