Search in sources :

Example 16 with SimpleHtmlFigure

use of org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure in project tdi-studio-se by Talend.

the class NodeLabelEditPart method createFigure.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
     */
@Override
public IFigure createFigure() {
    String text = ((NodeLabel) getModel()).getLabelText();
    SimpleHtmlFigure htmlFig = new SimpleHtmlFigure();
    htmlFig.setText(text);
    if (((NodeLabel) getModel()).isActivate()) {
        (htmlFig).setAlpha(-1);
    } else {
        (htmlFig).setAlpha(NodeLabel.ALPHA_VALUE);
    }
    ((NodeLabel) getModel()).setLabelSize(htmlFig.getPreferredSize());
    return htmlFig;
}
Also used : SimpleHtmlFigure(org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)

Aggregations

SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)16 Point (org.eclipse.draw2d.geometry.Point)8 Entry (java.util.Map.Entry)4 Dimension (org.eclipse.draw2d.geometry.Dimension)4 Image (org.eclipse.swt.graphics.Image)4 ECoreImage (org.talend.commons.ui.runtime.image.ECoreImage)4 Figure (org.eclipse.draw2d.Figure)3 ImageFigure (org.eclipse.draw2d.ImageFigure)3 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)3 List (java.util.List)2 ActionEvent (org.eclipse.draw2d.ActionEvent)2 ActionListener (org.eclipse.draw2d.ActionListener)2 IFigure (org.eclipse.draw2d.IFigure)2 LineBorder (org.eclipse.draw2d.LineBorder)2 RectangleFigure (org.eclipse.draw2d.RectangleFigure)2 RoundedRectangle (org.eclipse.draw2d.RoundedRectangle)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)2 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)2 EImage (org.talend.commons.ui.runtime.image.EImage)2