Author: kono
Date: 2010-10-20 16:49:05 -0700 (Wed, 20 Oct 2010)
New Revision: 22323
Added:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEvent.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEventListener.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObject.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObjectExtended.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualProperty.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualPropertyTest.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/ViewModelEventsTest.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/VisualPropertyEditorBuilderImpl.java
Removed:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedEvent.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedListener.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewCreatedEvent.java
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingNavigationRenderingEngineFactory.java
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
core3/viewmodel-api/trunk/pom.xml
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/AbstractVisualProperty.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/NullDataType.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/VisualProperty.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/Visualizable.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitContentEvent.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitSelectedEvent.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NodeViewChangeMicroListener.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/package-info.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractCyNetworkViewTest.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualLexiconFactoryTest.java
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualPropertyTest.java
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.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/FontVisualPropertyEditor.java
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/mappingeditor/C2CMappingEditor.java
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/ContinuousMappingEditorPanel.java
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
cytoscape3/trunk/application/src/main/java/cytoscape/internal/actions/PrintAction.java
Log:
View-model API bundle is mostly complete. Test coverage is 100%.
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingNavigationRenderingEngineFactory.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingNavigationRenderingEngineFactory.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingNavigationRenderingEngineFactory.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -16,8 +16,8 @@
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualLexicon;
-import org.cytoscape.view.model.events.NetworkViewChangedEvent;
-import org.cytoscape.view.model.events.NetworkViewChangedListener;
+import org.cytoscape.view.model.events.UpdateNetworkPresentationEvent;
+import org.cytoscape.view.model.events.UpdateNetworkPresentationEventListener;
import org.cytoscape.view.presentation.RenderingEngine;
import org.cytoscape.view.presentation.RenderingEngineFactory;
import org.cytoscape.work.TaskManager;
@@ -33,7 +33,7 @@
*
*/
public class DingNavigationRenderingEngineFactory implements
- RenderingEngineFactory<CyNetwork>, NetworkViewChangedListener
+ RenderingEngineFactory<CyNetwork>,
UpdateNetworkPresentationEventListener
{
private static final Logger logger =
LoggerFactory.getLogger(DingNavigationRenderingEngineFactory.class);
@@ -113,7 +113,7 @@
*
*/
@Override
- public void handleEvent(NetworkViewChangedEvent nvce) {
+ public void handleEvent(UpdateNetworkPresentationEvent nvce) {
DGraphView gv = viewMap.get(nvce.getSource());
if (gv != null)
gv.updateView();
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -21,8 +21,8 @@
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualLexicon;
-import org.cytoscape.view.model.events.NetworkViewChangedEvent;
-import org.cytoscape.view.model.events.NetworkViewChangedListener;
+import org.cytoscape.view.model.events.UpdateNetworkPresentationEvent;
+import org.cytoscape.view.model.events.UpdateNetworkPresentationEventListener;
import org.cytoscape.view.presentation.RenderingEngine;
import org.cytoscape.view.presentation.RenderingEngineFactory;
import org.cytoscape.work.TaskManager;
@@ -31,7 +31,7 @@
import org.slf4j.LoggerFactory;
public class DingRenderingEngineFactory implements
- RenderingEngineFactory<CyNetwork>, NetworkViewChangedListener {
+ RenderingEngineFactory<CyNetwork>,
UpdateNetworkPresentationEventListener {
private static final Logger logger = LoggerFactory
.getLogger(DingRenderingEngineFactory.class);
@@ -135,7 +135,7 @@
*
*/
@Override
- public void handleEvent(NetworkViewChangedEvent nvce) {
+ public void handleEvent(UpdateNetworkPresentationEvent nvce) {
DGraphView gv = viewMap.get(nvce.getSource());
logger.debug("NetworkViewChangedEvent listener got view update
request: "
+ nvce.getSource().getSUID());
Modified:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -45,7 +45,7 @@
public DoubleVisualProperty(final Double def, final String id,
final String name, final boolean ignoreDefault) {
super(def, id, name);
- this.isIgnoreDefault = ignoreDefault;
+ this.shouldIgnoreDefault = ignoreDefault;
}
@Override
Modified: core3/viewmodel-api/trunk/pom.xml
===================================================================
--- core3/viewmodel-api/trunk/pom.xml 2010-10-20 23:33:29 UTC (rev 22322)
+++ core3/viewmodel-api/trunk/pom.xml 2010-10-20 23:49:05 UTC (rev 22323)
@@ -34,13 +34,6 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
@@ -131,7 +124,7 @@
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
</project>
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/AbstractVisualProperty.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/AbstractVisualProperty.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/AbstractVisualProperty.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -39,49 +39,60 @@
* An abstract implementation of VisualProperty that omits the methods dealing
* with serializing data.
*
- * @since Cytoscape 3.0
- *
*/
public abstract class AbstractVisualProperty<T> implements VisualProperty<T> {
// Default value for this VP.
- protected final T defaultValue;
+ private final T defaultValue;
+
+ private final Class<T> dataType;
// Identifier.
- final protected String id;
+ private final String id;
// Human-readable name of VP.
- final protected String name;
+ private final String name;
- protected boolean isIgnoreDefault = false;
+ // If this is true, default value will be ignored by VizMapper.
+ protected boolean shouldIgnoreDefault;
+
/**
- * Constructor with all required immutable field values.
+ * Constructor to set all immutable fields.
*
- * @param objectType
- * @param defaultValue
- * @param id
- * @param name
+ * @param defaultValue default value for this visual property.
+ * @param id unique string for serialization.
+ * @param name human-readable name for this visual property.
+ *
*/
- public AbstractVisualProperty(final T defaultValue, final String id,
final String name) {
+ @SuppressWarnings("unchecked")
+ public AbstractVisualProperty(final T defaultValue, final String id,
final String displayName) {
+ if(defaultValue == null)
+ throw new NullPointerException("defaultValue should not
be null.");
+
+ if(id == null)
+ throw new NullPointerException("id should not be
null.");
+
+ if(displayName == null)
+ throw new NullPointerException("displayName should not
be null.");
+
+
+ this.dataType = (Class<T>) defaultValue.getClass();
+
this.defaultValue = defaultValue;
this.id = id;
- this.name = name;
+ this.name = displayName;
+ this.shouldIgnoreDefault = false;
}
@Override
- @SuppressWarnings("unchecked")
public Class<T> getType() {
- if (defaultValue != null)
- return (Class<T>) defaultValue.getClass();
- else
- return null;
+ return dataType;
}
- @Override
- public T getDefault() {
+ @Override public T getDefault() {
return defaultValue;
}
@@ -97,8 +108,8 @@
}
@Override
- public boolean isIgnoreDefault() {
- return this.isIgnoreDefault;
+ public boolean shouldIgnoreDefault() {
+ return this.shouldIgnoreDefault;
}
}
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -66,7 +66,7 @@
/**
* Returns a list of Views for all CyNodes in the network.
*
- * @return List of all node views.
+ * @return Collection of all node views in this network.
*/
Collection<View<CyNode>> getNodeViews();
@@ -74,31 +74,44 @@
* Returns a View for a specified Edge.
*
* @param n
- * DOCUMENT ME!
+ * Edge data model
*
- * @return DOCUMENT ME!
+ * @return View model for the edge data.
*/
View<CyEdge> getEdgeView(final CyEdge edge);
/**
* Returns a list of Views for all CyEdges in the network.
*
- * @return DOCUMENT ME!
+ * @return All edge views in this network.
*/
Collection<View<CyEdge>> getEdgeViews();
/**
* Returns a list of all View including those for Nodes, Edges, and
Network.
*
- * @return DOCUMENT ME!
+ * @return All view objects in this network including network view
itself.
*/
Collection<View<? extends CyTableEntry>> getAllViews();
- // These are utility methods to fire events to presentation layer.
+ /**
+ * Utility method to fit content to the presentation container (usually
a Swing Window).
+ * This fires event to the presentation layer for updating presentation.
+ */
void fitContent();
+
+
+ /**
+ * Utility method to fit selected graph objects to the presentation
container.
+ * This fires event to the presentation layer for updating presentation.
+ */
void fitSelected();
- public void updateView();
+
+ /**
+ * Cascading event for the presentation layer for updating presentation.
+ */
+ void updateView();
}
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/NullDataType.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/NullDataType.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/NullDataType.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -1,11 +1,10 @@
package org.cytoscape.view.model;
/**
- * An empty/null data type for Visual Properties holding no actual data.
+ * An empty/null data type marker interface for Visual Properties holding no
actual data.
+ * Root Visual Properties have this data type.
*
- * @author kono
- *
*/
public interface NullDataType {
-
+ // No methods are defined.
}
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/VisualProperty.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/VisualProperty.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/VisualProperty.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -100,6 +100,6 @@
*
* @return
*/
- boolean isIgnoreDefault();
+ boolean shouldIgnoreDefault();
}
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/Visualizable.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/Visualizable.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/Visualizable.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -2,12 +2,9 @@
/**
- * Data type for generic data sets, like network.
+ * Marker interface for data types used by higher-level Visual Properties such
as NODE, EDGE, or NETWORK.
*
- * TODO: what kind of method are required?
- *
- * @author kono
- *
+ * TODO: What should RenderingEngine do once this visual property is returned
as data type?
*/
public interface Visualizable {
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitContentEvent.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitContentEvent.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitContentEvent.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -9,12 +9,12 @@
* @author kono
*
*/
-public class FitContentEvent extends AbstractCyEvent<CyNetworkView> {
+public final class FitContentEvent extends AbstractCyEvent<CyNetworkView> {
/**
* Fit the size of network view to the current container.
*
- * @param source
+ * @param source network view to be fitted to the container.
*/
public FitContentEvent(final CyNetworkView source) {
super(source, FitContentEventListener.class);
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitSelectedEvent.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitSelectedEvent.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/FitSelectedEvent.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -8,7 +8,7 @@
* Fit only selected graph object views to the container.
*
*/
-public class FitSelectedEvent extends AbstractCyEvent<CyNetworkView> {
+public final class FitSelectedEvent extends AbstractCyEvent<CyNetworkView> {
/**
* Fit the selected part of network view to the container. Usually
this fires event to the presentation payer for redraw.
Deleted:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedEvent.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedEvent.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedEvent.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -1,18 +0,0 @@
-package org.cytoscape.view.model.events;
-
-import org.cytoscape.event.AbstractCyEvent;
-import org.cytoscape.view.model.CyNetworkView;
-
-/**
- * If something had been changed in the view model, presentation layer should
listening to the change and update itself.
- * This event will be used in such objects in the presentation layer.
- *
- * @author kono
- *
- */
-public final class NetworkViewChangedEvent extends
AbstractCyEvent<CyNetworkView> {
-
- public NetworkViewChangedEvent(final CyNetworkView source) {
- super(source, NetworkViewChangedListener.class);
- }
-}
Deleted:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedListener.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedListener.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedListener.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -1,18 +0,0 @@
-
-package org.cytoscape.view.model.events;
-
-import org.cytoscape.event.CyListener;
-
-/**
- * Listener for {...@linkplain NetworkViewChanged} event. Usually,
presentation layer objects implements this event handler.
- *
- */
-public interface NetworkViewChangedListener extends CyListener {
-
- /**
- * In most cases, this is for presentation layer objects. They should
update the rendered graphics based on the changes in view model.
- *
- * @param e Event containing target network view model.
- */
- public void handleEvent(NetworkViewChangedEvent e);
-}
Deleted:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewCreatedEvent.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewCreatedEvent.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewCreatedEvent.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -1,20 +0,0 @@
-package org.cytoscape.view.model.events;
-
-import org.cytoscape.event.AbstractCyEvent;
-import org.cytoscape.view.model.CyNetworkView;
-
-
-/**
- * TODO: Is this necessary?
- *
- * @author kono
- *
- */
-public class NetworkViewCreatedEvent extends AbstractCyEvent<CyNetworkView> {
-
- public NetworkViewCreatedEvent(CyNetworkView source, Class
listenerClass) {
- super(source, listenerClass);
- // TODO Auto-generated constructor stub
- }
-
-}
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NodeViewChangeMicroListener.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NodeViewChangeMicroListener.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NodeViewChangeMicroListener.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -1,4 +1,3 @@
-
/*
Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
@@ -32,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.model.events;
import org.cytoscape.event.CyMicroListener;
@@ -40,17 +39,29 @@
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualProperty;
-
/**
- * An interface to indicate that a View has changed. The intent is for
- * a Presentation to implement this interface so that the presentation
- * can be updated based on what has changed in the View.
+ * Micro-event listener for node view-models.
+ *
+ * An interface to indicate that a View has changed. The intent is for a
+ * Presentation to implement this interface so that the presentation can be
+ * updated based on what has changed in the View.
+ *
+ * <p>
+ * The purpose of this listener is different from
+ * {...@linkplain UpdateNetworkPresentationEventListener}. This one catches the
+ * event to set a {...@linkplain VisualProperty} from current value to the new
one. It does not mean actually re-drawing the
+ * presentation.
+ *
*/
public interface NodeViewChangeMicroListener extends CyMicroListener {
/**
* The method called when the specified VisualProperty is set to the
- * specified value in the View being listened to.
+ * specified value in the View being listened to.
+ * <p>
+ * Rendering engines should implement this method and update its states.
+ *
*/
- void nodeVisualPropertySet(final View<CyNode> target, final
VisualProperty<?> vp, final Object value);
+ void nodeVisualPropertySet(final View<CyNode> target,
+ final VisualProperty<?> vp, final Object value);
}
Copied:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEvent.java
(from rev 22282,
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedEvent.java)
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEvent.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEvent.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,25 @@
+package org.cytoscape.view.model.events;
+
+import org.cytoscape.event.AbstractCyEvent;
+import org.cytoscape.view.model.CyNetworkView;
+
+/**
+ * If something has been changed in the view model, presentation layer should
+ * catch the event and update its visualization. This event will be used in
such
+ * objects, mainly rendering engines, in the presentation layer. This means by
+ * firing this event, Cytoscape will invoke "redraw" method in the rendering
+ * engine.
+ *
+ */
+public final class UpdateNetworkPresentationEvent extends
+ AbstractCyEvent<CyNetworkView> {
+
+ /**
+ * Event for updating (redrawing) presentation.
+ *
+ * @param source source network view-model. Presentations associated
with this view-model use this event.
+ */
+ public UpdateNetworkPresentationEvent(final CyNetworkView source) {
+ super(source, UpdateNetworkPresentationEventListener.class);
+ }
+}
Copied:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEventListener.java
(from rev 22282,
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/NetworkViewChangedListener.java)
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEventListener.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/events/UpdateNetworkPresentationEventListener.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,20 @@
+package org.cytoscape.view.model.events;
+
+import org.cytoscape.event.CyListener;
+
+/**
+ * Listener for {...@linkplain UpdateNetworkPresentationEvent}. Usually,
+ * presentation layer objects implements this event handler and redraw the
+ * presentation (visualization) once it catches this event.
+ *
+ */
+public interface UpdateNetworkPresentationEventListener extends CyListener {
+
+ /**
+ * Listener implementing this method will redraw the presentation if
necessary.
+ *
+ * @param e
+ * Event containing target network view-model.
+ */
+ public void handleEvent(UpdateNetworkPresentationEvent e);
+}
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/package-info.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/package-info.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/package-info.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -1,7 +1,6 @@
/**
* Module for View Models and Visual Properties.
*
- * @author kono
*/
package org.cytoscape.view.model;
Modified:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractCyNetworkViewTest.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractCyNetworkViewTest.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractCyNetworkViewTest.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -10,7 +10,7 @@
import org.cytoscape.model.CyNode;
import org.junit.Test;
-public class AbstractCyNetworkViewTest {
+public abstract class AbstractCyNetworkViewTest {
private static final int NODE_COUNT = 5;
private static final int EDGE_COUNT = 8;
Modified:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualLexiconFactoryTest.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualLexiconFactoryTest.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualLexiconFactoryTest.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -10,7 +10,7 @@
import org.junit.Before;
import org.junit.Test;
-public class AbstractVisualLexiconFactoryTest {
+public abstract class AbstractVisualLexiconFactoryTest {
protected VisualLexiconNodeFactory nodeFactory;
Modified:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualPropertyTest.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualPropertyTest.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/AbstractVisualPropertyTest.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -18,15 +18,7 @@
protected Class<T> type;
protected Boolean ignore;
- @Before
- public void setUp() throws Exception {
-
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
+
@Test
public void testAbstractVisualProperty() {
assertNotNull(vp);
@@ -34,7 +26,7 @@
@Test
public void testGetType() {
- assertEquals(type, vp.getClass());
+ assertEquals(type, vp.getType());
}
@Test
@@ -55,6 +47,6 @@
@Test
public void testIsIgnoreDefault() {
- assertEquals(ignore, vp.isIgnoreDefault());
+ assertEquals(ignore, vp.shouldIgnoreDefault());
}
}
Added:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObject.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObject.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObject.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,8 @@
+package org.cytoscape.view.model;
+
+public class DummyObject {
+ public void doSomething() {
+ // Dummy method
+ }
+
+}
Added:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObjectExtended.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObjectExtended.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyObjectExtended.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,5 @@
+package org.cytoscape.view.model;
+
+public class DummyObjectExtended extends DummyObject {
+
+}
Added:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualProperty.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualProperty.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualProperty.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,19 @@
+package org.cytoscape.view.model;
+
+public class DummyVisualProperty extends AbstractVisualProperty<DummyObject> {
+
+ public DummyVisualProperty(DummyObject defaultValue, String id, String
name) {
+ super(defaultValue, id, name);
+ }
+
+ @Override
+ public String toSerializableString(DummyObject value) {
+ return "test";
+ }
+
+ @Override
+ public DummyObject parseSerializableString(String value) {
+ return new DummyObject();
+ }
+
+}
Added:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualPropertyTest.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualPropertyTest.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/DummyVisualPropertyTest.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,65 @@
+package org.cytoscape.view.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class DummyVisualPropertyTest extends
AbstractVisualPropertyTest<DummyObject> {
+
+ @Before
+ public void setUp() throws Exception {
+ id = "DummyVisualProperty";
+ defaultVal = new DummyObjectExtended();
+ displayName = "Dummy Visual Property";
+ type = (Class<DummyObject>) defaultVal.getClass();
+ ignore = false;
+ vp = new DummyVisualProperty(defaultVal, id, displayName);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testDummyVisualProperty() {
+ DummyVisualProperty dummy1 = null;
+ try {
+ dummy1 = new DummyVisualProperty(null, id, displayName);
+ } catch(Exception ex) {
+ assertNull(dummy1);
+ assertEquals(NullPointerException.class, ex.getClass());
+ }
+
+ DummyVisualProperty dummy2 = null;
+ try {
+ dummy2 = new DummyVisualProperty(defaultVal, null,
displayName);
+ } catch(Exception ex) {
+ assertNull(dummy2);
+ assertEquals(NullPointerException.class, ex.getClass());
+ }
+
+ DummyVisualProperty dummy3 = null;
+ try {
+ dummy3 = new DummyVisualProperty(defaultVal, id, null);
+ } catch(Exception ex) {
+ assertNull(dummy3);
+ assertEquals(NullPointerException.class, ex.getClass());
+ }
+
+ assertNotNull(vp);
+ }
+
+
+ @Test
+ public void testToSerializableString() {
+ assertNotNull(vp.toSerializableString(new DummyObject()));
+ }
+
+ @Test
+ public void testParseSerializableString() {
+ final DummyObject newObject =
vp.parseSerializableString("test");
+ assertTrue(newObject instanceof DummyObject);
+ }
+}
Added:
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/ViewModelEventsTest.java
===================================================================
---
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/ViewModelEventsTest.java
(rev 0)
+++
core3/viewmodel-api/trunk/src/test/java/org/cytoscape/view/model/ViewModelEventsTest.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,60 @@
+package org.cytoscape.view.model;
+
+
+import org.cytoscape.event.CyEventHelper;
+import org.cytoscape.model.CyEdge;
+import org.cytoscape.model.CyNode;
+import org.cytoscape.view.model.events.AddedEdgeViewEvent;
+import org.cytoscape.view.model.events.AddedNodeViewEvent;
+import org.cytoscape.view.model.events.FitContentEvent;
+import org.cytoscape.view.model.events.FitSelectedEvent;
+import org.cytoscape.view.model.events.UpdateNetworkPresentationEvent;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+public class ViewModelEventsTest {
+
+ CyEventHelper helper;
+
+ @Before
+ public void setUp() throws Exception {
+
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testEvents() {
+ final View<CyNode> nodeView = createMock(View.class);
+ final CyNetworkView networkView =
createMock(CyNetworkView.class);
+ AddedNodeViewEvent ev1 = new AddedNodeViewEvent(networkView,
nodeView);
+
+ assertEquals(nodeView, ev1.getNodeView());
+ assertEquals(networkView, ev1.getSource());
+
+ final View<CyEdge> edgeView = createMock(View.class);
+ AddedEdgeViewEvent ev2 = new AddedEdgeViewEvent(networkView,
edgeView);
+
+ assertEquals(edgeView, ev2.getEdgeView());
+ assertEquals(networkView, ev2.getSource());
+
+ UpdateNetworkPresentationEvent ev3 = new
UpdateNetworkPresentationEvent(networkView);
+ assertEquals(networkView, ev3.getSource());
+
+ FitSelectedEvent ev4 = new FitSelectedEvent(networkView);
+ assertEquals(networkView, ev4.getSource());
+
+ FitContentEvent ev5 = new FitContentEvent(networkView);
+ assertEquals(networkView, ev5.getSource());
+
+ }
+
+
+
+}
Modified:
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
===================================================================
---
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -27,7 +27,7 @@
import org.cytoscape.view.model.events.FitContentEvent;
import org.cytoscape.view.model.events.FitSelectedEvent;
import org.cytoscape.view.model.events.NetworkViewChangeMicroListener;
-import org.cytoscape.view.model.events.NetworkViewChangedEvent;
+import org.cytoscape.view.model.events.UpdateNetworkPresentationEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -164,7 +164,7 @@
public void updateView() {
logger.debug("Firing update view event from: View ID = " +
this.suid);
- cyEventHelper.fireSynchronousEvent( new
NetworkViewChangedEvent(this));
+ cyEventHelper.fireSynchronousEvent( new
UpdateNetworkPresentationEvent(this));
}
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-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/AbstractVisualPropertyEditor.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -55,8 +55,7 @@
public abstract class AbstractVisualPropertyEditor<T> implements
VisualPropertyEditor<T> {
// Target Visual Property.
protected final VisualProperty<T> vp;
-
- protected PropertyEditor propertyEditor;
+ protected final PropertyEditor propertyEditor;
protected Component continuousEditor;
protected Window vpValueEditor;
protected TableCellRenderer tableCellRenderer;
@@ -66,8 +65,9 @@
*
* @param vp DOCUMENT ME!
*/
- public AbstractVisualPropertyEditor(VisualProperty<T> vp) {
+ public AbstractVisualPropertyEditor(VisualProperty<T> vp, final
PropertyEditor propertyEditor) {
this.vp = vp;
+ this.propertyEditor = propertyEditor;
}
/**
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-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/ColorVisualPropertyEditor.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -56,11 +56,10 @@
* Constructor. Should instantiate one editor per VisualProperty.
*/
public ColorVisualPropertyEditor(VisualProperty<Color> vp, CyTable
attr) {
- super(vp);
+ super(vp, new CyColorPropertyEditor());
tableCellRenderer = new DefaultTableCellRenderer();
//FIXME
continuousEditor = new GradientEditorPanel(this.vp, null, attr);
- propertyEditor = new CyColorPropertyEditor();
}
/**
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-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/EditorManagerImpl.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -49,6 +49,7 @@
import javax.swing.table.TableCellRenderer;
+import org.cytoscape.view.model.VisualLexicon;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.gui.MappingFunctionFactoryManager;
import org.cytoscape.view.vizmap.gui.editor.EditorManager;
@@ -107,10 +108,8 @@
* org.cytoscape.vizmap.gui.editors.EditorFactory#addEditorDisplayer(org
* .cytoscape.vizmap.gui.editors.EditorDisplayer, java.util.Map)
*/
- @SuppressWarnings("unchecked")
- public void addValueEditor(ValueEditor<?> ve, Map properties) {
- logger.debug("Got Value Editor "
- + ve.toString() + ", this is for " +
ve.getType() + "\n\n\n");
+ public void addValueEditor(ValueEditor<?> ve,
@SuppressWarnings("rawtypes") Map properties) {
+ logger.debug("Got Value Editor " + ve.toString() + ", this is
for " + ve.getType() + "\n\n\n");
this.valueEditors.put(ve.getType(), ve);
}
@@ -121,12 +120,14 @@
* org.cytoscape.vizmap.gui.editors.EditorFactory#removeEditorDisplayer(
* org.cytoscape.vizmap.gui.editors.EditorDisplayer, java.util.Map)
*/
- @SuppressWarnings("unchecked")
- public void removeValueEditor(ValueEditor<?> lexicon, Map properties) {
- logger.debug("************* Removing Lexicon ****************");
- valueEditors.remove(lexicon.getType());
+ public void removeValueEditor(ValueEditor<?> valueEditor,
@SuppressWarnings("rawtypes") Map properties) {
+ logger.debug("************* Removing Value Editor
****************");
+ valueEditors.remove(valueEditor.getType());
}
+
+
+
// private <T> VisualPropertyEditor<T> findEditor(VisualProperty<T> type)
{
// final Class<T> dataType = type.getType();
@@ -167,8 +168,7 @@
*
org.cytoscape.vizmap.gui.editors.EditorFactory#showContinuousEditor(java
* .awt.Component, org.cytoscape.viewmodel.VisualProperty)
*/
- public <V> void showContinuousEditor(Component parentComponent,
- VisualProperty<V> type) throws Exception {
+ public <V> void showContinuousEditor(Component parentComponent,
VisualProperty<V> type) throws Exception {
final VisualPropertyEditor<?> editor = editors.get(type);
assert editor.getVisualProperty() == type;
@@ -184,8 +184,7 @@
}
@SuppressWarnings("unchecked")
- public <V> VisualPropertyEditor<V> getVisualPropertyEditor(
- VisualProperty<V> vp) {
+ public <V> VisualPropertyEditor<V> getVisualPropertyEditor(final
VisualProperty<V> vp) {
return (VisualPropertyEditor<V>) editors.get(vp);
}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/FontVisualPropertyEditor.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/FontVisualPropertyEditor.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/FontVisualPropertyEditor.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -2,23 +2,18 @@
package org.cytoscape.view.vizmap.gui.internal.editor;
-import java.awt.Component;
import java.awt.Font;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.gui.VizMapGUI;
import org.cytoscape.view.vizmap.gui.editor.EditorManager;
-//import org.cytoscape.view.vizmap.gui.internal.cellrenderer.FontCellRenderer;
-//import
org.cytoscape.view.vizmap.gui.internal.editor.mappingeditor.C2DMappingEditor;
import
org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor.CyFontPropertyEditor;
-import org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.FontEditor;
public class FontVisualPropertyEditor extends
AbstractVisualPropertyEditor<Font> {
public FontVisualPropertyEditor(VisualProperty<Font> vp, EditorManager
editorManager, VizMapGUI vizMapGUI) {
- super(vp);
- this.propertyEditor= new CyFontPropertyEditor();
+ super(vp, new CyFontPropertyEditor());
// this.tableCellRenderer = new FontCellRenderer();
// this.continuousEditor = new C2DMappingEditor<Font>(this.vp,
editorManager, vizMapGUI);
}
Modified:
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-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/NumberVisualPropertyEditor.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -38,10 +38,8 @@
import javax.swing.table.DefaultTableCellRenderer;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableManager;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.gui.SelectedVisualStyleManager;
-import org.cytoscape.view.vizmap.gui.VizMapGUI;
import
org.cytoscape.view.vizmap.gui.internal.editor.mappingeditor.C2CMappingEditor;
import
org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor.CyDoublePropertyEditor;
@@ -54,8 +52,7 @@
* Creates a new DiscreteNumber object.
*/
public NumberVisualPropertyEditor(VisualProperty<Number> vp, final
SelectedVisualStyleManager manager, CyTable attr) {
- super(vp);
- propertyEditor = new CyDoublePropertyEditor(null);
+ super(vp, new CyDoublePropertyEditor(null));
tableCellRenderer = new DefaultTableCellRenderer();
continuousEditor = new C2CMappingEditor<Number,
Number>(this.vp, manager, attr);
}
Added:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/VisualPropertyEditorBuilderImpl.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/VisualPropertyEditorBuilderImpl.java
(rev 0)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/VisualPropertyEditorBuilderImpl.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -0,0 +1,14 @@
+package org.cytoscape.view.vizmap.gui.internal.editor;
+
+import org.cytoscape.view.model.VisualProperty;
+import org.cytoscape.view.vizmap.gui.editor.VisualPropertyEditor;
+
+public class VisualPropertyEditorBuilderImpl {
+
+ public <T> VisualPropertyEditor<T> buildEditor(final VisualProperty<T>
vp) {
+
+ return null;
+
+ }
+
+}
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CMappingEditor.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CMappingEditor.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CMappingEditor.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -78,7 +78,7 @@
* @param type
* DOCUMENT ME!
*/
- public C2CMappingEditor(VisualProperty<V> type, final
SelectedVisualStyleManager manager, CyTable attr) {
+ public C2CMappingEditor(VisualProperty<V> type, final
SelectedVisualStyleManager manager, final CyTable attr) {
super(type, manager, attr);
abovePanel.setVisible(false);
belowPanel.setVisible(false);
Modified:
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/ContinuousMappingEditorPanel.java
===================================================================
---
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/ContinuousMappingEditorPanel.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/ContinuousMappingEditorPanel.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -53,13 +53,11 @@
import javax.swing.event.ChangeListener;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableManager;
import org.cytoscape.session.CyNetworkManager;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.VisualMappingFunction;
import org.cytoscape.view.vizmap.VisualMappingManager;
import org.cytoscape.view.vizmap.gui.SelectedVisualStyleManager;
-import org.cytoscape.view.vizmap.gui.VizMapGUI;
import org.cytoscape.view.vizmap.mappings.BoundaryRangeValues;
import org.cytoscape.view.vizmap.mappings.ContinuousMapping;
import org.cytoscape.view.vizmap.mappings.ContinuousMappingPoint;
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-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-gui-impl/trunk/src/main/resources/META-INF/spring/bundle-context-vizmapper.xml
2010-10-20 23:49:05 UTC (rev 22323)
@@ -97,12 +97,7 @@
/> -->
<!-- Value Chooser/Editors -->
- <bean id="colorEditor"
-
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.CyColorChooser"
/>
- <bean id="fontEditor"
-
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.FontEditor" />
-
<bean id="doubleClass" class="java.lang.Class" factory-method="forName">
<constructor-arg value="java.lang.Double" />
</bean>
@@ -115,11 +110,18 @@
<bean id="stringClass" class="java.lang.Class" factory-method="forName">
<constructor-arg value="java.lang.String" />
</bean>
+
+ <bean id="colorEditor"
+
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.CyColorChooser"
/>
+ <bean id="fontEditor"
+
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.FontEditor" />
+
<bean id="doubleValueEditor"
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.NumericValueEditor">
<constructor-arg ref="doubleClass" />
</bean>
+
<bean id="integerValueEditor"
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.NumericValueEditor">
<constructor-arg ref="integerClass" />
@@ -133,6 +135,7 @@
class="org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.StringValueEditor">
<constructor-arg ref="stringClass" />
</bean>
+
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-10-20 23:33:29 UTC (rev 22322)
+++
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleImpl.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -264,7 +264,7 @@
// Mapping is available for this VP. Apply it.
for (Object view : views)
mapping.apply((View<? extends CyTableEntry>)
view);
- } else if (!vp.isIgnoreDefault()) {
+ } else if (!vp.shouldIgnoreDefault()) {
// Ignore defaults flag is OFF. Apply defaults.
applyStyleDefaults((Collection<View<?>>) views, vp);
} else
Modified:
cytoscape3/trunk/application/src/main/java/cytoscape/internal/actions/PrintAction.java
===================================================================
---
cytoscape3/trunk/application/src/main/java/cytoscape/internal/actions/PrintAction.java
2010-10-20 23:33:29 UTC (rev 22322)
+++
cytoscape3/trunk/application/src/main/java/cytoscape/internal/actions/PrintAction.java
2010-10-20 23:49:05 UTC (rev 22323)
@@ -45,6 +45,7 @@
import java.awt.event.ActionEvent;
import java.awt.print.PrinterJob;
import java.util.Properties;
+import java.util.Set;
import javax.swing.event.MenuEvent;
@@ -88,9 +89,10 @@
RenderingEngine engine =
cyNetworkMgr.getCurrentRenderingEngine();
PrinterJob printJob = PrinterJob.getPrinterJob();
+ final Set<Object> keys = props.keySet();
+ for(Object key: keys)
+ engine.getProperties().put(key, props.get(key));
- engine.setProperties(props);
-
printJob.setPrintable(engine.createPrintable());
if (printJob.printDialog()) {
--
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.