use of org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure in project tdi-studio-se by Talend.
the class TreeNodeEditPart method performRequest.
@Override
public void performRequest(Request req) {
if (RequestConstants.REQ_DIRECT_EDIT.equals(req.getType())) {
Figure figure = null;
DirectEditRequest drequest = (DirectEditRequest) req;
Point figureLocation = drequest.getLocation();
if (getFigure() instanceof TableTreeEntityFigure) {
XmlmapTreeNodeFigure treeNodeFigure = (XmlmapTreeNodeFigure) getFigure();
ArrayList collection = new ArrayList();
collection.add(treeNodeFigure.getExpressionFigure());
collection.add(treeNodeFigure.getBranchContent());
figure = (Figure) treeNodeFigure.findFigureAt(figureLocation.x, figureLocation.y, new FigureSearch(collection));
}
if (figure instanceof IWidgetCell) {
directEditManager = new XmlMapNodeDirectEditManager(this, new XmlMapNodeCellEditorLocator(figure, this));
}
if (directEditManager != null) {
TreeNode outputTreeNode = (TreeNode) getModel();
if (figure instanceof ExpressionFigure) {
if (XmlMapUtil.isExpressionEditable(outputTreeNode)) {
Point location = drequest.getLocation();
if (figure.containsPoint(location)) {
directEditManager.show();
((XmlMapGraphicViewer) getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
}
}
} else if (!(((TreeNode) getModel()).eContainer() instanceof AbstractInOutTree)) {
// disable for RC2
// directEditManager.show();
// ((XmlMapGraphicViewer)
// getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
}
}
}
super.performRequest(req);
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure in project tdi-studio-se by Talend.
the class TreeBranchLayout method calculateDepth.
public void calculateDepth() {
int depth = 0;
if (getTreeNodeFigure() != null) {
TableTreeEntityFigure parent = getTreeNodeFigure().getParentEntity();
if (parent != null && parent.getTreeBranch() != null) {
depth += parent.getTreeBranch().getDepth();
}
}
depth++;
setDepth(depth);
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure in project tdi-studio-se by Talend.
the class TreeExpandSupportEditPolicy method activate.
@Override
public void activate() {
super.activate();
TableEntityPart host = (TableEntityPart) getHost();
if (host.getFigure() instanceof TableEntityFigure) {
TableTreeEntityFigure treeNodeFigure = (TableTreeEntityFigure) host.getFigure();
if (treeNodeFigure.getTreeBranch() != null) {
ExpandCollapseFigure ecFigure = treeNodeFigure.getTreeBranch().getExpandCollapseFigure();
if (ecFigure != null) {
ecFigure.addMouseListener(l);
}
}
}
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure in project tdi-studio-se by Talend.
the class TreeExpandSupportEditPolicy method deactivate.
@Override
public void deactivate() {
TableEntityPart host = (TableEntityPart) getHost();
if (host.getFigure() instanceof TableTreeEntityFigure) {
TableTreeEntityFigure treeNodeFigure = (TableTreeEntityFigure) host.getFigure();
if (treeNodeFigure.getTreeBranch() != null) {
ExpandCollapseFigure ecFigure = treeNodeFigure.getTreeBranch().getExpandCollapseFigure();
if (ecFigure != null) {
ecFigure.removeMouseListener(l);
}
}
}
super.deactivate();
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure in project tdi-studio-se by Talend.
the class TreeBranchLayout method paintLines.
public void paintLines(Graphics g) {
int gap = treeBranch.getGaps();
g.setLineStyle(getBranchLineStyle());
IFigure startFig = treeBranch.getTitle();
int x = startFig.getBounds().x + gap;
int y = startFig.getBounds().bottom() - 2;
if (getTreeNodeFigure() != null) {
List children = getTreeNodeFigure().getContents().getChildren();
if (children.size() == 0) {
return;
}
int bottom = y;
for (int i = 0; i < children.size(); i++) {
TableTreeEntityFigure treeNode = (TableTreeEntityFigure) children.get(i);
Rectangle childStartBounds = treeNode.getTreeBranch().getTitle().getBounds();
Point pt = childStartBounds.getLeft();
g.drawLine(x, pt.y, pt.x, pt.y);
bottom = Math.max(bottom, pt.y);
}
g.drawLine(x, y, x, bottom);
}
}
Aggregations