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


Java MarginBorder类代码示例

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


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

示例1: ComponentLabelFigure

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * Creates a new LabelFigure with a MarginBorder that is the given size and
 * a FlowPage containing a TextFlow with the style WORD_WRAP_SOFT.
 * 
 * @param borderSize
 *            the size of the MarginBorder
 */
public ComponentLabelFigure(int borderSize) {
	setBorder(new MarginBorder(borderSize));
	flowPage = new FlowPage();

	textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
			ParagraphTextLayout.WORD_WRAP_SOFT));
	

	flowPage.add(textFlow);
	flowPage.setHorizontalAligment(PositionConstants.CENTER);

	setLayoutManager(new StackLayout());
	add(flowPage);
	font = new Font( Display.getDefault(), "Arial", 9,
			SWT.NORMAL );
	setFont(font);
	setForegroundColor(ColorConstants.black);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:ComponentLabelFigure.java

示例2: CommentBoxFigure

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * Creates a new CommentBoxFigure with a MarginBorder that is the given size and a FlowPage containing a TextFlow
 * with the style WORD_WRAP_SOFT.
 * 
 * @param borderSize
 *            the size of the MarginBorder
 */
public CommentBoxFigure(int borderSize) {
	setBorder(new MarginBorder(5));
	FlowPage flowPage = new FlowPage();

	textFlow = new TextFlow();

	textFlow.setLayoutManager(new ParagraphTextLayout(textFlow, ParagraphTextLayout.WORD_WRAP_SOFT));

	flowPage.add(textFlow);

	setLayoutManager(new StackLayout());
	add(flowPage);
	font = new Font(Display.getDefault(), "Arial", 9, SWT.NORMAL);
	setFont(font);
	setForegroundColor(ColorConstants.black);
	setOpaque(false);

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:CommentBoxFigure.java

示例3: createColumnArea

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void createColumnArea(final IFigure columns) {
    initColumnArea(columns);

    columns.setBorder(new MarginBorder(0, 0, 0, 0));
    columns.setBackgroundColor(ColorConstants.white);
    columns.setOpaque(true);

    final Figure centerFigure = new Figure();
    centerFigure.setLayoutManager(new BorderLayout());
    centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

    centerFigure.add(columns, BorderLayout.CENTER);
    getTableFigure().add(centerFigure, BorderLayout.CENTER);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:19,代码来源:FunnyStyleSupport.java

示例4: createFooter

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void createFooter() {
    final IFigure footer = new Figure();
    final BorderLayout footerLayout = new BorderLayout();
    footer.setLayoutManager(footerLayout);
    footer.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

    final IFigure footer1 = new Figure();
    footer1.setSize(-1, 10);
    footer1.setBackgroundColor(Resources.VERY_LIGHT_GRAY);
    footer1.setOpaque(true);

    footer.add(footer1, BorderLayout.TOP);

    final IFigure footer2 = new Figure();
    footer2.setSize(-1, 7);

    footer.add(footer2, BorderLayout.BOTTOM);

    getTableFigure().add(footer, BorderLayout.BOTTOM);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:25,代码来源:FunnyStyleSupport.java

示例5: initTitleBar

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initTitleBar(final Figure top) {
    final ToolbarLayout topLayout = new ToolbarLayout();

    topLayout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
    topLayout.setStretchMinorAxis(true);
    top.setLayoutManager(topLayout);

    nameLabel = new Label();
    nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20)));
    top.add(nameLabel);

    final Figure separater = new Figure();
    separater.setSize(-1, 1);
    separater.setBackgroundColor(getTextColor());
    separater.setOpaque(true);

    top.add(separater);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:23,代码来源:SimpleStyleSupport.java

示例6: createColumnArea

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void createColumnArea(IFigure columns) {
	this.initColumnArea(columns);

	columns.setBorder(new MarginBorder(0, 0, 0, 0));
	columns.setBackgroundColor(ColorConstants.white);
	columns.setOpaque(true);

	this.centerFigure = new Figure();
	this.centerFigure.setLayoutManager(new BorderLayout());
	this.centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

	centerFigure.add(columns, BorderLayout.CENTER);
	this.getTableFigure().add(this.centerFigure, BorderLayout.CENTER);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:19,代码来源:FunnyStyleSupport.java

示例7: createFooter

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void createFooter() {
	IFigure footer = new Figure();
	BorderLayout footerLayout = new BorderLayout();
	footer.setLayoutManager(footerLayout);
	footer.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

	IFigure footer1 = new Figure();
	footer1.setSize(-1, 10);
	footer1.setBackgroundColor(Resources.VERY_LIGHT_GRAY);
	footer1.setOpaque(true);

	footer.add(footer1, BorderLayout.TOP);

	IFigure footer2 = new Figure();
	footer2.setSize(-1, 7);

	footer.add(footer2, BorderLayout.BOTTOM);

	this.getTableFigure().add(footer, BorderLayout.BOTTOM);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:25,代码来源:FunnyStyleSupport.java

示例8: initTitleBar

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initTitleBar(Figure top) {
	ToolbarLayout topLayout = new ToolbarLayout();

	topLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
	topLayout.setStretchMinorAxis(true);
	top.setLayoutManager(topLayout);

	this.nameLabel = new Label();
	this.nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20)));
	top.add(nameLabel);

	Figure separater = new Figure();
	separater.setSize(-1, 1);
	separater.setBackgroundColor(this.getTextColor());
	separater.setOpaque(true);

	top.add(separater);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:23,代码来源:SimpleStyleSupport.java

示例9: createTextFlow

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * createTextFlow
 * 
 * @return TextFlow
 */
public TextFlow createTextFlow() {
    flowPage = new FlowPage();

    flow = new TextFlow();

    flow.setLayoutManager(new ParagraphTextLayout(flow, ParagraphTextLayout.WORD_WRAP_SOFT));
    flow.setForegroundColor(new Color(null, 0, 0, 0));

    if (getName() != null)
        flow.setText(getName());
    else
        flow.setText(""); //$NON-NLS-1$

    flowPage.add(flow);
    flowPage.setHorizontalAligment(PositionConstants.LEFT);
    flowPage.setBorder(new MarginBorder(new Insets(15, 7, 7, 7)));
    setLayoutManager(new StackLayout());
    add(flowPage);

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

示例10: LifeLineNameHeaderFigure

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * LifeLineNameHeaderFigure
 * @param name
 */
public LifeLineNameHeaderFigure(String name) {
    super();
    this.stereptypeLabel = new Label("");
    this.add(this.stereptypeLabel);

    nameLabel = new CollapsedLabel(name);
    this.nameLabel2 = new Label("");
    this.nameLabel.setChildLabel(this.nameLabel2);
    // nameLabel.setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_LIFELINE));

    ToolbarLayout layout = new ToolbarLayout();
    layout.setSpacing(2);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
    setLayoutManager(layout);

    setOpaque(true);
    setBackgroundColor(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.White));
    setBorder(new MarginBorder(6));
    add(nameLabel);
    this.add(this.nameLabel2);

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

示例11: LifeLineNameFigure

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
/**
 * LifeLineNameFigure
 * @param name
 */
public LifeLineNameFigure(String name) {
    this.stereptypeLabel = new Label(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING);
    this.add(this.stereptypeLabel);

    nameLabel = new CollapsedLabel(name);
    this.nameLabel2 = new Label(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING);
    this.nameLabel.setChildLabel(this.nameLabel2);
    nameLabel.setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_LIFELINE));

    ToolbarLayout layout = new ToolbarLayout();
    layout.setSpacing(2);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
    setLayoutManager(layout);

    setOpaque(true);
    setBackgroundColor(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.White));
    setBorder(new MarginBorder(6));
    add(nameLabel);
    this.add(this.nameLabel2);

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

