本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}