Search in sources :

Example 1 with Label

use of org.eclipse.draw2d.Label in project cogtool by cogtool.

the class AbstractGraphicalSource method buildToolTip.

public void buildToolTip() {
    if (this.showToolTip) {
        String toolTipText = buildToolTipText(getModel(), getTypeDescription());
        Label toolTipLabel = new Label(" " + toolTipText + " ");
        toolTipLabel.setFont(FontUtils.SYMBOL_FONT);
        setToolTip(toolTipLabel);
    }
}
Also used : Label(org.eclipse.draw2d.Label)

Example 2 with Label

use of org.eclipse.draw2d.Label in project cogtool by cogtool.

the class DesignEditorTransition method buildToolTip.

protected void buildToolTip() {
    if (showToolTip) {
        String transitionAction = transition.getAction().getLocalizedString();
        TransitionSource source = transition.getSource();
        StringBuilder toolTipText = new StringBuilder();
        String sourceName = SWTStringUtil.insertEllipsis(source.getName(), 100, StringUtil.EQUAL, FontUtils.SYMBOL_FONT);
        String sourceFrameName = SWTStringUtil.insertEllipsis(source.getFrame().getName(), 150, StringUtil.NO_FRONT, FontUtils.SYMBOL_FONT);
        String destName = SWTStringUtil.insertEllipsis(transition.getDestination().getName(), StringUtil.NO_FRONT, FontUtils.SYMBOL_FONT);
        toolTipText.append(KeyDisplayUtil.convertActionToDisplay(transitionAction));
        toolTipText.append("\n    " + L10N.get("DE.Source", "Source") + ": ");
        toolTipText.append(sourceName + " (" + sourceFrameName + ")");
        toolTipText.append("\n    " + L10N.get("DE.Target", "Target") + ": ");
        toolTipText.append(destName);
        Label toolTipLabel = new Label(" " + toolTipText.toString() + " ");
        toolTipLabel.setFont(FontUtils.SYMBOL_FONT);
        setToolTip(toolTipLabel);
    }
}
Also used : TransitionSource(edu.cmu.cs.hcii.cogtool.model.TransitionSource) Label(org.eclipse.draw2d.Label)

Example 3 with Label

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

the class XmlMapDataEditPart method performRequest.

@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_DIRECT_EDIT.equals(req.getType())) {
        DirectEditRequest drequest = (DirectEditRequest) req;
        Point figureLocation = drequest.getLocation();
        IFigure findFigureAt = getFigure().findFigureAt(figureLocation.x, figureLocation.y);
        if (findFigureAt != null && findFigureAt instanceof Label) {
            directEditManager = new XmlMapNodeDirectEditManager(this, new XmlMapNodeCellEditorLocator((Figure) findFigureAt));
            directEditManager.show();
        }
        if (directEditManager != null) {
            if (findFigureAt != null && findFigureAt instanceof Label) {
                if (figure.containsPoint(figureLocation)) {
                    directEditManager.show();
                    ((XmlMapGraphicViewer) getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
                }
            }
        }
    }
}
Also used : XmlMapNodeDirectEditManager(org.talend.designer.xmlmap.parts.directedit.XmlMapNodeDirectEditManager) XmlMapNodeCellEditorLocator(org.talend.designer.gefabstractmap.part.directedit.XmlMapNodeCellEditorLocator) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) Label(org.eclipse.draw2d.Label) Point(org.eclipse.draw2d.geometry.Point) IFigure(org.eclipse.draw2d.IFigure)

Example 4 with Label

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

the class MonitorConnectionLabelPart method refreshVisuals.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
     */
@Override
protected void refreshVisuals() {
    String text = ((MonitorConnectionLabel) getModel()).getLabelText();
    Label figure = (Label) getFigure();
    // figure.setIcon(null); //TODO add icon to it
    figure.setText(text);
    figure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
    ConnectionPart parent = (ConnectionPart) getParent();
    PolylineConnection connFigure = (PolylineConnection) parent.getFigure();
    //$NON-NLS-1$
    MonitorConnectionLabelConstraint constraint = new MonitorConnectionLabelConstraint(text, "center", null, connFigure);
    parent.setLayoutConstraint(this, getFigure(), constraint);
}
Also used : Label(org.eclipse.draw2d.Label) PolylineConnection(org.eclipse.draw2d.PolylineConnection)

Example 5 with Label

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

the class OutputZoneToolBar method setTooltips.

private void setTooltips() {
    Label tooltip = new Label();
    tooltip.setText("Add output table");
    add_btn.setToolTip(tooltip);
    tooltip = new Label();
    tooltip.setText("Remove selected output table");
    remove_btn.setToolTip(tooltip);
    tooltip = new Label();
    tooltip.setText("Move up selected output table");
    move_up.setToolTip(tooltip);
    tooltip = new Label();
    tooltip.setText("Move down selected output table");
    move_down.setToolTip(tooltip);
    tooltip = new Label();
    tooltip.setText("Minimize all output tables");
    min_size.setToolTip(tooltip);
    tooltip = new Label();
    tooltip.setText("Map automatically inputs and outputs (for empty expressions only)");
    auto_map.setToolTip(tooltip);
}
Also used : Label(org.eclipse.draw2d.Label)

Aggregations

Label (org.eclipse.draw2d.Label)92 Point (org.eclipse.draw2d.geometry.Point)10 Rectangle (org.eclipse.draw2d.geometry.Rectangle)10 IFigure (org.eclipse.draw2d.IFigure)9 Image (org.eclipse.swt.graphics.Image)8 Font (org.eclipse.swt.graphics.Font)7 LineBorder (org.eclipse.draw2d.LineBorder)6 MouseEvent (org.eclipse.draw2d.MouseEvent)6 MouseListener (org.eclipse.draw2d.MouseListener)6 List (java.util.List)5 MarginBorder (org.eclipse.draw2d.MarginBorder)5 PolylineConnection (org.eclipse.draw2d.PolylineConnection)5 Dimension (org.eclipse.draw2d.geometry.Dimension)5 WrapLabel (org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel)5 ArrayList (java.util.ArrayList)4 RectangleFigure (org.eclipse.draw2d.RectangleFigure)4 FontData (org.eclipse.swt.graphics.FontData)4 Figure (org.eclipse.draw2d.Figure)3 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)3 Color (org.eclipse.swt.graphics.Color)3