示例12: createContents

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
protected void createContents() {
	int size = mapMode.DPtoLP(2);
	this.setBorder(new MarginBorder(size, size, size, size));
	Ellipse whiteCircle = new Ellipse();
	whiteCircle.setOutline(false);
	whiteCircle.setLineWidth(1);
	whiteCircle.setBackgroundColor(ColorConstants.white);
	size = mapMode.DPtoLP(3);
	whiteCircle.setBorder(new MarginBorder(size, size, size, size));
	BorderLayout layout = new BorderLayout();
	whiteCircle.setLayoutManager(layout);
	Object data = BorderLayout.CENTER;
	this.add(whiteCircle, data);
	Ellipse blackCircle = new Ellipse();
	blackCircle.setOutline(false);
	blackCircle.setLineWidth(mapMode.DPtoLP(1));
	blackCircle.setBackgroundColor(ColorConstants.black);
	data = BorderLayout.CENTER;
	whiteCircle.add(blackCircle, data);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:21,代码来源:FinalStateFigure.java

示例13: addRow

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

示例14: createFooter

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
@Override
public void createFooter() {
    final IFigure footer = new Figure();
    final BorderLayout footerLayout = new BorderLayout();
    footer.setLayoutManager(footerLayout);
    footer.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));

    final IFigure footer1 = new Figure();
    footer1.setSize(-1, 1);
    footer1.setBackgroundColor(ColorConstants.black);
    footer1.setOpaque(true);
    footer.add(footer1, BorderLayout.TOP);

    final IFigure footer2 = new Figure();
    footer2.setSize(-1, 6);
    footer.add(footer2, BorderLayout.BOTTOM);

    getTableFigure().add(footer, BorderLayout.BOTTOM);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:20,代码来源:FunnyStyleSupport.java

示例15: addColumnGroup

import org.eclipse.draw2d.MarginBorder; //导入依赖的package包/类
@Override
public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode,
        String name, boolean isAdded, boolean isUpdated, boolean isRemoved) {
    columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0)));

    final ImageFigure image = new ImageFigure();
    image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7)));
    image.setImage(Activator.getImage(ImageKey.GROUP));
    columnFigure.add(image);

    final StringBuilder text = new StringBuilder();
    text.append(name);
    text.append(" (GROUP)");

    setColumnFigureColor(columnFigure, false, false, isAdded, isUpdated, isRemoved);

    final Label label = createColumnLabel();

    label.setForegroundColor(ColorConstants.black);
    label.setLabelAlignment(PositionConstants.RIGHT);
    label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4)));

    label.setText(text.toString());

    columnFigure.add(label);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:27,代码来源:FunnyStyleSupport.java


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