Search in sources :

Example 16 with IStyleLink

use of org.talend.commons.ui.swt.drawing.link.IStyleLink in project tdi-studio-se by Talend.

the class StyleLinkFactory method getSelectedFilterStyle.

/**
     * DOC amaumont Comment method "getSelectedFilterStyle".
     * 
     * @return
     */
private IStyleLink getSelectedFilterStyle() {
    StyleLink style = new StyleLink();
    setCommonsStyleProperties(style);
    style.setDrawableLink(getZoneToZoneLink(style));
    ExtremityEastArrow eastArrowSource = new ExtremityEastArrow(style);
    style.setExtremity1(eastArrowSource);
    ExtremityEastArrow eastArrowTarget = new ExtremityEastArrow(style);
    eastArrowTarget.setXOffset(-eastArrowTarget.getSize().x);
    style.setExtremity2(eastArrowTarget);
    style.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTED_FILTER_LINK));
    return style;
}
Also used : IStyleLink(org.talend.commons.ui.swt.drawing.link.IStyleLink) StyleLink(org.talend.commons.ui.swt.drawing.link.StyleLink) ExtremityEastArrow(org.talend.commons.ui.swt.drawing.link.ExtremityEastArrow)

Example 17 with IStyleLink

use of org.talend.commons.ui.swt.drawing.link.IStyleLink in project tdi-studio-se by Talend.

the class StyleLinkFactory method getSelectedSameInputZoneStyle.

/**
     * DOC amaumont Comment method "getSelectedSameZoneStyle".
     * 
     * @param foregroundColor
     * @return
     */
public IStyleLink getSelectedSameInputZoneStyle() {
    StyleLink style = new StyleLink();
    setCommonsStyleProperties(style);
    IDrawableLink sameZoneLink = getSameZoneLink(style);
    style.setDrawableLink(sameZoneLink);
    ExtremityWestArrow westArrow = new ExtremityWestArrow(style);
    style.setExtremity1(westArrow);
    ExtremityEastArrow eastArrowTarget = new ExtremityEastArrow(style);
    eastArrowTarget.setXOffset(-eastArrowTarget.getSize().x);
    style.setExtremity2(eastArrowTarget);
    style.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTED_LOOKUP_LINKS));
    return style;
}
Also used : IStyleLink(org.talend.commons.ui.swt.drawing.link.IStyleLink) StyleLink(org.talend.commons.ui.swt.drawing.link.StyleLink) IDrawableLink(org.talend.commons.ui.swt.drawing.link.IDrawableLink) ExtremityWestArrow(org.talend.commons.ui.swt.drawing.link.ExtremityWestArrow) ExtremityEastArrow(org.talend.commons.ui.swt.drawing.link.ExtremityEastArrow)

Example 18 with IStyleLink

use of org.talend.commons.ui.swt.drawing.link.IStyleLink in project tdi-studio-se by Talend.

the class StyleLinkFactory method getStyleLink.

// public static DrawableLinkFactory getInstance() {
// if (instance == null) {
// instance = new DrawableLinkFactory();
// }
// return instance;
// }
//
// public IDrawableLink getDrawableLink(IMapperLink link) {
// IDrawableLink drawableLink = null;
// PointLinkDescriptor pointLinkDescriptorSource = link.getPointLinkDescriptorSource();
// PointLinkDescriptor pointLinkDescriptorTarget = link.getPointLinkDescriptorTarget();
// if (pointLinkDescriptorSource.getZone() != pointLinkDescriptorTarget.getZone()) {
// drawableLink = new HorizontalBezierLink();
// } else if (pointLinkDescriptorSource.getZone() == pointLinkDescriptorTarget.getZone()) {
// drawableLink = new VerticalRoundedCornerLink();
// }
// return drawableLink;
// }
//
public IStyleLink getStyleLink(IMapperLink link) {
    ILinkState linkState = link.getState();
    PointLinkDescriptor pointLinkDescriptorSource = link.getPointLinkDescriptor1();
    PointLinkDescriptor pointLinkDescriptorTarget = link.getPointLinkDescriptor2();
    ITableEntry targetTableEntry = pointLinkDescriptorTarget.getTableEntry();
    boolean targetIsConstraint = false;
    if (targetTableEntry instanceof FilterTableEntry) {
        targetIsConstraint = true;
    }
    IStyleLink style = null;
    if (pointLinkDescriptorSource.getZone() != pointLinkDescriptorTarget.getZone()) {
        if (linkState == LinkState.SELECTED) {
            if (targetIsConstraint) {
                style = selectedFilterStyle;
            } else {
                style = selectedZoneToZoneStyle;
            }
        } else if (linkState == LinkState.UNSELECTED) {
            if (targetIsConstraint) {
                style = unselectedFilterStyle;
            } else {
                style = unselectedZoneToZoneStyle;
            }
        }
    } else if ((pointLinkDescriptorSource.getZone() == Zone.INPUTS || pointLinkDescriptorSource.getZone() == Zone.OUTPUTS) && pointLinkDescriptorSource.getZone() == pointLinkDescriptorTarget.getZone()) {
        if (linkState == LinkState.SELECTED) {
            style = selectedSameInputZoneStyle;
        } else if (linkState == LinkState.UNSELECTED) {
            style = unselectedSameZoneStyle;
        }
    }
    return style;
}
Also used : PointLinkDescriptor(org.talend.designer.abstractmap.ui.visualmap.link.PointLinkDescriptor) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry) ILinkState(org.talend.designer.abstractmap.ui.visualmap.link.ILinkState) FilterTableEntry(org.talend.designer.dbmap.model.tableentry.FilterTableEntry) IStyleLink(org.talend.commons.ui.swt.drawing.link.IStyleLink)

