Search in sources :

Example 1 with FreeformLayout

use of org.eclipse.draw2d.FreeformLayout 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 FreeformLayout

use of org.eclipse.draw2d.FreeformLayout 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 3 with FreeformLayout

use of org.eclipse.draw2d.FreeformLayout in project yamcs-studio by yamcs.

the class DisplayEditpart method doCreateFigure.

@Override
protected IFigure doCreateFigure() {
    Figure f = new FreeformLayer() {

        @Override
        protected void paintFigure(Graphics graphics) {
            super.paintFigure(graphics);
            if (getExecutionMode() == ExecutionMode.EDIT_MODE && ((DisplayModel) getModel()).isShowEditRange()) {
                graphics.pushState();
                graphics.setLineStyle(SWT.LINE_DASH);
                graphics.setForegroundColor(ColorConstants.black);
                graphics.drawRectangle(new Rectangle(new Point(0, 0), getWidgetModel().getSize()));
                graphics.popState();
            }
        }
    };
    // f.setBorder(new MarginBorder(3));
    f.setLayoutManager(new FreeformLayout());
    return f;
}
Also used : Graphics(org.eclipse.draw2d.Graphics) FreeformLayout(org.eclipse.draw2d.FreeformLayout) Rectangle(org.eclipse.draw2d.geometry.Rectangle) Point(org.eclipse.draw2d.geometry.Point) FreeformLayer(org.eclipse.draw2d.FreeformLayer) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Example 4 with FreeformLayout

use of org.eclipse.draw2d.FreeformLayout in project jbosstools-hibernate by jbosstools.

the class DiagramEditPart method createFigure.

protected IFigure createFigure() {
    Figure f = new FreeformLayer();
    f.setBorder(new MarginBorder(3));
    f.setLayoutManager(new FreeformLayout());
    if (isManhattanConnectionRouter()) {
        getOrmDiagram().setupFanConnectionRouter();
        setupManhattanConnectionRouter();
    } else {
        getOrmDiagram().setupManhattanConnectionRouter();
        setupFanConnectionRouter();
    }
    return f;
}
Also used : FreeformLayout(org.eclipse.draw2d.FreeformLayout) MarginBorder(org.eclipse.draw2d.MarginBorder) FreeformLayer(org.eclipse.draw2d.FreeformLayer) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Example 5 with FreeformLayout

use of org.eclipse.draw2d.FreeformLayout in project cubrid-manager by CUBRID.

the class DiagramPart method createFigure.

/**
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 * @return figure
	 */
protected IFigure createFigure() {
    Figure figure = new FreeformLayer();
    figure.setLayoutManager(new FreeformLayout());
    return figure;
}
Also used : FreeformLayout(org.eclipse.draw2d.FreeformLayout) FreeformLayer(org.eclipse.draw2d.FreeformLayer) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Aggregations

FreeformLayout (org.eclipse.draw2d.FreeformLayout)9 Figure (org.eclipse.draw2d.Figure)8 FreeformLayer (org.eclipse.draw2d.FreeformLayer)8 IFigure (org.eclipse.draw2d.IFigure)8 MarginBorder (org.eclipse.draw2d.MarginBorder)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 Graphics (org.eclipse.draw2d.Graphics)1 Polyline (org.eclipse.draw2d.Polyline)1 RoundedRectangle (org.eclipse.draw2d.RoundedRectangle)1 Point (org.eclipse.draw2d.geometry.Point)1 GenericGroupFigure (org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure)1 IProcess2 (org.talend.core.model.process.IProcess2)1 JobletProcessItem (org.talend.core.model.properties.JobletProcessItem)1 SubjobContainerFigure (org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainerFigure)1 SparkStreamingSubjobContainerFigure (org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure)1