samer@0: /* samer@0: * VectorPlotter.java samer@0: * samer@0: * Copyright (c) 2000, Samer Abdallah, King's College London. samer@0: * All rights reserved. samer@0: * samer@0: * This software is provided AS iS and WITHOUT ANY WARRANTY; samer@0: * without even the implied warranty of MERCHANTABILITY or samer@0: * FITNESS FOR A PARTICULAR PURPOSE. samer@0: */ samer@0: samer@0: package samer.maths; samer@0: samer@0: import java.util.*; samer@0: import java.awt.*; samer@0: import java.awt.event.*; samer@0: import samer.core.*; samer@0: import samer.core.util.*; samer@0: import samer.core.Agent.*; samer@0: import samer.tools.*; samer@0: import java.awt.image.IndexColorModel; samer@0: samer@0: /** samer@0: A Viewer that draws multiple traces: one for each element of a vector samer@0: */ samer@0: samer@0: public class VectorTrace extends Trace samer@0: { samer@0: private Vec vec; samer@0: private Renderer R; samer@0: private int[] old; samer@0: private Color[] cols; samer@0: samer@0: public VectorTrace(Vec v) samer@0: { samer@0: IndexColorModel cmod=(IndexColorModel)Shell.get("colormap",ImageSourceBase.GREY); samer@0: R=(Renderer)Shell.get("renderer",Renderer.LINE); samer@0: samer@0: int N=v.size(), M=cmod.getMapSize(); samer@0: cols=new Color[N]; samer@0: old=new int[N]; samer@0: vec=v; samer@0: samer@0: for (int i=0; i