Java Code Examples for org.eclipse.draw2d.ToolbarLayout#setMinorAlignment()

The following examples show how to use org.eclipse.draw2d.ToolbarLayout#setMinorAlignment() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public EventFigure(ITimelineEvent event) {

		final ToolbarLayout layout = new ToolbarLayout(false);
		layout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
		layout.setStretchMinorAxis(true);
		setLayoutManager(layout);
		setLayoutManager(new CenterLayout());

		setLineWidth(2);

		fLabel = new Label(event.getTitle());
		fLabel.setForegroundColor(ColorConstants.black);
		add(fLabel);

		if (event.getMessage() != null)
			setToolTip(new EventTooltip(event.getMessage()));
	}
 
Example 2
Source File: SimpleStyleSupport.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@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);
}
 
Example 3
Source File: ModelPropertiesFigure.java    From erflute with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example 4
Source File: SimpleStyleSupport.java    From erflute with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 5
Source File: SimpleStyleSupport.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * {@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);
}
 
Example 6
Source File: ModelPropertiesFigure.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 7
Source File: AbstractStyleSupport.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 8
Source File: AbstractStyleSupport.java    From erflute with Apache License 2.0 5 votes vote down vote up
protected void initColumnArea(IFigure columns) {
    final 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);
}
 
Example 9
Source File: MethodClassSection.java    From JDeodorant with MIT License 5 votes vote down vote up
public MethodClassSection(){
	//setFont( Display.getCurrent().getSystemFont() ); 
	ToolbarLayout layout = new ToolbarLayout();
	layout.setSpacing(5);
	layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
	layout.setStretchMinorAxis(true);
	setLayoutManager(layout);

}
 
Example 10
Source File: ModelPropertiesFigure.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 11
Source File: AbstractStyleSupport.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
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);
}