1
2 package org.catacomb.druid.blocks;
3
4 import org.catacomb.druid.build.Context;
5 import org.catacomb.druid.build.Druid;
6 import org.catacomb.druid.build.GUIPath;
7 import org.catacomb.druid.gui.base.DruMovieDisplay;
8 import org.catacomb.druid.gui.base.DruPanel;
9 import org.catacomb.interlish.structure.ModeController;
10 import org.catacomb.interlish.structure.MovieController;
11 import org.catacomb.report.E;
12
13
14
15 public class MovieDisplay extends Panel {
16
17 public int width;
18 public int height;
19
20 public String controls;
21
22 public MovieDisplay() {
23
24 }
25
26
27
28
29 public DruPanel instantiatePanel() {
30 if (width <= 0) {
31 width = 200;
32 }
33 if (height <= 0) {
34 height = 200;
35 }
36 if (prefWidth <= 0) {
37 prefWidth = width;
38 }
39 if (prefHeight <= 0) {
40 prefHeight = height;
41 }
42
43 return new DruMovieDisplay(width, height);
44 }
45
46
47
48 public void populatePanel(DruPanel dpp, Context ctx, GUIPath gpath) {
49
50 DruMovieDisplay drap= (DruMovieDisplay)dpp;
51
52 String ctrlpan = null;
53 if (controls == null || controls.equals("true")) {
54 ctrlpan = "org.catacomb.druid.chunk.MovieControls";
55
56 } else {
57 E.warning("unrecognized ctrl style " + controls);
58 }
59
60
61 if (ctrlpan != null) {
62 Druid druid = new Druid(ctrlpan, ctx);
63 druid.whizzBang();
64 DruPanel dp = druid.getMainPanel();
65 drap.addSouth(dp);
66 drap.setMovieController((MovieController)druid.getController());
67 }
68
69
70
71 String modepan = "org.catacomb.druid.chunk.MouseModes";
72
73 if (modepan != null) {
74 Druid druid = new Druid(modepan, ctx);
75 druid.whizzBang();
76 DruPanel dp = druid.getMainPanel();
77 drap.addNorth(dp);
78 drap.setModeController((ModeController)druid.getController());
79 }
80
81
82
83 }
84
85 }