Java 类org.eclipse.draw2d.ToolbarLayout 实例源码

项目:bts    文件:MarkerFigure.java   
public MarkerFigure(String name) {
    ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);
    setBorder(new LineBorder(ColorConstants.black, 1));
    setBackgroundColor(classColor);
    setOpaque(true);
    org.eclipse.draw2d.Label label = new org.eclipse.draw2d.Label();
    label.setText(name);
    add(label);
    super.setCornerDimensions(new Dimension(0, 0));
    this.name = name;
}
项目:bdf2    文件:TableFigure.java   
public TableFigure() {
    ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);
    LineBorder lineBorder = new LineBorder(ColorConstants.lightGray, 2);
    setBorder(lineBorder);
    setOpaque(true);
    setBackgroundColor(ColorConstants.white);

    Font font = new Font(null, "宋体", 11, SWT.NORMAL);
    label.setFont(font);
    label.setBorder(new LineBorder(ColorConstants.lightGray));
    label.setIcon(Activator.getImage(Activator.IMAGE_TABLE_16));
    label.setOpaque(true);
    label.setBackgroundColor(ColorConstants.lightBlue);
    label.setForegroundColor(ColorConstants.black);
    add(label);
    add(columnFigure);
}
项目:bdf2    文件:ColumnFigure.java   
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);

}
项目:ermasterr    文件:SimpleStyleSupport.java   
/**
 * {@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);
}
项目:ermaster-k    文件:SimpleStyleSupport.java   
/**
 * {@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);
}
项目:NEXCORE-UML-Modeler    文件:LifeLineNameHeaderFigure.java   
/**
 * 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);

}
项目:NEXCORE-UML-Modeler    文件:LifeLineNameFigure.java   
/**
 * 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);

}
项目:bts    文件:TextAnnotationsComposite.java   
private LineFigure makeAnnotationsLineFigure(String key) {
    LineFigure fig = new LineFigure();
    fig.setSize(400, 190);
    List<LineFigure> lineList;
    if (annotationslineMap.containsKey(key))
    {
        lineList = annotationslineMap.get(key);
    }
    else
    {
        lineList = new Vector<>(1);
        annotationslineMap.put(key, lineList);
    }
    lineList.add(fig);
    container.add(fig);
    ToolbarLayout l = new ToolbarLayout();
    l.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
    l.setStretchMinorAxis(false);
    l.setSpacing(0);
    l.setHorizontal(true);
    fig.setLayoutManager(l);
    return fig;
}
项目:scouter    文件:ServerObjectFigure.java   
public ServerObjectFigure(ServerObject so, Font font) {
    ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);
    setOpaque(false);
    add(new ImageFigure(Images.scouter_48));
    Label title = new Label(so.getDisplayName(), null);
    add(title);
    StringBuffer sb = new StringBuffer();
    sb.append(ScouterUtil.humanReadableByteCount(so.getUsedMemory(), true));
    sb.append(" / ");
    sb.append(ScouterUtil.humanReadableByteCount(so.getTotalMemory(), true));
    Label memory = new Label(sb.toString(), null);
    memory.setFont(font);
    add(memory);
    setSize(-1, -1);
}
项目:erflute    文件:ModelPropertiesFigure.java   
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);
}
项目:erflute    文件:SimpleStyleSupport.java   
@Override
public void initTitleBar(Figure top) {
    final ToolbarLayout topLayout = new ToolbarLayout();

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

    this.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);
}
项目:ermaster-nhit    文件:SimpleStyleSupport.java   
/**
 * {@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);
}
项目:FRaMED    文件:ORMNaturalTypeFigure.java   
/**
 * The constructor of this class, where the constructor {@link ORMShapeFigure#ORMShapeFigure()}
 * is called, the basic {@link ShadowRectangle} is initialized and the child figures for the name(
 * {@link Label}) is added to the basic rectangle.
 * 
 * */
public ORMNaturalTypeFigure() {

  super();

  rectangle = new ShadowRectangle();

  ToolbarLayout layout = new ToolbarLayout();
  layout.setSpacing(8); // set the initial heigth of the child figures
  setLayoutManager(new XYLayout());
  setBackgroundColor(ColorConstants.white);

  rectangle.setAntialias(SWT.ON);
  rectangle.setLayoutManager(layout);
  rectangle.setOpaque(true);
  setOpaque(true);

  // add name figure
  rectangle.add(getLabel());

  add(rectangle);

}
项目:FRaMED    文件:ORMGroupV1Figure.java   
/**
 * The constructor of this class, where the constructor {@link ORMShapeFigure#ORMShapeFigure()}
 * is called, the basic {@link ShadowRoundedRectangle} is initialized
 * and the child figure for the name( {@link Label}) is added to the basic rectangle.
 * */
