home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 29 / CDT29.iso / e-Mail / WorldClient Pro 2.2.3 / wcsetup.exe / WEBHELP.ZIP / hhapplet / ContentsTree.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-10-21  |  2.1 KB  |  62 lines

  1. package hhapplet;
  2.  
  3. import java.applet.Applet;
  4. import java.awt.Image;
  5. import java.net.MalformedURLException;
  6. import treeview.ImageSet;
  7. import treeview.SiblingChildTree;
  8. import treeview.TreeViewNode;
  9.  
  10. public class ContentsTree extends TreeViewNode {
  11.    public String local;
  12.    public String url;
  13.    public String frame_name;
  14.    // $FF: renamed from: a java.applet.Applet
  15.    private Applet field_0;
  16.    private Image[] images;
  17.    private boolean use_folder_images;
  18.    private boolean new_topic;
  19.  
  20.    public ContentsTree(Applet var1, Image[] var2, String var3, String var4, String var5, String var6, boolean var7, boolean var8) {
  21.       super(var3, new ImageSet(var2));
  22.       this.field_0 = var1;
  23.       this.images = var2;
  24.       this.local = var4;
  25.       this.url = var5;
  26.       this.frame_name = var6;
  27.       this.use_folder_images = var7;
  28.       this.new_topic = var8;
  29.       ((TreeViewNode)this).setCollapsedState(true);
  30.    }
  31.  
  32.    public Image getCurrentImage() {
  33.       return ((TreeViewNode)this).getImages().getImage(this.imageIndex());
  34.    }
  35.  
  36.    private int imageIndex() {
  37.       if (((SiblingChildTree)this).numberOfChildren() != 0) {
  38.          return (!((TreeViewNode)this).getCollapsedState() ? 1 : 0) + (this.new_topic ? 2 : 0) + (this.use_folder_images ? 4 : 0);
  39.       } else {
  40.          return this.local != null && (this.local.toUpperCase().startsWith("HTTP") || this.local.toUpperCase().startsWith("FTP") || this.local.toUpperCase().startsWith("MAILTO") || this.local.toUpperCase().startsWith("NEWS")) && !this.use_folder_images ? 14 + (this.new_topic ? 1 : 0) : 8 + (this.use_folder_images ? 2 : 0) + (this.new_topic ? 1 : 0);
  41.       }
  42.    }
  43.  
  44.    public void doAction() {
  45.       if (this.local != null || this.url != null) {
  46.          if (this.local.charAt(0) == 'W' && this.local.startsWith("WebHelp:")) {
  47.             String var1 = this.local.substring(8);
  48.             ((WebHelp)this.field_0).Command(var1, "");
  49.          } else {
  50.             try {
  51.                if (this.frame_name != null) {
  52.                   this.field_0.getAppletContext().showDocument(URLFileHandler.makeURL(this.field_0.getDocumentBase(), this.local, this.url), this.frame_name);
  53.                } else {
  54.                   this.field_0.getAppletContext().showDocument(URLFileHandler.makeURL(this.field_0.getDocumentBase(), this.local, this.url), "_self");
  55.                }
  56.             } catch (MalformedURLException var2) {
  57.             }
  58.          }
  59.       }
  60.    }
  61. }
  62.