Example 19 with IStyleLink

use of org.talend.commons.ui.swt.drawing.link.IStyleLink in project tdi-studio-se by Talend.

the class StyleLinkFactory method getUnselectedFilterStyle.

/**
     * DOC amaumont Comment method "getSelectedFilterStyle".
     * 
     * @return
     */
private IStyleLink getUnselectedFilterStyle() {
    StyleLink style = new StyleLink();
    setCommonsStyleProperties(style);
    style.setDrawableLink(getZoneToZoneLink(style));
    // ExtremityEastArrow eastArrowSource = new ExtremityEastArrow(style);
    // style.setExtremity1(eastArrowSource);
    ExtremityEastArrow eastArrowTarget = new ExtremityEastArrow(style);
    eastArrowTarget.setXOffset(-eastArrowTarget.getSize().x);
    style.setExtremity2(eastArrowTarget);
    style.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_FILTER_LINK));
    return style;
}
Also used : IStyleLink(org.talend.commons.ui.swt.drawing.link.IStyleLink) StyleLink(org.talend.commons.ui.swt.drawing.link.StyleLink) ExtremityEastArrow(org.talend.commons.ui.swt.drawing.link.ExtremityEastArrow)

Example 20 with IStyleLink

use of org.talend.commons.ui.swt.drawing.link.IStyleLink in project tdi-studio-se by Talend.

the class StyleLinkFactory method getUnselectedZoneToZoneStyle.

/**
     * DOC amaumont Comment method "getNotSelectedSameZoneStyle".
     * 
     * @return
     */
private IStyleLink getUnselectedZoneToZoneStyle() {
    StyleLink style = new StyleLink();
    setCommonsStyleProperties(style);
    style.setDrawableLink(getZoneToZoneLink(style));
    ExtremityEastArrow eastArrowTarget = new ExtremityEastArrow(style);
    eastArrowTarget.setXOffset(-eastArrowTarget.getSize().x);
    style.setExtremity2(eastArrowTarget);
    style.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_ZONE_TO_ZONE_LINK));
    return style;
}
Also used : IStyleLink(org.talend.commons.ui.swt.drawing.link.IStyleLink) StyleLink(org.talend.commons.ui.swt.drawing.link.StyleLink) ExtremityEastArrow(org.talend.commons.ui.swt.drawing.link.ExtremityEastArrow)

Aggregations

IStyleLink (org.talend.commons.ui.swt.drawing.link.IStyleLink)29 ExtremityEastArrow (org.talend.commons.ui.swt.drawing.link.ExtremityEastArrow)14 StyleLink (org.talend.commons.ui.swt.drawing.link.StyleLink)14 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 HashSet (java.util.HashSet)6 Map (java.util.Map)6 Table (org.eclipse.swt.widgets.Table)6 TableItem (org.eclipse.swt.widgets.TableItem)6 IExtremityLink (org.talend.commons.ui.swt.drawing.link.IExtremityLink)6 LinkDescriptor (org.talend.commons.ui.swt.drawing.link.LinkDescriptor)6 List (java.util.List)5 Tree (org.eclipse.swt.widgets.Tree)5 TreeItem (org.eclipse.swt.widgets.TreeItem)5 IDrawableLink (org.talend.commons.ui.swt.drawing.link.IDrawableLink)5 ExtremityWestArrow (org.talend.commons.ui.swt.drawing.link.ExtremityWestArrow)4 Point (org.eclipse.swt.graphics.Point)3 Item (org.eclipse.swt.widgets.Item)3 Color (org.eclipse.swt.graphics.Color)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2