Search in sources :

Example 1 with CustomGraphicsInfo

use of org.cytoscape.graph.render.stateful.CustomGraphicsInfo in project cytoscape-impl by cytoscape.

the class DNodeView method setCustomGraphicsPosition.

@SuppressWarnings("rawtypes")
private void setCustomGraphicsPosition(final VisualProperty<?> vp, final ObjectPosition position) {
    // No need to modify
    if (position == null)
        return;
    final VisualProperty<CyCustomGraphics> parent = getParentCustomGraphicsProperty(vp);
    if (parent == null)
        return;
    synchronized (CG_LOCK) {
        final CustomGraphicsInfo info = getCustomGraphicsInfo(parent);
        info.setPosition(position);
    }
}
Also used : CustomGraphicsInfo(org.cytoscape.graph.render.stateful.CustomGraphicsInfo) CyCustomGraphics(org.cytoscape.view.presentation.customgraphics.CyCustomGraphics)

Example 2 with CustomGraphicsInfo

use of org.cytoscape.graph.render.stateful.CustomGraphicsInfo in project cytoscape-impl by cytoscape.

the class DNodeView method getCustomGraphicsInfo.

/**
 * If a CustomGraphicsInfo for the passed VisualProperty does not exist yet, it creates a new one.
 */
@SuppressWarnings("rawtypes")
private CustomGraphicsInfo getCustomGraphicsInfo(final VisualProperty<CyCustomGraphics> vp) {
    synchronized (CG_LOCK) {
        CustomGraphicsInfo info = cgInfoMap.get(vp);
        if (info == null) {
            info = new CustomGraphicsInfo(vp);
            cgInfoMap.put(vp, info);
        }
        return info;
    }
}
Also used : CustomGraphicsInfo(org.cytoscape.graph.render.stateful.CustomGraphicsInfo)

Example 3 with CustomGraphicsInfo

use of org.cytoscape.graph.render.stateful.CustomGraphicsInfo in project cytoscape-impl by cytoscape.

the class DNodeView method setCustomGraphics.

private void setCustomGraphics(final CustomGraphicsVisualProperty vp, final CyCustomGraphics<CustomGraphicLayer> cg) {
    synchronized (CG_LOCK) {
        final CustomGraphicsInfo info = getCustomGraphicsInfo(vp);
        info.setCustomGraphics(cg);
    }
}
Also used : CustomGraphicsInfo(org.cytoscape.graph.render.stateful.CustomGraphicsInfo)

Example 4 with CustomGraphicsInfo

use of org.cytoscape.graph.render.stateful.CustomGraphicsInfo in project cytoscape-impl by cytoscape.

the class DNodeView method setCustomGraphicsSize.

@SuppressWarnings("rawtypes")
private void setCustomGraphicsSize(final VisualProperty<Double> vp, final Double size) {
    if (size == null)
        return;
    final VisualProperty<CyCustomGraphics> parent = DVisualLexicon.getAssociatedCustomGraphicsVP(vp);
    if (parent == null)
        return;
    synchronized (CG_LOCK) {
        final CustomGraphicsInfo info = getCustomGraphicsInfo(parent);
        info.setSize(size);
    }
}
Also used : CustomGraphicsInfo(org.cytoscape.graph.render.stateful.CustomGraphicsInfo) CyCustomGraphics(org.cytoscape.view.presentation.customgraphics.CyCustomGraphics)

Aggregations

CustomGraphicsInfo (org.cytoscape.graph.render.stateful.CustomGraphicsInfo)4 CyCustomGraphics (org.cytoscape.view.presentation.customgraphics.CyCustomGraphics)2