Search in sources :

Example 36 with Label

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

the class BusinessTextNonResizableEditPolicy method getFeedbackBounds.

/**
     * @generated
     */
protected Rectangle getFeedbackBounds() {
    Rectangle bounds;
    if (getHostFigure() instanceof Label) {
        bounds = ((Label) getHostFigure()).getTextBounds();
        bounds.intersect(getHostFigure().getBounds());
    } else {
        bounds = getHostFigure().getBounds().getCopy();
    }
    getHostFigure().getParent().translateToAbsolute(bounds);
    getFeedbackLayer().translateToRelative(bounds);
    return bounds;
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) WrapLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel) Label(org.eclipse.draw2d.Label)

Example 37 with Label

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

the class BusinessTextNonResizableEditPolicy method createSelectionFeedbackFigure.

/**
     * @generated
     */
protected IFigure createSelectionFeedbackFigure() {
    if (getHostFigure() instanceof Label) {
        Label feedbackFigure = new Label();
        feedbackFigure.setOpaque(true);
        feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
        feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
        return feedbackFigure;
    } else {
        RectangleFigure feedbackFigure = new RectangleFigure();
        feedbackFigure.setFill(false);
        return feedbackFigure;
    }
}
Also used : RectangleFigure(org.eclipse.draw2d.RectangleFigure) WrapLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel) Label(org.eclipse.draw2d.Label)

Example 38 with Label

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

the class BusinessTextSelectionEditPolicy method createSelectionFeedbackFigure.

/**
     * @generated
     */
protected IFigure createSelectionFeedbackFigure() {
    if (getHostFigure() instanceof Label) {
        Label feedbackFigure = new Label();
        feedbackFigure.setOpaque(true);
        feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
        feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
        return feedbackFigure;
    } else {
        RectangleFigure feedbackFigure = new RectangleFigure();
        feedbackFigure.setFill(false);
        return feedbackFigure;
    }
}
Also used : RectangleFigure(org.eclipse.draw2d.RectangleFigure) WrapLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel) Label(org.eclipse.draw2d.Label)

Example 39 with Label

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

the class BusinessTextSelectionEditPolicy method updateLabel.

/**
     * @generated
     */
protected void updateLabel(Label target) {
    Label source = (Label) getHostFigure();
    target.setText(source.getText());
    target.setTextAlignment(source.getTextAlignment());
    target.setFont(source.getFont());
}
Also used : WrapLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel) Label(org.eclipse.draw2d.Label)

Example 40 with Label

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

the class BusinessTextSelectionEditPolicy method getFeedbackBounds.

/**
     * @generated
     */
protected Rectangle getFeedbackBounds() {
    Rectangle bounds;
    if (getHostFigure() instanceof Label) {
        bounds = ((Label) getHostFigure()).getTextBounds();
        bounds.intersect(getHostFigure().getBounds());
    } else {
        bounds = getHostFigure().getBounds().getCopy();
    }
    getHostFigure().getParent().translateToAbsolute(bounds);
    getFeedbackLayer().translateToRelative(bounds);
    return bounds;
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) WrapLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel) Label(org.eclipse.draw2d.Label)

Aggregations

Label (org.eclipse.draw2d.Label)56 IFigure (org.eclipse.draw2d.IFigure)8 Rectangle (org.eclipse.draw2d.geometry.Rectangle)8 Point (org.eclipse.draw2d.geometry.Point)7 LineBorder (org.eclipse.draw2d.LineBorder)6 WrapLabel (org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel)6 Image (org.eclipse.swt.graphics.Image)6 MouseEvent (org.eclipse.draw2d.MouseEvent)5 MouseListener (org.eclipse.draw2d.MouseListener)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Figure (org.eclipse.draw2d.Figure)4 RectangleFigure (org.eclipse.draw2d.RectangleFigure)4 Dimension (org.eclipse.draw2d.geometry.Dimension)4 PolylineConnection (org.eclipse.draw2d.PolylineConnection)3 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)3 EImage (org.talend.commons.ui.runtime.image.EImage)3 ComboCellLabel (org.talend.designer.gefabstractmap.figures.ComboCellLabel)3 RowBorder (org.talend.designer.gefabstractmap.figures.borders.RowBorder)3 CompoundBorder (org.eclipse.draw2d.CompoundBorder)2