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

DefaultQueryUser Class Reference

Inheritance diagram for DefaultQueryUser::

QueryUser List of all members.

Public Methods

 DefaultQueryUser (Component parent)
void allowSingleResults (boolean allow)
void allowMultipleResults (boolean allow)
void handleSegments (String video, String segmentation, HxCorba.VxSegment[] segments)
void handleMultipleSegments (HxCorba.SegmentQueryResult[] res)
void handleSQL (String sqlQuery)

Protected Methods

void showSingleResults (String video, String segmentation, HxCorba.VxSegment[] segments)
void showMultipleResults (HxCorba.SegmentQueryResult[] segments)
void alertWrongMode ()

Constructor & Destructor Documentation

DefaultQueryUser::DefaultQueryUser Component    parent [inline]
 

00019 {
00020     _parent = parent;
00021 
00022     _allowSingleResults = true;
00023     _allowMultipleResults = true;
00024 }


Member Function Documentation

void DefaultQueryUser::allowSingleResults boolean    allow [inline]
 

00027 {
00028     _allowSingleResults = allow;
00029 }

void DefaultQueryUser::allowMultipleResults boolean    allow [inline]
 

00032 {
00033     _allowMultipleResults = allow;
00034 }

void DefaultQueryUser::handleSegments String    video,
String    segmentation,
HxCorba.VxSegment    segments[]
[inline]
 

Reimplemented from QueryUser.

00039 {
00040     boolean show = showResultLength(segments.length);
00041     if(!show) return;
00042 
00043     if(_allowSingleResults) {
00044         showSingleResults(video, segmentation, segments);
00045     }
00046     else {
00047         HxCorba.SegmentQueryResult[] res =
00048             new HxCorba.SegmentQueryResult[segments.length];
00049         for(int i=0; i<res.length; i++) {
00050             int start = segments[i].start();
00051             int end = segments[i].end();
00052             res[i] = new HxCorba.SegmentQueryResult(video, segmentation,
00053                  segments[i], new HxCorba.VxTimeSpan(start, end));
00054         }
00055         showMultipleResults(res);
00056     }
00057 }

void DefaultQueryUser::handleMultipleSegments HxCorba.SegmentQueryResult    res[] [inline]
 

Reimplemented from QueryUser.

00061 {
00062     boolean show = showResultLength(res.length);
00063     if(!show) return;
00064 
00065     if(_allowMultipleResults) {
00066         showMultipleResults(res);
00067     }
00068     else {
00069         String videoName = res[0].videoName;
00070         String segName = res[0].segmentationName;
00071         boolean singleQuery = true;
00072         HxCorba.VxSegment[] segments = new HxCorba.VxSegment[res.length];
00073         for(int i=0; (i<res.length) && singleQuery; i++) {
00074             if(!res[i].videoName.equals(videoName)) singleQuery = false;
00075             if(!res[i].segmentationName.equals(segName)) singleQuery = false;
00076             segments[i] = res[i].segment;
00077         }
00078 
00079         if(!singleQuery) alertWrongMode();
00080         else
00081             showSingleResults(videoName, segName, segments);
00082     }
00083 }

void DefaultQueryUser::handleSQL String    sqlQuery [inline]
 

Reimplemented from QueryUser.

00086 {
00087 }

void DefaultQueryUser::showSingleResults String    video,
String    segName,
HxCorba.VxSegment    segments[]
[inline, protected]
 

00091 {
00092 }

void DefaultQueryUser::showMultipleResults HxCorba.SegmentQueryResult    res[] [inline, protected]
 

00095 {
00096 }

void DefaultQueryUser::alertWrongMode   [inline, protected]
 

00099 {
00100     String message = "Query returned segments from different "+
00101         "segmentations or videos.\nResults can not be shown.";
00102     JOptionPane.showMessageDialog(_parent,
00103         message, "Query results", JOptionPane.ERROR_MESSAGE);
00104 }


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