Inheritance diagram for DefaultQueryUser::
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 () |
|
00019 { 00020 _parent = parent; 00021 00022 _allowSingleResults = true; 00023 _allowMultipleResults = true; 00024 } |
|
00027 { 00028 _allowSingleResults = allow; 00029 } |
|
00032 { 00033 _allowMultipleResults = allow; 00034 } |
|
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 } |
|
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 } |
|
Reimplemented from QueryUser.
00086 { 00087 } |
|
00091 { 00092 } |
|
00095 { 00096 } |
|
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 } |