home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Button;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.LayoutManager;
- import java.awt.List;
- import java.awt.Panel;
-
- public class ACapplstpan extends Panel {
- List dhtmlList;
- // $FF: renamed from: d java.awt.Dimension
- Dimension field_0 = new Dimension(0, 0);
- private Font normfont = new Font("Helvetica", 0, 11);
- private Image off;
- private Graphics g_off;
- boolean first_paint = true;
- boolean ready_resize = false;
- boolean paint_called;
- boolean first_run;
- Color bgColor;
- int alx;
- int aly;
- int alw;
- int alh;
- int blx;
- int bly;
- int blw;
- int blh;
- // $FF: renamed from: ix int
- int field_1;
- // $FF: renamed from: iy int
- int field_2;
- // $FF: renamed from: iw int
- int field_3;
- // $FF: renamed from: ih int
- int field_4;
- private Button select;
- private Button quit;
- private Button template;
- private Button scroller;
- private Button menu;
- public OCTextArea infoarea;
- ACapplst iface;
-
- public void addButtons() {
- this.select = new Button("New");
- this.select.setFont(this.normfont);
- this.template = new Button("Template");
- this.template.setFont(this.normfont);
- this.quit = new Button("Cancel");
- this.quit.setFont(this.normfont);
- this.figureButtons();
- ((Container)this).add(this.select);
- ((Container)this).add(this.template);
- ((Container)this).add(this.quit);
- }
-
- private void reDoGrid() {
- this.first_run = true;
- this.paintIt();
- }
-
- ACapplstpan(ACapplst var1) {
- this.bgColor = ACutilb.windowColor;
- this.alx = 9;
- this.aly = 9;
- this.alw = 160;
- this.alh = 104;
- this.blx = 116;
- this.bly = 126;
- this.blw = 70;
- this.blh = 20;
- this.field_1 = 183;
- this.field_2 = 10;
- this.field_3 = 152;
- this.field_4 = 102;
- this.iface = var1;
- ((Container)this).setLayout((LayoutManager)null);
- ((Component)this).setBackground(this.bgColor);
- }
-
- public void paint(Graphics var1) {
- this.paint_called = true;
- this.paintIt();
- }
-
- private synchronized void paintIt() {
- if (this.paint_called) {
- Graphics var1 = ((Component)this).getGraphics();
- if (this.first_paint) {
- this.drawArea();
- var1.drawImage(this.off, 0, 0, this);
- this.first_paint = false;
- } else {
- var1.drawImage(this.off, 0, 0, this);
- }
- }
- }
-
- public void figureInfoArea() {
- this.infoarea.reshape(this.field_1, this.field_2, this.field_3, this.field_4);
- }
-
- public void resize(Dimension var1) {
- if (var1.width * var1.height > 0) {
- this.reFigureAll();
- super.resize(var1);
- }
- }
-
- public void resize(int var1, int var2) {
- if (var1 * var2 > 0) {
- this.field_0 = new Dimension(var1, var2);
- this.reFigureAll();
- super.resize(var1, var2);
- }
- }
-
- public void addAppList() {
- this.dhtmlList = new List();
- ((Container)this).add(this.dhtmlList);
- }
-
- public void reFigureAll() {
- if (!this.first_run && this.ready_resize) {
- this.figureInfoArea();
- this.figureButtons();
- }
-
- this.first_run = false;
- }
-
- public void figureButtons() {
- this.select.reshape(this.blx, this.bly, this.blw, this.blh);
- this.template.reshape(this.blx + this.blw + 5, this.bly, this.blw, this.blh);
- this.quit.reshape(this.blx + this.blw * 2 + 10, this.bly, this.blw, this.blh);
- }
-
- public void addComponentSelection() {
- this.dhtmlList = new List();
- this.dhtmlList.reshape(this.alx, this.aly, this.alw, this.alh);
-
- for(int var1 = 0; var1 < this.iface.appListInfo[0].length; ++var1) {
- this.dhtmlList.addItem(this.iface.appListInfo[0][var1]);
- }
-
- this.dhtmlList.select(this.iface.cur_selection);
- ((Container)this).add(this.dhtmlList);
- }
-
- public void addInfoArea() {
- this.infoarea = new OCTextArea(this.iface.appListInfo[1][this.iface.cur_selection]);
- this.infoarea.setFont("Helvetica, plain, 11");
- this.infoarea.setTitleFont("Helvetica, bold, 12");
- this.infoarea.setAlign(1);
- this.infoarea.setVAlign(1);
- this.infoarea.setTopMargin(2);
- this.infoarea.setExtraTitleSpace(0);
- this.infoarea.setUnderlineTitle(true);
- this.figureInfoArea();
- ((Container)this).add(this.infoarea);
- }
-
- public void drawArea() {
- this.off = ((Component)this).createImage(this.field_0.width, this.field_0.height);
- this.g_off = this.off.getGraphics();
- this.g_off.setColor(Color.white);
- this.g_off.drawRect(this.field_1 - 1, this.field_2 - 1, this.field_3 + 2, this.field_4 + 2);
- this.g_off.setColor(Color.gray);
- this.g_off.drawRect(this.field_1 - 2, this.field_2 - 2, this.field_3 + 2, this.field_4 + 2);
- this.g_off.setColor(Color.white);
- this.g_off.drawLine(this.field_1, this.field_2, this.field_1 + this.field_3 - 1, this.field_2);
- this.g_off.drawLine(this.field_1, this.field_2, this.field_1, this.field_2 + this.field_4 - 1);
- }
-
- public Dimension getMinimumSize() {
- return new Dimension(50, 50);
- }
-
- public Dimension getPreferredSize() {
- return new Dimension(50, 50);
- }
-
- public boolean handleEvent(Event var1) {
- if (var1.id == 701) {
- if (var1.target == this.dhtmlList) {
- if (this.dhtmlList.getSelectedIndex() != this.iface.cur_selection && this.dhtmlList.getSelectedIndex() > -1) {
- this.infoarea.setText(this.iface.appListInfo[1][this.dhtmlList.getSelectedIndex()]);
- }
-
- ACutila.dhtmlList_lastSelection = this.dhtmlList.getSelectedIndex();
- this.iface.cur_selection = this.dhtmlList.getSelectedIndex();
- }
- } else if (var1.id == 1001) {
- if (var1.target == this.select) {
- if (this.iface.cur_selection != -1) {
- this.iface.selectedApplet(this.iface.cur_selection);
- this.iface.dispose();
- } else {
- new OCDialog(ACutila.iface, true, "First select an avaialble applet from the list, then click 'New'", "No Selected Applet");
- }
-
- return true;
- }
-
- if (var1.target == this.template) {
- if (this.iface.cur_selection != -1) {
- new OCAOpnr(this.iface.rawinfo, ACutila.iface, this.iface.rawinfo.getAppletInfo(this.iface.cur_selection)[2], true);
- this.iface.dispose();
- } else {
- new OCDialog(ACutila.iface, true, "First select an avaialble effect from the list, then click 'Template'", "No Selected Applet");
- }
-
- return true;
- }
-
- if (var1.target == this.quit) {
- this.iface.dispose();
- return true;
- }
-
- if (var1.target == this.scroller) {
- this.iface.selectedApplet(0);
- this.iface.dispose();
- return true;
- }
-
- if (var1.target == this.menu) {
- this.iface.selectedApplet(1);
- this.iface.dispose();
- return true;
- }
- }
-
- return super.handleEvent(var1);
- }
-
- public void reshape(int var1, int var2, int var3, int var4) {
- if (var3 * var4 > 0) {
- this.field_0 = new Dimension(var3, var4);
- this.reFigureAll();
- super.reshape(var1, var2, var3, var4);
- }
- }
- }
-