public ORMGroupV1Figure() {

  super();

  rectangle = new ShadowRoundedRectangle();

  ToolbarLayout layout = new ToolbarLayout();
  layout.setSpacing(4); // set initial heigth of child figures
  setLayoutManager(new XYLayout());
  setBackgroundColor(ColorConstants.white);

  rectangle.setAntialias(SWT.ON);
  rectangle.setLayoutManager(layout);
  rectangle.setOpaque(true);

  // add name figure
  rectangle.add(getLabel());
  setOpaque(true);

  add(rectangle);

}
项目:FRaMED    文件:ORMRoleTypeFigure.java   
/**
 * The constructor of this class, where he constructor {@link ORMShapeFigure#ORMShapeFigure()}
 * is called, the basic {@link ShadowRoundedRectangle} is initialized 
 * and the child figures for the name( {@link Label}) is added to basic rectangle.
 * 
 * */
public ORMRoleTypeFigure() {
  super();

  rectangle = new ShadowRoundedRectangle();

  ToolbarLayout layout = new ToolbarLayout();
  layout.setSpacing(8); // set the initial heigth of the child figures
  setLayoutManager(new BorderLayout());
  setBackgroundColor(ColorConstants.white);

  rectangle.setAntialias(SWT.ON);
  rectangle.setLayoutManager(layout);
  rectangle.setOpaque(true);
  setOpaque(true);

  // add name figure
  rectangle.add(getLabel());

  add(rectangle, BorderLayout.CENTER);
}
项目:snaker-designer    文件:FieldFigure.java   
public FieldFigure(Field field) {
    this.model = field;
    this.component = ConfigManager.getComponentByGroupAndType(
            ConfigManager.COMPONENT_TYPE_FIELD, field.getType());
    setLayoutManager(new FlowLayout());

    setForegroundColor(ColorConstants.blue);
    setBackgroundColor(ColorConstants.blue);
    setBorder(new FieldBorder(field.getDisplayName()));
    setOpaque(true);
    SimpleLabel sl = new SimpleLabel();
    sl.setIcon(getImageByType());
    add(sl, ToolbarLayout.ALIGN_CENTER);

    placeHolder = ConfigManager.getPlaceHolderValue(component);
    int iWidth = 200 * placeHolder + 1;
    setSize(iWidth, 22);
}
项目:jive    文件:ContourMemberTableFigure.java   
public ContourMemberTableFigure()
{
  identifierColumn = new Figure();
  typeColumn = new Figure();
  valueColumn = new Figure();
  identifierColumn.setBorder(ContourMemberTableFigure.IDENTIFIER_COLUMN_BORDER);
  typeColumn.setBorder(ContourMemberTableFigure.TYPE_COLUMN_BORDER);
  valueColumn.setBorder(ContourMemberTableFigure.VALUE_COLUMN_BORDER);
  final ToolbarLayout identifierLayout = new ToolbarLayout(false);
  identifierLayout.setStretchMinorAxis(true);
  identifierColumn.setLayoutManager(identifierLayout);
  final ToolbarLayout typeLayout = new ToolbarLayout(false);
  typeLayout.setStretchMinorAxis(true);
  typeColumn.setLayoutManager(typeLayout);
  final ToolbarLayout valueLayout = new ToolbarLayout(false);
  valueLayout.setStretchMinorAxis(true);
  valueColumn.setLayoutManager(valueLayout);
  final BorderLayout layout = new BorderLayout();
  setLayoutManager(layout);
  add(identifierColumn, BorderLayout.LEFT);
  add(typeColumn, BorderLayout.CENTER);
  add(valueColumn, BorderLayout.RIGHT);
}
项目:wt-studio    文件:TableModelFigure.java   
public TableModelFigure()
{
    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(true);
    layout.setSpacing(10);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);

    setLayoutManager(new FillLayout());
    setOpaque(true);
    setBackgroundColor(ColorConstants.white);
    border = new FrameBorder("列表");
    border.setLabel("Block");
    this.setBorder(border);
    ScrollPane scrollpane = new ScrollPane();
    scrollpane.setHorizontalScrollBarVisibility(1);
    scrollpane.setVerticalScrollBarVisibility(0);
    headerFigure = new FreeformLayer();
    headerFigure.setLayoutManager(new ScrollAreaLayout());
    headerFigure.setBackgroundColor(ColorConstants.white);
    add(scrollpane);
    scrollpane.setViewport(new FreeformViewport());
    scrollpane.setContents(headerFigure);
}
项目:xeda    文件:DepartmentNodeFigure.java   
public DepartmentNodeFigure() {
    ToolbarLayout layout= new ToolbarLayout();
    setLayoutManager(layout);

    label = new Label();

    label.setLabelAlignment(PositionConstants.LEFT);
    label.setForegroundColor(ColorConstants.blue);
    label.setIcon(Activator.getDefault().getImageRegistry().get(Activator.STATE_MACHINE));
    label.setPreferredSize(700, 50);
    label.setBorder(new MarginBorder(TOP_LEVEL_SPACE));

    add(label);

    Figure line = new RectangleFigure();
    line.setBackgroundColor(ColorConstants.lightGray);
    line.setForegroundColor(ColorConstants.lightGray);
    line.setPreferredSize(700, 1);
    add(line);

    figure = new Figure();
    figure.setLayoutManager(new XYLayout());

    add(figure);
    setBorder(new LineBorder(ColorConstants.lightGray, 1));
}
项目:OnionUmlVisualization    文件:ClassFigure.java   
/**
 * Constructs a new ClassFigure with the specified background color
 * and fonts.
 * @param bgColor the background color of the class
 * @param nameFont the font to use for the name label of the class
 * @param contentFont the font to use for properties and operations
 * @param stereotypeFont the font to use for the stereotype label
 */
