本文整理汇总了Java中org.eclipse.gef.GraphicalEditPart.setLayoutConstraint方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalEditPart.setLayoutConstraint方法的具体用法?Java GraphicalEditPart.setLayoutConstraint怎么用?Java GraphicalEditPart.setLayoutConstraint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.GraphicalEditPart
的用法示例。
在下文中一共展示了GraphicalEditPart.setLayoutConstraint方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
@Override
protected void refreshVisuals()
{
GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
GraphicalEditPart parent = (GraphicalEditPart) getParent();
parent.setLayoutConstraint(this, figure, gridData);
GridLayout layoutManager = (GridLayout) getFigure().getLayoutManager();
layoutManager.numColumns =
((ChartSet) parent.getModel()).getOrientation() == Orientation.HORIZONTAL
? getModelChildren().size() : 1;
layoutManager.invalidate();
}
示例2: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
@Override
public void refreshVisuals(){
GraphicalEditPart parent = (GraphicalEditPart)getParent();
if(parent != null){
int validEnums = HyEvolutionUtil.getValidTemporalElements(featureModel.getModel().getEnums(), featureModel.getSelectedDate()).size();
figure.setVisible(validEnums != 0);
parent.setLayoutConstraint(this, figure, getFigureConstraint());
}
}
示例3: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
@Override
public void refreshVisuals() {
final DiagramWalker element = (DiagramWalker) getModel();
setVisible();
final Rectangle rectangle = getRectangle();
final GraphicalEditPart parent = (GraphicalEditPart) getParent();
final IFigure figure = getFigure();
final int[] color = element.getColor();
if (color != null) {
final Color bgColor = DesignResources.getColor(color);
figure.setBackgroundColor(bgColor);
}
parent.setLayoutConstraint(this, figure, rectangle);
}
示例4: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
final public void refreshVisuals() {
refreshChildren();
doRefreshVisuals();
setVisible();
final NodeElement element = (NodeElement) getModel();
final IFigure figure = getFigure();
final int[] color = element.getColor();
if (color != null) {
final ChangeTrackingList changeTrackingList = getDiagram().getChangeTrackingList();
if (changeTrackingList.isCalculated() && (element instanceof Note || element instanceof ERTable)) {
if (changeTrackingList.isAdded(element)) {
figure.setBackgroundColor(Resources.ADDED_COLOR);
} else if (changeTrackingList.getUpdatedNodeElement(element) != null) {
figure.setBackgroundColor(Resources.UPDATED_COLOR);
} else {
figure.setBackgroundColor(ColorConstants.white);
}
} else {
final Color bgColor = Resources.getColor(color);
figure.setBackgroundColor(bgColor);
}
}
final Rectangle rectangle = getRectangle();
final GraphicalEditPart parent = (GraphicalEditPart) getParent();
parent.setLayoutConstraint(this, figure, rectangle);
getFigure().getUpdateManager().performValidation();
element.setActualLocation(toLocation(getFigure().getBounds()));
refreshMovedAnchor();
}
示例5: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
final public void refreshVisuals() {
this.refreshChildren();
this.doRefreshVisuals();
this.setVisible();
NodeElement element = (NodeElement) this.getModel();
IFigure figure = this.getFigure();
int[] color = element.getColor();
if (color != null) {
ChangeTrackingList changeTrackingList = this.getDiagram()
.getChangeTrackingList();
if (changeTrackingList.isCalculated()
&& (element instanceof Note || element instanceof ERTable)) {
if (changeTrackingList.isAdded(element)) {
figure.setBackgroundColor(Resources.ADDED_COLOR);
} else if (changeTrackingList.getUpdatedNodeElement(element) != null) {
figure.setBackgroundColor(Resources.UPDATED_COLOR);
} else {
figure.setBackgroundColor(ColorConstants.white);
}
} else {
Color bgColor = Resources.getColor(color);
figure.setBackgroundColor(bgColor);
}
}
Rectangle rectangle = this.getRectangle();
GraphicalEditPart parent = (GraphicalEditPart) this.getParent();
parent.setLayoutConstraint(this, figure, rectangle);
this.getFigure().getUpdateManager().performValidation();
this.refreshMovedAnchor();
}
示例6: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
@Override
protected void refreshVisuals()
{
axisNameLabel.setName(getAxis().getName());
GraphicalEditPart parent = (GraphicalEditPart) getParent();
boolean horizontal =
((ChartSet) parent.getParent().getParent().getParent().getModel())
.getOrientation() == Orientation.HORIZONTAL;
GridLayout layout = (GridLayout) getFigure().getLayoutManager();
if (horizontal)
{
layout.numColumns = 1;
parent.setLayoutConstraint(this, figure, new GridData(GridData.FILL,
GridData.CENTER, true, false));
layout.setConstraint(datasetsPane, new GridData(GridData.FILL,
GridData.CENTER, true, false));
layout.setConstraint(arrowFigure, new GridData(GridData.FILL,
GridData.CENTER, true, false));
layout.setConstraint(axisNameLabel, new GridData(GridData.FILL,
GridData.CENTER, true, false));
axisNameLabel.setVertical(false);
arrowFigure.setHorizontal(true);
}
else
{
layout.numColumns = figure.getChildren().size();
parent.setLayoutConstraint(this, figure, new GridData(GridData.CENTER,
GridData.FILL, false, true));
layout.setConstraint(datasetsPane, new GridData(GridData.CENTER,
GridData.FILL, false, true));
layout.setConstraint(arrowFigure, new GridData(GridData.CENTER,
GridData.FILL, false, true));
layout.setConstraint(axisNameLabel, new GridData(GridData.CENTER,
GridData.FILL, false, true));
axisNameLabel.setVertical(true);
arrowFigure.setHorizontal(false);
}
layout.invalidate();
parent.refresh();
GridLayout layoutManager = (GridLayout) datasetsPane.getLayoutManager();
layoutManager.numColumns = horizontal ? 1 : getModelChildren().size();
layoutManager.invalidate();
}
示例7: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void refreshVisuals() {
setVisible();
final Rectangle rectangle = getRectangle();
final GraphicalEditPart parent = (GraphicalEditPart) getParent();
final IFigure figure = getFigure();
figure.setBackgroundColor(Resources.REMOVED_COLOR);
parent.setLayoutConstraint(this, figure, rectangle);
}
示例8: refreshVisuals
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void refreshVisuals() {
this.setVisible();
Rectangle rectangle = this.getRectangle();
GraphicalEditPart parent = (GraphicalEditPart) this.getParent();
IFigure figure = this.getFigure();
figure.setBackgroundColor(Resources.REMOVED_COLOR);
parent.setLayoutConstraint(this, figure, rectangle);
}