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


Java Border类代码示例

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


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

示例1: createFigure

import org.eclipse.draw2d.Border; //导入依赖的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

示例2: createFigure

import org.eclipse.draw2d.Border; //导入依赖的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

示例3: addRow

import org.eclipse.draw2d.Border; //导入依赖的package包/类
private void addRow(String name, String value, String tableStyle) {
    final Border border = new MarginBorder(5);
    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);
    final Label nameLabel = new Label();
    final Label valueLabel = new Label();
    nameLabel.setBorder(border);
    nameLabel.setText(name);
    nameLabel.setLabelAlignment(PositionConstants.LEFT);
    nameLabel.setForegroundColor(foregroundColor);
    add(nameLabel);
    if (!DisplayMessages.getMessage("action.title.change.design.simple").equals(tableStyle)
            && !DisplayMessages.getMessage("action.title.change.design.frame").equals(tableStyle)) {
        valueLabel.setBackgroundColor(ColorConstants.white);
        valueLabel.setOpaque(true);
        valueLabel.setForegroundColor(ColorConstants.black);
    } else {
        valueLabel.setOpaque(false);
        valueLabel.setForegroundColor(foregroundColor);
    }
    valueLabel.setBorder(border);
    valueLabel.setText(value);
    valueLabel.setLabelAlignment(PositionConstants.LEFT);
    add(valueLabel);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:27,代码来源:ModelPropertiesFigure.java

示例4: getConstraintFor

import org.eclipse.draw2d.Border; //导入依赖的package包/类
/**
 * Generates a draw2d constraint object derived from the specified child
 * EditPart using the provided Request. The returned constraint will be
 * translated to the application's model later using
 * {@link #translateToModelConstraint(Object)}.
 * 
 * @param request
 *            the ChangeBoundsRequest
 * @param child
 *            the child EditPart for which the constraint should be
 *            generated
 * @return the draw2d constraint
 */
