// 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: SelectionHandles.java
// Classes: SelectionHandles
// Original Author: Jason Robbins
// $Id: SelectionHandles.java,v 1.2 2000/09/19 21:08:34 dougo Exp $

// Modified by : Kedar Patankar

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

import java.awt.Graphics;
import java.awt.Rectangle;



/** A Selection class to represent selections on DiagramElement's that
 * present handles. Needs-More-Work: in an early version of this graph
 * editing framework the DiagramElement's did their own drawing of
 * handles. I want to get away from that, but it has not happened
 * yet. */

public class SelectionHandles extends SelectionSingle {

  /** Height and width of handle */
  public static final int HAND_SIZE = 6;	

  // protected Vector _handles; // needs-more-work

  /** Construct a new SelectionHandles for the given DiagramElement */
  public SelectionHandles(DiagramElement de) { super(de); }

  /** Draw the SelectionHandles by asking the contained DiagramElement
   * to drawSelected. Some of this logic is common to all
   * DiagramElement's that have handles and I want to move more of it
   * here to avoid duplication.
   *
   * @see DiagramElement#drawSelected */
  public void draw(Graphics g) {
    // needs-more-work: should manage Handle objects here
    _content.drawSelected(g);
  }

  /** The bounding box of the selection is the bbox of the contained
   * DiagramElement, plus the size of the handles. */
  public Rectangle getBoundingBox() {
    Rectangle r = _content.getBoundingBox();
    r.setBounds(r.x - HAND_SIZE, r.y - HAND_SIZE,
	      r.width + 2*HAND_SIZE, r.height + 2*HAND_SIZE);
    return r;
  }
  public void setGraphicAttribute(String k, Object v){}
} /* end class SelectionHandles */

