home *** CD-ROM | disk | FTP | other *** search
Wrap
import com.ms.awt.FontX; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Event; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Image; import java.awt.Menu; import java.awt.MenuItem; import java.awt.PopupMenu; class OCmsl extends OCdg { private int menux; private int menuy; private int oldmenux = -1; private int oldmenuy = -1; private int bitheight; private boolean first_crun = true; public Color bgColor = new Color(255, 255, 255); private Image poff; private Graphics g_poff; private int pwidth = 8; private int pheight = 8; int oldpy = -1; int oldpx = -1; int curPoint = -1; int aDist = 10; int rmx; int rmy; int curHL = -1; int leaveHL = -1; int realHL = -1; int auxHL = -1; int sub_level; String branchid; boolean subOn = false; private Image upa; private Image downa; Image menu; Graphics g_menu; // $FF: renamed from: fm java.awt.FontMetrics public FontMetrics field_0; // $FF: renamed from: ds java.awt.Dimension public Dimension field_1; public int appx; public int appy; private Color m_hltextcolor = new Color(255, 255, 153); private Color m_hlbgcolor = new Color(102, 102, 102); private Color m_outline_color; private Color m_textcolor; private Font m_font; private Font m_hlfont; public int m_xoffset; private Color m_menucolor; private String m_textdecoration; private String m_hltextdecoration; private int m_marginleft; private int m_marginright; private int m_margintop; private int m_marginbottom; private Color m_border_color; private int m_borderwidth_left; private int m_borderwidth_right; private int m_borderheight_top; private int m_borderheight_bottom; private int m_divider_height; private Color m_divider_color; private boolean m_usedivder_topandbottom; public String[] m_desc; public int[] m_iconid; public String[] m_iconfiles; private Image[] m_iconimage; public String[] m_switch_iconfiles; private Image[] m_switch_iconimage; public boolean[] iconimage_status; private String m_icon_align; public int num_descrips; public int level; public int max_string_width; public int menuwidth; public int menuheight; private int itemwidth; private int itemheight; public int desc_index; boolean multi_level; private int indWidth; private Color indArrowColor; private Image upArrow; private boolean[] hasHigherlevel; public int drag_iposx; public int drag_iposy; private int init_dragx; private int init_dragy; private int[] save_iposx; private int[] save_iposy; private int[] save_iposw; private int[] save_iposh; private int[] item_h; private int[] item_y; private int icon_xoff; private int icon_yoff; APInfo apinfo; private boolean useColors; public boolean mouseMove(Event var1, int var2, int var3) { this.rmx = super.scroll_x + super.offimgx + this.aDist; this.rmy = super.scroll_y + super.offimgy; if (var2 > this.rmx && var2 < this.rmx + this.menuwidth + 1 && var3 > this.rmy && var3 < this.rmy + this.menuheight + 1) { for(int var4 = 0; var4 < this.num_descrips; ++var4) { int var5 = var4 * this.bitheight + this.rmy; if (var3 > var5 && var3 < var5 + this.bitheight && this.curHL != var4) { this.undohlMenuItem(); this.hlMenuItem(var4); this.curHL = var4; ((OCdg)this).drawAppOff(); ((OCdg)this).paintIt(); } } } else if (this.curHL != -1) { this.undohlMenuItem(); this.curHL = -1; ((OCdg)this).drawAppOff(); ((OCdg)this).paintIt(); } return true; } public void initIcons() { int var2 = super.icon_pv.size(); this.m_iconfiles = new String[var2]; this.m_iconimage = new Image[var2]; this.m_switch_iconfiles = new String[var2]; this.m_switch_iconimage = new Image[var2]; this.iconimage_status = new boolean[var2]; for(int var3 = 0; var3 < var2; ++var3) { String var1 = ((OCdg)this).getParameterIcon("iconimage", var3); if (var1 != null) { this.m_iconfiles[var3] = var1; } else { this.m_iconfiles[var3] = null; } var1 = ((OCdg)this).getParameterIcon("switchimage", var3); if (var1 != null && !var1.equalsIgnoreCase("<none>")) { this.m_switch_iconfiles[var3] = var1; } else { this.m_switch_iconfiles[var3] = null; } } ACutil var6 = new ACutil(); for(int var4 = 0; var4 < var2; ++var4) { if (this.m_iconfiles[var4] != null && (this.m_iconimage[var4] = var6.getDGImage(this.m_iconfiles[var4])) != null) { this.iconimage_status[var4] = true; if (this.m_switch_iconfiles[var4] != null) { if ((this.m_switch_iconimage[var4] = var6.getDGImage(this.m_switch_iconfiles[var4])) == null) { this.m_switch_iconimage[var4] = this.m_iconimage[var4]; } } else { this.m_switch_iconimage[var4] = this.m_iconimage[var4]; } } } } public boolean mouseExit(Event var1, int var2, int var3) { this.rmx = super.scroll_x + super.offimgx + this.aDist; this.rmy = super.scroll_y + super.offimgy; if (this.curHL > -1) { this.undohlMenuItem(); ((OCdg)this).drawAppOff(); ((OCdg)this).paintIt(); this.curHL = -1; } return true; } public void mouseMoveFromDesignGrid(Event var1, int var2, int var3, Image var4, Graphics var5, OCdgImg var6, Image var7) { this.rmx = var6.sub_posx[this.level] + var6.scroll_x; this.rmy = var6.sub_posy[this.level] + var6.scroll_y; for(int var8 = 0; var8 < this.num_descrips; ++var8) { int var9 = this.item_y[var8] + this.rmy; if (var3 > var9 && var3 < var9 + this.bitheight) { this.realHL = var8; if (var6.appinfo.getSpecMLValues().isItem(this.branchid + "-" + var8 + "-0")) { if (this.curHL != var8) { this.fdg_undohlMenuItem(var7, var5); if (this.leaveHL > -1 && this.leaveHL != var8) { this.fdg_hlMenuItem(this.leaveHL, var5, true); } this.fdg_hlMenuItem(var8, var5, true); this.curHL = var8; var6.drawSub(true); ((OCdg)var6).paintIt(); return; } } else if (this.curHL != -1) { this.fdg_undohlMenuItem(var7, var5); this.curHL = -1; if (this.leaveHL > -1) { this.fdg_hlMenuItem(this.leaveHL, var5, true); } var6.drawSub(true); ((OCdg)var6).paintIt(); } return; } } this.realHL = -1; } OCmsl(APInfo var1) { this.m_outline_color = Color.black; this.m_textcolor = Color.black; this.m_font = new Font("Helvetica", 0, 11); this.m_hlfont = new Font("Helvetica", 0, 11); this.m_xoffset = 8; this.m_menucolor = Color.white; this.m_textdecoration = "normal"; this.m_hltextdecoration = "normal"; this.m_marginleft = 0; this.m_marginright = 0; this.m_margintop = 0; this.m_marginbottom = 0; this.m_border_color = Color.white; this.m_borderwidth_left = 0; this.m_borderwidth_right = 0; this.m_borderheight_top = 0; this.m_borderheight_bottom = 0; this.m_divider_height = 0; this.m_divider_color = Color.white; this.m_usedivder_topandbottom = false; this.m_icon_align = "right"; this.desc_index = 0; this.multi_level = false; this.indWidth = 10; this.indArrowColor = Color.black; this.icon_xoff = 0; this.icon_yoff = 0; this.useColors = false; this.apinfo = var1; this.multi_level = this.apinfo.multi_level; } OCmsl(APInfo var1, boolean var2) { this.m_outline_color = Color.black; this.m_textcolor = Color.black; this.m_font = new Font("Helvetica", 0, 11); this.m_hlfont = new Font("Helvetica", 0, 11); this.m_xoffset = 8; this.m_menucolor = Color.white; this.m_textdecoration = "normal"; this.m_hltextdecoration = "normal"; this.m_marginleft = 0; this.m_marginright = 0; this.m_margintop = 0; this.m_marginbottom = 0; this.m_border_color = Color.white; this.m_borderwidth_left = 0; this.m_borderwidth_right = 0; this.m_borderheight_top = 0; this.m_borderheight_bottom = 0; this.m_divider_height = 0; this.m_divider_color = Color.white; this.m_usedivder_topandbottom = false; this.m_icon_align = "right"; this.desc_index = 0; this.multi_level = false; this.indWidth = 10; this.indArrowColor = Color.black; this.icon_xoff = 0; this.icon_yoff = 0; this.useColors = false; this.apinfo = var1; this.multi_level = this.apinfo.multi_level; } OCmsl(boolean var1) { this.m_outline_color = Color.black; this.m_textcolor = Color.black; this.m_font = new Font("Helvetica", 0, 11); this.m_hlfont = new Font("Helvetica", 0, 11); this.m_xoffset = 8; this.m_menucolor = Color.white; this.m_textdecoration = "normal"; this.m_hltextdecoration = "normal"; this.m_marginleft = 0; this.m_marginright = 0; this.m_margintop = 0; this.m_marginbottom = 0; this.m_border_color = Color.white; this.m_borderwidth_left = 0; this.m_borderwidth_right = 0; this.m_borderheight_top = 0; this.m_borderheight_bottom = 0; this.m_divider_height = 0; this.m_divider_color = Color.white; this.m_usedivder_topandbottom = false; this.m_icon_align = "right"; this.desc_index = 0; this.multi_level = false; this.indWidth = 10; this.indArrowColor = Color.black; this.icon_xoff = 0; this.icon_yoff = 0; this.useColors = false; this.useColors = var1; } OCmsl(boolean var1, int var2) { this.m_outline_color = Color.black; this.m_textcolor = Color.black; this.m_font = new Font("Helvetica", 0, 11); this.m_hlfont = new Font("Helvetica", 0, 11); this.m_xoffset = 8; this.m_menucolor = Color.white; this.m_textdecoration = "normal"; this.m_hltextdecoration = "normal"; this.m_marginleft = 0; this.m_marginright = 0; this.m_margintop = 0; this.m_marginbottom = 0; this.m_border_color = Color.white; this.m_borderwidth_left = 0; this.m_borderwidth_right = 0; this.m_borderheight_top = 0; this.m_borderheight_bottom = 0; this.m_divider_height = 0; this.m_divider_color = Color.white; this.m_usedivder_topandbottom = false; this.m_icon_align = "right"; this.desc_index = 0; this.multi_level = false; this.indWidth = 10; this.indArrowColor = Color.black; this.icon_xoff = 0; this.icon_yoff = 0; this.useColors = false; this.useColors = var1; this.sub_level = var2; } OCmsl() { this.m_outline_color = Color.black; this.m_textcolor = Color.black; this.m_font = new Font("Helvetica", 0, 11); this.m_hlfont = new Font("Helvetica", 0, 11); this.m_xoffset = 8; this.m_menucolor = Color.white; this.m_textdecoration = "normal"; this.m_hltextdecoration = "normal"; this.m_marginleft = 0; this.m_marginright = 0; this.m_margintop = 0; this.m_marginbottom = 0; this.m_border_color = Color.white; this.m_borderwidth_left = 0; this.m_borderwidth_right = 0; this.m_borderheight_top = 0; this.m_borderheight_bottom = 0; this.m_divider_height = 0; this.m_divider_color = Color.white; this.m_usedivder_topandbottom = false; this.m_icon_align = "right"; this.desc_index = 0; this.multi_level = false; this.indWidth = 10; this.indArrowColor = Color.black; this.icon_xoff = 0; this.icon_yoff = 0; this.useColors = false; } public void drawIconsFromDesignGrid(Graphics var1) { for(int var2 = 0; var2 < this.num_descrips; ++var2) { int var3 = this.m_iconid[var2]; if (var3 > -1 && this.iconimage_status[var3]) { if (var2 != this.leaveHL && var2 != this.curHL) { var1.drawImage(this.m_iconimage[var3], this.save_iposx[var2] - this.init_dragx + this.drag_iposx, this.save_iposy[var2] - this.init_dragy + this.drag_iposy, this); } else { var1.drawImage(this.m_switch_iconimage[var3], this.save_iposx[var2] - this.init_dragx + this.drag_iposx, this.save_iposy[var2] - this.init_dragy + this.drag_iposy, this); } } } } public void initDefault() { this.m_outline_color = Color.black; this.m_textcolor = Color.black; this.m_menucolor = new Color(220, 220, 220); if (this.useColors) { int var2 = 8; String var3 = "Helvetica"; String var4 = "normal"; String var5 = "normal"; String var1 = ((OCdg)this).getParameterDefault("fontsize"); if (var1 != null) { var2 = Integer.parseInt(var1); } var1 = ((OCdg)this).getParameterDefault("fontfamily"); if (var1 != null) { var3 = var1; } var1 = ((OCdg)this).getParameterDefault("fontstyle"); if (var1 != null) { var4 = var1; } var1 = ((OCdg)this).getParameterDefault("fontweight"); if (var1 != null) { var5 = var1; } int var6 = 0; if (var5.toLowerCase().equals("bold")) { var6 = 1; } if (var4.toLowerCase().equals("italic")) { var6 += 2; } var1 = ((OCdg)this).getParameterDefault("textdecoration"); if (var1 != null) { this.m_textdecoration = var1; } var1 = ((OCdg)this).getParameterDefault("hl_textdecoration"); if (var1 != null) { this.m_hltextdecoration = var1; } if (var2 > 3) { var2 += 3; } if (this.m_textdecoration.equalsIgnoreCase("underline")) { this.m_font = new FontX(var3, var6, var2, 4); } else { this.m_font = new FontX(var3, var6, var2); } if (this.m_hltextdecoration.equalsIgnoreCase("underline")) { this.m_hlfont = new FontX(var3, var6, var2, 4); } else { this.m_hlfont = this.m_font; } var1 = ((OCdg)this).getParameterDefault("textcolor"); if (var1 != null) { this.m_textcolor = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("dividercolor"); if (var1 != null) { this.m_divider_color = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("bordercolor"); if (var1 != null) { this.m_border_color = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("bghighlightcolor"); if (var1 != null) { this.m_hlbgcolor = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("hl_textcolor"); if (var1 != null) { this.m_hltextcolor = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("bordercolor"); if (var1 != null) { this.m_outline_color = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("backgroundcolor"); if (var1 != null) { this.m_menucolor = occcolor.ConvertColor(var1); } var1 = ((OCdg)this).getParameterDefault("icon_align"); if (var1 != null) { this.m_icon_align = var1; } var1 = ((OCdg)this).getParameterDefault("marginleft"); if (var1 != null) { this.m_marginleft = Integer.parseInt(var1) + 2; } var1 = ((OCdg)this).getParameterDefault("marginright"); if (var1 != null) { this.m_marginright = Integer.parseInt(var1) + 2; } var1 = ((OCdg)this).getParameterDefault("margintop"); if (var1 != null) { this.m_margintop = Integer.parseInt(var1) + 2; } var1 = ((OCdg)this).getParameterDefault("marginbottom"); if (var1 != null) { this.m_marginbottom = Integer.parseInt(var1) + 2; } var1 = ((OCdg)this).getParameterDefault("borderwidth_left"); if (var1 != null) { this.m_borderwidth_left = Integer.parseInt(var1); } var1 = ((OCdg)this).getParameterDefault("borderwidth_right"); if (var1 != null) { this.m_borderwidth_right = Integer.parseInt(var1); } var1 = ((OCdg)this).getParameterDefault("borderheight_top"); if (var1 != null) { this.m_borderheight_top = Integer.parseInt(var1); } var1 = ((OCdg)this).getParameterDefault("borderheight_bottom"); if (var1 != null) { this.m_borderheight_bottom = Integer.parseInt(var1); } var1 = ((OCdg)this).getParameterDefault("dividerheight"); if (var1 != null) { this.m_divider_height = Integer.parseInt(var1); } var1 = ((OCdg)this).getParameterDefault("usedivider_topandbottom"); if (var1 != null) { this.m_usedivder_topandbottom = Boolean.valueOf(var1); } var1 = ((OCdg)this).getParameterDefault("icon_offsetxy"); if (var1 != null) { int[] var7 = occcord.getIntValues(var1, ",", 2); if (var7 != null) { this.icon_xoff = var7[0]; this.icon_yoff = var7[1]; } } } ((Component)this).setFont(this.m_font); this.field_0 = ((Component)this).getFontMetrics(this.m_font); } public void fdg_hlMenuItem(int var1, Graphics var2, boolean var3) { var2.setFont(this.m_hlfont); var2.setColor(this.m_hlbgcolor); var2.fillRect(this.m_borderwidth_left, this.item_y[var1], this.itemwidth, this.bitheight); var2.setColor(this.m_hltextcolor); var2.drawString(this.m_desc[var1], this.m_marginleft + this.m_borderwidth_left, this.item_y[var1] + this.field_0.getHeight() - this.field_0.getDescent() + this.m_margintop); if (var3) { int var4 = this.m_iconid[var1]; if (var4 > -1 && this.iconimage_status[var4]) { int var5 = this.m_iconimage[var4].getHeight(this); int var6 = this.m_iconimage[var4].getWidth(this); int var7 = (this.item_h[var1] - var5) / 2 + this.item_y[var1] + this.icon_yoff; int var8 = this.icon_xoff + this.m_borderwidth_left; if (this.m_icon_align.toLowerCase().equals("right")) { var8 = var8 + this.itemwidth - var6; } var2.drawImage(this.m_switch_iconimage[var4], var8, var7, this); } } } public void fdg_undohlMenuItem(Image var1, Graphics var2) { var2.drawImage(var1, 0, 0, this); } public void DrawApplet() { this.drawMenu(); if (this.first_crun) { this.drawPointer(); this.setPointer(this.apinfo.cur_tree_index); this.showPointer(); this.first_crun = false; } } public Dimension getMenuImageSize() { this.field_0 = ((Component)this).getFontMetrics(this.m_font); this.itemwidth = this.max_string_width + this.m_marginleft + this.m_marginright; this.menuwidth = this.itemwidth + this.m_borderwidth_left + this.m_borderwidth_right; this.itemheight = this.num_descrips * this.field_0.getHeight() + this.num_descrips * this.m_margintop + this.num_descrips * this.m_marginbottom; if (this.m_usedivder_topandbottom) { this.itemheight += (this.num_descrips + 1) * this.m_divider_height; } else { this.itemheight += (this.num_descrips - 1) * this.m_divider_height; } this.menuheight = this.itemheight + this.m_borderheight_top + this.m_borderheight_bottom; this.bitheight = this.field_0.getHeight() + this.m_margintop + this.m_marginbottom; for(int var1 = 0; var1 < this.num_descrips; ++var1) { this.item_h[var1] = this.bitheight; this.item_y[var1] = this.bitheight * var1 + this.m_borderheight_top; if (this.m_usedivder_topandbottom) { int[] var10000 = this.item_y; var10000[var1] += this.m_divider_height; } int[] var3 = this.item_y; var3[var1] += var1 * this.m_divider_height; } Dimension var2 = new Dimension(this.menuwidth, this.menuheight); return var2; } private void drawUpArrow() { byte var1 = 7; byte var2 = 5; this.upArrow = ((Component)this).createImage(var1, var2); Graphics var3 = this.upArrow.getGraphics(); var3.setColor(new Color(255, 255, 255)); var3.fillRect(0, 0, var1, var2); var3.setColor(this.indArrowColor); int var4 = 0; int var5 = var2 - 1; int var6 = 6; do { var3.drawLine(var4, var5, var4 + var6, var5); --var5; ++var4; var6 -= 2; } while(var6 >= 0); } public void initSpecifics() { this.max_string_width = 0; boolean var2 = false; this.num_descrips = super.spe_pv.size(); this.m_desc = new String[this.num_descrips]; this.m_iconid = new int[this.num_descrips]; this.item_h = new int[this.num_descrips]; this.item_y = new int[this.num_descrips]; this.save_iposx = new int[this.num_descrips]; this.save_iposy = new int[this.num_descrips]; this.save_iposw = new int[this.num_descrips]; this.save_iposh = new int[this.num_descrips]; for(int var4 = 0; var4 < this.num_descrips; ++var4) { String var1 = ((OCdg)this).getParameterSpecific("subdesc", var4); if (var1 != null) { this.m_desc[var4] = var1; if (this.field_0.stringWidth(this.m_desc[var4]) > this.max_string_width) { this.max_string_width = this.field_0.stringWidth(this.m_desc[var4]); } } else { this.m_desc[var4] = " "; } var1 = ((OCdg)this).getParameterSpecific("iconid", var4); if (var1 != null) { this.m_iconid[var4] = Integer.parseInt(var1); } else { this.m_iconid[var4] = -1; } } } private synchronized void showUpArrows() { int var1 = this.aDist + 1 + this.menuwidth; super.g_off.setColor(new Color(255, 255, 255)); super.g_off.fillRect(var1, 0, this.indWidth, super.off.getHeight(this)); String var2 = ACutila.iface.appinfo.getMLparamObject().getBranchId(ACutila.iface.appinfo.convertTree()); for(int var3 = 0; var3 < this.num_descrips; ++var3) { if (ACutila.iface.appinfo.getMLparamObject().isItem(var2 + "-" + var3 + "-0")) { super.g_off.drawImage(this.upArrow, var1 + 3, this.bitheight * var3 + (this.bitheight - 4) / 2, this); } } } private void drawMenu() { this.max_string_width += this.m_xoffset * 2; this.field_0 = ((Component)this).getFontMetrics(this.m_font); this.menuwidth = this.max_string_width; this.menuheight = this.num_descrips * this.field_0.getHeight(); this.bitheight = this.field_0.getHeight(); this.menu = ((Component)this).createImage(this.menuwidth + 1, this.menuheight + 1); this.g_menu = this.menu.getGraphics(); this.g_menu.setFont(this.m_font); int var1 = this.menuwidth + 1 + this.aDist; if (this.multi_level) { var1 += this.indWidth; } super.off = ((Component)this).createImage(var1, this.menuheight + 1); super.g_off = super.off.getGraphics(); super.g_off.setColor(new Color(255, 255, 255)); super.g_off.fillRect(0, 0, var1, this.menuheight + 1); this.g_menu.setColor(this.m_menucolor); this.g_menu.fillRect(0, 0, this.menuwidth, this.menuheight); for(int var2 = 0; var2 < this.num_descrips; ++var2) { this.g_menu.setColor(this.m_outline_color); this.g_menu.drawRect(0, this.bitheight * var2, this.max_string_width, this.field_0.getHeight()); this.g_menu.setColor(this.m_textcolor); this.g_menu.drawString(this.m_desc[var2], this.m_xoffset, this.bitheight * var2 + this.field_0.getHeight() - this.field_0.getDescent()); } super.g_off.drawImage(this.menu, this.aDist, 0, this); if (this.multi_level) { if (this.first_crun) { this.drawUpArrow(); } this.showUpArrows(); } } private void drawPointer() { this.poff = ((Component)this).createImage(this.pwidth, this.pheight); this.g_poff = this.poff.getGraphics(); this.g_poff.setColor(new Color(255, 255, 255)); this.g_poff.fillRect(0, 0, this.pwidth, this.pheight); ACutil var2 = new ACutil(); Image var1; if ((var1 = var2.getImage("acimg/gold_arrow.gif")) != null) { this.g_poff.drawImage(var1, 2, 1, this); } } public void setPointer(int var1) { this.curPoint = var1; if (!super.first_run) { this.showPointer(); ((OCdg)this).drawAppOff(); ((OCdg)this).paintIt(); } } private synchronized void showPointer() { if (this.curPoint >= 0) { int var1 = this.bitheight * this.curPoint + (this.bitheight - this.pheight) / 2; int var2 = this.bitheight; super.g_off.setColor(new Color(255, 255, 255)); super.g_off.fillRect(0, 0, this.aDist - 1, super.off.getHeight(this)); super.g_off.drawImage(this.poff, 0, var1, this); int var3 = 0; if (super.offimgy + super.scroll_y + var1 >= super.d.height - 5) { var3 = -var1; if (var2 < super.d.height) { var3 = var3 + (super.d.height - var2) - super.sEdge; } ((OCdg)this).setVerticalPagePosition(var3); } if (super.offimgy + super.scroll_y + var1 < 0) { ((OCdg)this).setVerticalPagePosition(-var1); } } } public boolean mouseDown(Event var1, int var2, int var3) { boolean var4 = false; if (var1.modifiers == 4) { var4 = true; } this.rmx = super.scroll_x + super.offimgx + this.aDist; this.rmy = super.scroll_y + super.offimgy; if (var2 > this.rmx && var2 < this.rmx + this.menuwidth + 1 && var3 > this.rmy && var3 < this.rmy + this.menuheight + 1 && this.curHL > -1) { ((Component)this).requestFocus(); super.postEvent(new Event(this, 9202, new Integer(this.curHL))); if (var4) { PopupMenu var9 = new PopupMenu("pu - dnm - additem"); MenuItem[] var10 = new MenuItem[]{new MenuItem("Level - Up"), new MenuItem("Level - Down"), new MenuItem("-"), new MenuItem("Edit Text"), new MenuItem("-"), new MenuItem("Add Item"), new MenuItem("Insert Item")}; for(int var7 = 0; var7 < var10.length; ++var7) { ((Menu)var9).add(var10[var7]); } if (ACutila.iface.appinfo.cur_tree_level < 2) { var10[1].disable(); } ((Component)this).add(var9); var9.show(this, var2, var3); return true; } if (var1.clickCount > 1) { String var5 = ACutila.iface.appinfo.getMLparamObject().getBranchId(ACutila.iface.appinfo.convertTree()); if (ACutila.iface.appinfo.getMLparamObject().isItem(var5 + "-" + this.curHL + "-0")) { Event var6 = new Event(this, 960, this); var6.id = 1001; var6.arg = "Level - Up"; super.postEvent(var6); return true; } } if (var1.clickCount > 2 && ACutila.iface.appinfo.cur_tree_level > 1) { Event var8 = new Event(this, 960, this); var8.id = 1001; var8.arg = "Level - Down"; super.postEvent(var8); return true; } } return true; } public Image getMenuImage(Image var1, Graphics var2) { this.field_0 = ((Component)this).getFontMetrics(this.m_font); var2.setFont(this.m_font); var2.setColor(this.m_border_color); var2.fillRect(0, 0, this.menuwidth, this.menuheight); var2.setColor(this.m_menucolor); var2.fillRect(this.m_borderwidth_left, this.m_borderheight_top, this.itemwidth, this.itemheight); if (this.m_usedivder_topandbottom) { var2.setColor(this.m_divider_color); var2.fillRect(this.m_borderwidth_left, this.m_borderheight_top, this.itemwidth, this.m_divider_height); } for(int var3 = 0; var3 < this.num_descrips; ++var3) { if (var3 != this.num_descrips - 1 || this.m_usedivder_topandbottom) { var2.setColor(this.m_divider_color); var2.fillRect(this.m_borderwidth_left, this.item_y[var3] + this.bitheight, this.itemwidth, this.m_divider_height); } var2.setColor(this.m_textcolor); var2.drawString(this.m_desc[var3], this.m_marginleft + this.m_borderwidth_left, this.item_y[var3] + this.field_0.getHeight() - this.field_0.getDescent() + this.m_margintop); } return var1; } public boolean mouseDownFromDesignGrid(int var1, int var2, OCdgImg var3) { this.rmx = var3.sub_posx[this.level] + var3.scroll_x; this.rmy = var3.sub_posy[this.level] + var3.scroll_y; for(int var4 = 0; var4 < this.num_descrips; ++var4) { if (this.save_iposw[var4] > -1 && var1 > this.save_iposx[var4] + this.rmx && var2 > this.save_iposy[var4] + this.rmy && var1 < this.save_iposx[var4] + this.rmx + this.save_iposw[var4] && var2 < this.save_iposy[var4] + this.rmy + this.save_iposh[var4]) { return true; } } return false; } private void hlMenuItem(int var1) { super.g_off.setColor(new Color(102, 102, 102)); super.g_off.fillRect(this.aDist + 1, var1 * this.bitheight + 1, this.menuwidth - 1, this.bitheight - 1); super.g_off.setColor(new Color(255, 255, 153)); super.g_off.drawString(this.m_desc[var1], this.m_xoffset + this.aDist, var1 * this.bitheight + this.field_0.getHeight() - this.field_0.getDescent()); } public void setLevelColors(String[] var1, String[] var2) { super.def_pn = var1; super.def_pv = var2; String var3 = ((OCdg)this).getParameterDefault("menucolor"); if (var3 != null && !var3.equalsIgnoreCase("<default>")) { this.m_menucolor = occcolor.ConvertColor(var3); } var3 = ((OCdg)this).getParameterDefault("menutextcolor"); if (var3 != null && !var3.equalsIgnoreCase("<default>")) { this.m_textcolor = occcolor.ConvertColor(var3); } var3 = ((OCdg)this).getParameterDefault("menuoutlinecolor"); if (var3 != null && !var3.equalsIgnoreCase("<default>")) { this.m_outline_color = occcolor.ConvertColor(var3); } } private void undohlMenuItem() { super.g_off.drawImage(this.menu, this.aDist, 0, this); } public Image getMenuImageIcon(Image var1, Graphics var2) { for(int var3 = 0; var3 < this.num_descrips; ++var3) { int var4 = this.m_iconid[var3]; if (var4 > -1 && this.iconimage_status[var4]) { int var5 = this.m_iconimage[var4].getHeight(this); int var6 = this.m_iconimage[var4].getWidth(this); int var7 = (this.item_h[var3] - var5) / 2 + this.item_y[var3] + this.icon_yoff; int var8 = this.icon_xoff + this.m_borderwidth_left; if (this.m_icon_align.equalsIgnoreCase("right")) { var8 = var8 + this.itemwidth - var6; } this.drag_iposx = this.icon_xoff; this.drag_iposy = this.icon_yoff; this.init_dragx = this.drag_iposx; this.init_dragy = this.drag_iposy; this.save_iposx[var3] = var8; this.save_iposy[var3] = var7; this.save_iposw[var3] = var6; this.save_iposh[var3] = var5; var2.drawImage(this.m_iconimage[var4], var8, var7, this); } else { this.save_iposx[var3] = -1; this.save_iposy[var3] = -1; this.save_iposw[var3] = -1; this.save_iposh[var3] = -1; } } return var1; } }