/*
 * (C) IBM Corp. 1997-1998
 *
 * The program is provided "as is" without any warranty express or
 * implied, including the warranty of non-infringement and the implied
 * warranties of merchantibility and fitness for a particular purpose.
 * IBM will not be liable for any damages suffered by you as a result
 * of using the Program. In no event will IBM be liable for any
 * special, indirect or consequential damages or lost profits even if
 * IBM has been advised of the possibility of their occurrence. IBM
 * will not be liable for any third party claims against you.
 */

package com.ibm.xml.cdfedit;

import com.ibm.xml.parser.*;
import java.awt.event.*;
import java.net.*;

class XMLComponentM extends XMLComponent implements java.awt.event.MouseListener {

    URL m_url;
    XMLComponent[] m_children;

    XMLComponentM() {
        super();
        addMouseListener(this);
    }

    Gateway m_gate;

    public Gateway getGateway() {
      return m_gate;
   }
    void setGateway(Gateway g) {
        m_gate = g;
        if (null == m_children) {
        }else {
            for (int i = 0;  i < m_children.length;  i ++) {
                if (m_children[i] instanceof XMLComponentM)
                    ((XMLComponentM)m_children[i]).setGateway(g);
            }
        }
    }
    int getConnectedOffset() {
        return 0;
    }

    boolean m_selected = false;
    void select(boolean f) {
        m_selected = f;
    }

    public void mouseClicked(MouseEvent e) {
    }
    public void mousePressed(MouseEvent e) {
    }
    public void mouseReleased(MouseEvent e) {
    }
    public void mouseEntered(MouseEvent e) {
        if (null != m_url) {
	  m_gate.setText(m_url.toString());
        }
    }
    public void mouseExited(MouseEvent e) {
        if (null != m_url) {
	   m_gate.setText("");
        }
    }
}            









