Search in sources :

Example 6 with MarginBorder

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

the class MapperRootEditPart method createFigure.

@Override
protected IFigure createFigure() {
    Figure mainFigure = new Figure();
    XmlMapDataLayout manager2 = new XmlMapDataLayout(getRootModelManager().getGraphicalViewer());
    mainFigure.setLayoutManager(manager2);
    // input
    Figure inputZone = new Figure();
    inputZone.setLayoutManager(new ZoneLayout());
    inputToolBar = createInputZoneToolBar();
    inputToolBar.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    inputZone.add(inputToolBar);
    inputScroll = new ScrollPane();
    inputScroll.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    leftFigure = new Figure();
    // ToolbarLayout subManager = new ToolbarLayout();
    ToolbarLayout subManager = createZoneContentLayout();
    subManager.setSpacing(20);
    subManager.setVertical(true);
    leftFigure.setLayoutManager(subManager);
    leftFigure.setBorder(new MarginBorder(20, 40, 20, 40));
    inputScroll.getViewport().setContents(leftFigure);
    inputScroll.getViewport().setContentsTracksWidth(true);
    inputZone.add(inputScroll);
    mainFigure.add(inputZone);
    // separator 1
    SashSeparator separatorLeft = new SashSeparator();
    separatorLeft.setImage(ImageProviderMapper.getImage(ImageInfo.ZONE_SASH));
    mainFigure.add(separatorLeft);
    // search , var
    searchToolBar = createSearchZoneToolBar();
    searchToolBar.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    varScroll = new ScrollPane();
    varScroll.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    centerFigure = new Figure();
    subManager = createZoneContentLayout();
    subManager.setSpacing(20);
    subManager.setVertical(true);
    centerFigure.setLayoutManager(subManager);
    centerFigure.setBorder(new MarginBorder(10, 40, 10, 40));
    varScroll.getViewport().setContents(centerFigure);
    varScroll.getViewport().setContentsTracksWidth(true);
    centerFigure.add(searchToolBar);
    mainFigure.add(varScroll);
    // separetor 2
    SashSeparator separatorRight = new SashSeparator();
    separatorRight.setImage(ImageProviderMapper.getImage(ImageInfo.ZONE_SASH));
    mainFigure.add(separatorRight);
    // output
    Figure outputZone = new Figure();
    outputZone.setLayoutManager(new ZoneLayout());
    outputToolBar = createOutputZoneToolBar();
    outputToolBar.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    outputZone.add(outputToolBar);
    outputScroll = new ScrollPane();
    outputScroll.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    rightFigure = new Figure();
    subManager = createZoneContentLayout();
    subManager.setSpacing(20);
    subManager.setVertical(true);
    rightFigure.setLayoutManager(subManager);
    rightFigure.setBorder(new MarginBorder(20, 40, 20, 40));
    outputScroll.getViewport().setContents(rightFigure);
    outputScroll.getViewport().setContentsTracksWidth(true);
    outputZone.add(outputScroll);
    mainFigure.add(outputZone);
    mainFigure.setOpaque(true);
    mainFigure.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_BACKGROUND_LINKS_ZONE));
    separatorLeft.setLeftFigure(inputZone);
    separatorLeft.setRightFigure(varScroll);
    separatorLeft.setParentFigure(mainFigure);
    separatorRight.setLeftFigure(varScroll);
    separatorRight.setRightFigure(outputZone);
    separatorRight.setParentFigure(mainFigure);
    return mainFigure;
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) XmlMapDataLayout(org.talend.designer.gefabstractmap.figures.layout.XmlMapDataLayout) ScrollPane(org.eclipse.draw2d.ScrollPane) LineBorder(org.eclipse.draw2d.LineBorder) MarginBorder(org.eclipse.draw2d.MarginBorder) SashSeparator(org.talend.designer.gefabstractmap.figures.sash.SashSeparator) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Example 7 with MarginBorder

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

the class FilterContainer method createContent.

private void createContent() {
    FilterContainerLayout manager = new FilterContainerLayout();
    manager.setVertical(false);
    manager.setSpacing(5);
    setLayoutManager(manager);
    textArea = new FilterTextArea();
    textArea.setText(tableManager.getExpressionFilter());
    this.add(textArea);
    textArea.setOpaque(true);
    setBackgroundColor(ColorConstants.white);
    button = new ImageFigure(ImageProviderMapper.getImage(ImageInfo.FILTER_BUTTON));
    addButtonListener();
    this.add(button);
    setOpaque(true);
    setBackgroundColor(ColorConstants.yellow);
    setBorder(new MarginBorder(2));
}
Also used : MarginBorder(org.eclipse.draw2d.MarginBorder) ImageFigure(org.eclipse.draw2d.ImageFigure)

Example 8 with MarginBorder

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

the class AbstractTableContainer method createContents.

