Search in sources :

Example 1 with VisualStyleChangeRecord

use of org.cytoscape.view.vizmap.events.VisualStyleChangeRecord in project EnrichmentMapApp by BaderLab.

the class EMStyleBuilder method updateProperties.

/**
	 * Updates the whole EM style.
	 */
public void updateProperties(VisualStyle vs, EMStyleOptions options, CyCustomGraphics2<?> chart) {
    eventHelper.silenceEventSource(vs);
    try {
        // Network Properties
        vs.setDefaultValue(NETWORK_BACKGROUND_PAINT, Colors.BG_COLOR);
        setEdgeDefaults(vs, options);
        setEdgePaint(vs, options);
        setEdgeWidth(vs, options);
        setEdgeLineType(vs, options);
        String chartName = chart != null ? chart.getDisplayName() : null;
        ChartType chartType = ChartType.toChartType(chartName);
        setNodeDefaults(vs, options, chartType);
        setNodeShapes(vs, options, chartType);
        setNodeSize(vs, options, chartType);
        setNodeBorderColors(vs, options);
        setNodeColors(vs, options);
        setNodeLabels(vs, options);
        setNodeTooltip(vs, options);
        setNodeChart(vs, chart);
        if (options.isPublicationReady()) {
            vs.removeVisualMappingFunction(BasicVisualLexicon.NODE_LABEL);
            vs.setDefaultValue(BasicVisualLexicon.NODE_LABEL, "");
            vs.setDefaultValue(BasicVisualLexicon.NETWORK_BACKGROUND_PAINT, Color.WHITE);
        }
    } finally {
        eventHelper.unsilenceEventSource(vs);
        eventHelper.addEventPayload(vs, new VisualStyleChangeRecord(), VisualStyleChangedEvent.class);
    }
}
Also used : VisualStyleChangeRecord(org.cytoscape.view.vizmap.events.VisualStyleChangeRecord)

Example 2 with VisualStyleChangeRecord

use of org.cytoscape.view.vizmap.events.VisualStyleChangeRecord in project EnrichmentMapApp by BaderLab.

the class EMStyleBuilder method updateNodeChart.

public void updateNodeChart(VisualStyle vs, EMStyleOptions options, CyCustomGraphics2<?> chart) {
    eventHelper.silenceEventSource(vs);
    try {
        String chartName = chart != null ? chart.getDisplayName() : null;
        ChartType chartType = ChartType.toChartType(chartName);
        setNodeChartDefaults(vs, chartType);
        setNodeShapes(vs, options, chartType);
        setNodeSize(vs, options, chartType);
        setNodeChart(vs, chart);
    } finally {
        eventHelper.unsilenceEventSource(vs);
        eventHelper.addEventPayload(vs, new VisualStyleChangeRecord(), VisualStyleChangedEvent.class);
    }
}
Also used : VisualStyleChangeRecord(org.cytoscape.view.vizmap.events.VisualStyleChangeRecord)

Aggregations

VisualStyleChangeRecord (org.cytoscape.view.vizmap.events.VisualStyleChangeRecord)2