Content of test/remove/Remove.java extracted from visualap.jar
// ONLY FOR DEMO PURPOSE package test.remove; import common.SampledAudio; import java.io.Serializable; import java.lang.reflect.*; import java.awt.image.BufferedImage; import java.util.prefs.*; /** * * Note: visualap components shall implement Serializable and Cloneable * * @author javalc6 * @version 1.0 */ public class Remove implements Serializable, Cloneable { public static final long serialVersionUID = -2198213713506132935L; public Object clone() { Remove cloning = new Remove(); return cloning; } // method accessible from the outside world! public void print(Object obj) { String datapath = System.getProperty("user.dir"); // backward compatibility with old VisualAp versions try { Preferences prefs = Preferences.userNodeForPackage(Class.forName("visualap.VisualAp")); datapath = prefs.get("dataPath", System.getProperty("user.dir")); } catch (Exception ex) { } System.out.println(datapath); if (obj != null) { Class c = obj.getClass(); if (c.isArray()) System.out.print(c.getComponentType().getName() +"["+Array.getLength(obj)+"]"); else if (c.isPrimitive()) { System.out.print(", value = "+obj); } else { System.out.print(c.getName()); if (obj instanceof SampledAudio) System.out.print("["+((SampledAudio)obj).format.toString()+" "+((SampledAudio)obj).length+" bytes ]"); if (obj instanceof BufferedImage) { BufferedImage image = (BufferedImage)obj; System.out.print("["+image.getWidth()+" x "+image.getHeight()+"]"); } } System.out.println(); } else System.out.println("null"); } public static String getToolTipText() { return "print type information"; } }