public ClassFigure(Color bgColor, Font nameFont, Font contentFont,
        Font stereotypeFont) {

    ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);
    setBorder(new LineBorder(ColorConstants.black, 1));
    setBackgroundColor(bgColor);
    setOpaque(true);

    mStereotypeLabel = new Label("");
    mNameLabel = new Label("");
    mStereotypeLabel.setFont(stereotypeFont);
    mNameLabel.setFont(nameFont);

    mContentFont = contentFont;

    mPropertiesFigure = new ClassSectionFigure(false);
    mOperationsFigure = new ClassSectionFigure(false);
    mOnionRelationshipsFigure = new ClassSectionFigure(true);

    reconstruct();
}
项目:gw4e.project    文件:EdgeFigure.java   
public BlockedFigure() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(true);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(false);
    layout.setSpacing(0);
    setLayoutManager(layout);
    setBorder(null);
    lblocked = new Label("", PreferenceManager.getImageBlocked());
    add(lblocked);
}
项目:gw4e.project    文件:EdgeFigure.java   
public GuardFigure() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(true);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(false);
    layout.setSpacing(0);
    setLayoutManager(layout);
    setBorder(null);
    lguarded = new Label("", PreferenceManager.getImageGuardScripted());
    add(lguarded);
}
项目:gw4e.project    文件:EdgeFigure.java   
public ActionFigure() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(true);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(false);
    layout.setSpacing(0);
    setLayoutManager(layout);
    setBorder(null);
}
项目:DarwinSPL    文件:DwEnumContainerFigure.java   
public DwEnumContainerFigure(DwGraphicalFeatureModelViewer editor) {
    super(editor);

    DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();

    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(false);
    layout.setSpacing(theme.getPrimaryMargin());        
    setLayoutManager(layout);   

    this.setBorder(new DwMarginLineBorder(new Insets(10, 10, 10, 10), theme.getLineColor(), theme.getLineWidth()));
}
项目:DarwinSPL    文件:DwEnumFigure.java   
@Override
protected void createChildFigures() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(false); 
    setLayoutManager(layout);


    DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();

    label = new Label();
    label.setFont(theme.getFeatureFont());
    label.setBorder(new MarginBorder(5));
    add(label);
}
项目:subclipse    文件:NodeTooltipFigure.java   
public NodeTooltipFigure(Node node) {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setStretchMinorAxis(false);
    setLayoutManager(layout);   
    setBackgroundColor(Activator.BGCOLOR);
    setOpaque(true);
    layout.setSpacing(5);

    // lazy loading and reuse
    if(dateFormat == null) {
        dateFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
    }

    Figure tooltip = new Figure();
    setToolTip(tooltip);

    add(createLabel("Action and path", JFaceResources.getHeaderFont(), Activator.FONT_COLOR));
    add(createLabel(node.getAction()+" "+node.getPath(), JFaceResources.getTextFont()));
    add(createLabel("Author", JFaceResources.getHeaderFont(), Activator.FONT_COLOR));
    add(createLabel(node.getAuthor(), JFaceResources.getTextFont()));
    add(createLabel("Date", JFaceResources.getHeaderFont(), Activator.FONT_COLOR));
    add(createLabel(dateFormat.format(node.getRevisionDate()), JFaceResources.getTextFont()));
    add(createLabel("Message", JFaceResources.getHeaderFont(), Activator.FONT_COLOR));
    add(createLabel(getFirstLines(node.getMessage(), NUMBER_OF_LOG_MESSAGE_LINES), JFaceResources.getTextFont()));
    if(node.getCopySrcPath() != null) {
        add(createLabel("From", JFaceResources.getHeaderFont(), Activator.FONT_COLOR));
        add(createLabel(format(node.getCopySrcRevision(), node.getCopySrcPath()), JFaceResources.getTextFont()));
    }
}
项目:ermasterr    文件:CategoryFigure.java   
public CategoryFigure(final String name) {
    setOpaque(true);

    final ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);

    label = new Label();
    label.setText(name);
    label.setBorder(new MarginBorder(7));
    this.add(label);
}
项目:ermasterr    文件:ModelPropertiesFigure.java   
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);
}
项目:ermasterr    文件:AbstractStyleSupport.java   
protected void initColumnArea(final IFigure columns) {
    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);
    layout.setSpacing(0);

    columns.setBorder(new MarginBorder(0, 2, 2, 2));
    columns.setLayoutManager(layout);

    columns.setBackgroundColor(null);
    columns.setOpaque(false);
}
项目:ermasterr    文件:ImageTest.java   
private static void main() throws FileNotFoundException {
    try {
        shell.setSize(100, 100);

        final LightweightSystem lws = new LightweightSystem(shell);

        final IFigure panel = new Figure();
        panel.setLayoutManager(new ToolbarLayout());

        initialize(panel);

        lws.setContents(panel);

        shell.open();

        final Display display = Display.getDefault();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }

    } finally {
        if (image != null) {
            image.dispose();
        }
    }
}
项目:ermaster-k    文件:CategoryFigure.java   
public CategoryFigure(String name) {
    this.setOpaque(true);

    ToolbarLayout layout = new ToolbarLayout();
    this.setLayoutManager(layout);

    this.label = new Label();
    this.label.setText(name);
    this.label.setBorder(new MarginBorder(7));
    this.add(this.label);
}
项目:ermaster-k    文件:ModelPropertiesFigure.java   
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);
}
项目:ermaster-k    文件:AbstractStyleSupport.java   
protected void initColumnArea(IFigure columns) {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);
    layout.setSpacing(0);

    columns.setBorder(new MarginBorder(0, 2, 2, 2));
    columns.setLayoutManager(layout);

    columns.setBackgroundColor(null);
    columns.setOpaque(false);
}
项目:ermaster-k    文件:ImageTest.java   
private static void main() throws FileNotFoundException {
    try {
        shell.setSize(100, 100);

        LightweightSystem lws = new LightweightSystem(shell);

        IFigure panel = new Figure();
        panel.setLayoutManager(new ToolbarLayout());

        initialize(panel);

        lws.setContents(panel);

        shell.open();

        Display display = Display.getDefault();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }

    } finally {
        if (image != null) {
            image.dispose();
        }
    }
}
项目:NEXCORE-UML-Modeler    文件:DataTypeFigure.java   
/**
 * DataTypeFigure
 * @param isDangling
 */
