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


Java GridLayout类代码示例

本文整理汇总了Java中org.eclipse.draw2d.GridLayout的典型用法代码示例。如果您正苦于以下问题:Java GridLayout类的具体用法?Java GridLayout怎么用?Java GridLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GridLayout类属于org.eclipse.draw2d包,在下文中一共展示了GridLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMain

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
@Override
protected IFigure createMain ()
{
    final Figure rootFigure = new Figure ();

    rootFigure.setLayoutManager ( new GridLayout ( 3, true ) );

    rootFigure.add ( makeHeader (), new GridData ( GridData.BEGINNING, GridData.CENTER, true, false, 3, 1 ) );

    rootFigure.add ( createSourceValue (), new GridData ( GridData.CENTER, GridData.CENTER, true, true ) );
    rootFigure.add ( new Figure () );
    rootFigure.add ( createTargetValue (), new GridData ( GridData.CENTER, GridData.CENTER, true, true ) );

    rootFigure.add ( new Figure () );
    rootFigure.add ( createCommandPanel (), new GridData ( GridData.CENTER, GridData.CENTER, true, true ) );

    createRoundArrow ( rootFigure );

    return rootFigure;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:RoundDetailsPart.java

示例2: GridContainerController

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
public GridContainerController ( final SymbolController controller, final GridContainer element, final BasicViewElementFactory factory ) throws Exception
{
    this.figure = new Figure ();

    final GridLayout gridLayout = new GridLayout ( element.getColumns (), element.isEqualWidth () );
    gridLayout.horizontalSpacing = element.getHorizontalSpacing ();
    gridLayout.verticalSpacing = element.getVerticalSpacing ();
    gridLayout.marginHeight = element.getMarginHeight ();
    gridLayout.marginWidth = element.getMarginWidth ();

    this.figure.setLayoutManager ( gridLayout );

    for ( final GridChild child : element.getChildren () )
    {
        final Controller elementController = factory.create ( controller, child.getElement () );
        final IFigure childFigure = elementController.getFigure ();
        this.figure.add ( childFigure, convert ( child ) );
    }

    controller.addElement ( element, this );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:GridContainerController.java

示例3: ColumnFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
public ColumnFigure() {
	ToolbarLayout layout = new ToolbarLayout();
	setLayoutManager(layout);
	layout.setSpacing(2);
	layout.setStretchMinorAxis(false);
	layout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
	setOpaque(true);
	setBorder(new ColumnFigureBorder());
	GridLayout gridLayout = new GridLayout(6, false);
	gridLayout.marginHeight = 3;
	gridLayout.marginWidth = 5;
	gridLayout.horizontalSpacing = 5;
	dataFigure.setLayoutManager(gridLayout);
	dataFigure.add(pkFigure);
	dataFigure.add(fkFigure);
	dataFigure.add(firstLabel);
	dataFigure.add(lastLabel);
	dataFigure.add(notNullFigure);
	dataFigure.add(uniqueFigure);
	add(dataFigure);

}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:23,代码来源:ColumnFigure.java

示例4: ReferenceFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
public ReferenceFigure(IReferenceModel model) {
	super(model, false);
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 3;
	layout.verticalSpacing = 0;
	setLayoutManager(layout);
	label = new Label(model.getName());
	label.setForegroundColor(ColorConstants.black);
	FontManager.setFont(label, PandionJConstants.VAR_FONT_SIZE);
	
	String tooltip = Utils.getTooltip(model); 

	Collection<String> tags = model.getTags();
	if(!tags.isEmpty())
		tooltip += "\ntags: " + String.join(", ", tags);
		
	label.setToolTip(new Label(tooltip));

	add(label);
	refLabel = new ReferenceLabel(model);
	add(refLabel);
	layout.setConstraint(refLabel, new GridData(PandionJConstants.POSITION_WIDTH, PandionJConstants.POSITION_WIDTH));
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:26,代码来源:ReferenceFigure.java

示例5: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    NotationNode notationNode = (NotationNode) getModel();

    EObject umlModel = notationNode.getUmlModel();
    if(isValid(umlModel)){
        componentFigure = new ComponentFigure(false);
    } else {
        componentFigure = new ComponentFigure();
    }
    
    componentFigure.setSize(notationNode.getWidth(), notationNode.getHeight());
    componentFigure.setLocation(new Point(notationNode.getX(), notationNode.getY()));

    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    componentFigure.setLayoutManager(gridLayout);

    return componentFigure;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:ComponentEditPart.java

示例6: createCompartmentFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * 
 * 이름,스테레오타입을 위한 컴파트먼트 피겨를 생성
 * 
 * @param labelNode
 * @return IFigure
 */
private IFigure createCompartmentFigure(LabelNode labelNode) {
    AbstractView parent = (AbstractView) labelNode.getParent();
    CompartmentLabelFigure figure = new CompartmentLabelFigure();

    if (parent instanceof AbstractNode) {
        // 라벨 뷰모델에 저장되어 있는 위치 값은 부모 노드의 위치와의 차이값이다. 라벨 자체의 위치 값이 저장된 것이 아님.
        figure.setLocation(new Point(parent.getX() + labelNode.getX(), parent.getY() + labelNode.getY()));
        figure.setSize(DiagramUtil.getWidthSize(((NamedElement) parent.getUmlModel()).getName(),
            UiCorePlugin.getDefault().getFont("default")), 0);
        figure.setOpaque(false);

        GridLayout gridLayout = new GridLayout();
        gridLayout.verticalSpacing = 0;
        gridLayout.numColumns = 1;
        figure.setLayoutManager(gridLayout);

        return figure;

    } else {
        Point centerPoint = getCenterPoint(labelNode);
        figure.setLocation(new Point(centerPoint.x + labelNode.getX(), centerPoint.y + labelNode.getY()));

        return figure;
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:33,代码来源:LabelNodeEditPart.java

示例7: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    NotationNode notationNode = (NotationNode) getModel();

    EObject umlModel = notationNode.getUmlModel();
    
    if (umlModel != null && isValid(umlModel)) {
        classFigure = new ClassFigure(false);
    } else {
        classFigure = new ClassFigure();
    }
    
    classFigure.setSize(notationNode.getWidth(), notationNode.getHeight());
    classFigure.setLocation(new Point(notationNode.getX(), notationNode.getY()));

    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    classFigure.setLayoutManager(gridLayout);

    return classFigure;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:ClassEditPart.java

示例8: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    NotationNode notationNode = (NotationNode) getModel();

    EObject umlModel = notationNode.getUmlModel();
    if(isValid(umlModel)){
        interfaceFigure = new InterfaceFigure(false);
    } else {
        interfaceFigure = new InterfaceFigure();
    }
    
    interfaceFigure.setSize(notationNode.getWidth(), notationNode.getHeight());
    interfaceFigure.setLocation(new Point(notationNode.getX(), notationNode.getY()));
    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    interfaceFigure.setLayoutManager(gridLayout);

    return interfaceFigure;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:24,代码来源:InterfaceEditPart.java

示例9: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {

    NotationNode notationNode = (NotationNode) getModel();
    EObject umlModel = notationNode.getUmlModel();
    
    if(isValid(umlModel)){
        figure = new ArtifactFigure(false);
    } else {
        figure = new ArtifactFigure();
    }
    
    figure.setLocation(new Point(notationNode.getX(), notationNode.getY()));
    figure.setSize(notationNode.getWidth(), notationNode.getHeight());

    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    figure.setLayoutManager(gridLayout);

    return figure;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:ArtifactEditPart.java

示例10: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {

    NotationNode notationNode = (NotationNode) getModel();

    EObject umlModel = notationNode.getUmlModel();
    if(isValid(umlModel)){
        dataTypeFigure = new DataTypeFigure(false);
    } else {
        dataTypeFigure = new DataTypeFigure();
    }
    
    dataTypeFigure.setLocation(new Point(notationNode.getX(), notationNode.getY()));
    dataTypeFigure.setSize(notationNode.getWidth(), notationNode.getHeight());

    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    dataTypeFigure.setLayoutManager(gridLayout);

    return dataTypeFigure;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:DataTypeEditPart.java

示例11: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    NotationNode notationNode = (NotationNode) getModel();

    EObject umlModel = notationNode.getUmlModel();
    if(isValid(umlModel)){
        EnumerationFigure = new EnumerationFigure(false);
    } else {
        EnumerationFigure = new EnumerationFigure();
    }
    

    EnumerationFigure.setName(notationNode.getName());
    EnumerationFigure.setSize(notationNode.getWidth(), notationNode.getHeight());
    EnumerationFigure.setLocation(new Point(notationNode.getX(), notationNode.getY()));

    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    EnumerationFigure.setLayoutManager(gridLayout);

    return EnumerationFigure;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:EnumerationEditPart.java

示例12: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {

    NotationNode notationNode = (NotationNode) getModel();
    EObject umlModel = notationNode.getUmlModel();

    if(isValid(umlModel)){
        figure = new ActorFigure(false);
    } else {
        figure = new ActorFigure();
    }

    GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.numColumns = 1;
    figure.setLayoutManager(gridLayout);

    figure.setSize(notationNode.getWidth(), notationNode.getHeight());
    figure.setLocation(new Point(notationNode.getX(), notationNode.getY()));

    return figure;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:ActorEditPart.java

示例13: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
@Override
protected IFigure createFigure()
{
  RectangleFigure figure = new RectangleFigure();
  figure.setBackgroundColor(BACKGROUND_COLOR);
  Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
  Border figureBorder = new LineBorder(borderCol, 2);
  figure.setBorder(figureBorder);

  figure.setOutline(false);
  GridLayout layoutManager = new GridLayout();
  // zero margin, in order to connect the dependent axes to the shared one
  layoutManager.marginHeight = 0;
  layoutManager.marginWidth = 0;
  figure.setLayoutManager(layoutManager);

  datasetsPane = new RectangleFigure();
  datasetsPane.setOutline(false);
  final SimpleLoweredBorder datasetBorder = new SimpleLoweredBorder(3);
  datasetsPane.setBorder(datasetBorder);
  GridLayout datasetsPaneLayout = new GridLayout();
  datasetsPane.setLayoutManager(datasetsPaneLayout);
  figure.add(datasetsPane);

  arrowFigure = new ArrowFigure(false);
  figure.add(arrowFigure);

  axisNameLabel = new AxisNameFigure(this);
  figure.add(axisNameLabel);

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

示例14: refreshVisuals

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
@Override
protected void refreshVisuals()
{
  final ChartEditPart.ChartPanePosition pos = (ChartPanePosition) getModel();
  final IFigure figure = getFigure();
  
  ChartSet chartSet = ((Chart)getParent().getModel()).getParent();
  boolean vertical = chartSet.getOrientation() == Orientation.VERTICAL;
  
  if (pos == ChartPanePosition.MIN)
  {
    ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure,
        vertical ? BorderLayout.LEFT : BorderLayout.BOTTOM);
  }
  else
  {
    ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure,
        vertical ? BorderLayout.RIGHT : BorderLayout.TOP);
  }

  ((GridLayout) getFigure().getLayoutManager()).numColumns =
      vertical ? getModelChildren().size() : 1;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:24,代码来源:ChartPaneEditPart.java

示例15: createFigure

import org.eclipse.draw2d.GridLayout; //导入依赖的package包/类
@Override
protected IFigure createFigure()
{
  final RectangleFigure figure = new RectangleFigure();
  figure.setOutline(false);
  final Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
  final Border figureBorder = new LineBorder(borderCol, 2);
  figure.setBorder(figureBorder);

  figure.setLayoutManager(new GridLayout());
  nameLabel = new DirectionalLabel(Activator.FONT_8);

  final ChartPaneEditPart.AxisLandingPad pad =
      (ChartPaneEditPart.AxisLandingPad) getModel();

  nameLabel.setText(pad.pos == ChartPanePosition.MIN ? "Min Axis"
      : "Max Axis");

  figure.add(nameLabel);
  figure.getLayoutManager().setConstraint(nameLabel, new GridData(
      GridData.FILL, GridData.FILL, true, true));

  return figure;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:25,代码来源:AxisLandingPadEditPart.java


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