Search in sources :

Example 1 with FreeformLayer

use of org.eclipse.draw2d.FreeformLayer in project tdi-studio-se by Talend.

the class ErDiagramPart method createFigure.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
     */
@Override
protected IFigure createFigure() {
    Figure figure = new FreeformLayer();
    figure.setLayoutManager(new FreeformLayout());
    fig2 = new FreeformLayer();
    getLayer(ErDiagramRootEditPart.PROCESS_BACKGROUND_LAYER).add(fig2);
    return figure;
}
Also used : FreeformLayout(org.eclipse.draw2d.FreeformLayout) FreeformLayer(org.eclipse.draw2d.FreeformLayer) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Example 2 with FreeformLayer

use of org.eclipse.draw2d.FreeformLayer in project tdi-studio-se by Talend.

the class ErDiagramRootEditPart method createScaledLayers.

protected ScalableFreeformLayeredPane createScaledLayers() {
    ScalableFreeformLayeredPane layers = new ScalableFreeformLayeredPane();
    layers.add(new FreeformLayer(), PROCESS_BACKGROUND_LAYER);
    // layers.add(createGridLayer(), GRID_LAYER);
    layers.add(getPrintableLayers(), PRINTABLE_LAYERS);
    layers.add(new FeedbackLayer(), SCALED_FEEDBACK_LAYER);
    return layers;
}
Also used : ScalableFreeformLayeredPane(org.eclipse.draw2d.ScalableFreeformLayeredPane) FreeformLayer(org.eclipse.draw2d.FreeformLayer)

Example 3 with FreeformLayer

use of org.eclipse.draw2d.FreeformLayer in project tdi-studio-se by Talend.

the class SubjobContainerPart method createFigure.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
     */
@Override
protected IFigure createFigure() {
    SubjobContainer container = (SubjobContainer) this.getModel();
    Boolean isDisplaySubjobs = (container).isDisplayed();
    if (!isDisplaySubjobs) {
        Figure figure = new FreeformLayer();
        figure.setLayoutManager(new FreeformLayout());
        return figure;
    }
    IProcess2 process = container.getProcess();
    //$NON-NLS-1$
    Object obj = process.getAdditionalProperties().get("FRAMEWORK");
    SubjobContainerFigure subjobContainer = null;
    if ("Spark Streaming".equals(obj) && !(process.getProperty().getItem() instanceof JobletProcessItem)) {
        //$NON-NLS-1$
        subjobContainer = new SparkStreamingSubjobContainerFigure(container);
    } else {
        subjobContainer = new SubjobContainerFigure(container);
    }
    return subjobContainer;
}
Also used : SparkStreamingSubjobContainerFigure(org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure) FreeformLayout(org.eclipse.draw2d.FreeformLayout) JobletProcessItem(org.talend.core.model.properties.JobletProcessItem) SparkStreamingSubjobContainerFigure(org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure) IProcess2(org.talend.core.model.process.IProcess2) FreeformLayer(org.eclipse.draw2d.FreeformLayer) IFigure(org.eclipse.draw2d.IFigure) SparkStreamingSubjobContainerFigure(org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure) Figure(org.eclipse.draw2d.Figure)

Example 4 with FreeformLayer

use of org.eclipse.draw2d.FreeformLayer in project tdi-studio-se by Talend.

the class TalendScalableFreeformRootEditPart method createScaledLayers.

@Override
protected ScalableFreeformLayeredPane createScaledLayers() {
    ScalableFreeformLayeredPane layers = new ScalableFreeformLayeredPane();
    layers.add(new FreeformLayer(), SUBJOB_BACKGROUND_LAYER);
    layers.add(new FreeformLayer(), PROCESS_BACKGROUND_LAYER);
    layers.add(createGridLayer(), GRID_LAYER);
    layers.add(getPrintableLayers(), PRINTABLE_LAYERS);
    layers.add(new FreeformLayer(), MAP_REDUCE_LAYER);
    layers.add(new FreeformLayer(), SelectionFeedbackEditPolicy.TALEND_FEEDBACK_LAYER);
    layers.add(new FeedbackLayer(), SCALED_FEEDBACK_LAYER);
    feedbackLayer = new FeedbackLayer();
    return layers;
}
Also used : ScalableFreeformLayeredPane(org.eclipse.draw2d.ScalableFreeformLayeredPane) FreeformLayer(org.eclipse.draw2d.FreeformLayer)

Example 5 with FreeformLayer

use of org.eclipse.draw2d.FreeformLayer in project tdi-studio-se by Talend.

the class BusinessDiagramEditor method configureGraphicalViewer.

/**
     * @generated
     */
@Override
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    IDiagramGraphicalViewer viewer = getDiagramGraphicalViewer();
    // customize popup menu
    ContextMenuProvider provider = new BusinessDiagramActionProvider(this, viewer);
    viewer.setContextMenu(provider);
    getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, viewer);
    DiagramRootEditPart root = (DiagramRootEditPart) getDiagramGraphicalViewer().getRootEditPart();
    LayeredPane printableLayers = (LayeredPane) root.getLayer(LayerConstants.PRINTABLE_LAYERS);
    FreeformLayer extLabelsLayer = new FreeformLayer();
    extLabelsLayer.setLayoutManager(new DelegatingLayout());
    printableLayers.addLayerAfter(extLabelsLayer, BusinessEditPartFactory.EXTERNAL_NODE_LABELS_LAYER, LayerConstants.PRIMARY_LAYER);
    LayeredPane scalableLayers = (LayeredPane) root.getLayer(LayerConstants.SCALABLE_LAYERS);
    FreeformLayer scaledFeedbackLayer = new FreeformLayer();
    scaledFeedbackLayer.setEnabled(false);
    scalableLayers.addLayerAfter(scaledFeedbackLayer, LayerConstants.SCALED_FEEDBACK_LAYER, DiagramRootEditPart.DECORATION_UNPRINTABLE_LAYER);
}
Also used : IDiagramGraphicalViewer(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer) DelegatingLayout(org.eclipse.draw2d.DelegatingLayout) LayeredPane(org.eclipse.draw2d.LayeredPane) FreeformLayer(org.eclipse.draw2d.FreeformLayer) BusinessDiagramActionProvider(org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider) DiagramRootEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart)

Aggregations

FreeformLayer (org.eclipse.draw2d.FreeformLayer)25 Figure (org.eclipse.draw2d.Figure)10 IFigure (org.eclipse.draw2d.IFigure)10 FreeformLayout (org.eclipse.draw2d.FreeformLayout)8 ScalableFreeformLayeredPane (org.eclipse.draw2d.ScalableFreeformLayeredPane)4 Rectangle (org.eclipse.draw2d.geometry.Rectangle)3 LineLayout (org.eclipse.gemoc.timeline.layout.LineLayout)3 Rectangle (org.eclipse.swt.graphics.Rectangle)3 Test (org.junit.Test)3 ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)2 FreeformLayeredPane (org.eclipse.draw2d.FreeformLayeredPane)2 Label (org.eclipse.draw2d.Label)2 MarginBorder (org.eclipse.draw2d.MarginBorder)2 Image (org.eclipse.swt.graphics.Image)2 Shell (org.eclipse.swt.widgets.Shell)2 DelegatingLayout (org.eclipse.draw2d.DelegatingLayout)1 Graphics (org.eclipse.draw2d.Graphics)1 GridLayout (org.eclipse.draw2d.GridLayout)1 LayeredPane (org.eclipse.draw2d.LayeredPane)1 LineBorder (org.eclipse.draw2d.LineBorder)1