当前位置: 首页>>代码示例>>Java>>正文


Java GraphicalEditPart.setLayoutConstraint方法代码示例

本文整理汇总了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();
}
 
开发者ID:debrief,项目名称:limpet,代码行数:19,代码来源:ChartsPanelEditPart.java

示例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());
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:12,代码来源:DwEnumContainerEditPart.java

示例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);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:15,代码来源:DiagramWalkerEditPart.java

示例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();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:48,代码来源:NodeElementEditPart.java

示例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();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:48,代码来源:NodeElementEditPart.java

示例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();

}
 
开发者ID:debrief,项目名称:limpet,代码行数:55,代码来源:AxisEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:18,代码来源:RemovedNodeElementEditPart.java

示例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);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:RemovedNodeElementEditPart.java


注:本文中的org.eclipse.gef.GraphicalEditPart.setLayoutConstraint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。