Inheritance diagram for VxMediaPlayerApp::
Public Methods | |
void | handleOpen () |
This function is called by _bmenu if the associated menu item is selected. More... | |
void | handleExit () |
This function is called by _bmenu if the associated menu item is selected. More... | |
void | showStructure (int curFrame) |
void | dumpStructure (int curFrame) |
void | showBlockInfo (int curFrame) |
void | showSceneInfo (int curFrame) |
void | showCameraInfo (int curFrame) |
void | showDistanceInfo (int curFrame) |
void | showTekstInfo (int curFrame) |
void | showTopicInfo (int curFrame) |
void | showFaceoutInfo (int curFrame) |
void | showTrackoutInfo (int curFrame) |
void | controllerUpdate (ControllerEvent ce) |
void | valueChanged (ListSelectionEvent e) |
void | stateChanged (ChangeEvent e) |
void | handleFrameChanged (int newFrame) |
Implementation of FrameNavigatorUser. More... | |
void | handleStart () |
Called when the user presses the start button in the GUI. More... | |
void | handleStop () |
Called when the user presses the stop button in the GUI. More... | |
void | handleContinue () |
Called when the user presses the continue button in the GUI. More... | |
void | handleStep () |
Called when the user presses the step button in the GUI. More... | |
void | handleLightweightRenderer (boolean b) |
void | handleThangMode (String mode) |
void | handleTimeLineMode (String mode) |
Static Public Methods | |
void | main (String[] args) |
main is called when this is used as an application. More... | |
Protected Methods | |
boolean | buildSample (JFrame parent, JApplet applet, String[] args) |
|
main is called when this is used as an application. This function has to be overloaded in the "leaf node" application itself. Reimplemented from SampleApp.
00042 { 00043 VxMediaPlayerApp app = new VxMediaPlayerApp(); 00044 app.doMain(args); 00045 00046 // doMain will call buildSample 00047 } |
|
This function is called by _bmenu if the associated menu item is selected.
00052 { 00053 _fc.setFileFilter(_imSeqFilter); 00054 int returnVal = _fc.showOpenDialog(this); 00055 if (returnVal != JFileChooser.APPROVE_OPTION) 00056 return; 00057 java.io.File file =_fc.getSelectedFile(); 00058 00059 try { 00060 if(_proc != null) _proc.close(); 00061 00062 java.net.URL url = new java.net.URL("file:/"+file.getPath()); 00063 _proc = Manager.createProcessor(url); 00064 _proc.addControllerListener((ControllerListener)this); 00065 _proc.configure(); 00066 00067 _structure = loadVxStructure(file); 00068 00069 buildSegmentListTables(); 00070 buildVxGraphic(); 00071 _slices.updateSegs(_blocksModel, Color.blue, file); 00072 } 00073 catch (NoProcessorException e) { ErrorStreamArea.println("Error: "+e); } 00074 catch (java.net.MalformedURLException e) { ErrorStreamArea.println("Error: "+e); } 00075 catch (java.io.IOException e) { ErrorStreamArea.println("Error: "+e); } 00076 catch(Exception e) { ErrorStreamArea.println("Error: "+e); } 00077 } |
|
This function is called by _bmenu if the associated menu item is selected.
00083 { 00084 System.exit(0); 00085 } |
|
00088 { 00089 dumpStructure(curFrame); 00090 if (_blocksModel != null) showBlockInfo(curFrame); 00091 if (_scenesModel != null) showSceneInfo(curFrame); 00092 if (_cameraModel != null) showCameraInfo(curFrame); 00093 if (_distanceModel != null) showDistanceInfo(curFrame); 00094 if (_tekstModel != null) showTekstInfo(curFrame); 00095 if (_topicModel != null) showTopicInfo(curFrame); 00096 if (_faceoutModel != null) showFaceoutInfo(curFrame); 00097 if (_trackoutModel != null) showTrackoutInfo(curFrame); 00098 } |
|
00102 { 00103 if (_dumpStruc.isSelected() == false) return; 00104 00105 OutputStreamArea.clear(); 00106 String[] levels = _structure.getLevelNames(); 00107 for (int i=0 ; i<levels.length ; i++) { 00108 OutputStreamArea.println(levels[i]); 00109 HxCorba.VxSegment segment = _structure.mapsToSegment(levels[i], curFrame); 00110 String[] ids = segment.getIds(); 00111 String[] types = segment.getTypes(); 00112 for (int j=0 ; j<ids.length ; j++) { 00113 OutputStreamArea.print(" " + ids[j]); 00114 if (types[j].compareTo("int") == 0) { 00115 OutputStreamArea.print(" : " + segment.getInt(ids[j])); 00116 } 00117 else if (types[j].compareTo("double") == 0) { 00118 OutputStreamArea.print(" : " + segment.getDouble(ids[j])); 00119 } 00120 else if (types[j].compareTo("string") == 0) { 00121 OutputStreamArea.print(" : " + segment.getString(ids[j])); 00122 } 00123 OutputStreamArea.println(""); 00124 } 00125 } 00126 } |
|
00130 { 00131 if(_blocksModel.isCurrentSegment(curFrame)) return; 00132 00133 _blockTypeField.setText(""); 00134 _blockFrameField.setText(""); 00135 _blockDescField.setText(""); 00136 00137 HxCorba.VxSegment segment = _blocksModel.getSegment(curFrame); 00138 if(segment == null) return; 00139 00140 _blockFrameField.setText(" " + segment.start() + " - " + segment.end()); 00141 String[] ids = segment.getIds(); 00142 for (int j=0 ; j<ids.length ; j++) { 00143 if (ids[j].compareTo("type") == 0) { 00144 String type = segment.getString(ids[j]); 00145 if (type.compareTo("effect") == 0) 00146 type = segment.getString("effect"); 00147 _blockTypeField.setText(type); 00148 } 00149 else if (ids[j].compareTo("description") == 0) { 00150 String desc = segment.getString(ids[j]); 00151 _blockDescField.setText(desc); 00152 _blockDescField.setCaretPosition(0); 00153 } 00154 } 00155 } |
|
00159 { 00160 if(_scenesModel.isCurrentSegment(curFrame)) return; 00161 00162 _sceneTypeField.setText(""); 00163 _sceneFrameField.setText(""); 00164 _sceneDescField.setText(""); 00165 00166 HxCorba.VxSegment segment = _scenesModel.getSegment(curFrame); 00167 if(segment == null) return; 00168 00169 _sceneFrameField.setText(" " + segment.start() + " - " + segment.end()); 00170 String[] ids = segment.getIds(); 00171 for (int j=0 ; j<ids.length ; j++) { 00172 if (ids[j].compareTo("type") == 0) { 00173 String type = segment.getString(ids[j]); 00174 _sceneTypeField.setText(type); 00175 } 00176 else if (ids[j].compareTo("description") == 0) { 00177 String desc = segment.getString(ids[j]); 00178 _sceneDescField.setText(desc); 00179 _sceneDescField.setCaretPosition(0); 00180 } 00181 } 00182 } |
|
00186 { 00187 if(_cameraModel.isCurrentSegment(curFrame)) return; 00188 00189 _cameraTypeField.setText(""); 00190 _cameraFrameField.setText(""); 00191 _cameraDescField.setText(""); 00192 if (_panArrowID != -1) { 00193 _leftViewer.removeObject(_panArrowID); 00194 _panArrowID = -1; 00195 } 00196 if (_tiltArrowID != -1) { 00197 _leftViewer.removeObject(_tiltArrowID); 00198 _tiltArrowID = -1; 00199 } 00200 00201 HxCorba.VxSegment segment = _cameraModel.getSegment(curFrame); 00202 if(segment == null) return; 00203 00204 _cameraFrameField.setText(" " + segment.start() + " - " + segment.end()); 00205 String[] ids = segment.getIds(); 00206 if (ids.length == 0) return; 00207 00208 String type = null; 00209 double factor = 0.0; 00210 double panFactor = 0.0; 00211 double tiltFactor = 0.0; 00212 for (int j=0 ; j<ids.length ; j++) { 00213 if (ids[j].compareTo("type") == 0) { 00214 type = segment.getString(ids[j]); 00215 } 00216 else if (ids[j].compareTo("panFactor") == 0) { 00217 panFactor = segment.getDouble(ids[j]); 00218 } 00219 else if (ids[j].compareTo("tiltFactor") == 0) { 00220 tiltFactor = segment.getDouble(ids[j]); 00221 } 00222 else if (ids[j].compareTo("factor") == 0) { 00223 factor = segment.getDouble(ids[j]); 00224 } 00225 } 00226 00227 _cameraTypeField.setText(type); 00228 00229 // TO DO: Get Frame sizes. 00230 00231 //HxCorba.Sizes seqSizes = _seq.frameSizes(); 00232 double x = 100;//seqSizes.x / 2; 00233 double y = 100;//seqSizes.y / 2; 00234 boolean doPan = false; 00235 boolean doTilt = false; 00236 if (type.compareTo("pan") == 0) { 00237 panFactor = factor; 00238 doPan = true; 00239 } 00240 else if (type.compareTo("tilt") == 0) { 00241 tiltFactor = factor; 00242 doTilt = true; 00243 } 00244 else if (type.compareTo("pantilt") == 0) { 00245 doPan = true; 00246 doTilt = true; 00247 } 00248 String desc = new String(""); 00249 if (doPan) { 00250 int angle = 0; 00251 if (panFactor < 0.0) 00252 angle = 180; 00253 CanvasObject arrow = new CanvasArrow(x, y, Math.abs(panFactor), angle); 00254 _panArrowID = _leftViewer.addObject(arrow); 00255 desc += "pan factor " + panFactor + " "; 00256 } 00257 if (doTilt) { 00258 int angle2 = -90; 00259 if (tiltFactor < 0.0) 00260 angle2 = 90; 00261 CanvasObject arrow2 = new CanvasArrow(x, y, Math.abs(tiltFactor), angle2); 00262 _tiltArrowID = _leftViewer.addObject(arrow2); 00263 desc += "tilt factor " + tiltFactor; 00264 } 00265 _cameraDescField.setText(desc); 00266 } |
|
00270 { 00271 if(_distanceModel.isCurrentSegment(curFrame)) return; 00272 00273 HxCorba.VxSegment segment = _distanceModel.getSegment(curFrame); 00274 if(segment == null) return; 00275 00276 String[] ids = segment.getIds(); 00277 if (ids.length == 0) return; 00278 00279 String strDst = null; 00280 for (int j=0 ; j<ids.length ; j++) { 00281 if (ids[j].compareTo("StrDst") == 0) { 00282 strDst = segment.getString(ids[j]); 00283 } 00284 } 00285 00286 if (strDst == null) 00287 return; 00288 String desc = _cameraDescField.getText(); 00289 desc += " distance : " + strDst; 00290 _cameraDescField.setText(desc); 00291 } |
|
00295 { 00296 if(_tekstModel.isCurrentSegment(curFrame)) return; 00297 00298 _tekstFrameField.setText(""); 00299 _tekstDescField.setText(""); 00300 00301 HxCorba.VxSegment segment = _tekstModel.getSegment(curFrame); 00302 if(segment == null) return; 00303 00304 _tekstFrameField.setText(" " + segment.start() + " - " + segment.end()); 00305 String[] ids = segment.getIds(); 00306 for (int j=0 ; j<ids.length ; j++) { 00307 if (ids[j].compareTo("sentence") == 0) { 00308 String desc = segment.getString(ids[j]); 00309 _tekstDescField.setText(desc); 00310 _tekstDescField.setCaretPosition(0); 00311 } 00312 } 00313 } |
|
00317 { 00318 if(_topicModel.isCurrentSegment(curFrame)) return; 00319 00320 _topicFrameField.setText(""); 00321 _topicDescField.setText(""); 00322 00323 HxCorba.VxSegment segment = _topicModel.getSegment(curFrame); 00324 if(segment == null) return; 00325 00326 _topicFrameField.setText(" " + segment.start() + " - " + segment.end()); 00327 String[] ids = segment.getIds(); 00328 for (int j=0 ; j<ids.length ; j++) { 00329 if (ids[j].compareTo("topic") == 0) { 00330 String desc = segment.getString(ids[j]); 00331 _topicDescField.setText(desc); 00332 _topicDescField.setCaretPosition(0); 00333 } 00334 } 00335 } |
|
00338 { 00339 for (int i=0; i<_no_faces; i++) { 00340 _leftViewer.removeObject(_faces[i]); 00341 } 00342 _no_faces = 0; // remove all 00343 00344 if(!_thang.equals("face")) return; 00345 00346 HxCorba.VxSegment segment = _faceoutModel.getSegment(curFrame); 00347 if(segment == null) return; 00348 00349 //get faces 00350 String[] ids = segment.getIds(); 00351 if (ids.length == 0) return; 00352 00353 String face_string = null; 00354 for (int j=0 ; j<ids.length ; j++) { 00355 if (ids[j].compareTo("faces") == 0) { 00356 face_string = segment.getString(ids[j]); 00357 } 00358 } 00359 00360 // drawing faces 00361 java.util.StringTokenizer st = new java.util.StringTokenizer(face_string); 00362 int no_faces = Integer.parseInt(st.nextToken()); 00363 for (int i=0; i<no_faces; i++) { 00364 double centerx = Double.parseDouble(st.nextToken()); 00365 double centery = Double.parseDouble(st.nextToken()); 00366 double w = Double.parseDouble(st.nextToken()); 00367 double h = Double.parseDouble(st.nextToken()); 00368 CanvasObject rec = new CanvasRectangle(centerx-w/2, centery-h/2, w, h, Color.white); 00369 _faces[_no_faces] = _leftViewer.addObject(rec); 00370 if (_faces[_no_faces] != -1) _no_faces++; 00371 } 00372 } |
|
00375 { 00376 if (_track_recID != -1) { 00377 _leftViewer.removeObject(_track_recID); 00378 _track_recID = -1; 00379 } 00380 00381 if(!_thang.equals("track")) return; 00382 00383 HxCorba.VxSegment segment = _trackoutModel.getSegment(curFrame); 00384 if(segment == null) return; 00385 00386 //get object 00387 String[] ids = segment.getIds(); 00388 if (ids.length == 0) return; 00389 00390 double centerx = 0, centery=0, w=0, h=0; 00391 String des = ""; 00392 00393 for (int j=0 ; j<ids.length ; j++) { 00394 if (ids[j].compareTo("centerx") == 0) { 00395 centerx = segment.getDouble(ids[j]); 00396 } 00397 else if (ids[j].compareTo("centery") == 0) { 00398 centery = segment.getDouble(ids[j]); 00399 } 00400 else if (ids[j].compareTo("width") == 0) { 00401 w = segment.getDouble(ids[j]); 00402 } 00403 else if (ids[j].compareTo("height") == 0) { 00404 h = segment.getDouble(ids[j]); 00405 } 00406 else if (ids[j].compareTo("description") == 0) { 00407 des = segment.getString(ids[j]); 00408 } 00409 } 00410 00411 if (des.compareTo("Occlusion!") == 0) { 00412 CanvasObject rec = new CanvasRectangle(centerx-w/2, centery-h/2, w, h, Color.red); 00413 _track_recID = _leftViewer.addObject(rec); 00414 } 00415 else { 00416 CanvasObject rec = new CanvasRectangle(centerx-w/2, centery-h/2, w, h, Color.white); 00417 _track_recID = _leftViewer.addObject(rec); 00418 } 00419 } |
|
00423 { 00424 if (ce instanceof ConfigureCompleteEvent) { 00425 // Use processor as a player 00426 _proc.setContentDescriptor(null); 00427 00428 TrackControl tc[] = _proc.getTrackControls(); 00429 TrackControl videoTrack = null; 00430 for (int i = 0; i < tc.length; i++) { 00431 if (tc[i].getFormat() instanceof VideoFormat) { 00432 videoTrack = tc[i]; 00433 break; 00434 } 00435 } 00436 if (videoTrack == null) { 00437 ErrorStreamArea.println("The input media does not contain a video track."); 00438 return; 00439 } 00440 00441 VideoFormat format = (VideoFormat)videoTrack.getFormat(); 00442 _frameRate = format.getFrameRate(); 00443 OutputStreamArea.println("Video format: " + format); 00444 00445 // Instantiate and set the frame access codec to the data flow path. 00446 try { 00447 Codec codec[] = { new PostAccessCodec() }; 00448 videoTrack.setCodecChain(codec); 00449 } 00450 catch (UnsupportedPlugInException e) { 00451 ErrorStreamArea.println("The process does not support effects."); 00452 } 00453 00454 _proc.prefetch(); 00455 } 00456 else if (ce instanceof DurationUpdateEvent) { 00457 Time duration = _proc.getDuration(); 00458 if(duration == Duration.DURATION_UNKNOWN) 00459 ErrorStreamArea.println("DURATION_UNKNOWN"); 00460 _nrFrames = (int)(duration.getSeconds() * _frameRate); 00461 } 00462 else if (ce instanceof RealizeCompleteEvent) { 00463 //Control ctrl = _proc.getControl("javax.media.control.FramePositioningControl"); 00464 //FramePositioningControl posCtrl = (FramePositioningControl)ctrl; 00465 } 00466 else if (ce instanceof PrefetchCompleteEvent) { 00467 final Component seqView = _proc.getVisualComponent(); 00468 final Component ctrl = _proc.getControlPanelComponent(); 00469 00470 final Runnable doShowComponents = new Runnable() { 00471 public void run() { showVideoComponents(seqView, ctrl); } 00472 }; 00473 SwingUtilities.invokeLater(doShowComponents); 00474 } 00475 else if (ce instanceof EndOfMediaEvent) { 00476 handleStop(); 00477 System.err.println("End Of Media"); 00478 } 00479 } |
|
00483 { 00484 //System.out.println("valueChanged "+e.getValueIsAdjusting()); 00485 00486 if (e.getValueIsAdjusting()) 00487 return; 00488 00489 for (int i=0 ; i<_tables.length ; i++) { 00490 if (_tables[i] == null) 00491 continue; 00492 if(!(_tables[i].getModel() instanceof SegmentListTableModel)) 00493 continue; 00494 00495 if (e.getSource().equals(_tables[i].getSelectionModel())) { 00496 SegmentListTableModel model = (SegmentListTableModel)_tables[i].getModel(); 00497 int row = _tables[i].getSelectedRow(); 00498 //System.out.println("valueChanged "+row); 00499 if((row != -1) && (row != model.getSegmentRow(_curFrame))) { 00500 Integer start = (Integer) model.getValueAt(row, 0); 00501 Integer end = (Integer) model.getValueAt(row, 1); 00502 int frameNr = start.intValue()+2; 00503 if(frameNr > end.intValue()) frameNr = start.intValue(); 00504 handleFrameChanged(frameNr); 00505 } 00506 } 00507 } 00508 } |
|
00512 { 00513 int i = _tabbedPane.getSelectedIndex(); 00514 int row = _tables[i].getSelectedRow(); 00515 if(row == -1) return; 00516 _tables[i].scrollRectToVisible(_tables[i].getCellRect(row, 0, true)); 00517 } |
|
Implementation of FrameNavigatorUser.
Reimplemented from FrameNavigatorUser.
00522 { 00523 System.out.println("handleFrameChanged: "+newFrame); 00524 double sec = ((double)newFrame) / _frameRate; 00525 _proc.setMediaTime(new Time(sec)); 00526 //System.out.println("*setting frame "+newFrame+" (secs: "+sec+")"); 00527 } |
|
Called when the user presses the start button in the GUI.
00532 { 00533 _nrDisplayed = 0; 00534 _startTime = System.currentTimeMillis(); 00535 _statField.setText("running"); 00536 _proc.setMediaTime(new Time(0.0)); 00537 _proc.start(); 00538 00539 //_refreshTimer.setRepeats(true); 00540 _refreshTimer.start(); 00541 } |
|
Called when the user presses the stop button in the GUI.
00547 { 00548 _statField.setText("stopping"); 00549 _refreshTimer.stop(); 00550 _proc.stop(); 00551 } |
|
Called when the user presses the continue button in the GUI.
00557 { 00558 _nrDisplayed = 0; 00559 _startTime = System.currentTimeMillis(); 00560 _statField.setText("running"); 00561 _proc.start(); 00562 00563 //_refreshTimer.setRepeats(true); 00564 _refreshTimer.start(); 00565 } |
|
Called when the user presses the step button in the GUI.
00571 { 00572 handleFrameChanged(++ _curFrame); 00573 00574 //_refreshTimer.setRepeats(false); 00575 //_refreshTimer.start(); 00576 } |
|
00579 { 00580 Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(b)); 00581 } |
|
00584 { 00585 _thang = mode; 00586 } |
|
00589 { 00590 CardLayout cl = (CardLayout)(_timeLinePanel.getLayout()); 00591 cl.show(_timeLinePanel, mode); 00592 } |
|
Reimplemented from SampleApp.
00602 { 00603 //OutputStreamArea out = new OutputStreamArea(10,80, false); 00604 ErrorStreamArea err = new ErrorStreamArea(parent, 10, 80); 00605 00606 _refreshTimer = createRefreshTimer(100); 00607 00608 OutputStreamArea.println("Initializing CorbaMediator..."); 00609 initCorbaMediator(args); 00610 00611 OutputStreamArea.println("Building "+getSampleName()+" GUI..."); 00612 00613 _leftViewer = ViewerFactory.makeBasicViewer(); 00614 00615 // Create FileChooser, for loading image sequences 00616 _fc = new JFileChooser("\\video"); 00617 _imSeqFilter = new ImSeqFilter(); 00618 _fc.addChoosableFileFilter(_imSeqFilter); 00619 00620 00621 JPanel gui = new JPanel(new GridBagLayout()); 00622 00623 // Add splitpane with two viewers 00624 00625 JPanel leftPanel = new JPanel(new GridBagLayout()); 00626 HX.addGridComp(leftPanel, _leftViewer, 0, 1, 1, 1, 00627 GridBagConstraints.BOTH, 1.0, 1.0, 1, 1); 00628 00629 00630 JPanel rightPanel = makeTabbedPanel(); 00631 00632 JSplitPane viewSP = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 00633 leftPanel, rightPanel); 00634 viewSP.setOneTouchExpandable(true); 00635 viewSP.setDividerLocation(378); 00636 HX.addGridComp(gui, viewSP, 0, 0, 1, 1, 00637 GridBagConstraints.BOTH, 1.0, 0.5, 0, 3); 00638 00639 00640 // Add frame navigator 00641 00642 _frameNav = new FrameNavigator(this, 0, 0, 720, 1); 00643 HX.addGridComp(gui, _frameNav, 0, 1, 1, 1, 00644 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00645 00646 00647 // Add button control panel 00648 00649 JPanel butPanel = new JPanel(); 00650 00651 JButton b1 = new JButton("Reset"); 00652 b1.setToolTipText("Start playing"); 00653 b1.addActionListener(new AbstractAction() { 00654 public void actionPerformed(ActionEvent e) { 00655 handleStart(); 00656 }}); 00657 butPanel.add(b1); 00658 00659 JButton b2 = new JButton("Stop"); 00660 b2.setToolTipText("Stop playing"); 00661 b2.addActionListener(new AbstractAction() { 00662 public void actionPerformed(ActionEvent e) { 00663 handleStop(); 00664 }}); 00665 butPanel.add(b2); 00666 00667 JButton b3 = new JButton("Play"); 00668 b3.setToolTipText("Continue playing"); 00669 b3.addActionListener(new AbstractAction() { 00670 public void actionPerformed(ActionEvent e) { 00671 handleContinue(); 00672 }}); 00673 butPanel.add(b3); 00674 00675 JButton b4 = new JButton("Step"); 00676 b4.setToolTipText("Step one frame"); 00677 b4.addActionListener(new AbstractAction() { 00678 public void actionPerformed(ActionEvent e) { 00679 handleStep(); 00680 }}); 00681 butPanel.add(b4); 00682 00683 _statField = new JTextField("idle", 8); 00684 _statField.setEditable(false); 00685 butPanel.add(_statField); 00686 00687 _fpsField = new JTextField("fps", 8); 00688 _fpsField.setEditable(false); 00689 butPanel.add(_fpsField); 00690 00691 HX.addGridComp(gui, butPanel, 0, 2, 1, 1, 00692 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00693 00694 00695 // Add checkbox panel 00696 00697 JPanel checkPanel = new JPanel(new GridBagLayout()); 00698 00699 _showStruc = new JCheckBox("Show video structure", true); 00700 HX.addGridComp(checkPanel, _showStruc, 0, 0, 1, 1, 00701 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00702 00703 _dumpStruc = new JCheckBox("Dump video structure", false); 00704 HX.addGridComp(checkPanel, _dumpStruc, 1, 0, 1, 1, 00705 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00706 00707 _graphStruc = new JCheckBox("Graphic video structure", true); 00708 HX.addGridComp(checkPanel, _graphStruc, 2, 0, 1, 1, 00709 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00710 00711 //HX.addGridComp(this, checkPanel, 0, 3, 1, 1, 00712 // GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00713 00714 00715 // Add block description panel 00716 00717 JPanel blockPanel = new JPanel(new GridBagLayout()); 00718 00719 JLabel l1 = new JLabel("Block : "); 00720 HX.addGridComp(blockPanel, l1, 0, 0, 1, 1, 00721 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00722 00723 _blockTypeField = new JTextField("", 8); 00724 _blockTypeField.setEditable(false); 00725 HX.addGridComp(blockPanel, _blockTypeField, 1, 0, 1, 1, 00726 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00727 00728 JLabel l2 = new JLabel(" frames "); 00729 HX.addGridComp(blockPanel, l2, 2, 0, 1, 1, 00730 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00731 00732 _blockFrameField = new JTextField("", 8); 00733 _blockFrameField.setEditable(false); 00734 HX.addGridComp(blockPanel, _blockFrameField, 3, 0, 1, 1, 00735 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00736 00737 _blockDescField = new JTextField("", 20); 00738 _blockDescField.setEditable(false); 00739 HX.addGridComp(blockPanel, _blockDescField, 4, 0, 1, 1, 00740 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 1, 1); 00741 00742 HX.addGridComp(gui, blockPanel, 0, 4, 1, 1, 00743 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00744 00745 00746 // Add scene description panel 00747 00748 JPanel scenePanel = new JPanel(new GridBagLayout()); 00749 00750 JLabel l11 = new JLabel("Scene : "); 00751 HX.addGridComp(scenePanel, l11, 0, 0, 1, 1, 00752 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00753 00754 _sceneTypeField = new JTextField("", 8); 00755 _sceneTypeField.setEditable(false); 00756 HX.addGridComp(scenePanel, _sceneTypeField, 1, 0, 1, 1, 00757 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00758 00759 JLabel l22 = new JLabel(" frames "); 00760 HX.addGridComp(scenePanel, l22, 2, 0, 1, 1, 00761 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00762 00763 _sceneFrameField = new JTextField("", 8); 00764 _sceneFrameField.setEditable(false); 00765 HX.addGridComp(scenePanel, _sceneFrameField, 3, 0, 1, 1, 00766 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00767 00768 _sceneDescField = new JTextField("", 20); 00769 _sceneDescField.setEditable(false); 00770 HX.addGridComp(scenePanel, _sceneDescField, 4, 0, 1, 1, 00771 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 1, 1); 00772 00773 HX.addGridComp(gui, scenePanel, 0, 5, 1, 1, 00774 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00775 00776 00777 // Add camera description panel 00778 00779 JPanel cameraPanel = new JPanel(new GridBagLayout()); 00780 00781 JLabel l111 = new JLabel("Camera : "); 00782 HX.addGridComp(cameraPanel, l111, 0, 0, 1, 1, 00783 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00784 00785 _cameraTypeField = new JTextField("", 8); 00786 _cameraTypeField.setEditable(false); 00787 HX.addGridComp(cameraPanel, _cameraTypeField, 1, 0, 1, 1, 00788 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00789 00790 JLabel l222 = new JLabel(" frames "); 00791 HX.addGridComp(cameraPanel, l222, 2, 0, 1, 1, 00792 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00793 00794 _cameraFrameField = new JTextField("", 8); 00795 _cameraFrameField.setEditable(false); 00796 HX.addGridComp(cameraPanel, _cameraFrameField, 3, 0, 1, 1, 00797 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00798 00799 _cameraDescField = new JTextField("", 20); 00800 _cameraDescField.setEditable(false); 00801 HX.addGridComp(cameraPanel, _cameraDescField, 4, 0, 1, 1, 00802 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 1, 1); 00803 00804 HX.addGridComp(gui, cameraPanel, 0, 6, 1, 1, 00805 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00806 00807 00808 // Add tekst description panel 00809 00810 JPanel tekstPanel = new JPanel(new GridBagLayout()); 00811 00812 JLabel l1111 = new JLabel("Tekst : "); 00813 HX.addGridComp(tekstPanel, l1111, 0, 0, 1, 1, 00814 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00815 00816 JLabel l2222 = new JLabel(" frames "); 00817 HX.addGridComp(tekstPanel, l2222, 1, 0, 1, 1, 00818 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00819 00820 _tekstFrameField = new JTextField("", 8); 00821 _tekstFrameField.setEditable(false); 00822 HX.addGridComp(tekstPanel, _tekstFrameField, 2, 0, 1, 1, 00823 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00824 00825 _tekstDescField = new JTextField("", 20); 00826 _tekstDescField.setEditable(false); 00827 HX.addGridComp(tekstPanel, _tekstDescField, 3, 0, 1, 1, 00828 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 1, 1); 00829 00830 HX.addGridComp(gui, tekstPanel, 0, 7, 1, 1, 00831 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00832 00833 00834 // Add topic description panel 00835 00836 JPanel topicPanel = new JPanel(new GridBagLayout()); 00837 00838 JLabel l11111 = new JLabel("Topic : "); 00839 HX.addGridComp(topicPanel, l11111, 0, 0, 1, 1, 00840 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00841 00842 JLabel l22222 = new JLabel(" frames "); 00843 HX.addGridComp(topicPanel, l22222, 1, 0, 1, 1, 00844 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00845 00846 _topicFrameField = new JTextField("", 8); 00847 _topicFrameField.setEditable(false); 00848 HX.addGridComp(topicPanel, _topicFrameField, 2, 0, 1, 1, 00849 GridBagConstraints.NONE, 0.0, 0.0, 1, 1); 00850 00851 _topicDescField = new JTextField("", 20); 00852 _topicDescField.setEditable(false); 00853 HX.addGridComp(topicPanel, _topicDescField, 3, 0, 1, 1, 00854 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 1, 1); 00855 00856 HX.addGridComp(gui, topicPanel, 0, 8, 1, 1, 00857 GridBagConstraints.HORIZONTAL, 1.0, 0.0, 0, 3); 00858 00859 00860 // Add graphics panel 00861 00862 _vxGraphic = new VxGraphicsPanel(3000, 200); 00863 JScrollPane graphicScroll = new JScrollPane(_vxGraphic); 00864 String graphicId = "Boundaries"; 00865 00866 _slices = new SlicesPanel(10000, 280); 00867 JScrollPane slicesScroll = new JScrollPane(_slices); 00868 String slicesId = "Slices"; 00869 00870 _timeLinePanel = new JPanel(); 00871 _timeLinePanel.setLayout(new CardLayout()); 00872 _timeLinePanel.add(graphicScroll, graphicId); 00873 _timeLinePanel.add(slicesScroll, slicesId); 00874 00875 HX.addGridComp(gui, _timeLinePanel, 0, 9, 1, 1, 00876 GridBagConstraints.BOTH, 1.0, 0.5, 0, 3); 00877 00878 00879 // Create ExtMenuBar: 00880 00881 _bmenu = new ExtMenuBar(this); 00882 _bmenu.addMenu("File"); 00883 _bmenu.addMenuItem("File", "Open", "handleOpen"); 00884 _bmenu.addSeparator("File"); 00885 _bmenu.addMenuItem("File", "Exit", "handleExit"); 00886 00887 _bmenu.addMenu("Preferences"); 00888 _bmenu.addCheckBoxItem("Preferences", "Use Lightweight Renderer", 00889 "handleLightweightRenderer", true); 00890 _bmenu.addSeparator("Preferences"); 00891 _bmenu.addSubMenu("Preferences", "Detection mode"); 00892 String[] tmodes = { "face", "track", "none" }; 00893 _bmenu.addGroupMenu("Detection mode", tmodes, "handleThangMode", tmodes[0]); 00894 _bmenu.addSubMenu("Preferences", "Time line mode"); 00895 String[] vmodes = { graphicId, slicesId }; 00896 _bmenu.addGroupMenu("Time line mode", vmodes, "handleTimeLineMode", vmodes[0]); 00897 00898 parent.setJMenuBar(_bmenu); 00899 parent.getContentPane().add(gui, BorderLayout.CENTER); 00900 parent.setSize(1000, 800); 00901 parent.setLocation(0, 0); 00902 00903 // MIA logo 00904 00905 Image logo = Toolkit.getDefaultToolkit().createImage(CorbaSamplesRes.get_mia()); 00906 CanvasCorbaImage cIm = new CanvasCorbaImage(new JavaImageData(logo)); 00907 _leftViewer.addObject(cIm); 00908 00909 Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true)); 00910 00911 OutputStreamArea.println("Done."); 00912 00913 return true; 00914 } |