Author: abeld
Date: 2008-10-16 01:23:36 -0700 (Thu, 16 Oct 2008)
New Revision: 15069

Modified:
   
cytoscape3/branches/abeld-gsoc/dev/pluggable-renderers/application/src/main/java/cytoscape/visual/ui/DefaultAppearenceBuilder.java
Log:
use .getName() to show user-friendly name of VisualProperty in 
DefaultAppearanceBuilder

Modified: 
cytoscape3/branches/abeld-gsoc/dev/pluggable-renderers/application/src/main/java/cytoscape/visual/ui/DefaultAppearenceBuilder.java
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/pluggable-renderers/application/src/main/java/cytoscape/visual/ui/DefaultAppearenceBuilder.java
  2008-10-16 08:01:13 UTC (rev 15068)
+++ 
cytoscape3/branches/abeld-gsoc/dev/pluggable-renderers/application/src/main/java/cytoscape/visual/ui/DefaultAppearenceBuilder.java
  2008-10-16 08:23:36 UTC (rev 15069)
@@ -349,9 +349,7 @@
                                        list = edgeList;
                                }
 
-                               newValue = 
VizMapperMainPanel.showValueSelectDialog((VisualProperty) list
-                                                                               
                                                                                
                                                                                
                                                                                
                                                              
.getSelectedValue(),
-                                                                               
    this);
+                               newValue = 
VizMapperMainPanel.showValueSelectDialog((VisualProperty) 
list.getSelectedValue(), this);
                                VizMapperMainPanel.apply(newValue, 
(VisualProperty) list.getSelectedValue());
                        } catch (Exception e1) {
                                e1.printStackTrace();
@@ -508,13 +506,12 @@
                public Component getListCellRendererComponent(JList list, 
Object value, int index,
                                                              boolean 
isSelected, boolean cellHasFocus) {
                        final VisualPropertyIcon icon;
-
+                       
                        if (icons.size() > index) {
                                icon = (VisualPropertyIcon) icons.get(index);
                        } else
                                icon = null;
 
-                       setText(value.toString());
                        setIcon(icon);
                        setFont(isSelected ? SELECTED_FONT : NORMAL_FONT);
 
@@ -522,13 +519,18 @@
                        this.setVerticalAlignment(SwingConstants.CENTER);
                        this.setIconTextGap(55);
 
-                       if (value instanceof VisualProperty
-                           && (((VisualProperty) value).getDataType() == 
String.class)) {
-                               final Object defVal = 
Cytoscape.getVisualMappingManager().getVisualStyle().getDefaultValue((VisualProperty)value);
 
+                       if (value instanceof VisualProperty) {
+                               VisualProperty vp = (VisualProperty) value;
+                               setText(vp.getName());
+                               if (vp.getDataType() == String.class) {
+                                       final Object defVal = 
Cytoscape.getVisualMappingManager().getVisualStyle().getDefaultValue(vp); 
 
-                               if (defVal != null) {
-                                       this.setToolTipText((String) defVal);
+                                       if (defVal != null) {
+                                               this.setToolTipText((String) 
defVal);
+                                       }
                                }
+                       } else {
+                               setText(value.toString());
                        }
 
                        setBackground(isSelected ? SELECTED_COLOR : 
list.getBackground());


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to