@SuppressWarnings("deprecation")
public DataTypeFigure(boolean isDangling) {
    setDangling(isDangling);

    ToolbarLayout layout = new ToolbarLayout();
    layout.setMatchWidth(false);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);

    setLayoutManager(layout);
    setOpaque(true);
}
项目:NEXCORE-UML-Modeler    文件:CompartmentFigure.java   
/**
 * Constructor
 */
public CompartmentFigure() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(false);
    layout.setSpacing(2);
    setLayoutManager(layout);
    this.setPreferredSize(20, 20);
    setBorder(new CompartmentFigureBorder());
}
项目:NEXCORE-UML-Modeler    文件:PackageCompartmentFigure.java   
/**
 * Constructor
 */
public PackageCompartmentFigure() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(false);
    layout.setSpacing(2);
    setLayoutManager(layout);
    setBackgroundColor(ColorConstants.red);
    // setBorder(new CompartmentFigureBorder());
}
项目:NEXCORE-UML-Modeler    文件:ClassFigure.java   
/**
 * ClassFigure
 * @param isDangling
 */
public ClassFigure(boolean isDangling) {
    setDangling(isDangling);

    ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);
    setOpaque(true);

    setBorder(new LineBorder(ColorConstants.black));
}
项目:NEXCORE-UML-Modeler    文件:EnumerationFigure.java   
/**
 * EnumerationFigure
 * @param isDangling
 */
public EnumerationFigure(boolean isDangling) {
    setDangling(isDangling);
    ToolbarLayout layout = new ToolbarLayout();
    setLayoutManager(layout);
    setOpaque(true);

    setBorder(new LineBorder(ColorConstants.black));
}
项目:NEXCORE-UML-Modeler    文件:ComponentFigure.java   
/**
 * ComponentFigure
 */
public ComponentFigure(boolean isDangling) {
    setDangling(isDangling);
    ToolbarLayout layout = new ToolbarLayout();

    setLayoutManager(layout);
    setBorder(new LineBorder(ColorConstants.black, 1));
    setOpaque(true);
}