/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.console.Console; /* */ import NET.worlds.console.DialogReceiver; /* */ import NET.worlds.console.PolledDialog; /* */ import java.awt.Button; /* */ import java.awt.Checkbox; /* */ import java.awt.Event; /* */ import java.awt.FlowLayout; /* */ import java.awt.Font; /* */ import java.awt.GridLayout; /* */ import java.awt.Label; /* */ import java.awt.Panel; /* */ import java.awt.Window; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class CDControl /* */ extends PolledDialog /* */ { /* */ private static final long serialVersionUID = 1L; /* */ private Label display; /* 30 */ private Button stopButton = new Button("[]"); /* 31 */ private Button pauseButton = new Button("||"); /* 32 */ private Button playButton = new Button(">"); /* 33 */ private Button prevButton = new Button("|<<"); /* 34 */ private Button nextButton = new Button(">>|"); /* */ /* 36 */ private Panel top = new Panel(); /* 37 */ private Panel bottom = new Panel(); /* 38 */ private Checkbox cdBox = new Checkbox( /* 39 */ Console.message("Autoplay-CD"), /* 40 */ CDAudio.useAutoCDFlag); /* 41 */ private Checkbox midiBox = new Checkbox( /* 42 */ Console.message("Autoplay-MIDI"), /* 43 */ CDAudio.useMidiFlag); /* */ private String time; /* 45 */ private static Font font = new Font( /* 46 */ Console.message("MenuFont"), 0, 12); /* */ /* */ public CDControl(Window parent, DialogReceiver receiver) /* */ { /* 50 */ super(parent, receiver, Console.message("Music"), false); /* 51 */ this.display = new Label(this.time = CDAudio.get().getTimeReadout()); /* 52 */ setAlignment(1); /* 53 */ ready(); /* */ } /* */ /* */ protected void build() /* */ { /* 58 */ setLayout(new GridLayout(2, 1)); /* */ /* 60 */ this.top.setLayout(new FlowLayout()); /* 61 */ this.top.add(this.display); /* 62 */ this.top.add(this.stopButton); /* 63 */ this.top.add(this.pauseButton); /* 64 */ this.top.add(this.playButton); /* 65 */ this.top.add(this.prevButton); /* 66 */ this.top.add(this.nextButton); /* */ /* 68 */ this.bottom.setLayout(new GridLayout(2, 1)); /* 69 */ this.cdBox.setFont(font); /* 70 */ this.midiBox.setFont(font); /* 71 */ this.bottom.add(this.cdBox); /* 72 */ this.bottom.add(this.midiBox); /* */ /* 74 */ add(this.top); /* 75 */ add(this.bottom); /* */ } /* */ /* */ protected void activeCallback() /* */ { /* 80 */ String tmp = CDAudio.get().getTimeReadout(); /* 81 */ if (!tmp.equals(this.time)) { /* 82 */ this.display.setText(this.time = tmp); /* */ } /* */ } /* */ /* */ public boolean action(Event event, Object what) { /* 87 */ Object target = event.target; /* 88 */ if (target == this.stopButton) { /* 89 */ CDAudio.get().stop(); /* 90 */ } else if (target == this.pauseButton) { /* 91 */ CDAudio.get().pause(); /* 92 */ } else if (target == this.playButton) { /* 93 */ CDAudio.get().play(); /* 94 */ } else if (target == this.prevButton) { /* 95 */ CDAudio.get().prev(); /* 96 */ } else if (target == this.nextButton) { /* 97 */ CDAudio.get().next(); /* 98 */ } else if (target == this.cdBox) { /* 99 */ CDAudio.get().useAutoCD(this.cdBox.getState()); /* 100 */ } else if (target == this.midiBox) { /* 101 */ CDAudio.get().setMidiFlag(this.midiBox.getState()); /* */ } else /* 103 */ return false; /* 104 */ return true; /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\CDControl.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */