Search in sources :

Example 16 with ToolbarLayout

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

the class JobletContainerFigure method initMRFigures.

private void initMRFigures() {
    Node node = this.jobletContainer.getNode();
    if (!node.isMapReduceStart()) {
        return;
    }
    if (node.getMrGroupId() == null) {
        return;
    }
    if (dispose) {
        return;
    }
    Integer mrCount = node.getMrJobInGroupCount();
    if (mrCount == null) {
        mrCount = 1;
    }
    Image image = ImageProvider.getImage(ECoreImage.MRGREEBAR);
    // Image map = ImageProvider.getImage(ECoreImage.MRMAP);
    // Image reduce = ImageProvider.getImage(ECoreImage.MRREDUCE);
    int progressHeight = image.getBounds().height;
    int progressWidth = image.getBounds().width;
    for (int i = 0; i < mrCount; i++) {
        SimpleHtmlFigure progressMap = new SimpleHtmlFigure();
        // progressMap.setOutline(false);
        progressMap.setOpaque(false);
        Label mapTip = new Label();
        mapTip.setText("Map ");
        progressMap.setToolTip(mapTip);
        progressMap.setLayoutManager(new ToolbarLayout(true));
        progressMap.setVisible(false);
        SimpleHtmlFigure mapTitle = new SimpleHtmlFigure();
        mapTitle.setText("<b>Map</b> ");
        mapTitle.setSize(mapTitle.getPreferredSize());
        mapTitle.setOpaque(false);
        RectangleFigure mapGreen = new RectangleFigure();
        mapGreen.setSize(progressWidth, progressHeight);
        mapGreen.setPreferredSize(progressWidth, progressHeight + 5);
        mapGreen.setBorder(new LineBorder(ColorConstants.black, 1));
        mapGreen.setLayoutManager(new ToolbarLayout(true));
        mapGreen.setLocation(new Point(progressMap.getLocation().x + mapTitle.getPreferredSize().width, progressMap.getLocation().y));
        mapGreen.setOpaque(true);
        mapGreen.setAlpha(255);
        mapGreen.setVisible(true);
        progressMap.add(mapTitle, 0);
        progressMap.add(mapGreen, 1);
        progressMap.setSize(mapTitle.getPreferredSize().width + mapGreen.getPreferredSize().width, progressHeight + 2);
        progressMap.setPreferredSize(mapTitle.getPreferredSize().width + mapGreen.getPreferredSize().width, progressHeight + 2);
        mrFigures.put(KEY_MAP + i, progressMap);
        // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        SimpleHtmlFigure progressReduce = new SimpleHtmlFigure();
        // progressReduce.setOutline(false);
        progressReduce.setOpaque(false);
        Label reduceTip = new Label();
        reduceTip.setText("Reduce ");
        progressReduce.setToolTip(reduceTip);
        progressReduce.setLayoutManager(new ToolbarLayout(true));
        progressReduce.setVisible(false);
        SimpleHtmlFigure reduceTitle = new SimpleHtmlFigure();
        reduceTitle.setText("<b>Reduce</b> ");
        reduceTitle.setSize(reduceTitle.getPreferredSize());
        reduceTitle.setOpaque(false);
        RectangleFigure reduceGreen = new RectangleFigure();
        reduceGreen.setSize(progressWidth, progressHeight);
        reduceGreen.setPreferredSize(progressWidth, progressHeight + 5);
        reduceGreen.setBorder(new LineBorder(ColorConstants.black, 1));
        reduceGreen.setLayoutManager(new ToolbarLayout(true));
        reduceGreen.setLocation(new Point(progressReduce.getLocation().x + reduceTitle.getPreferredSize().width, progressReduce.getLocation().y));
        reduceGreen.setOpaque(true);
        reduceGreen.setAlpha(255);
        reduceGreen.setVisible(true);
        progressReduce.add(reduceTitle, 0);
        progressReduce.add(reduceGreen, 1);
        progressReduce.setSize(reduceTitle.getPreferredSize().width + reduceGreen.getPreferredSize().width, progressHeight + 2);
        progressReduce.setPreferredSize(reduceTitle.getPreferredSize().width + reduceGreen.getPreferredSize().width, progressHeight + 2);
        mrFigures.put(KEY_REDUCE + i, progressReduce);
    }
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) RectangleFigure(org.eclipse.draw2d.RectangleFigure) Node(org.talend.designer.core.ui.editor.nodes.Node) LineBorder(org.eclipse.draw2d.LineBorder) Label(org.eclipse.draw2d.Label) Point(org.eclipse.draw2d.geometry.Point) Image(org.eclipse.swt.graphics.Image) EImage(org.talend.commons.ui.runtime.image.EImage) ECoreImage(org.talend.commons.ui.runtime.image.ECoreImage) Point(org.eclipse.draw2d.geometry.Point) SimpleHtmlFigure(org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)

