use of org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure in project tdi-studio-se by Talend.
the class DataBusinessItemEditPart method createNodeFigure.
/**
* Creates figure for this edit part.
*
* Body of this method does not depend on settings in generation model so you may safely remove <i>generated</i> tag
* and modify it.
*
* @generated
*/
protected NodeFigure createNodeFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
contentPane = setupContentPane(shape);
return figure;
}
use of org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure in project tdi-studio-se by Talend.
the class BusinessItemShapeEditPart method refreshVisuals.
@Override
public void refreshVisuals() {
super.refreshVisuals();
NodeFigure nodeFigure = getNodeFigure();
for (Object obj : nodeFigure.getChildren()) {
if (obj instanceof BusinessItemShapeFigure) {
BusinessItemShapeFigure shapFigure = (BusinessItemShapeFigure) obj;
for (Object figure : shapFigure.getChildren()) {
if (figure instanceof BusinessItemNameFigure) {
BusinessItemNameFigure nameFigure = (BusinessItemNameFigure) figure;
nameFigure.addMouseMotionListener(new MouseMotionListener() {
@Override
public void mouseMoved(MouseEvent me) {
// TODO Auto-generated method stub
}
@Override
public void mouseHover(MouseEvent me) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent me) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent me) {
elementHelper.updateTooltipFigure(getNodeFigure(), tooltipFigure, editPart);
}
@Override
public void mouseDragged(MouseEvent me) {
// TODO Auto-generated method stub
}
});
EObject object = ((Node) getModel()).getElement();
if (object instanceof BusinessItem) {
BusinessItem item = (BusinessItem) object;
String hAlignment = item.getHAlignment();
if (hAlignment == null) {
hAlignment = BusinessAlignment.LEFT.toString();
}
String vAlignment = item.getVAlignment();
if (vAlignment == null) {
vAlignment = BusinessAlignment.TOP.toString();
}
if (BusinessAlignment.HCENTRE.toString().equals(hAlignment)) {
if (BusinessAlignment.TOP.toString().equals(vAlignment)) {
nameFigure.setAlignment(PositionConstants.TOP);
} else if (BusinessAlignment.BOTTOM.toString().equals(vAlignment)) {
nameFigure.setAlignment(PositionConstants.BOTTOM);
} else {
nameFigure.setAlignment(PositionConstants.CENTER);
}
} else if (BusinessAlignment.VCENTRE.toString().equals(vAlignment)) {
if (BusinessAlignment.LEFT.toString().equals(hAlignment)) {
nameFigure.setAlignment(PositionConstants.LEFT);
} else if (BusinessAlignment.RIGHT.toString().equals(hAlignment)) {
nameFigure.setAlignment(PositionConstants.RIGHT);
} else {
nameFigure.setAlignment(PositionConstants.CENTER);
}
} else {
nameFigure.setAlignment(getPosition(hAlignment, BusinessAlignment.HORIZONTAL, item) | getPosition(vAlignment, BusinessAlignment.VERTICAL, item));
}
}
}
}
}
}
elementHelper.updateTooltipFigure(getNodeFigure(), tooltipFigure, this);
}
Aggregations