-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmpresent.jsp
725 lines (637 loc) · 25.7 KB
/
mpresent.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
<%
/*
* mpresent.jsp
*
* Created on 2010-07-13 (Original CGI 2010-07-07)
*
* Copyright (c) 2010 imacat
*
* version 0.01
*/
%><%@ page
contentType="text/html; charset=utf-8"
import="com.sun.star.beans.PropertyValue"
import="com.sun.star.bridge.XUnoUrlResolver"
import="com.sun.star.comp.helper.Bootstrap"
import="com.sun.star.frame.XDesktop"
import="com.sun.star.lang.XComponent"
import="com.sun.star.lang.XMultiComponentFactory"
import="com.sun.star.uno.UnoRuntime"
import="com.sun.star.uno.XComponentContext"
import="com.sun.star.ucb.XFileIdentifierConverter"
import="com.sun.star.container.XEnumeration"
import="com.sun.star.container.XEnumerationAccess"
import="com.sun.star.frame.XModel"
import="com.sun.star.lang.XServiceInfo"
import="com.sun.star.drawing.XDrawPages"
import="com.sun.star.drawing.XDrawPagesSupplier"
import="com.sun.star.frame.XComponentLoader"
import="com.sun.star.presentation.XPresentation"
import="com.sun.star.presentation.XPresentation2"
import="com.sun.star.presentation.XPresentationSupplier"
import="com.sun.star.presentation.XSlideShowController"
import="java.util.Hashtable"
import="java.util.Vector"
%><%!
/** The servlet request */
private HttpServletRequest r = null;
/** The desktop service. */
private Object desktop = null;
/** The bootstrap context. */
private XComponentContext bootstrapContext = null;
/** The registry service manager. */
private XMultiComponentFactory serviceManager = null;
/** The document. */
private XComponent doc = null;
/** The action type. */
private ActionType action = null;
/** The file. */
private String file = null;
/** The current slide index. */
private int currentSlide = -1;
/** The goto slide index. */
private int slide = -1;
/** The slide indeces of all the opened presentations. */
private Hashtable<String,Integer> savedSlideIndeces
= new Hashtable<String,Integer>();
/** The presentation document files. */
private Vector<PresentationFile> allFiles
= new Vector<PresentationFile>();
/**
* Parses the arguments.
*
*/
private void parseArguments() {
this.action = null;
this.file = null;
this.currentSlide = -1;
this.slide = -1;
if (this.allFiles.size() == 0) {
this.allFiles.add(new PresentationFile(
"/home/imacat/ooomagic.odp",
"OpenOffice.org的UNO魔術"));
this.allFiles.add(new PresentationFile(
"/home/imacat/(一)初級篇.odp",
"Perl Regular Expression初級篇"));
this.allFiles.add(new PresentationFile(
"/home/imacat/(二)進階篇.odp",
"Perl Regular Expression進階篇"));
this.allFiles.add(new PresentationFile(
"/home/imacat/ooomagic-real.odp",
"真•OpenOffice.org的UNO魔術"));
this.allFiles.add(new PresentationFile(
"/home/imacat/ooomagic-real-real.odp",
"真•真•OpenOffice.org的UNO魔術"));
}
try {
this.r.setCharacterEncoding("UTF-8");
} catch (java.io.UnsupportedEncodingException e) {
throw new java.lang.IllegalArgumentException(e);
}
if (this.r.getMethod().equals("POST")) {
if (this.r.getParameter("start") != null) {
this.action = ActionType.START;
} else if (this.r.getParameter("next") != null) {
this.action = ActionType.NEXT;
} else if (this.r.getParameter("previous") != null) {
this.action = ActionType.PREVIOUS;
} else if (this.r.getParameter("stop") != null) {
this.action = ActionType.STOP;
} else if (this.r.getParameter("goto") != null) {
this.action = ActionType.GOTO;
} else if (this.r.getParameter("close") != null) {
this.action = ActionType.CLOSE;
}
this.file = this.r.getParameter("file");
if (this.r.getParameter("slide") != null && !this.r.getParameter("slide").equals("")) {
this.slide = Integer.parseInt(this.r.getParameter("slide")) - 1;
}
}
return;
}
/**
* Shows the HTML presentation controller page.
*
* @return the HTML of the page
*/
private String showHTML() {
String html = null;
String script = this.r.getServletPath();
int pos = 0;
pos = script.lastIndexOf('/');
script = script.substring(pos + 1);
html = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n"
+ " \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"zh-tw\">\n"
+ "<head>\n"
+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.5\" />\n"
+ "<title>簡報遙控</title>\n"
+ "</head>\n"
+ "<body>\n";
if (this.doc != null) {
XDrawPagesSupplier xDrawPagesSupplier = null;
int count = -1;
xDrawPagesSupplier = (XDrawPagesSupplier)
UnoRuntime.queryInterface(
XDrawPagesSupplier.class, this.doc);
count = xDrawPagesSupplier.getDrawPages().getCount();
html += "<form action=\"" + script + "\" method=\"POST\">\n"
+ "<div>\n"
+ "<input type=\"hidden\" name=\"file\" value=\""
+ this.file + "\" />\n"
+ "<input type=\"submit\" name=\"stop\" value=\"■\" />\n"
+ "<input type=\"submit\" name=\"previous\" value=\"◀◀\" />\n"
+ "<input type=\"submit\" name=\"start\" value=\"▶\" />\n"
+ "<input type=\"submit\" name=\"next\" value=\"▶▶\" />\n"
+ "</div>\n"
+ "<div> </div>\n";
html += "<div>\n"
+ "<select name=\"slide\">\n";
for (int i = 0; i < count; i++) {
html += " <option value=\"" + (i + 1) + "\""
+ (i == this.currentSlide? " selected=\"selected\"": "")
+ ">" + (i + 1) + "</option>\n";
}
html += "</select>\n"
+ "<input type=\"submit\" name=\"goto\" value=\"Go\" />\n"
+ "<input type=\"submit\" name=\"close\" value=\"▲ \" />\n"
+ "</div>\n"
+ "</form>\n";
}
html += "<form action=\"" + script + "\" method=\"POST\">\n"
+ "<div><select name=\"file\">\n";
for (int i = 0; i < this.allFiles.size(); i++) {
PresentationFile thisFile = this.allFiles.get(i);
html += " <option"
+ " value=\"" + thisFile.getFile() + "\""
+ (this.file != null && this.file.equals(thisFile.getFile())?
" selected=\"selected\"": "")
+ ">" + thisFile.getTitle() + "</option>\n";
}
html += "</select></div>\n"
+ "<input type=\"submit\" name=\"start\" value=\"▶\" />\n"
+ "</div>\n"
+ "</form>\n"
+ "</body>\n"
+ "</html>";
return html;
}
/**
* Connects to the OpenOffice.org process.
*
* @param host specifies the host name
* @param port specifies the port number
* @throws com.sun.star.comp.helper.BootstrapException if fails to
* create the initial component context
* @throws com.sun.star.connection.NoConnectException if no one
* is accepting on the specified resource.
* @throws com.sun.star.connection.ConnectionSetupException if
* it is not possible to accept on a local resource
*/
private void connect(String host, int port)
throws com.sun.star.comp.helper.BootstrapException,
com.sun.star.connection.NoConnectException,
com.sun.star.connection.ConnectionSetupException {
boolean doConnect = false;
XComponentContext localContext;
XMultiComponentFactory localServiceManager = null;
Object unoUrlResolver = null;
XUnoUrlResolver xUnoUrlResolver = null;
Object bootstrapContext = null;
if (this.desktop == null) {
doConnect = true;
} else {
try {
UnoRuntime.queryInterface(XDesktop.class, this.desktop);
} catch (com.sun.star.lang.DisposedException e) {
doConnect = true;
}
}
if (!doConnect) {
return;
}
// Obtain the local context
try {
localContext = Bootstrap.createInitialComponentContext(null);
} catch (java.lang.Exception e) {
throw new com.sun.star.comp.helper.BootstrapException(e);
}
if (localContext == null) {
throw new com.sun.star.comp.helper.BootstrapException(
"Failed to obtain the local OpenOffice.org component context.");
}
// Obtain the local service manager
localServiceManager = localContext.getServiceManager();
// Obtain the URL resolver
try {
unoUrlResolver = localServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(
XUnoUrlResolver.class, unoUrlResolver);
// Obtain the context
try {
bootstrapContext = xUnoUrlResolver.resolve(String.format(
"uno:socket,host=%s,port=%d;urp;StarOffice.ComponentContext",
host, port));
} catch (com.sun.star.connection.NoConnectException e) {
throw e;
} catch (com.sun.star.connection.ConnectionSetupException e) {
throw e;
} catch (com.sun.star.lang.IllegalArgumentException e) {
throw new java.lang.IllegalArgumentException(e);
}
if (bootstrapContext == null) {
throw new java.lang.UnsupportedOperationException(
String.format("Failed to connect to OpenOffice.org at %s:%d.",
host, port));
}
this.bootstrapContext = (XComponentContext) UnoRuntime.queryInterface(
XComponentContext.class, bootstrapContext);
// Obtain the service manager
this.serviceManager = this.bootstrapContext.getServiceManager();
// Obtain the desktop service
try {
this.desktop = this.serviceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
}
/**
* Finds the already-opened document.
*
*/
private void findDocument() {
Object fileContentProvider = null;
XFileIdentifierConverter xFileIdentifierConverter = null;
String url = null;
XDesktop xDesktop = null;
XEnumerationAccess xEnumerationAccess = null;
XEnumeration xEnumeration = null;
boolean isRunning = false;
try {
fileContentProvider
= this.serviceManager.createInstanceWithContext(
"com.sun.star.ucb.FileContentProvider",
this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
xFileIdentifierConverter = (XFileIdentifierConverter)
UnoRuntime.queryInterface(
XFileIdentifierConverter.class, fileContentProvider);
url = xFileIdentifierConverter.getFileURLFromSystemPath(
"", this.file);
this.doc = null;
// Obtain all the components
xDesktop = (XDesktop) UnoRuntime.queryInterface(
XDesktop.class, this.desktop);
xEnumerationAccess = xDesktop.getComponents();
xEnumeration = xEnumerationAccess.createEnumeration();
while (xEnumeration.hasMoreElements()) {
Object component = null;
XServiceInfo xServiceInfo = null;
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XModel xModel = null;
boolean isThisDocument = false;
try {
component = xEnumeration.nextElement();
} catch (com.sun.star.container.NoSuchElementException e) {
throw new java.util.NoSuchElementException(e.getMessage());
} catch (com.sun.star.lang.WrappedTargetException e) {
throw new java.lang.RuntimeException(e);
}
xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(
XServiceInfo.class, component);
if (xServiceInfo == null) {
continue;
}
if (!xServiceInfo.supportsService(
"com.sun.star.presentation.PresentationDocument")) {
continue;
}
xModel = (XModel) UnoRuntime.queryInterface(
XModel.class, component);
if (url.equals(xModel.getURL())) {
this.doc = (XComponent) UnoRuntime.queryInterface(
XComponent.class, component);
isThisDocument = true;
}
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, component);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
if (!isThisDocument && xPresentation2.isRunning()) {
XSlideShowController xSlideShowController
= xPresentation2.getController();
this.savedSlideIndeces.put(xModel.getURL(),
xSlideShowController.getCurrentSlideIndex());
xPresentation2.end();
}
}
}
/**
* Opens the presentation document.
*
* @throws java.io.IOException when file couldn't be found or was
corrupt
*/
private void open()
throws java.io.IOException {
Object fileContentProvider = null;
XFileIdentifierConverter xFileIdentifierConverter = null;
String url = null;
XComponentLoader xComponentLoader = null;
PropertyValue props[] = new PropertyValue[0];
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
if (this.doc == null) {
try {
fileContentProvider
= this.serviceManager.createInstanceWithContext(
"com.sun.star.ucb.FileContentProvider",
this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
xFileIdentifierConverter = (XFileIdentifierConverter)
UnoRuntime.queryInterface(
XFileIdentifierConverter.class, fileContentProvider);
// Open the file
url = xFileIdentifierConverter.getFileURLFromSystemPath(
"", this.file);
xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(
XComponentLoader.class, this.desktop);
try {
this.doc = xComponentLoader.loadComponentFromURL(
url, "_default", 0, props);
} catch (com.sun.star.io.IOException e) {
throw new java.io.IOException(e);
} catch (com.sun.star.lang.IllegalArgumentException e) {
throw new java.lang.IllegalArgumentException(e);
}
if (this.savedSlideIndeces.containsKey(url)) {
this.savedSlideIndeces.remove(url);
}
}
// Obtain the presentation
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
// Obtain the current slide
if (xPresentation2.isRunning()) {
xSlideShowController = xPresentation2.getController();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
// Start the presentation if not started yet
} else {
if (this.action != ActionType.STOP) {
XModel xModel = null;
xPresentation2.start();
while (!xPresentation2.isRunning()) { }
xSlideShowController = xPresentation2.getController();
xModel = (XModel) UnoRuntime.queryInterface(
XModel.class, this.doc);
url = xModel.getURL();
if (this.savedSlideIndeces.containsKey(url)) {
this.currentSlide = this.savedSlideIndeces.get(url);
} else {
this.currentSlide = -1;
}
// Go to the current slide
if (this.currentSlide == -1) {
if (xSlideShowController.getCurrentSlideIndex() != 0) {
xSlideShowController.gotoSlideIndex(0);
}
} else {
if ( xSlideShowController.getCurrentSlideIndex()
!= this.currentSlide) {
xSlideShowController.gotoSlideIndex(this.currentSlide);
}
}
// Redraw the screen for sometimes the screen is black
xSlideShowController.gotoNextSlide();
try {
Thread.currentThread().sleep(50);
} catch (java.lang.InterruptedException e) {
}
xSlideShowController.gotoPreviousSlide();
}
}
return;
}
/**
* Starts the presentation.
*
*/
private void start() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Goes to the next slide.
*
*/
private void gotoNextSlide() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
xSlideShowController.gotoNextSlide();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Goes to the previous slide.
*
*/
private void gotoPreviousSlide() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
xSlideShowController.gotoPreviousSlide();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Stops the presentation
*
*/
private void stop() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
if (xPresentation2.isRunning()) {
XSlideShowController xSlideShowController
= xPresentation2.getController();
XModel xModel = (XModel) UnoRuntime.queryInterface(
XModel.class, this.doc);
this.savedSlideIndeces.put(xModel.getURL(),
xSlideShowController.getCurrentSlideIndex());
xPresentation.end();
}
return;
}
/**
* Goes to a specific slide.
*
*/
private void gotoSlide() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
xSlideShowController.gotoSlideIndex(this.slide);
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Closes the presentation document.
*
*/
private void close() {
this.doc.dispose();
this.doc = null;
return;
}
/**
* The action type.
*
* @author <a href="mailto:imacat@mail.imacat.idv.tw">imacat</a>
* @version 0.01
*/
private enum ActionType {
/** Starts the presentation. */
START,
/** Goes to the next slide. */
NEXT,
/** Goes to the previous slide. */
PREVIOUS,
/** Stop the presentation. */
STOP,
/** Goes to a specific slide. */
GOTO,
/** Closes the presentation document. */
CLOSE;
}
/**
* The presentation file.
*
* @author <a href="mailto:imacat@mail.imacat.idv.tw">imacat</a>
* @version 0.01
*/
private class PresentationFile {
/** The document file. */
private String file = null;
/** The document title. */
private String title = null;
/**
* Creates a new instance of PresentationFile.
*
* @param file the document file
* @param title the document title
*/
private PresentationFile(String file, String title) {
this.file = file;
this.title = title;
}
/**
* Returns the document file.
*
* @return the document file
*/
private String getFile() {
return this.file;
}
/**
* Returns the document title.
*
* @return the document title
*/
private String getTitle() {
return this.title;
}
}
%><%
this.r = request;
this.parseArguments();
if (this.action != null) {
this.connect("localhost", 2002);
this.findDocument();
this.open();
switch (this.action) {
case START:
this.start();
break;
case NEXT:
this.gotoNextSlide();
break;
case PREVIOUS:
this.gotoPreviousSlide();
break;
case STOP:
this.stop();
break;
case CLOSE:
this.stop();
this.close();
break;
case GOTO:
this.gotoSlide();
break;
}
}
out.print(this.showHTML());
%>