/*
 * ArrowView.java  
 *
 * Copyright 2001
 * College of Computer Science
 * Northeastern University
 * Boston, MA  02115
 *
 * This software may be used for educational purposes as long as
 * this copyright notice is retained intact at the top of all files.
 *
 * Should this software be modified, the words "Modified from 
 * Original" must be included as a comment below this notice.
 *
 * All publication rights are retained.  This software or its 
 * documentation may not be published in any media either in whole
 * or in part without explicit permission.
 *
 * Contact information:
 *   Richard Rasala    rasala@ccs.neu.edu
 *   Viera Proulx      vkp@ccs.neu.edu
 *   Jeff Raab         jmr@ccs.neu.edu
 *   Jennifer McDonald jenimac@ccs.neu.edu
 * 
 * Telephone:          617-373-2462
 *
 * This software was created with support from Northeastern 
 * University and from NSF grant DUE-9950829.
 */

import edu.neu.ccs.*;
import edu.neu.ccs.gui.*;

// View for input of an arrow
// Will only be available if an acceptable
// from and to state have been selected

public class ArrowView extends DisplayPanel
					   implements TypedView {
					   
    private TransitionView tView = 
    	new TransitionView();
    
  	// Property list for ArrowView
    private InputProperties properties =
    	new InputProperties();
  
  
	//constructor
	public ArrowView() {
  		add(tView);
	}

	public Stringable demandObject() {
		return null;
	}
	
	public Stringable requestObject()
		throws CancelledException {
		return null;
	}	
	
	public Arrow requestObject(State source, State target, 
									Automata automata) 
									throws CancelledException {
		
		Arrow a = new Arrow();
		
		Transition t = (Transition) tView.requestObject();
		
		automata.addTransition(source, target, t);
		
		a.set(source, target, 
			  automata.getTransitionsBetween(source, target));
			  
		return a;
	}
		
	
	public Class getDataType(){
		return Arrow.class;
	}
	
	public InputProperties getInputProperties(){
		return properties;	
	}
		
	public void setInputProperties(InputProperties p){
		properties = p;	
	}
		
}