Example 17 with ToolbarLayout

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

the class GlobalMapContainer method createContent.

public void createContent() {
    setLayoutManager(new ToolbarLayout());
    tableFigure = new GlobalMapKeysTable(tableModelManager);
    this.add(tableFigure);
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout)

Example 18 with ToolbarLayout

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

the class InputTreeSettingContainer method createContent.

public void createContent() {
    setLayoutManager(new ToolbarLayout());
    // table
    tableFigure = new InputTreeSettingTable(tableModelManager);
    this.add(tableFigure);
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) InputTreeSettingTable(org.talend.designer.xmlmap.figures.table.InputTreeSettingTable)

Example 19 with ToolbarLayout

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

the class OutputTreeSettingContainer method createContent.

public void createContent() {
    setLayoutManager(new ToolbarLayout());
    // table
    tableFigure = new OutputTreeSettingTable(tableModelManager);
    this.add(tableFigure);
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) OutputTreeSettingTable(org.talend.designer.xmlmap.figures.table.OutputTreeSettingTable)

Example 20 with ToolbarLayout

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

the class TalendConnectionHandle method validate.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.handles.AbstractHandle#validate()
     */
@Override
public void validate() {
    if (isValid()) {
        return;
    }
    removeAll();
    if (this.mainConnector == null) {
        this.mainConnector = new NodeConnectorTool(nodePart).getConnector();
    }
    if (this.mainConnector == null) {
        return;
    }
    Rectangle rec = new Rectangle(0, 0, 12, 12);
    PentagonShape sourceShape = new PentagonShape(this.mainConnector);
    sourceShape.addPoint(new Point(0, 0));
    sourceShape.addPoint(new Point(9, 0));
    sourceShape.addPoint(new Point(11, 4.5));
    sourceShape.addPoint(new Point(11, 6.5));
    sourceShape.addPoint(new Point(9, 11));
    sourceShape.addPoint(new Point(0, 11));
    sourceShape.setFill(true);
    Color whiteColor = ColorUtils.getCacheColor(new RGB(255, 255, 255));
    sourceShape.setBackgroundColor(whiteColor);
    sourceShape.setPreferredSize(rec.getSize());
    if (mainConnector != null) {
        RGB shapeColor = this.mainConnector.getConnectionProperty(this.mainConnector.getDefaultConnectionType()).getRGB();
        sourceShape.setForegroundColor(ColorUtils.getCacheColor(shapeColor));
    }
    sourceShape.setBounds(rec);
    sourceShape.setLayoutManager(new ToolbarLayout());
    add(sourceShape);
    setSize(sourceShape.getPreferredSize());
    super.validate();
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) Color(org.eclipse.swt.graphics.Color) Rectangle(org.eclipse.draw2d.geometry.Rectangle) Point(org.eclipse.draw2d.geometry.Point) RGB(org.eclipse.swt.graphics.RGB)

Aggregations

ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)30 Figure (org.eclipse.draw2d.Figure)14 IFigure (org.eclipse.draw2d.IFigure)11 MarginBorder (org.eclipse.draw2d.MarginBorder)7 LineBorder (org.eclipse.draw2d.LineBorder)6 Rectangle (org.eclipse.draw2d.geometry.Rectangle)5 List (java.util.List)3 ImageFigure (org.eclipse.draw2d.ImageFigure)3 Label (org.eclipse.draw2d.Label)3 Panel (org.eclipse.draw2d.Panel)3 RectangleFigure (org.eclipse.draw2d.RectangleFigure)3 Dimension (org.eclipse.draw2d.geometry.Dimension)3 Point (org.eclipse.draw2d.geometry.Point)3 Image (org.eclipse.swt.graphics.Image)3 ECoreImage (org.talend.commons.ui.runtime.image.ECoreImage)3 SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)3 ScrollPane (org.eclipse.draw2d.ScrollPane)2 IStructureFigure (org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure)2 ITreeElement (org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)2 HeadingFigure (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)2