[june23_2007_douglas
douglas@music.columbia.edu**20070623222048
 
 More work with new SingleFeaturePanels. 
 
 Added functionality to SingleFeaturePanelTester. You can add panels,
 move them around, delete them. Also an info box.
 
 Started working on adding a SFP renderer to the original 
 visualizer, but gave up. The paradigms don't match. So for now
 we'll have different apps.
 
 
] {
hunk ./Makefile 38
+visualizer:
+	javac $(JFLAGS) $(SRCDIR)/$(BASEPKGDIR)/visualizer/*.java  
+	
hunk ./src/com/meapsoft/visualizer/BarGraphRenderer.java 404
-	/*
-	public void actionPerformed(ActionEvent arg0)
-	{		
-		Object source = arg0.getSource();
-		String command = arg0.getActionCommand();
-		
-		super.actionPerformed(arg0);
-	}
-	*/
+
hunk ./src/com/meapsoft/visualizer/DrawingPanel.java 34
+import javax.swing.BoxLayout;
hunk ./src/com/meapsoft/visualizer/DrawingPanel.java 62
+		
+		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+		
hunk ./src/com/meapsoft/visualizer/MultiFileFeatureRenderer.java 1
-/*
- *  Copyright 2006-2007 Columbia University.
- *
- *  This file is part of MEAPsoft.
- *
- *  MEAPsoft is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  MEAPsoft is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with MEAPsoft; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- *  02110-1301 USA
- *
- *  See the file "COPYING" for the text of the license.
- */
-
-/*
- * Created on Nov 15, 2006
- *
- * various ways of viewing EDL files
- * 
- */
-package com.meapsoft.visualizer;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.image.BufferedImage;
-import java.util.Vector;
-
-import javax.swing.BoxLayout;
-import javax.swing.JCheckBox;
-import javax.swing.JPanel;
-
-import com.meapsoft.DSP;
-import com.meapsoft.EDLFile;
-import com.meapsoft.FeatFile;
-
-/**
- * displays multiple SingleFeaturePanels
- *
- * @author Douglas Repetto (douglas@music.columbia.edu)
- * and the MEAP team
- */
-
-public class MultiFileFeatureRenderer extends Renderer
-{
-	public MultiFileFeatureRenderer(FeatFile featFile, EDLFile eDLFile, String name) {
-		super(featFile, eDLFile, name);
-		// TODO Auto-generated constructor stub
-	}
-
-	@Override
-	public void draw(BufferedImage image, int width, int height) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public Vector getChunkVisInfosForPoint(Point p) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public String getFeatureNameForPoint(Point p) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public int getFeatureNumberForPoint(Point p) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public double getFeatureValueForPoint(Point p) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public void rangeFilterSelectionChanged() {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void setDragRect(Rectangle r, boolean dS) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public static void main(String[] args)
-	{	
-		//Schedule a job for the event-dispatching thread:
-		//creating and showing this application's GUI.
-		javax.swing.SwingUtilities.invokeLater(new Runnable() 
-		{
-			public void run() 
-			{
-				new MultiFileFeatureRenderer(null, null, null);
-			}
-		});
-	}
-}
-
-
-
rmfile ./src/com/meapsoft/visualizer/MultiFileFeatureRenderer.java
addfile ./src/com/meapsoft/visualizer/MultiSingleFeatureRenderer.java
hunk ./src/com/meapsoft/visualizer/MultiSingleFeatureRenderer.java 1
+/*
+ *  Copyright 2006-2007 Columbia University.
+ *
+ *  This file is part of MEAPsoft.
+ *
+ *  MEAPsoft is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  MEAPsoft is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with MEAPsoft; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ *  02110-1301 USA
+ *
+ *  See the file "COPYING" for the text of the license.
+ */
+
+
+package com.meapsoft.visualizer;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.image.BufferedImage;
+import java.util.Vector;
+
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import com.meapsoft.EDLFile;
+import com.meapsoft.FeatFile;
+import com.meapsoft.MEAPUtil;
+import com.meapsoft.gui.GUIUtils;
+import com.meapsoft.visualizer.TypeFileFeature;
+
+/**
+ * displays multiple SingleFeaturePanels
+ *
+ * @author Douglas Repetto (douglas@music.columbia.edu)
+ * and the MEAP team
+ */
+
+/*
+ * 
+ * Giving up on this. It makes no sense to use the SingleFeaturePanels within the 
+ * original Visualizer paradigm. They're really display only, much simpler than
+ * what's happening in the Visualizer. Too many arch changes needed to integrate 
+ * them. So maybe they're in another stand-alone app...
+ * 
+ */
+
+public class MultiSingleFeatureRenderer extends Renderer
+{
+	JComboBox visTypeOptionsBox;
+	
+	Vector panels = new Vector();
+	
+	public MultiSingleFeatureRenderer(FeatFile featFile, EDLFile eDLFile) 
+	{
+		super(featFile, eDLFile, "MultiSingleFeature");
+
+	}
+	
+	public MultiSingleFeatureRenderer(Renderer r)
+	{
+		super(r);
+		//have to do this so we're not stuck with invalid
+		//multipliers from another renderer
+		updateColorMultipliers();
+	}
+
+	@Override
+	public void draw(BufferedImage image, int width, int height) 
+	{
+		//drawing is taken care of in the individual panels...
+	}
+
+	@Override
+	public Vector getChunkVisInfosForPoint(Point p) 
+	{
+		Vector chunks = new Vector();
+		
+		chunks.add(events.elementAt(0));
+		
+		return chunks;
+	}
+
+	@Override
+	public String getFeatureNameForPoint(Point p) 
+	{
+		// TODO Auto-generated method stub
+		return "unknown feature";
+	}
+
+	@Override
+	public int getFeatureNumberForPoint(Point p) 
+	{
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public double getFeatureValueForPoint(Point p) 
+	{
+		// TODO Auto-generated method stub
+		return 0.0;
+	}
+
+	@Override
+	public void rangeFilterSelectionChanged() 
+	{
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setDragRect(Rectangle r, boolean dS) 
+	{
+		// TODO Auto-generated method stub
+		
+	}
+
+	public JPanel buildGUI(Color bgColor)
+	{
+		
+		JPanel panel = super.buildGUI(bgColor);
+		
+		JPanel localControlsPanel = new JPanel();
+		localControlsPanel.setBackground(bgColor);
+		localControlsPanel.setLayout(new BoxLayout(localControlsPanel, BoxLayout.Y_AXIS));
+		
+		JLabel vTL = new JLabel("vis type: ");
+		vTL.setBackground(bgColor);
+		localControlsPanel.add(vTL);
+		
+		String[] visTypeOptions = {"BarGraph", "LineGraph", "ColorBars"};
+		
+		visTypeOptionsBox = new JComboBox(visTypeOptions);
+		visTypeOptionsBox.setBackground(bgColor);
+		visTypeOptionsBox.setActionCommand("visType");
+		visTypeOptionsBox.setSelectedIndex(2);
+		visTypeOptionsBox.addActionListener(this);
+		localControlsPanel.add(visTypeOptionsBox);
+		
+		JLabel sCL = new JLabel("show: ");
+		sCL.setBackground(bgColor);
+		localControlsPanel.add(sCL);
+		
+		JButton addPanelButton = new JButton("add panel");
+		addPanelButton.setBackground(bgColor);
+		addPanelButton.setActionCommand("addPanel");
+		addPanelButton.addActionListener(this);
+		localControlsPanel.add(addPanelButton);
+		
+		controlsPanel.add(localControlsPanel);
+		
+		return panel;
+	}
+	
+	void addAPanel(TypeFileFeature tFF)
+	{
+		SingleFeaturePanel sFP = null;
+		
+		if (tFF.panelType.equals("BarGraph"))
+			sFP = new SingleFeatureBarGraphPanel(tFF.featFile, tFF.featureName);
+		else if (tFF.panelType.equals("LineGraph"))
+			sFP = new SingleFeatureLineGraphPanel(tFF.featFile, tFF.featureName);
+		else if (tFF.panelType.equals("ColorBars"))
+			sFP = new SingleFeatureColorBarsPanel(tFF.featFile, tFF.featureName);
+		else
+		{
+			System.out.println("don't know that type of panel!");
+			System.exit(-1);
+		}
+		
+		if (sFP.initialize() == -1)
+		{
+			System.out.println("hmm, something wrong, bailing.");
+			System.exit(-1);
+		}
+
+		sFP.setBackgroundColor(Color.YELLOW);
+		sFP.setDefaultForegroundColor(Color.GREEN);
+		
+		drawingPanel.add(sFP);
+		panels.add(sFP);	
+	}
+
+	
+	String getPanelType()
+	{
+		Object[] possibilities = {"BarGraph", "LineGraph", "ColorBars"};
+		String s = (String)JOptionPane.showInputDialog(
+		                    null,
+		                    "Select a panel type:",
+		                    "Customized Dialog",
+		                    JOptionPane.PLAIN_MESSAGE,
+		                    null,
+		                    possibilities,
+		                    "BarGraph");
+		return s;
+	}
+	
+	String getFeatureFromFile(FeatFile fF)
+	{
+		Vector features = fF.featureDescriptions;
+		
+		Object[] choices = new Object[features.size()];
+		
+		for (int i = 0; i < features.size(); i++)
+		{
+			String name = (String)features.elementAt(i);
+			//we're splitting on "." but have to use an escape sequence!
+			String[] chunks = name.split("\\.");
+			choices[i] = chunks[chunks.length-1];
+		
+		}
+		//Object[] possibilities = {"BarGraph", "LineGraph", "ColorBars"};
+		String s = (String)JOptionPane.showInputDialog(
+		                    null,
+		                    "Select a feature:",
+		                    "Customized Dialog",
+		                    JOptionPane.PLAIN_MESSAGE,
+		                    null,
+		                    choices,
+		                    "");
+
+		return s;
+	}
+	
+	
+	public TypeFileFeature selectATFF()
+	{		
+		String panelType = getPanelType();
+		
+		String dataDirectory = "./";
+		
+		String paths[] = MEAPUtil.getPaths();
+		if (paths != null)
+		{
+			dataDirectory = paths[1];
+		}
+		else
+			System.exit(-1);
+		String names[] = GUIUtils.FileSelector(GUIUtils.OPENFEAT, dataDirectory, null);
+		
+		if (names[0] == null)
+			return null;
+		
+		FeatFile fF = new FeatFile(names[0]);
+		try
+		{
+			fF.readFile();
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+			System.exit(-1);
+		}
+
+		String feature = getFeatureFromFile(fF);
+		TypeFileFeature fAF = new TypeFileFeature(panelType, fF, names[0], feature);
+		return fAF;
+	}
+	
+	public void actionPerformed(ActionEvent arg0)
+	{		
+		//Object source = arg0.getSource();
+		String command = arg0.getActionCommand();
+		
+		if (command.equals("visType"))
+		{
+			System.out.println("visType");
+		}
+		else if (command.equals("addPanel"))
+		{
+			addAPanel(selectATFF());	
+		}
+		else
+			super.actionPerformed(arg0);
+	}
+		
+	public static void main(String[] args)
+	{	
+		//Schedule a job for the event-dispatching thread:
+		//creating and showing this application's GUI.
+		javax.swing.SwingUtilities.invokeLater(new Runnable() 
+		{
+			public void run() 
+			{
+				new MultiSingleFeatureRenderer(null, null);
+			}
+		});
+	}
+}
+
+
+
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 1
+/*
+ *  Copyright 2006-2007 Columbia University.
+ *
+ *  This file is part of MEAPsoft.
+ *
+ *  MEAPsoft is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  MEAPsoft is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with MEAPsoft; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ *  02110-1301 USA
+ *
+ *  See the file "COPYING" for the text of the license.
+ */
+
+
+
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 29
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 40
-{
-
+{	
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 48
+	public String getDisplayType() 
+	{
+		return "BarGraph";
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 82
+			
+		//g.setColor(this.defaultFGColor);
+		//g.drawString(featureName, 20, 20);
+
+		if (selected)
+			drawBorder(g);	
+	}
+
+	public void mouseClicked(MouseEvent arg0) 
+	{		
+		//System.out.println(featureName + ": thanks for clicking in me!");
+	}
+
+	public void mouseEntered(MouseEvent arg0) {
+		// TODO Auto-generated method stub
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 98
-		g.drawString(featureName, 20, 20);
hunk ./src/com/meapsoft/visualizer/SingleFeatureBarGraphPanel.java 100
+	public void mouseExited(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mousePressed(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mouseReleased(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeatureColorBarsPanel.java 1
+/*
+ *  Copyright 2006-2007 Columbia University.
+ *
+ *  This file is part of MEAPsoft.
+ *
+ *  MEAPsoft is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  MEAPsoft is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with MEAPsoft; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ *  02110-1301 USA
+ *
+ *  See the file "COPYING" for the text of the license.
+ */
+
+
+
hunk ./src/com/meapsoft/visualizer/SingleFeatureColorBarsPanel.java 29
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
hunk ./src/com/meapsoft/visualizer/SingleFeatureColorBarsPanel.java 40
-{
-
+{	
hunk ./src/com/meapsoft/visualizer/SingleFeatureColorBarsPanel.java 48
+	public String getDisplayType() 
+	{
+		return "ColorBars";
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeatureColorBarsPanel.java 100
-		g.drawString(featureName, 20, 20);
+		//g.setColor(this.defaultFGColor);
+		//g.drawString(featureName, 20, 20);
+
+		if (selected)
+			drawBorder(g);	
+	}
+	
+	public void mouseClicked(MouseEvent arg0) 
+	{		
+		//System.out.println(featureName = ": thanks for clicking in me!");
+	}
+
+	public void mouseEntered(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mouseExited(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mousePressed(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mouseReleased(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
hunk ./src/com/meapsoft/visualizer/SingleFeatureLineGraphPanel.java 1
+/*
+ *  Copyright 2006-2007 Columbia University.
+ *
+ *  This file is part of MEAPsoft.
+ *
+ *  MEAPsoft is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  MEAPsoft is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with MEAPsoft; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ *  02110-1301 USA
+ *
+ *  See the file "COPYING" for the text of the license.
+ */
+
+
hunk ./src/com/meapsoft/visualizer/SingleFeatureLineGraphPanel.java 28
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
hunk ./src/com/meapsoft/visualizer/SingleFeatureLineGraphPanel.java 40
-
+	String displayType = "LineGraph";
+	
hunk ./src/com/meapsoft/visualizer/SingleFeatureLineGraphPanel.java 49
+	public String getDisplayType() 
+	{
+		return "LineGraph";
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeatureLineGraphPanel.java 95
-			g.drawString(featureName, 20, 20);
+			//g.setColor(this.defaultFGColor);
+			//g.drawString(featureName, 20, 20);
+
+			if (selected)
+				drawBorder(g);	
hunk ./src/com/meapsoft/visualizer/SingleFeatureLineGraphPanel.java 102
+	
+	public void mouseClicked(MouseEvent arg0) 
+	{		
+		//System.out.println(featureName = ": thanks for clicking in me!");
+	}
+
+	public void mouseEntered(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mouseExited(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mousePressed(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void mouseReleased(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 28
+import java.awt.Rectangle;
+import java.awt.event.MouseListener;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 49
-public abstract class SingleFeaturePanel extends JPanel
+public abstract class SingleFeaturePanel extends JPanel implements MouseListener
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 81
+	Color outlineColor = Color.black;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 83
+	boolean selected = false;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 93
+		addMouseListener(this);
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 205
+	void setSelected(boolean selected)
+	{
+		this.selected = selected;
+		//System.out.println(featureName + ": selected = " + selected);
+	}
+	
+	boolean isSelected()
+	{
+		return selected;
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 275
+	void drawBorder(Graphics g)
+	{
+		g.setColor(outlineColor);
+		
+		Rectangle r = getLocalBounds();
+		g.drawRect(r.x, r.y, r.width - 1 , r.height - 1);
+		g.drawRect(r.x + 1, r.y + 1, r.width - 3, r.height - 3);
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanel.java 296
+	Rectangle getLocalBounds()
+	{
+		Rectangle bounds = getBounds();
+		
+		return new Rectangle(0, 0, bounds.width, bounds.height);
+	}
+	
+	public abstract String getDisplayType();
+	
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 1
+/*
+ *  Copyright 2006-2007 Columbia University.
+ *
+ *  This file is part of MEAPsoft.
+ *
+ *  MEAPsoft is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  MEAPsoft is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with MEAPsoft; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ *  02110-1301 USA
+ *
+ *  See the file "COPYING" for the text of the license.
+ */
+
+
+
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 28
+import java.awt.Point;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 34
+import java.util.Iterator;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 40
+import javax.swing.JLabel;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 51
-	JPanel panel;
+	JPanel mainPanel;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 53
+	JPanel infoPanel;
+	
+	JLabel infoText;
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 61
-	Vector panels = new Vector();
-	Vector tFFs = new Vector();
-
+	Vector sFPanels = new Vector();
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 63
+
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 86
-		panel = new JPanel();
-		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
-		frame.setContentPane(panel);
+		
+		mainPanel = new JPanel();
+		mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
+
+		frame.setContentPane(mainPanel);
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 93
-		panel.add(controlsPanel);
+		mainPanel.add(controlsPanel);
+		
+		buildInfoPanel();
+		mainPanel.add(infoPanel);
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 103
+		
+
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 116
+		
+		JLabel selectedOperationsLabel = new JLabel("selected: ");
+		controlsPanel.add(selectedOperationsLabel);
+		
+		JButton deletePanelButton = new JButton("delete");
+		deletePanelButton.setActionCommand("deletePanel");
+		deletePanelButton.addActionListener(this);
+		controlsPanel.add(deletePanelButton);
+		
+		JButton shiftUpButton = new JButton("shift up");
+		shiftUpButton.setActionCommand("shiftUp");
+		shiftUpButton.addActionListener(this);
+		controlsPanel.add(shiftUpButton);
+		
+		JButton shiftDownButton = new JButton("shift down");
+		shiftDownButton.setActionCommand("shiftDown");
+		shiftDownButton.addActionListener(this);
+		controlsPanel.add(shiftDownButton);
+	}
+	
+	void buildInfoPanel()
+	{
+		infoPanel = new JPanel();
+		infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.X_AXIS));
+
+		JLabel labelLabel = new JLabel("selected: ");
+		infoPanel.add(labelLabel);
+		infoText = new JLabel("select a panel!");
+		infoPanel.add(infoText);
+	}
+	
+	void updateInfoText(SingleFeaturePanel sFP)
+	{
+		String fileNameParts[] = sFP.featFile.filename.split(slash);
+		String shortFileName = fileNameParts[fileNameParts.length - 1];
+		infoText.setText(shortFileName + " : " + sFP.featureName + " : " + sFP.getDisplayType());
+	}
+	
+	void rebuildPanelLayout()
+	{
+		System.out.println("rebuilding layout...");
+		Rectangle bounds = frame.getBounds();
+		frame.setVisible(false);
+		
+		mainPanel.removeAll();
+	
+		Iterator it2 = sFPanels.iterator();
+		while (it2.hasNext ())
+			mainPanel.add((SingleFeaturePanel)it2.next());
+		
+		mainPanel.add(controlsPanel);
+		mainPanel.add(infoPanel);
+		
+		frame.pack();
+		frame.setVisible(true);
+		frame.setBounds(bounds);
+	}
+	
+	void refreshGUI()
+	{
+		Rectangle bounds = frame.getBounds();
+		frame.setVisible(false);
+		frame.pack();
+		frame.setBounds(bounds);
+		frame.setVisible(true);	
+	}
+
+	//deletes the currently selected panel
+	void deletePanel()
+	{
+		boolean deleted = false;
+
+		Iterator it = sFPanels.iterator();
+		while (it.hasNext())
+		{
+			SingleFeaturePanel sFP = (SingleFeaturePanel)it.next();
+			if (sFP.isSelected())
+			{
+				it.remove();
+				deleted = true;
+			}
+		}
+		
+		if (deleted)
+			rebuildPanelLayout();
+	}
+	
+	void shiftPanelUp()
+	{
+		boolean shifted = false;
+		int currPos = -1;
+		SingleFeaturePanel shifter = null;
+		
+		Iterator it = sFPanels.iterator();
+		while (it.hasNext())
+		{
+			SingleFeaturePanel sFP = (SingleFeaturePanel)it.next();
+			if (sFP.isSelected())
+			{
+				currPos = sFPanels.indexOf(sFP);
+				shifter = sFP;
+				shifted = true;
+			}
+		}
+		
+		if (currPos - 1 < 0)
+			return;
+		
+		if (shifted)
+		{
+			sFPanels.remove(shifter);
+			sFPanels.add(currPos - 1, shifter);
+			
+			rebuildPanelLayout();
+		}
+	}
+	
+	void shiftPanelDown()
+	{
+		boolean shifted = false;
+		int currPos = -1;
+		SingleFeaturePanel shifter = null;
+		
+		Iterator it = sFPanels.iterator();
+		while (it.hasNext())
+		{
+			SingleFeaturePanel sFP = (SingleFeaturePanel)it.next();
+			if (sFP.isSelected())
+			{
+				currPos = sFPanels.indexOf(sFP);
+				shifter = sFP;
+				shifted = true;
+			}
+		}
+		
+		if (currPos + 1 == sFPanels.size())
+			return;
+		
+		if (shifted)
+		{
+			sFPanels.remove(shifter);
+			sFPanels.add(currPos + 1, shifter);
+			
+			rebuildPanelLayout();
+		}
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 289
-		Rectangle bounds = frame.getBounds();
-		frame.setVisible(false);
-		
-		panel.add(sFP);
-		panels.add(sFP);
-		
-		frame.pack();
-		frame.setVisible(true);
-		frame.setBounds(bounds);
-		
+		//mainPanel.add(sFP);
+		sFPanels.add(sFP);
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 292
+		rebuildPanelLayout();		
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 364
-		System.out.println("mouse click!");
+		//System.out.println("mouse click!");
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 366
-		/*
-		String newFN = null;
+		SingleFeaturePanel sourcePanel = (SingleFeaturePanel)e.getComponent();
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 368
-		switch (sFP.featureNumber)
+		int numPanels = sFPanels.size();
+		
+		for (int i = 0; i < numPanels; i++)
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 372
-			case -2:
-				newFN = "Length";
-				break;
-			case -1:
-				newFN = "AvgMelSpec";
-				break;
-			case 0:
-				newFN = "AvgPitchSimple";
-				break;
-			case 1:
-				newFN = "AvgSpecCentroid";
-				break;
-			case 2:
-				newFN = "ChunkPower";
-				break;
-			case 3:
-				newFN = "SpectralStability";
-				break;
-			case 4:
-				newFN = "StartTime";
-				break;
+			SingleFeaturePanel testPanel = (SingleFeaturePanel)sFPanels.elementAt(i);
+			if (sourcePanel == testPanel)
+			{
+				sourcePanel.setSelected(true);
+				updateInfoText(sourcePanel);
+			}
+			else
+				testPanel.setSelected(false);
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 381
-		sFP.setFeatureName(newFN);
-		sFP.repaint();
-		*/
+		refreshGUI();
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 404
+	public void actionPerformed(ActionEvent arg0) 
+	{
+		String command = arg0.getActionCommand();
+		
+		if (command.equals("newPanel"))
+		{
+			addAPanel(selectATFF());
+		}
+		else if (command.equals("deletePanel"))
+		{
+			deletePanel();
+		}
+		else if (command.equals("shiftUp"))
+		{
+			shiftPanelUp();
+		}
+		else if (command.equals("shiftDown"))
+		{
+			shiftPanelDown();
+		}
+	}
+	
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 439
-	public class TypeFileFeature
-	{
-		String panelType = null;
-		FeatFile featFile = null;
-		String fileName = null;
-		String featureName = null;
-		
-		public TypeFileFeature(String panelType, FeatFile fF, String fileName, String featureName)
-		{
-			this.panelType = panelType;
-			this.featFile = fF;
-			this.fileName = fileName;
-			this.featureName = featureName;
-		}
-	}
hunk ./src/com/meapsoft/visualizer/SingleFeaturePanelTester.java 440
-	public void actionPerformed(ActionEvent arg0) 
-	{
-		String command = arg0.getActionCommand();
-		
-		if (command.equals("newPanel"))
-		{
-			addAPanel(selectATFF());
-		}
-		
-	}
addfile ./src/com/meapsoft/visualizer/TypeFileFeature.java
hunk ./src/com/meapsoft/visualizer/TypeFileFeature.java 1
+/*
+ *  Copyright 2006-2007 Columbia University.
+ *
+ *  This file is part of MEAPsoft.
+ *
+ *  MEAPsoft is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  MEAPsoft is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with MEAPsoft; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ *  02110-1301 USA
+ *
+ *  See the file "COPYING" for the text of the license.
+ */
+
+
+package com.meapsoft.visualizer;
+
+import com.meapsoft.FeatFile;
+
+public class TypeFileFeature
+{
+	String panelType = null;
+	FeatFile featFile = null;
+	String fileName = null;
+	String featureName = null;
+	
+	public TypeFileFeature(String panelType, FeatFile fF, String fileName, String featureName)
+	{
+		this.panelType = panelType;
+		this.featFile = fF;
+		this.fileName = fileName;
+		this.featureName = featureName;
+	}
+}
hunk ./src/com/meapsoft/visualizer/Visualizer.java 184
-		mainWindow.show();
+		mainWindow.setVisible(true);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 208
+				//, "multi single features"};
hunk ./src/com/meapsoft/visualizer/Visualizer.java 760
-				mainWindow.hide();
+				mainWindow.setVisible(false);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 774
-				mainWindow.show();
+				mainWindow.setVisible(true);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 778
-				mainWindow.hide();
+				mainWindow.setVisible(false);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 791
-				mainWindow.show();
+				mainWindow.setVisible(true);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 795
-				mainWindow.hide();
+				mainWindow.setVisible(false);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 808
-				mainWindow.show();
+				mainWindow.setVisible(true);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 812
-				mainWindow.hide();
+				mainWindow.setVisible(false);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 825
-				mainWindow.show();
+				mainWindow.setVisible(true);
hunk ./src/com/meapsoft/visualizer/Visualizer.java 827
+			/*
+			else if (rendererSelector.getSelectedIndex() == 4)
+			{
+				mainWindow.setVisible(false);
+				drawingPanel.resetZoom();
+				MultiSingleFeatureRenderer fSFR;
+				if (drawingPanel.renderer != null)
+					fSFR = new MultiSingleFeatureRenderer(drawingPanel.renderer);			
+				else 
+					fSFR = new MultiSingleFeatureRenderer(featInputFile, eDLInputFile);
+				drawingPanel.setRenderer(fSFR);
+				fSFR.setDrawingPanel(drawingPanel);
+				guiPanel.remove(localControlPanel);
+				localControlPanel = drawingPanel.renderer.buildGUI(Color.orange);
+				guiPanel.add(localControlPanel, BorderLayout.PAGE_END);
+				guiPanel.repaint();
+				mainWindow.setVisible(true);
+			}
+			*/
}
