Search in sources :

Example 1 with UpdateNetworkPresentationEvent

use of org.cytoscape.view.model.events.UpdateNetworkPresentationEvent in project cytoscape-impl by cytoscape.

the class DGraphView method updateView.

private void updateView(final boolean forceRedraw) {
    getEventHelper().flushPayloadEvents();
    invokeOnEDTAndWait(() -> {
        if (forceRedraw)
            setContentChanged();
        m_networkCanvas.repaint();
        // Check if image size has changed if so, visual property needs to be changed as well
        if (m_networkCanvas.getWidth() != imageWidth || m_networkCanvas.getHeight() != imageHeight) {
            imageWidth = m_networkCanvas.getWidth();
            imageHeight = m_networkCanvas.getHeight();
            setVisualProperty(BasicVisualLexicon.NETWORK_WIDTH, (double) imageWidth);
            setVisualProperty(BasicVisualLexicon.NETWORK_HEIGHT, (double) imageHeight);
        }
    });
    getEventHelper().fireEvent(new UpdateNetworkPresentationEvent(this));
}
Also used : UpdateNetworkPresentationEvent(org.cytoscape.view.model.events.UpdateNetworkPresentationEvent)

Aggregations

UpdateNetworkPresentationEvent (org.cytoscape.view.model.events.UpdateNetworkPresentationEvent)1