Search in sources :

Example 6 with IFigure

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

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

the class OutputXmlTreeEditPart 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 IWidgetCell) {
            directEditManager = new XmlMapNodeDirectEditManager(this, new XmlMapNodeCellEditorLocator((Figure) findFigureAt));
            directEditManager.show();
        }
        if (directEditManager != null) {
            if (findFigureAt != null && findFigureAt instanceof FilterTextArea) {
                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) FilterTextArea(org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea) Point(org.eclipse.draw2d.geometry.Point) IWidgetCell(org.talend.designer.gefabstractmap.figures.cells.IWidgetCell) IFigure(org.eclipse.draw2d.IFigure)

Example 8 with IFigure

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

the class TreeNodeEditPart method getSourceConnectionAnchor.

@Override
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
    IFigure figure = null;
    boolean forceDarshDot = false;
    if (getRootAnchor() != null) {
        figure = getRootAnchor();
        forceDarshDot = true;
    } else {
        figure = getFigure();
    }
    if (connection instanceof XmlMapLookupConnectionPart) {
        return new LookupColumnAnchor(figure, connection, entityManger);
    }
    if (connection instanceof XmlMapFilterConnectionPart) {
        return new FilterColumnAnchor(figure, connection, entityManger);
    }
    return new ConnectionColumnAnchor(figure, connection, entityManger, forceDarshDot);
}
Also used : ConnectionColumnAnchor(org.talend.designer.gefabstractmap.figures.anchors.ConnectionColumnAnchor) FilterColumnAnchor(org.talend.designer.gefabstractmap.figures.anchors.FilterColumnAnchor) IFigure(org.eclipse.draw2d.IFigure) LookupColumnAnchor(org.talend.designer.gefabstractmap.figures.anchors.LookupColumnAnchor)

Example 9 with IFigure

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

the class TreeNodeEditPart method getTargetConnectionAnchor.

@Override
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
    IFigure figure = null;
    boolean forceDarshDot = false;
    if (getRootAnchor() != null) {
        figure = getRootAnchor();
        forceDarshDot = true;
    } else {
        figure = getFigure();
    }
    if (connection instanceof XmlMapLookupConnectionPart) {
        return new LookupColumnAnchor(figure, connection, entityManger);
    }
    return new ConnectionColumnAnchor(figure, connection, entityManger, forceDarshDot);
}
Also used : ConnectionColumnAnchor(org.talend.designer.gefabstractmap.figures.anchors.ConnectionColumnAnchor) IFigure(org.eclipse.draw2d.IFigure) LookupColumnAnchor(org.talend.designer.gefabstractmap.figures.anchors.LookupColumnAnchor)

Example 10 with IFigure

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

the class ConnectionTraceEditPart method addChildVisual.

protected void addChildVisual(EditPart childEditPart, int index) {
    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
    getContentPane().add(child, index);
}
Also used : AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

IFigure (org.eclipse.draw2d.IFigure)440 Rectangle (org.eclipse.draw2d.geometry.Rectangle)120 Point (org.eclipse.draw2d.geometry.Point)77 Dimension (org.eclipse.draw2d.geometry.Dimension)56 Figure (org.eclipse.draw2d.Figure)38 List (java.util.List)37 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)35 IWidgetPropertyChangeHandler (org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler)32 Graphics (org.eclipse.draw2d.Graphics)17 Iterator (java.util.Iterator)15 ArrayList (java.util.ArrayList)14 EditPart (org.eclipse.gef.EditPart)13 StackLayout (org.eclipse.draw2d.StackLayout)12 DefaultSizeNodeFigure (org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure)12 NodeFigure (org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure)12 Insets (org.eclipse.draw2d.geometry.Insets)11 INodeFigure (org.whole.lang.ui.figures.INodeFigure)11 MarginBorder (org.eclipse.draw2d.MarginBorder)10 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)10 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)10