view src/samer/maths/LineTrace.java @ 5:b67a33c44de7

Remove some crap, etc
author samer
date Fri, 05 Apr 2019 21:34:25 +0100
parents bf79fb79ee13
children
line wrap: on
line source
/*
 *	MatrixTrace.java	
 *
 *	Copyright (c) 2000, Samer Abdallah, King's College London.
 *	All rights reserved.
 *
 *	This software is provided AS iS and WITHOUT ANY WARRANTY; 
 *	without even the implied warranty of MERCHANTABILITY or 
 *	FITNESS FOR A PARTICULAR PURPOSE.
 */

package samer.maths;
import  samer.core.*;
import  samer.tools.*;
import  java.util.*;

/**
	This viewer outputs all the elements of a row or column
	to a trace (graph of value against time step). All elements
	of the row are column are consecutively output at each time
	step.
  */

public class LineTrace extends Trace implements Observer
{
	Observable	obs;
	Vec			src;

	public LineTrace( Observable o, Vec v) { obs=o; src=v; }

	public void attach() { obs.addObserver(this); }
	public void detach() { obs.deleteObserver(this); super.detach(); }

	public void update(Observable o, Object s) 
	{
		if (s==Viewable.DISPOSING) {
			Shell.releaseViewer(this);
		} else if (obs==o) {
			Vec.Iterator i=src.iterator();
			while (i.more()) next(i.next());
		}
	}
	protected void next(double x) {} // !! fix this
	protected void realized() { super.realized(); attach(); }
}