protected Object getConstraintFor( ChangeBoundsRequest request,
		GraphicalEditPart child )
{
	IFigure figure = child.getFigure( );
	Rectangle rect = new PrecisionRectangle(figure.getBounds());
	figure.translateToAbsolute(rect);
	rect = request.getTransformedRectangle( rect );
	
	figure.translateToRelative(rect);
	rect.translate( getLayoutOrigin( ).getNegated( ) );
	if (figure instanceof IOutsideBorder)
	{
		Border border = ((IOutsideBorder)figure).getOutsideBorder( );
		if (border !=  null)
		{
			Insets insets = border.getInsets( figure );
			rect.shrink( insets.right, insets.bottom );
		}
	}

	return getConstraintFor( rect );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:ReportFlowLayoutEditPolicy.java

示例5: getFigureSize

import org.eclipse.draw2d.Border; //导入依赖的package包/类
private Dimension getFigureSize()
{
	IFigure figure = getOwner( ).getFigure( );
	Dimension dim = figure.getSize( );
	if (figure instanceof IOutsideBorder)
	{
		Border border = ((IOutsideBorder)figure).getOutsideBorder( );
		Insets insets = border.getInsets( figure );
		if (PositionConstants.EAST == getResizeDirection())
		{
			dim.width = dim.width - insets.right - insets.left;
		}
		else if (PositionConstants.SOUTH == getResizeDirection())
		{
			dim.height = dim.height - insets.bottom - insets.top;
		}
	}
	return dim;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ReportResizeTracker.java

示例6: addRow

import org.eclipse.draw2d.Border; //导入依赖的package包/类
private void addRow(final String name, final String value, final String tableStyle) {
    final Border border = new MarginBorder(5);

    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);

    final Label nameLabel = new Label();

    final Label valueLabel = new Label();

    nameLabel.setBorder(border);
    nameLabel.setText(name);
    nameLabel.setLabelAlignment(PositionConstants.LEFT);
    nameLabel.setForegroundColor(foregroundColor);

    this.add(nameLabel);

    if (!ResourceString.getResourceString("action.title.change.design.simple").equals(tableStyle) && !ResourceString.getResourceString("action.title.change.design.frame").equals(tableStyle)) {
        valueLabel.setBackgroundColor(ColorConstants.white);
        valueLabel.setOpaque(true);
        valueLabel.setForegroundColor(ColorConstants.black);

    } else {
        valueLabel.setOpaque(false);
        valueLabel.setForegroundColor(foregroundColor);
    }

    valueLabel.setBorder(border);
    valueLabel.setText(value);
    valueLabel.setLabelAlignment(PositionConstants.LEFT);

    this.add(valueLabel);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:35,代码来源:ModelPropertiesFigure.java

示例7: addRow

import org.eclipse.draw2d.Border; //导入依赖的package包/类
private void addRow(String name, String value, String tableStyle) {
	Border border = new MarginBorder(5);

	ToolbarLayout layout = new ToolbarLayout();
	layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
	layout.setStretchMinorAxis(true);

	Label nameLabel = new Label();

	Label valueLabel = new Label();

	nameLabel.setBorder(border);
	nameLabel.setText(name);
	nameLabel.setLabelAlignment(PositionConstants.LEFT);
	nameLabel.setForegroundColor(this.foregroundColor);

	this.add(nameLabel);

	if (!ResourceString.getResourceString(
			"action.title.change.design.simple").equals(tableStyle)
			&& !ResourceString.getResourceString(
					"action.title.change.design.frame").equals(tableStyle)) {
		valueLabel.setBackgroundColor(ColorConstants.white);
		valueLabel.setOpaque(true);
		valueLabel.setForegroundColor(ColorConstants.black);

	} else {
		valueLabel.setOpaque(false);
		valueLabel.setForegroundColor(this.foregroundColor);
	}

	valueLabel.setBorder(border);
	valueLabel.setText(value);
	valueLabel.setLabelAlignment(PositionConstants.LEFT);

	this.add(valueLabel);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:38,代码来源:ModelPropertiesFigure.java

示例8: setBorder

import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
public void setBorder(Border border) {
	if (border != null){
		Assert.isTrue(border instanceof TitaniumBackgroundBorder,
				"Only TitaniumBackgroundBorder can be set in TitaniumFigure!");
	}
	super.setBorder(border);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:9,代码来源:TitaniumFigure.java

示例9: setBorder

import org.eclipse.draw2d.Border; //导入依赖的package包/类
/**
 * Overridden to assert that only {@link FlowBorder} is used.
 * <code>null</code> is still a valid value as well.
 * 
 * @param border
 *            <code>null</code> or a FlowBorder
 */
public void setBorder(Border border) {
	if (border == null || border instanceof FlowBorder)
		super.setBorder(border);
	else
		throw new RuntimeException(
				"Border must be an instance of FlowBorder"); //$NON-NLS-1$
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:InlineFlow.java

示例10: createBorder

import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
protected Border createBorder() {
  MarginBorder marginBorder = new MarginBorder(PADDING - 1);
  LineBorder lineBorder = new LineBorder(1);
  lineBorder.setColor(ColorConstants.black);
  return new CompoundBorder(lineBorder, marginBorder);
}
 
开发者ID:antlr4ide,项目名称:antlr4ide,代码行数:8,代码来源:RectangleNode.java

示例11: fillShape

import org.eclipse.draw2d.Border; //导入依赖的package包/类
protected void fillShape( Graphics graphics )
{
	Rectangle bounds = getBounds( ).getCopy( );
	Border border = getBorder( );
	if ( border != null )
	{
		bounds = bounds.crop( border.getInsets( null ) );
	}
	if ( isOpaque( ) )
		graphics.fillRectangle( bounds );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:RectangleFigure.java

示例12: outlineShape

import org.eclipse.draw2d.Border; //导入依赖的package包/类
protected void outlineShape( Graphics graphics )
{
	Rectangle bounds = getBounds( ).getCopy( );
	Border border = getBorder( );
	if ( border != null )
	{
		bounds = bounds.crop( border.getInsets( null ) );
	}
	graphics.drawRectangle( bounds.x,
			bounds.y,
			bounds.width - 1,
			bounds.height - 1 );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:RectangleFigure.java

示例13: setBorder

import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
public void setBorder(Border border) {
	super.setBorder(border);
	if(border != null)
		setSize(border.getPreferredSize(this));
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:7,代码来源:AbstractArrayFigure.java

示例14: setBorder

import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
public void setBorder(Border border) {
	getContentsPane().setBorder(border);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:5,代码来源:PickerColumnFigure.java

示例15: setBorder

import org.eclipse.draw2d.Border; //导入依赖的package包/类
/**
 * @see org.eclipse.draw2d.Figure#setBorder(org.eclipse.draw2d.Border)
 */
@Override
public void setBorder(Border border) {
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:7,代码来源:ActorFigure.java


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