// Copyright (c) 1995, 1996 Regents of the University of California.
// All rights reserved.
//
// This software was developed by the Arcadia project
// at the University of California, Irvine.
//
// Redistribution and use in source and binary forms are permitted
// provided that the above copyright notice and this paragraph are
// duplicated in all such forms and that any documentation,
// advertising materials, and other materials related to such
// distribution and use acknowledge that the software was developed
// by the University of California, Irvine.  The name of the
// University may not be used to endorse or promote products derived
// from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
// WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

// File: NetPrimitive.java
// Classes: NetPrimitive
// Original Author: Jason Robbins
// $Id: NetPrimitive.java,v 1.2 2000/09/19 21:08:33 dougo Exp $

package edu.neu.ccs.demeter.tools.apstudio.graphedit;

import java.util.Observable;
import java.util.Observer;


/** Abstract superclass for all Net-level objects. I currently
 * anticipate exactly 4 subclasses: NetNode, NetPort, NetArc, and
 * NetList. The only behavior that is common to all of those is that
 * they pass update notifications on to their Observer's if they don't
 * handle a notification themselves, and they can highlight by passing
 * a notification to their Perspective, or ArcPerspective if any.
 *
 * @see NetNode
 * @see NetArc
 * @see NetList
 * @see Perspective
 * @see ArcPerspective
 */

public abstract class NetPrimitive extends Observable implements Observer 
{

  /** Construct a new net-level object, currently does nothing */
  public NetPrimitive() { }

  /** if a update notification is not understood in a subclass it
   * should call super.update() and this method will pass that
   * notification on to my Observer's */
  public void update(Observable o, Object arg) {
    /* If I dont handle it, maybe my observers do */
    setChanged();
    notifyObservers(arg);
  }

  /** Draw the user's attention to any and all visualizations of this
   * net-level object. */
  public void highlight() { notifyObservers("Highlight"); }

  /** Stop drawing the user's attention. */
  public void unhighlight() { notifyObservers("Unhighlight"); }

} /* end class NetPrimitive */

