[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Sun Apr 11 02:22:07 UTC 2010
gordonp
Sat Apr 10 22:22:06 EDT 2010
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui
In directory dev.open-bio.org:/tmp/cvs-serv20087/src/main/ca/ucalgary/seahawk/gui
Modified Files:
MobyDataObjectWidget.java
Log Message:
Better populated data field description
moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyDataObjectWidget.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyDataObjectWidget.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyDataObjectWidget.java 2007/12/06 17:26:26 1.3
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyDataObjectWidget.java 2010/04/11 02:22:06 1.4
@@ -18,6 +18,7 @@
*/
public class MobyDataObjectWidget extends JLabel implements MobyObjectReceiver, MobyContentProducer{
public static final int PARAM_TOOLTIP_WIDTH = 50;
+ public static final int MAX_DATA_DESC = 30;
public static final Color INSTANTIATED_FG_COLOUR = Color.DARK_GRAY;
public static final Color UNINSTANTIATED_FG_COLOUR = Color.RED;
public static final String INSTANTIATED_ICON_RESOURCE = "ca/ucalgary/seahawk/resources/images/checkmark.gif";
@@ -150,7 +151,14 @@
labelText = name+": Collection("+dataType.getName()+") -- "+actualData.getName();
}
else{
- labelText = name+": "+dataType.getName()+" -- "+actualData.getName();
+ String display = actualData.getName();
+ if(display == null || display.trim().length() == 0){
+ display = ((MobyDataInstance) actualData).getObject().toString();
+ }
+ if(display.length() > MAX_DATA_DESC){
+ display = display.substring(0, MAX_DATA_DESC-3)+"...";
+ }
+ labelText = name+": "+dataType.getName()+" -- "+display;
}
tipText = dataType.getDescription();
if(tipText == null || tipText.length() == 0){
More information about the MOBY-guts
mailing list