protected void createContents() {
    setLayoutManager(new TableContainerLayout(tableModelManager));
    this.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    header = new Figure();
    header.setOpaque(true);
    header.setBackgroundColor(ColorConstants.tooltipBackground);
    header.setBorder(new RowBorder());
    header.setLayoutManager(new EqualWidthLayout());
    Label tableName = new Label();
    // tableName.setBorder(new LineBorder(ColorConstants.black));
    tableName.setText(getTreeDisplayName());
    tableName.setFont(FontProviderMapper.getFont(FontInfo.FONT_SYSTEM_BOLD));
    tableName.setLabelAlignment(PositionConstants.LEFT);
    tableName.setBorder(new MarginBorder(5, 10, 5, -1));
    header.add(tableName);
    toolBarContainer = createToolBarContainer();
    header.setOpaque(true);
    header.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.ZONE_BACKGROUND_COLOR));
    this.add(header);
    if (toolBarContainer != null) {
        header.add(toolBarContainer);
    }
    createTreeSettings(this);
    if (withScroll) {
        ScrollPane scroll = new ScrollPane();
        scroll.setVerticalScrollBarVisibility(ScrollPane.NEVER);
        scroll.getViewport().setContents(createTable());
        scroll.getViewport().setContentsTracksWidth(true);
        // ///
        scroll.setBackgroundColor(ColorConstants.white);
        scroll.setOpaque(true);
        this.add(scroll);
    } else {
        this.add(createTable());
    }
}
Also used : RowBorder(org.talend.designer.gefabstractmap.figures.borders.RowBorder) ScrollPane(org.eclipse.draw2d.ScrollPane) LineBorder(org.eclipse.draw2d.LineBorder) MarginBorder(org.eclipse.draw2d.MarginBorder) Label(org.eclipse.draw2d.Label) TableContainerLayout(org.talend.designer.gefabstractmap.figures.layout.TableContainerLayout) EqualWidthLayout(org.talend.designer.gefabstractmap.figures.layout.EqualWidthLayout) IFigure(org.eclipse.draw2d.IFigure) GenericFigure(org.talend.designer.gefabstractmap.figures.GenericFigure) Figure(org.eclipse.draw2d.Figure)

Example 9 with MarginBorder

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

the class ToolBarButtonImageFigure method addLineBorder.

private void addLineBorder() {
    if (getBorder() instanceof MarginBorder) {
        LineBorder outer = new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER));
        CustomCompoundBorder border = new CustomCompoundBorder(outer, getBorder());
        setBorder(border);
    }
}
Also used : MarginBorder(org.eclipse.draw2d.MarginBorder) LineBorder(org.eclipse.draw2d.LineBorder)

Example 10 with MarginBorder

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

the class VarEntityFigure method createVariableContainer.

protected Figure createVariableContainer() {
    Figure container = new Figure();
    // container.setBorder(new RowBorder());
    ToolbarLayout manager = new ToolbarLayout() {

        @Override
        public void layout(IFigure parent) {
            super.layout(parent);
            List children = parent.getChildren();
            if (children.size() == 2) {
                Figure checkImageFigure = (Figure) children.get(0);
                Figure variableFigure = (Figure) children.get(1);
                Rectangle varFigureBounds = variableFigure.getBounds().getCopy();
                int avialableWith = parent.getBounds().width - checkImageFigure.getBounds().width;
                if (avialableWith > varFigureBounds.width) {
                    varFigureBounds.width = avialableWith;
                }
                variableFigure.setBounds(varFigureBounds);
            }
        }
    };
    manager.setVertical(false);
    manager.setStretchMinorAxis(false);
    container.setLayoutManager(manager);
    // if(varNode.)
    Label nullableToolTip = new Label("Nullable");
    if (!isNullable()) {
        checkImage = new ImageFigure(ImageProvider.getImage(EImage.UNCHECKED_ICON));
    } else {
        checkImage = new ImageFigure(ImageProvider.getImage(EImage.CHECKED_ICON));
    }
    checkImage.setToolTip(nullableToolTip);
    variableLabel = new VarNodeTextLabel();
    variableLabel.setText(getVarName());
    variableLabel.setLabelAlignment(PositionConstants.LEFT);
    variableLabel.setBorder(new MarginBorder(2, 5, 2, -1));
    container.add(checkImage);
    container.add(variableLabel);
    addCheckListener();
    return container;
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) VarNodeTextLabel(org.talend.designer.gefabstractmap.figures.VarNodeTextLabel) MarginBorder(org.eclipse.draw2d.MarginBorder) Rectangle(org.eclipse.draw2d.geometry.Rectangle) VarNodeTextLabel(org.talend.designer.gefabstractmap.figures.VarNodeTextLabel) ComboCellLabel(org.talend.designer.gefabstractmap.figures.ComboCellLabel) Label(org.eclipse.draw2d.Label) List(java.util.List) ImageFigure(org.eclipse.draw2d.ImageFigure) IFigure(org.eclipse.draw2d.IFigure) ImageFigure(org.eclipse.draw2d.ImageFigure) TableEntityFigure(org.talend.designer.gefabstractmap.figures.table.entity.TableEntityFigure) Figure(org.eclipse.draw2d.Figure) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

MarginBorder (org.eclipse.draw2d.MarginBorder)10 Figure (org.eclipse.draw2d.Figure)3 IFigure (org.eclipse.draw2d.IFigure)3 LightweightSystem (org.eclipse.draw2d.LightweightSystem)3 LineBorder (org.eclipse.draw2d.LineBorder)3 Viewport (org.eclipse.draw2d.Viewport)3 ScrollableThumbnail (org.eclipse.draw2d.parts.ScrollableThumbnail)3 Canvas (org.eclipse.swt.widgets.Canvas)3 ImageFigure (org.eclipse.draw2d.ImageFigure)2 Label (org.eclipse.draw2d.Label)2 ScrollPane (org.eclipse.draw2d.ScrollPane)2 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)2 List (java.util.List)1 Border (org.eclipse.draw2d.Border)1 MouseEvent (org.eclipse.draw2d.MouseEvent)1 MouseListener (org.eclipse.draw2d.MouseListener)1 Insets (org.eclipse.draw2d.geometry.Insets)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1