home *** CD-ROM | disk | FTP | other *** search
- package netscape.application;
-
- import netscape.util.ClassInfo;
- import netscape.util.CodingException;
- import netscape.util.Decoder;
- import netscape.util.Encoder;
-
- public class PopupItem extends ListItem {
- Popup popup;
- static final String POPUP_KEY = "popup";
-
- public void setPopup(Popup var1) {
- this.popup = var1;
- }
-
- public Popup popup() {
- return this.popup;
- }
-
- public void drawInRect(Graphics var1, Rect var2) {
- super.drawInRect(var1, var2);
- if (this.popup != null) {
- PopupItem var6 = (PopupItem)this.popup.selectedItem();
- if (var6.equals(this)) {
- Image var5 = this.popup.popupImage();
- int var3;
- int var4;
- if (var5 != null) {
- var3 = var5.width();
- var4 = var5.height();
- } else {
- var4 = 0;
- var3 = 0;
- }
-
- if (super.selected) {
- var1.setColor(super.selectedColor);
- } else {
- var1.setColor(super.listView.backgroundColor());
- }
-
- var1.fillRect(var2.x + var2.width - var3 - 4, var2.y, var3 + 4, var2.height);
- if (var5 != null) {
- var5.drawAt(var1, var2.x + var2.width - var3 - 2, var2.y + (var2.height - var4) / 2);
- }
- }
- }
-
- }
-
- public void describeClassInfo(ClassInfo var1) {
- super.describeClassInfo(var1);
- var1.addClass("netscape.application.PopupItem", 1);
- var1.addField("popup", (byte)18);
- }
-
- public void encode(Encoder var1) throws CodingException {
- super.encode(var1);
- var1.encodeObject("popup", this.popup);
- }
-
- public void decode(Decoder var1) throws CodingException {
- super.decode(var1);
- this.popup = (Popup)var1.decodeObject("popup");
- }
- }
-