001/* ----------------------------------------------------------------------------
002   The Kiwi Toolkit - A Java Class Library
003   Copyright (C) 1998-2004 Mark A. Lindner
004
005   This library is free software; you can redistribute it and/or
006   modify it under the terms of the GNU General Public License as
007   published by the Free Software Foundation; either version 2 of the
008   License, or (at your option) any later version.
009
010   This library is distributed in the hope that it will be useful,
011   but WITHOUT ANY WARRANTY; without even the implied warranty of
012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013   General Public License for more details.
014
015   You should have received a copy of the GNU General Public License
016   along with this library; if not, write to the Free Software
017   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
018   02111-1307, USA.
019 
020   The author may be contacted at: mark_a_lindner@yahoo.com
021   ----------------------------------------------------------------------------
022   $Log: KiwiAppletStub.java,v $
023   Revision 1.3  2004/05/06 00:46:52  markl
024   comment block updates
025
026   Revision 1.2  2003/06/01 11:08:55  markl
027   Final refinements for release 1.4.2
028   ----------------------------------------------------------------------------
029*/
030
031package kiwi.ui.applet;
032
033import java.applet.*;
034import java.awt.*;
035import java.util.*;
036import java.io.*;
037import java.net.*;
038
039/**
040  * @author Mark Lindner
041  * @since Kiwi 1.4.2
042  */
043
044class KiwiAppletStub implements AppletStub
045  {
046  private AppletPanel panel;
047  private AppletContext context;
048  private Dictionary params;
049  private URL url;
050  private URLClassLoader classLoader;
051
052  /**
053   */
054  
055  KiwiAppletStub(AppletPanel panel, AppletContext context, URL url,
056                 Dictionary params)
057    {
058    this.panel = panel;
059    this.context = context;
060    this.url = url;
061
062    this.params = params;
063    }
064
065  /**
066   */
067  
068  public void appletResize(int w, int h)
069    {
070    Dimension dim = new Dimension(w, h);
071    panel.setPreferredSize(dim);
072    panel.setSize(dim);
073    }
074
075  /**
076   */
077
078  public AppletContext getAppletContext()
079    {
080    return(context);
081    }
082
083  /**
084   */
085  
086  public URL getCodeBase()
087    {
088    return(url);
089    }
090
091  /**
092   */
093  
094  public URL getDocumentBase()
095    {
096    return(url);
097    }
098
099  /**
100   */
101  
102  public String getParameter(String name)
103    {
104    return((String)params.get(name));
105    }
106
107  /**
108   */
109  
110  public boolean isActive()
111    {
112    return(panel.isVisible());
113    }
114  
115  }
116
117/* end of source file */