From: <nl...@us...> - 2007-06-20 21:13:56
|
Revision: 677 http://svn.sourceforge.net/obo/?rev=677&view=rev Author: nlw Date: 2007-06-20 14:13:58 -0700 (Wed, 20 Jun 2007) Log Message: ----------- *Indications for OBSOLETE terms added in title area. Modified Paths: -------------- phenote/trunk/src/java/phenote/gui/TermInfo.java phenote/trunk/src/java/phenote/util/HtmlUtil.java Modified: phenote/trunk/src/java/phenote/gui/TermInfo.java =================================================================== --- phenote/trunk/src/java/phenote/gui/TermInfo.java 2007-06-20 20:45:16 UTC (rev 676) +++ phenote/trunk/src/java/phenote/gui/TermInfo.java 2007-06-20 21:13:58 UTC (rev 677) @@ -56,6 +56,7 @@ private UseTermListener useTermListener; private JPanel termInfoPanel; private JPanel naviPanel; + private JButton useTermButton; private JEditorPane termField; private static int TERM_INFO_DEFAULT_WIDTH=350; private static int TERM_INFO_DEFAULT_HEIGHT=400; @@ -95,7 +96,7 @@ termInfoPanel.add(scrollPane,BorderLayout.CENTER); //Layout doesn't look good right now. Will fix ImageIcon ok = new ImageIcon("OK.GIF"); - JButton useTermButton = new JButton(ok); + useTermButton = new JButton(ok); // JButton useTermButton = new JButton("Use Term"); useTermButton.addActionListener(new UseTermActionListener()); useTermButton.setPreferredSize(new Dimension(BUTTON_HEIGHT, BUTTON_HEIGHT)); @@ -204,9 +205,10 @@ currentOboClass = oboClass; String html = HtmlUtil.termInfo(oboClass); - + String term = HtmlUtil.termName(oboClass); textArea.setText(html); - termField.setText("<b>"+oboClass.getName()+"</b>"); + termField.setText(term); + useTermButton.setEnabled(!oboClass.isObsolete()); // scroll to top (by default does bottom) textArea.setCaretPosition(0); } Modified: phenote/trunk/src/java/phenote/util/HtmlUtil.java =================================================================== --- phenote/trunk/src/java/phenote/util/HtmlUtil.java 2007-06-20 20:45:16 UTC (rev 676) +++ phenote/trunk/src/java/phenote/util/HtmlUtil.java 2007-06-20 21:13:58 UTC (rev 677) @@ -71,6 +71,14 @@ return sb.toString(); } + public static String termName(OBOClass oboClass) { + StringBuffer sb = new StringBuffer(); + if (oboClass.isObsolete()) { + sb.append(bold(colorFont(bold("(OBSOLETE) "), "red"))); + } + sb.append(bold(oboClass.getName())); + return sb.toString(); + } //Nicole's attempt at making the Term Info box look a little better //I'm puting all the information into an html table. rhs are each single table cells //but are separated by line breaks. @@ -83,7 +91,6 @@ sb.append("<table>"); sb.append(makeRow(makeLeftCol(bold("ONTOLOGY"))+makeRightCol(oboClass.getNamespace().toString()))); if (oboClass.isObsolete()) { - //sb.append(makeRow(makeLeftCol(bold("TERM"))+makeRightCol(bold(oboClass.getName())+colorFont(bold(" (OBSOLETE)"), "red")))); sb.append(makeObsLinks(oboClass)); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |