[Jtreeview-cvs] jtreeview commit notification
Brought to you by:
alokito
|
From: Alok S. <al...@us...> - 2004-06-29 18:47:55
|
Update of /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19794/src/edu/stanford/genetics/treeview Modified Files: FileSet.java Log Message: added function to set FileSet type by arbitrary string, such as one provided by command line. The error handling could be better, I just didn't want to deal with exceptions. Index: FileSet.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/FileSet.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileSet.java 25 Sep 2003 04:53:37 -0000 1.6 --- FileSet.java 29 Jun 2004 18:47:47 -0000 1.7 *************** *** 24,27 **** --- 24,28 ---- import java.io.*; + import javax.swing.*; /** *************** *** 283,286 **** --- 284,303 ---- node.setAttribute("style", newStyle, AUTO_STYLE); } + private String validStyles = "auto|classic|kmeans|linked"; + public void setStyle(String newStyle) { + if (newStyle == null) { + JOptionPane.showMessageDialog(null, "Error: Invalid Style null. Valid styles " + validStyles); + } else if (newStyle.equals("auto")) { + setStyle(AUTO_STYLE); + } else if (newStyle.equals("classic")) { + setStyle(CLASSIC_STYLE); + } else if (newStyle.equals("kmeans")) { + setStyle(KMEANS_STYLE); + } else if (newStyle.equals("linked")) { + setStyle(LINKED_STYLE); + } else { + JOptionPane.showMessageDialog(null, "Error: Invalid Style "+newStyle+". Valid styles " + validStyles); + } + } } |