Search in sources :

Example 11 with LineBorder

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

the class TableFigure method setHoverEnterState.

public void setHoverEnterState() {
    if (isDisabled()) {
    // do nothing
    } else {
        LineBorder lineBorder = (LineBorder) this.getBorder();
        this.setBackgroundColor(hoverBackgroundColor);
        lineBorder.setColor(hoverBorderColor);
    }
}
Also used : LineBorder(org.eclipse.draw2d.LineBorder)

Example 12 with LineBorder

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

the class TableFigure method setSelectedState.

public void setSelectedState() {
    LineBorder lineBorder = (LineBorder) getBorder();
    this.setBackgroundColor(selectedBackgroundColor);
    lineBorder.setColor(selectedBorderColor);
}
Also used : LineBorder(org.eclipse.draw2d.LineBorder)

Example 13 with LineBorder

use of org.eclipse.draw2d.LineBorder 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 14 with LineBorder

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

the class XmlMapSearchZoneToolBar method createZoneContent.

@Override
public void createZoneContent() {
    super.createZoneContent();
    Label findLabel = new Label("Find :");
    add(findLabel);
    searchText = new VarNodeTextLabel();
    searchText.setDirectEditType(DirectEditType.SERACH);
    // searchText.setText("Enter search text prefix or pattern(*,?)");
    searchText.setLabelAlignment(PositionConstants.LEFT);
    searchText.setBorder(new LineBorder(ColorConstants.gray));
    searchText.setOpaque(true);
    searchText.setBackgroundColor(ColorConstants.white);
    add(searchText);
    this.add(move_down);
    this.add(move_up);
    this.add(hightLightAll);
    move_down.setEnabled(true);
    move_up.setEnabled(true);
}
Also used : VarNodeTextLabel(org.talend.designer.gefabstractmap.figures.VarNodeTextLabel) LineBorder(org.eclipse.draw2d.LineBorder) VarNodeTextLabel(org.talend.designer.gefabstractmap.figures.VarNodeTextLabel) Label(org.eclipse.draw2d.Label)

Example 15 with LineBorder

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

Aggregations

LineBorder (org.eclipse.draw2d.LineBorder)18 Label (org.eclipse.draw2d.Label)6 Figure (org.eclipse.draw2d.Figure)3 IFigure (org.eclipse.draw2d.IFigure)3 MarginBorder (org.eclipse.draw2d.MarginBorder)3 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)3 Image (org.eclipse.swt.graphics.Image)3 ImageFigure (org.eclipse.draw2d.ImageFigure)2 RectangleFigure (org.eclipse.draw2d.RectangleFigure)2 ScrollPane (org.eclipse.draw2d.ScrollPane)2 Point (org.eclipse.draw2d.geometry.Point)2 ECoreImage (org.talend.commons.ui.runtime.image.ECoreImage)2 SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)2 TableFigure (com.cubrid.common.ui.er.figures.TableFigure)1 List (java.util.List)1 Graphics (org.eclipse.draw2d.Graphics)1 MouseEvent (org.eclipse.draw2d.MouseEvent)1 MouseListener (org.eclipse.draw2d.MouseListener)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 Color (org.eclipse.swt.graphics.Color)1