Author: kono
Date: 2010-11-15 20:02:57 -0800 (Mon, 15 Nov 2010)
New Revision: 22865
Added:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/DoubleVisualPropertyEditor.java
Removed:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/NumberVisualPropertyEditor.java
Modified:
core3/default-mappingcalculators/trunk/src/main/java/org/cytoscape/view/vizmap/mappings/DiscreteMapping.java
core3/ding-presentation-impl/trunk/osgi.bnd
core3/ding-presentation-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
core3/model-api/trunk/src/main/java/org/cytoscape/model/CyTableManager.java
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
core3/vizmap-gui-impl/trunk/pom.xml
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/AbstractVizMapperPanel.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewPanelImpl.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertySheetBuilder.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/AbstractVisualPropertyEditor.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/ColorVisualPropertyEditor.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/EditorManagerImpl.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/CyDoublePropertyEditor.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/DataLoadedEventHandler.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/InitializedEventHandler.java
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi-vizmapper.xml
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-vizmapper.xml
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleImpl.java
Log:
Basic discrete mapping functions UI was broken due to the refactoring in model
layer. Now it's fixed.
Modified:
core3/default-mappingcalculators/trunk/src/main/java/org/cytoscape/view/vizmap/mappings/DiscreteMapping.java
===================================================================
---
core3/default-mappingcalculators/trunk/src/main/java/org/cytoscape/view/vizmap/mappings/DiscreteMapping.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/default-mappingcalculators/trunk/src/main/java/org/cytoscape/view/vizmap/mappings/DiscreteMapping.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -112,30 +112,28 @@
private void applyDiscreteMapping(final View<? extends CyTableEntry>
view) {
final CyRow row = view.getModel().getCyRow();
+//
+// logger.debug("Target View = " + view.getModel().getSUID());
+// logger.debug("AttrName = " + attrName);
+// logger.debug("AttrType = " + attrType);
+// logger.debug("Row keys = " + row.getAllValues().keySet());
+// logger.debug("Row vals = " + row.getAllValues().values());
- logger.debug("Target View = " + view.getModel().getSUID());
- logger.debug("AttrName = " + attrName);
- logger.debug("AttrType = " + attrType);
- logger.debug("Row keys = " + row.getAllValues().keySet());
- logger.debug("Row vals = " + row.getAllValues().values());
-
if (row.isSet(attrName, attrType)) {
// skip Views where source attribute is not defined;
// ViewColumn will automatically substitute the per-VS
or global
// default, as appropriate
final K key = view.getModel().getCyRow().get(attrName,
attrType);
-
- logger.debug("Discrete apply Key = " + key);
-
+
if (attribute2visualMap.containsKey(key)) {
final V value = attribute2visualMap.get(key);
// Assign value to view
view.setVisualProperty(vp, value);
} else { // remove value so that default value will be
used:
// Set default value
- view.setVisualProperty(vp, null);
+ view.setVisualProperty(vp, null);
}
} else { // remove value so that default value will be used:
view.setVisualProperty(vp, null);
Modified: core3/ding-presentation-impl/trunk/osgi.bnd
===================================================================
--- core3/ding-presentation-impl/trunk/osgi.bnd 2010-11-16 02:23:54 UTC (rev
22864)
+++ core3/ding-presentation-impl/trunk/osgi.bnd 2010-11-16 04:02:57 UTC (rev
22865)
@@ -2,4 +2,5 @@
# Use this file to add customized Bnd instructions for the bundle
#-----------------------------------------------------------------
+Import-package: *
Export-Package: org.cytoscape.ding, org.cytoscape.ding.impl,
org.cytoscape.ding.icon
Modified:
core3/ding-presentation-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/ding-presentation-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2010-11-16 04:02:57 UTC (rev 22865)
@@ -13,7 +13,6 @@
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi-1.0.xsd"
default-lazy-init="false">
-
<import resource="bundle-context-osgi.xml" />
<context:annotation-config />
Modified:
core3/model-api/trunk/src/main/java/org/cytoscape/model/CyTableManager.java
===================================================================
--- core3/model-api/trunk/src/main/java/org/cytoscape/model/CyTableManager.java
2010-11-16 02:23:54 UTC (rev 22864)
+++ core3/model-api/trunk/src/main/java/org/cytoscape/model/CyTableManager.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -56,7 +56,7 @@
* @return a map of table names to tables, which contain the attributes
* for the specified network.
*/
- Map<String, CyTable> getTableMap(Class<?> type, CyNetwork network);
+ public Map<String, CyTable> getTableMap(Class<?> type, CyNetwork
network);
/**
* Returns a Set of all tables with the specified visibility.
Modified:
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
===================================================================
---
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -67,7 +67,7 @@
}
- public Map<String,CyTable> getTableMap(final Class<?> graphObjectType,
final CyNetwork network) {
+ @Override public Map<String, CyTable> getTableMap(final Class<?>
graphObjectType, final CyNetwork network) {
if ( network == null || graphObjectType == null )
return null;
@@ -103,7 +103,8 @@
tables.put( t.getSUID(), t );
}
- public Set<CyTable> getAllTables(boolean includePrivate) {
+
+ @Override public Set<CyTable> getAllTables(boolean includePrivate) {
Set<CyTable> res = new HashSet<CyTable>();
for ( CyTable t : tables.values() ) {
if ( includePrivate )
@@ -114,7 +115,7 @@
return res;
}
- public CyTable getTable(long suid) {
+ @Override public CyTable getTable(long suid) {
return tables.get(suid);
}
}
Modified: core3/vizmap-gui-impl/trunk/pom.xml
===================================================================
--- core3/vizmap-gui-impl/trunk/pom.xml 2010-11-16 02:23:54 UTC (rev 22864)
+++ core3/vizmap-gui-impl/trunk/pom.xml 2010-11-16 04:02:57 UTC (rev 22865)
@@ -6,7 +6,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.cytoscape</groupId>
- <version>1.0-SNAPSHOT</version>
+ <version>3.0.0-alpha4-SNAPSHOT</version>
</parent>
<properties>
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/AbstractVizMapperPanel.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/AbstractVizMapperPanel.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/AbstractVizMapperPanel.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -212,6 +212,18 @@
.getDefaultComboBoxEditor("mappingTypeEditor");
}
+
+ private void initializeVisualStyleComboBox() {
+ vsComboBoxModel = new DefaultComboBoxModel();
+ final VisualStyle defaultVS = manager.getDefaultStyle();
+ final Set<VisualStyle> styles = vmm.getAllVisualStyles();
+
+ for(VisualStyle style: styles)
+ vsComboBoxModel.addElement(style);
+
+ visualStyleComboBox = new JComboBox(vsComboBoxModel);
+ visualStyleComboBox.setSelectedItem(defaultVS);
+ }
private void initComponents() {
mainSplitPane = new javax.swing.JSplitPane();
@@ -226,10 +238,7 @@
buttonPanel = new javax.swing.JPanel();
- vsComboBoxModel = new DefaultComboBoxModel();
- final VisualStyle defaultVS = manager.getDefaultStyle();
- vsComboBoxModel.addElement(defaultVS);
- visualStyleComboBox = new JComboBox(vsComboBoxModel);
+ initializeVisualStyleComboBox();
optionButton = new DropDownMenuButton(new AbstractAction() {
private final static long serialVersionUID =
1213748836776579L;
@@ -490,26 +499,26 @@
// ///////////////// Managing Visual Style Combobox //////////////////
- public void setSelectedVisualStyle(final VisualStyle vs) {
- final int itemCount = vsComboBoxModel.getSize();
+// public void setSelectedVisualStyle(final VisualStyle vs) {
+// final int itemCount = vsComboBoxModel.getSize();
+//
+// for (int i = 0; i < itemCount; i++) {
+// if (visualStyleComboBox.getItemAt(i).equals(vs)) {
+//
+// eventHelper
+// .fireAsynchronousEvent(new
SelectedVisualStyleSwitchedEvent(
+//
visualStyleComboBox,
+// (VisualStyle)
visualStyleComboBox.getItemAt(i),
+// vs));
+// visualStyleComboBox.setSelectedItem(vs);
+// return;
+// }
+// }
+//
+// throw new IllegalArgumentException(
+// "No such Visual Style in the combo box: " + vs);
+// }
- for (int i = 0; i < itemCount; i++) {
- if (visualStyleComboBox.getItemAt(i).equals(vs)) {
-
- eventHelper
- .fireAsynchronousEvent(new
SelectedVisualStyleSwitchedEvent(
-
visualStyleComboBox,
- (VisualStyle)
visualStyleComboBox.getItemAt(i),
- vs));
- visualStyleComboBox.setSelectedItem(vs);
- return;
- }
- }
-
- throw new IllegalArgumentException(
- "No such Visual Style in the combo box: " + vs);
- }
-
public JPanel getDefaultViewPanel() {
return this.defaultViewImagePanel;
}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewPanelImpl.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewPanelImpl.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewPanelImpl.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -34,6 +34,9 @@
*/
package org.cytoscape.view.vizmap.gui.internal;
+import static
org.cytoscape.view.presentation.property.TwoDVisualLexicon.NODE_X_LOCATION;
+import static
org.cytoscape.view.presentation.property.TwoDVisualLexicon.NODE_Y_LOCATION;
+
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Paint;
@@ -46,7 +49,6 @@
import org.cytoscape.model.CyNode;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.view.model.CyNetworkViewFactory;
-import org.cytoscape.view.model.View;
import org.cytoscape.view.presentation.RenderingEngineFactory;
import org.cytoscape.view.vizmap.VisualStyle;
import org.cytoscape.view.vizmap.gui.DefaultViewPanel;
@@ -55,14 +57,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.cytoscape.view.presentation.property.TwoDVisualLexicon.*;
-
/**
* Panel to show the default properties visually (as graphics).
*
* @version 0.6
* @since Cytoscape 2.5
- * @author kono
*/
public class DefaultViewPanelImpl extends JPanel implements DefaultViewPanel,
SelectedVisualStyleSwitchedListener {
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -98,15 +98,15 @@
*/
public <K, V> VizMapperProperty<VisualProperty<V>, String,
VisualMappingFunctionFactory> buildProperty(
final VisualMappingFunction<K, V> visualMapping,
- final VisualProperty<?> rootObjectCategory,
+ final String categoryName,
final PropertySheetPanel propertySheetPanel, final
VisualMappingFunctionFactory factory) {
- logger.debug("\n\n\nbuildProp called: Root VP = " +
rootObjectCategory.getDisplayName());
+ logger.debug("\n\n\nbuildProp called: Root VP = " +
categoryName);
// Mapping is empty
if (visualMapping == null)
throw new NullPointerException("Mapping is null.");
- if (rootObjectCategory == null)
+ if (categoryName == null)
throw new NullPointerException(
"Category is null. It should be one of
the following: NODE, EDGE, or NETWORK.");
if (propertySheetPanel == null)
@@ -117,7 +117,7 @@
= new VizMapperProperty<VisualProperty<V>, String,
VisualMappingFunctionFactory>(CellType.VISUAL_PROPERTY_TYPE, vp, String.class);
// Build Property object
- topProperty.setCategory(rootObjectCategory.getDisplayName());
+ topProperty.setCategory(categoryName);
topProperty.setDisplayName(vp.getDisplayName());
topProperty.setInternalValue(factory);
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertySheetBuilder.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertySheetBuilder.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertySheetBuilder.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -94,17 +94,23 @@
return this.propertyMap;
}
+ /**
+ * Create new properties.
+ *
+ * @param style
+ */
public void setPropertyTable(final VisualStyle style) {
setPropertySheetAppearence(style);
+ // Remove all.
for (Property item : propertySheetPanel.getProperties())
propertySheetPanel.removeProperty(item);
/*
* Add properties to the property sheet.
*/
- List<Property> propRecord = setPropertyFromCalculator(style);
+ List<Property> propRecord =
getPropertyListFromVisualStyle(style);
// Save it for later use.
propertyMap.put(style, propRecord);
@@ -228,14 +234,14 @@
// lineCellEditor.setAvailableIcons(iconArray);
}
- private List<Property> setPropertyFromCalculator(final VisualStyle
style) {
+ private List<Property> getPropertyListFromVisualStyle(final VisualStyle
style) {
final Collection<VisualProperty<?>> nodeVP =
style.getVisualLexicon().getAllDescendants(TwoDVisualLexicon.NODE);
final Collection<VisualProperty<?>> edgeVP =
style.getVisualLexicon().getAllDescendants(TwoDVisualLexicon.EDGE);
//final Collection<VisualProperty<?>> networkVP =
style.getVisualLexicon().getVisualLexiconNode(TwoDVisualLexicon.NETWORK).getChildren();
- final List<Property> nodeProps = setProps(style,
TwoDVisualLexicon.NODE, nodeVP);
- final List<Property> edgeProps = setProps(style,
TwoDVisualLexicon.EDGE, edgeVP);
+ final List<Property> nodeProps = getProps(style,
TwoDVisualLexicon.NODE.getDisplayName(), nodeVP);
+ final List<Property> edgeProps = getProps(style,
TwoDVisualLexicon.EDGE.getDisplayName(), edgeVP);
//final List<Property> networkProps = setProps(style,
TwoDVisualLexicon.NETWORK);
final List<Property> result = new ArrayList<Property>();
@@ -247,16 +253,16 @@
}
- private List<Property> setProps(final VisualStyle style, final
VisualProperty<?> cat, final Collection<VisualProperty<?>> vpSet) {
+
+ private List<Property> getProps(final VisualStyle style, final String
categoryName, final Collection<VisualProperty<?>> vpSet) {
final List<Property> props = new ArrayList<Property>();
- final Collection<VisualMappingFunction<?, ?>> mappings = style
- .getAllVisualMappingFunctions();
+ final Collection<VisualMappingFunction<?, ?>> mappings =
style.getAllVisualMappingFunctions();
for (VisualMappingFunction<?, ?> mapping : mappings) {
final VisualProperty<?> targetVP =
mapping.getVisualProperty();
- logger.debug("!!!!!!Checking VP: " +
targetVP.getDisplayName() + " for " + cat.getDisplayName());
+ logger.debug("!!!!!!Checking VP: " +
targetVP.getDisplayName() + " for " + categoryName);
// execute the following only if category matches.
if (vpSet.contains(targetVP) == false ||
style.getVisualLexicon().getVisualLexiconNode(targetVP).getChildren().size() !=
0)
continue;
@@ -266,7 +272,7 @@
final VizMapperProperty<?, String, ?>
calculatorTypeProp = vizMapPropertyBuilder
- .buildProperty(mapping, cat,
propertySheetPanel, null);
+ .buildProperty(mapping, categoryName,
propertySheetPanel, null);
logger.debug("Built new PROP: " +
calculatorTypeProp.getDisplayName());
@@ -280,7 +286,7 @@
&&
(calculatorTypeProp.getCategory().equals(
"Unused Properties") ==
false)) {
- logger.debug("***** Testing category: " +
cat.getDisplayName());
+ logger.debug("***** Testing category: " +
categoryName);
((PropertyEditorRegistry)
this.propertySheetPanel
.getTable().getEditorFactory())
.registerEditor(calculatorTypeProp, editorManager
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -71,6 +71,7 @@
import org.cytoscape.view.vizmap.gui.SelectedVisualStyleManager;
import org.cytoscape.view.vizmap.gui.editor.EditorManager;
import org.cytoscape.view.vizmap.gui.event.SelectedVisualStyleSwitchedEvent;
+import org.cytoscape.view.vizmap.gui.event.SelectedVisualStyleSwitchedListener;
import org.cytoscape.view.vizmap.gui.internal.theme.ColorManager;
import org.cytoscape.view.vizmap.gui.internal.theme.IconManager;
import org.slf4j.Logger;
@@ -97,7 +98,7 @@
* @param <syncronized>
*/
public class VizMapperMainPanel extends AbstractVizMapperPanel implements
- VisualStyleAddedListener, VisualStyleAboutToBeRemovedListener,
PopupMenuListener, NetworkViewAddedListener, NetworkAddedListener,
CytoPanelComponent {
+ VisualStyleAddedListener, VisualStyleAboutToBeRemovedListener,
PopupMenuListener, NetworkViewAddedListener, NetworkAddedListener,
CytoPanelComponent, SelectedVisualStyleSwitchedListener {
private final static long serialVersionUID = 1202339867854959L;
@@ -106,7 +107,7 @@
private static final String TAB_TITLE = "VizMapper\u2122";
private boolean ignore = false;
- private VisualStyle lastVS = null;
+
private DefaultViewMouseListener defaultViewMouseListener;
/**
@@ -139,6 +140,7 @@
// Initialize all components
initPanel();
+
}
private void initPanel() {
@@ -153,7 +155,8 @@
refreshUI();
// Switch to the default style.
- switchVS(manager.getDefaultStyle());
+ switchVS(manager.getDefaultStyle(), true);
+
}
@@ -161,36 +164,43 @@
private void addVisualStyleChangeAction() {
visualStyleComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
- switchVS((VisualStyle)
visualStyleComboBox.getSelectedItem());
+ final VisualStyle lastStyle =
manager.getCurrentVisualStyle();
+ final VisualStyle style = (VisualStyle)
visualStyleComboBox.getSelectedItem();
+ if(style.equals(lastStyle))
+ return;
+
+ switchVS(style);
+ eventHelper.fireSynchronousEvent(new
SelectedVisualStyleSwitchedEvent(this, lastStyle, style));
+ logger.debug("######## Event: new selected
style: " + style);
}
});
}
- public void switchVS(VisualStyle style) {
+
+ private void switchVS(final VisualStyle style) {
+ switchVS(style, false);
+ }
+ private void switchVS(final VisualStyle style, boolean forceUpdate) {
- if (ignore)
- return;
+ logger.debug("######## Switching start: " + style.getTitle() );
// If new VS name is the same, ignore.
- if (style == null || style.equals(lastVS))
+ if (!forceUpdate &&
style.equals(manager.getCurrentVisualStyle()))
return;
+ logger.debug("######## Switching: " + style.getTitle() );
+ // Close editor windows
editorWindowManager.closeAllEditorWindows();
- logger.debug("######## Fireing new style: " + style);
- eventHelper.fireSynchronousEvent(new
SelectedVisualStyleSwitchedEvent(this, lastVS, style));
- logger.debug("######## Event end: new style: " + style);
if
(vizMapPropertySheetBuilder.getPropertyMap().containsKey(style)) {
- final List<Property> props = vizMapPropertySheetBuilder
- .getPropertyMap().get(style);
+ logger.debug("######## Style exists in buffer: " +
style.getTitle() );
+ final List<Property> props =
vizMapPropertySheetBuilder.getPropertyMap().get(style);
final Map<String, Property> unused = new
TreeMap<String, Property>();
- /*
- * Remove currently shown property
- */
+ // Remove all from current table
for (Property item : propertySheetPanel.getProperties())
propertySheetPanel.removeProperty(item);
@@ -198,6 +208,7 @@
* Add properties to current property sheet.
*/
for (Property prop : props) {
+ logger.debug("<Prop> " + prop.getDisplayName()
);
if
(prop.getCategory().startsWith(CATEGORY_UNUSED) == false) {
propertySheetPanel.addProperty(prop);
} else {
@@ -208,11 +219,11 @@
final List<String> keys = new
ArrayList<String>(unused.keySet());
Collections.sort(keys);
- for (Object key : keys) {
+ for (Object key : keys)
propertySheetPanel.addProperty(unused.get(key));
- }
+
} else {
- logger.debug("######## Set prop table called.");
+ logger.debug("######## Need to create new prop sheet: "
+ style.getTitle());
vizMapPropertySheetBuilder.setPropertyTable(style);
updateAttributeList();
}
@@ -224,7 +235,9 @@
if (currentView != null) {
vmm.setVisualStyle((VisualStyle)
visualStyleComboBox.getModel()
.getSelectedItem(), currentView);
- style.apply(applicationManager.getCurrentNetworkView());
+ style.apply(currentView);
+ // Update view
+ currentView.updateView();
}
/*
@@ -251,10 +264,6 @@
// spcs.firePropertyChange("UPDATE_LOCK", null, lockState);
propertySheetPanel.setSorting(true);
-
- this.eventHelper.fireSynchronousEvent(new
SelectedVisualStyleSwitchedEvent(this,lastVS, style));
- lastVS = style;
-
}
public void refreshUI() {
@@ -665,14 +674,14 @@
* Update GUI components when new Visual Style is created.
*/
@Override public void handleEvent(final VisualStyleAddedEvent e) {
+ final VisualStyle currentStyle =
manager.getCurrentVisualStyle();
final VisualStyle newStyle = e.getVisualStyleAdded();
- if (newStyle == null)
+ if (newStyle == null || newStyle.equals(currentStyle))
return;
vsComboBoxModel.addElement(newStyle);
+ visualStyleComboBox.setSelectedItem(newStyle);
- // Set selected style
- setSelectedVisualStyle(newStyle);
final CyNetworkView currentView =
applicationManager.getCurrentNetworkView();
if (currentView != null)
@@ -691,25 +700,28 @@
}
switchVS(newStyle);
+ eventHelper.fireSynchronousEvent(new
SelectedVisualStyleSwitchedEvent(this, currentStyle, newStyle));
+ logger.debug("######## Event: Got new style: " + newStyle);
}
@Override
public void handleEvent(NetworkViewAddedEvent e) {
- VisualStyle targetStyle = lastVS;
- if(targetStyle == null) {
- targetStyle = manager.getDefaultStyle();
- }
- vmm.setVisualStyle(targetStyle, e.getNetworkView());
- targetStyle.apply(e.getNetworkView());
+ final CyNetworkView newView = e.getNetworkView();
+ final VisualStyle targetStyle = manager.getCurrentVisualStyle();
+ logger.debug("@@@@@@ Network View added. Apply " + targetStyle);
+
+ vmm.setVisualStyle(targetStyle, newView);
+ targetStyle.apply(newView);
+ newView.updateView();
}
@Override public void handleEvent(NetworkAddedEvent e) {
+ // TODO: is this necessary?
+ logger.debug("!!!!!!!!!! Network added. Need to update prop
sheet: " + e.getNetwork().getSUID());
- logger.debug("!!!!!!!!!! Network added. Need to update prop
sheet: " + e.getNetwork().getSUID());
- vizMapPropertySheetBuilder.setPropertyTable(this.lastVS);
}
@@ -718,10 +730,14 @@
*/
@Override
public void handleEvent(VisualStyleAboutToBeRemovedEvent e) {
-
+
+ final VisualStyle toBeRemoved = e.getVisualStyleToBeRemoved();
+
// Update image
getDefaultImageManager().remove(e.getVisualStyleToBeRemoved());
vizMapPropertySheetBuilder.getPropertyMap().remove(e.getVisualStyleToBeRemoved());
+ this.visualStyleComboBox.removeItem(toBeRemoved);
+
// Switch to the default style
final VisualStyle defaultStyle = manager.getDefaultStyle();
@@ -730,6 +746,8 @@
final CyNetworkView view =
applicationManager.getCurrentNetworkView();
if (view != null)
vmm.setVisualStyle(defaultStyle, view);
+ eventHelper.fireSynchronousEvent(new
SelectedVisualStyleSwitchedEvent(this, toBeRemoved, defaultStyle));
+ logger.debug("######## Event: removed style: " + toBeRemoved);
}
public String getTitle() {
@@ -747,4 +765,10 @@
public Icon getIcon() {
return null;
}
+
+ @Override
+ public void handleEvent(SelectedVisualStyleSwitchedEvent e) {
+ final VisualStyle newStyle = e.getNewVisualStyle();
+ this.visualStyleComboBox.setSelectedItem(newStyle);
+ }
}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/AbstractVisualPropertyEditor.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/AbstractVisualPropertyEditor.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/AbstractVisualPropertyEditor.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -45,7 +45,9 @@
import org.cytoscape.view.vizmap.gui.editor.VisualPropertyEditor;
+import com.l2fprod.common.propertysheet.PropertyRendererRegistry;
+
/**
*
*
@@ -53,6 +55,12 @@
*/
public abstract class AbstractVisualPropertyEditor<T> implements
VisualPropertyEditor<T> {
+ protected static final PropertyRendererRegistry REG = new
PropertyRendererRegistry();
+
+ static {
+ REG.registerDefaults();
+ }
+
protected final Class<T> type;
protected final PropertyEditor propertyEditor;
protected Component continuousEditor;
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/ColorVisualPropertyEditor.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/ColorVisualPropertyEditor.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/ColorVisualPropertyEditor.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -53,11 +53,7 @@
*/
public class ColorVisualPropertyEditor extends
AbstractVisualPropertyEditor<Paint> {
- private static final PropertyRendererRegistry REG = new
PropertyRendererRegistry();
- static {
- REG.registerDefaults();
- }
/**
* Constructor. Should instantiate one editor per VisualProperty.
*/
Copied:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/DoubleVisualPropertyEditor.java
(from rev 22793,
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/NumberVisualPropertyEditor.java)
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/DoubleVisualPropertyEditor.java
(rev 0)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/DoubleVisualPropertyEditor.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -0,0 +1,77 @@
+/*
+ Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+package org.cytoscape.view.vizmap.gui.internal.editor;
+
+import javax.swing.Icon;
+
+import org.cytoscape.view.vizmap.gui.SelectedVisualStyleManager;
+import
org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor.CyDoublePropertyEditor;
+
+/**
+ *
+ */
+public class DoubleVisualPropertyEditor extends
+ AbstractVisualPropertyEditor<Double> {
+
+
+ /**
+ * Creates a new DiscreteNumber object.
+ */
+ public DoubleVisualPropertyEditor(Class<Double> type,
+ final SelectedVisualStyleManager manager) {
+ super(type, new CyDoublePropertyEditor(null));
+ tableCellRenderer = REG.getRenderer(Double.class);
+ // continuousEditor = new C2CMappingEditor<Number,
Number>(this.vp,
+ // manager, attr);
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param vp
+ * DOCUMENT ME!
+ * @param width
+ * DOCUMENT ME!
+ * @param height
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public Icon getDefaultIcon(int width, int height) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/EditorManagerImpl.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/EditorManagerImpl.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/EditorManagerImpl.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -154,8 +154,7 @@
public void addVisualPropertyEditor(VisualPropertyEditor<?> ve,
@SuppressWarnings("rawtypes") Map properties) {
- logger.debug("### Got VP Editor " + ve.toString() + ", this is
for "
- + ve.getType());
+ logger.debug("### Got VP Editor " + ve.toString() + ", this is
for " + ve.getType());
this.editors.put(ve.getType(), ve);
}
@@ -247,14 +246,8 @@
return ret;
}
- /*
- * (non-Javadoc)
- *
- * @see
- *
org.cytoscape.application.swing.vizmap.gui.editors.EditorFactory#getDiscreteCellEditor(
- * org.cytoscape.application.swing.viewmodel.VisualProperty)
- */
- public PropertyEditor getDiscreteCellEditor(VisualProperty<?> type) {
+
+ @Override public PropertyEditor getDiscreteCellEditor(VisualProperty<?>
type) {
VisualPropertyEditor<?> editor = editors.get(type.getType());
if (editor == null)
return null;
Deleted:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/NumberVisualPropertyEditor.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/NumberVisualPropertyEditor.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/NumberVisualPropertyEditor.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -1,73 +0,0 @@
-/*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-package org.cytoscape.view.vizmap.gui.internal.editor;
-
-import javax.swing.Icon;
-import javax.swing.table.DefaultTableCellRenderer;
-
-import org.cytoscape.model.CyTable;
-import org.cytoscape.view.model.VisualProperty;
-import org.cytoscape.view.vizmap.gui.SelectedVisualStyleManager;
-import
org.cytoscape.view.vizmap.gui.internal.editor.mappingeditor.C2CMappingEditor;
-import
org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor.CyDoublePropertyEditor;
-
-
-/**
- *
- */
-public class NumberVisualPropertyEditor extends
AbstractVisualPropertyEditor<Number> {
- /**
- * Creates a new DiscreteNumber object.
- */
- public NumberVisualPropertyEditor(Class<Number> type, final
SelectedVisualStyleManager manager) {
- super(type, new CyDoublePropertyEditor(null));
- tableCellRenderer = new DefaultTableCellRenderer();
- //continuousEditor = new C2CMappingEditor<Number,
Number>(this.vp, manager, attr);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param vp DOCUMENT ME!
- * @param width DOCUMENT ME!
- * @param height DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- @Override public Icon getDefaultIcon(int width, int height) {
- // TODO Auto-generated method stub
- return null;
- }
-}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/CyDoublePropertyEditor.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/CyDoublePropertyEditor.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/CyDoublePropertyEditor.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -31,7 +31,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ */
package org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor;
import java.awt.event.FocusEvent;
@@ -40,15 +40,22 @@
import javax.swing.JTextField;
import org.cytoscape.view.vizmap.gui.internal.VizMapperMainPanel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.l2fprod.common.beans.editor.DoublePropertyEditor;
import com.l2fprod.common.propertysheet.PropertySheetTableModel.Item;
-
/**
*
*/
public class CyDoublePropertyEditor extends DoublePropertyEditor {
+
+ private static final Logger logger = LoggerFactory
+ .getLogger(CyDoublePropertyEditor.class);
+
+ private final VizMapperMainPanel panel;
+
private Object currentValue;
private Object selected;
@@ -57,18 +64,22 @@
*/
public CyDoublePropertyEditor(final VizMapperMainPanel vmp) {
super();
+ panel = vmp;
((JTextField) editor).addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- final Item item = (Item)
vmp.getSelectedItem();
- selected =
item.getProperty().getDisplayName();
- setCurrentValue();
- }
+ public void focusGained(FocusEvent e) {
+
+ logger.debug("Double Editor got val: " +
currentValue);
+
+ final Item item = (Item)
panel.getSelectedItem();
+ selected = item.getProperty().getDisplayName();
+ setCurrentValue();
+ }
- public void focusLost(FocusEvent arg0) {
- checkChange();
- }
- });
+ public void focusLost(FocusEvent arg0) {
+ checkChange();
+ }
+ });
}
private void setCurrentValue() {
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -226,7 +226,7 @@
(VisualMappingFunctionFactory)
e.getNewValue(),
controllingAttrName.toString());
} else if (prop.getParentProperty() != null) {
- // Discrete Cell editor.
+ // Discrete Cell editor. Create new map entry and
register it.
logger.debug("Cell edit event: name = " +
prop.getName());
logger.debug("Cell edit event: old val = " +
prop.getValue());
logger.debug("Cell edit event: new val = " + newVal);
@@ -248,11 +248,6 @@
}
}
- private <K, V> void processSingleValueEdit(DiscreteMapping<K, V>
mapping, Object key, Object value) {
-
-
- }
-
// if (e.getNewValue() == null)
// return;
//
@@ -580,7 +575,7 @@
final VisualProperty<Visualizable> category =
util.getCategory((Class<? extends CyTableEntry>) vp.getTargetDataType());
VizMapperProperty<VisualProperty<V>, String, ?> newRootProp =
vizMapPropertySheetBuilder
.getPropertyBuilder().buildProperty(newMapping,
- category, propertySheetPanel,
factory);
+ category.getDisplayName(),
propertySheetPanel, factory);
logger.debug("!!!!!!! Removing Prop: " + prop);
@@ -608,19 +603,31 @@
final String controllingAttrName) {
final VisualStyle style = manager.getCurrentVisualStyle();
+
logger.debug("Mapping combo box clicked: " + style.getTitle());
logger.debug("Mapping Category: " + prop.getCategory());
+
+
+
final VisualProperty<Visualizable> startVP =
util.getCategory((Class<? extends CyTableEntry>) vp.getTargetDataType());
+
+ final VisualMappingFunction<?, ?> currentMapping =
style.getVisualMappingFunction(vp);
+
+ logger.debug("Current Mapping for " + vp.getDisplayName() + "
is: " + currentMapping);
+
+ final VisualMappingFunction<?, ?> newMapping;
+ if(currentMapping == null) {
- final AttributeSet attrSet =
attrManager.getAttributeSet(applicationManager.getCurrentNetwork(), (Class<?
extends CyTableEntry>) vp.getTargetDataType());
- final Class<?> attributeDataType =
attrSet.getAttrMap().get(controllingAttrName);
- final VisualMappingFunction<?, ?> newMapping = factory
-
.createVisualMappingFunction(controllingAttrName, attributeDataType,
- vp);
+ final AttributeSet attrSet =
attrManager.getAttributeSet(applicationManager.getCurrentNetwork(), (Class<?
extends CyTableEntry>) vp.getTargetDataType());
+ final Class<?> attributeDataType =
attrSet.getAttrMap().get(controllingAttrName);
+ newMapping =
factory.createVisualMappingFunction(controllingAttrName, attributeDataType,vp);
+
+ style.addVisualMappingFunction(newMapping);
+ } else {
+ newMapping = currentMapping;
+ }
- style.addVisualMappingFunction(newMapping);
-
logger.debug("New VisualMappingFunction Created: Mapping Type =
"
+
style.getVisualMappingFunction(vp).toString());
logger.debug("New VisualMappingFunction Created: Controlling
attr = "
@@ -634,7 +641,7 @@
newRootProp = vizMapPropertySheetBuilder.getPropertyBuilder()
- .buildProperty(newMapping, startVP,
+ .buildProperty(newMapping,
startVP.getDisplayName(),
propertySheetPanel, factory);
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/DataLoadedEventHandler.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/DataLoadedEventHandler.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/DataLoadedEventHandler.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -44,7 +44,8 @@
final VisualStyle vs =
vmm.getVisualStyle(applicationManager.getCurrentNetworkView());
vizMapperMainPanel.refreshUI();
- vizMapperMainPanel.switchVS(vs);
- vizMapperMainPanel.setSelectedVisualStyle(vs);
+ // FIXME: remove this class.
+// vizMapperMainPanel.switchVS(vs);
+// vizMapperMainPanel.setSelectedVisualStyle(vs);
}
}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/InitializedEventHandler.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/InitializedEventHandler.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/InitializedEventHandler.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -43,13 +43,14 @@
public void processEvent(PropertyChangeEvent e) {
final VisualStyle vs =
vmm.getVisualStyle(applicationManager.getCurrentNetworkView());
-
vizMapperMainPanel.setDefaultViewImagePanel(vizMapperMainPanel.getDefaultImageManager()
-
.get(vs));
- vizMapperMainPanel.setSelectedVisualStyle(vs);
-
- vizMapPropertySheetBuilder.setPropertyTable(vs);
- vizMapperMainPanel.updateAttributeList();
-
- propertySheetPanel.setSorting(true);
+ // FIXME: remove this.
+//
vizMapperMainPanel.setDefaultViewImagePanel(vizMapperMainPanel.getDefaultImageManager()
+//
.get(vs));
+// vizMapperMainPanel.setSelectedVisualStyle(vs);
+//
+// vizMapPropertySheetBuilder.setPropertyTable(vs);
+// vizMapperMainPanel.updateAttributeList();
+//
+// propertySheetPanel.setSorting(true);
}
}
Modified:
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi-vizmapper.xml
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi-vizmapper.xml
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi-vizmapper.xml
2010-11-16 04:02:57 UTC (rev 22865)
@@ -37,7 +37,7 @@
auto-export="interfaces" />
<osgi:service id="colorPropertyEditorService" ref="colorPropertyEditor"
auto-export="interfaces" />
- <osgi:service id="numberPropertyEditorService"
ref="numberPropertyEditor" auto-export="interfaces" />
+ <osgi:service id="numberPropertyEditorService"
ref="doublePropertyEditor" auto-export="interfaces" />
<!-- Export as Editor Manager -->
Modified:
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-vizmapper.xml
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-vizmapper.xml
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-vizmapper.xml
2010-11-16 04:02:57 UTC (rev 22865)
@@ -134,9 +134,9 @@
class="org.cytoscape.view.vizmap.gui.internal.editor.ColorVisualPropertyEditor">
<constructor-arg ref="paintClass" />
</bean>
- <bean id="numberPropertyEditor"
-
class="org.cytoscape.view.vizmap.gui.internal.editor.NumberVisualPropertyEditor">
- <constructor-arg ref="numberClass" />
+ <bean id="doublePropertyEditor"
+
class="org.cytoscape.view.vizmap.gui.internal.editor.DoubleVisualPropertyEditor">
+ <constructor-arg ref="doubleClass" />
<constructor-arg ref="selectedVisualStyleManager" />
</bean>
@@ -162,9 +162,6 @@
<bean name="defaultViewPanel"
class="org.cytoscape.view.vizmap.gui.internal.DefaultViewPanelImpl">
- <description>
- Create default view panel.
- </description>
<constructor-arg ref="cyNetworkFactoryServiceRef" />
<constructor-arg ref="graphViewFactoryServiceRef" />
<constructor-arg ref="presentationFactoryServiceRef" />
Modified:
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleImpl.java
===================================================================
---
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleImpl.java
2010-11-16 02:23:54 UTC (rev 22864)
+++
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleImpl.java
2010-11-16 04:02:57 UTC (rev 22865)
@@ -236,7 +236,7 @@
* DOCUMENT ME!
*/
private void applyImpl(
- final Collection<?> views,
+ final Collection<? extends View<?>> views,
final Collection<VisualProperty<?>> visualProperties) {
@@ -255,7 +255,7 @@
* DOCUMENT ME!
*/
private void applyToView(
- final Collection<?> views,
+ final Collection<? extends View<?>> views,
final VisualProperty<?> vp) {
final VisualMappingFunction<?, ?> mapping =
getVisualMappingFunction(vp);
@@ -263,8 +263,13 @@
if (mapping != null) {
// Mapping is available for this VP. Apply it.
logger.debug("###### Mapping found for " +
vp.getDisplayName() + ": " + mapping.toString());
- for (Object view : views)
+ final Object styleDefaultValue = getDefaultValue(vp);
+ for (View<?> view : views) {
mapping.apply((View<? extends CyTableEntry>)
view);
+
+ if(view.getVisualProperty(vp) ==
vp.getDefault())
+ view.setVisualProperty(vp,
styleDefaultValue);
+ }
} else if (!vp.shouldIgnoreDefault()) {
// Ignore defaults flag is OFF. Apply defaults.
applyStyleDefaults((Collection<View<?>>) views, vp);
--
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.