org.eclipse.draw2d.FlowLayout Java Examples

The following examples show how to use org.eclipse.draw2d.FlowLayout. 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: NormalColumnFigure.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
public NormalColumnFigure() {
    final FlowLayout layout = new FlowLayout();
    layout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
    setLayoutManager(layout);

    setBorder(new MarginBorder(new Insets(0, 5, 0, 0)));
}
 
Example #2
Source File: FunnyStyleSupport.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initTitleBar(final Figure top) {
    top.setLayoutManager(new BorderLayout());

    final Figure title = new Figure();
    top.add(title, BorderLayout.TOP);
    final FlowLayout titleLayout = new FlowLayout();
    titleLayout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
    title.setLayoutManager(titleLayout);

    final ImageFigure image = new ImageFigure();
    image.setBorder(new MarginBorder(new Insets(5, 10, 5, 2)));
    image.setImage(ERDiagramActivator.getImage(getTableFigure().getImageKey()));
    title.add(image);

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

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

    top.add(separater, BorderLayout.BOTTOM);
}
 
Example #3
Source File: GroupColumnFigure.java    From erflute with Apache License 2.0 5 votes vote down vote up
public GroupColumnFigure() {
    final FlowLayout layout = new FlowLayout();
    layout.setStretchMinorAxis(true);
    layout.setMajorSpacing(0);
    layout.setMinorSpacing(0);
    setLayoutManager(layout);
}
 
Example #4
Source File: NormalColumnFigure.java    From erflute with Apache License 2.0 5 votes vote down vote up
public NormalColumnFigure() {
    final FlowLayout layout = new FlowLayout();
    layout.setStretchMinorAxis(true);
    layout.setMajorSpacing(0);
    layout.setMinorSpacing(0);
    setLayoutManager(layout);
}
 
Example #5
Source File: FunnyStyleSupport.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
public void initTitleBar(Figure top) {
    top.setLayoutManager(new BorderLayout());

    final FlowLayout layout = new FlowLayout();
    layout.setStretchMinorAxis(true);
    final Figure title = new Figure();
    top.add(title, BorderLayout.TOP);
    title.setLayoutManager(layout);

    title.setBorder(new MarginBorder(new Insets(2, 2, 2, 2)));

    final ImageFigure image = new ImageFigure();
    image.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));
    image.setImage(Activator.getImage(getTableFigure().getImageKey()));
    title.add(image);

    this.nameLabel = new Label();
    nameLabel.setBorder(new MarginBorder(new Insets(0, 0, 0, 20)));
    title.add(nameLabel);

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

    top.add(separater, BorderLayout.BOTTOM);
}
 
Example #6
Source File: ProportionalFlowLayout.java    From JDeodorant with MIT License 5 votes vote down vote up
public ProportionalFlowLayout(double scale, int widthSpacing, int heightSpacing){
	setStretchMinorAxis(false);
	setMinorSpacing(widthSpacing);
	setMajorSpacing(heightSpacing);
	setMinorAlignment(FlowLayout.ALIGN_TOPLEFT);
	setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
	this.scale= scale;
}
 
Example #7
Source File: AttributeEditPart.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
protected IFigure createFigure( )
{

	ColumnFigure columnFigure = null;
	columnFigure = new AttributeFigure( );
	FlowLayout layout = new FlowLayout( );
	layout.setMinorSpacing( 2 );
	columnFigure.setLayoutManager( layout );
	columnFigure.setOpaque( true );
	String name = OlapUtil.getDataFieldDisplayName( getColumn( ) );
	label = new Label( name );
	columnFigure.add( label );
	return columnFigure;

}
 
Example #8
Source File: HierarchyColumnEditPart.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
protected IFigure createFigure( )
{
	ColumnFigure columnFigure = null;
	columnFigure = new ColumnFigure( );
	FlowLayout layout = new FlowLayout( );
	layout.setMinorSpacing( 2 );
	columnFigure.setLayoutManager( layout );
	columnFigure.setOpaque( true );
	String name = OlapUtil.getDataFieldDisplayName( getColumn( ) );
	label = new Label( name );
	columnFigure.add( label );
	return columnFigure;
}
 
Example #9
Source File: ColumnEditPart.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
protected IFigure createFigure( )
{
	ColumnFigure columnFigure = null;
	columnFigure = new ColumnFigure( );
	FlowLayout layout = new FlowLayout( );
	layout.setMinorSpacing( 2 );
	columnFigure.setLayoutManager( layout );
	columnFigure.setOpaque( true );
	String name = OlapUtil.getDataFieldDisplayName( getColumn( ) );
	label = new Label( name );
	columnFigure.add( label );
	return columnFigure;
}
 
Example #10
Source File: GroupColumnFigure.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
public GroupColumnFigure() {
	FlowLayout layout = new FlowLayout();
	layout.setStretchMinorAxis(true);
	layout.setMajorSpacing(0);
	layout.setMinorSpacing(0);
	this.setLayoutManager(layout);
}
 
Example #11
Source File: NormalColumnFigure.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
public NormalColumnFigure() {
	FlowLayout layout = new FlowLayout();
	layout.setStretchMinorAxis(true);
	layout.setMajorSpacing(0);
	layout.setMinorSpacing(0);
	this.setLayoutManager(layout);
}
 
Example #12
Source File: FunnyStyleSupport.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initTitleBar(Figure top) {
	top.setLayoutManager(new BorderLayout());

	FlowLayout layout = new FlowLayout();
	layout.setStretchMinorAxis(true);
	Figure title = new Figure();
	top.add(title, BorderLayout.TOP);
	title.setLayoutManager(layout);

	if (new BigDecimal("1.5").equals(getSettings().getTitleFontEm())) {
		title.setBorder(new MarginBorder(new Insets(2, 2, 2, 2)));
	} else {
		title.setBorder(new MarginBorder(new Insets(4, 4, 4, 4)));
	}

	ImageFigure image = new ImageFigure();
	image.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));
	image.setImage(Activator.getImage(this.getTableFigure().getImageKey()));
	title.add(image);

	this.nameLabel = new Label();
	this.nameLabel.setBorder(new MarginBorder(new Insets(0, 0, 0, 20)));
	title.add(this.nameLabel);

	Figure separater = new Figure();
	separater.setSize(-1, 1);
	separater.setBackgroundColor(ColorConstants.black);
	separater.setOpaque(true);

	top.add(separater, BorderLayout.BOTTOM);
}
 
Example #13
Source File: ManualOverride.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IFigure createMain ()
{
    final LayeredPane root = new LayeredPane ();

    final Layer figureLayer = new Layer ();
    figureLayer.setLayoutManager ( new FlowLayout () );

    final ConnectionLayer connectionLayer = new ConnectionLayer ();
    connectionLayer.setAntialias ( SWT.ON );

    final Figure figure = new Figure ();
    figureLayer.add ( figure );

    final GridLayout gridLayout = new GridLayout ( 3, true );
    gridLayout.horizontalSpacing = 50;
    gridLayout.verticalSpacing = 50;
    figure.setLayoutManager ( gridLayout );

    final Figure rpvFigure = createRPV ();
    final Figure pvFigure = createPV ();
    final Figure rmvFigure = createRMV ();
    final Figure mvFigure = createMV ();
    final Figure rvFigure = createRV ();

    figure.add ( rpvFigure, new GridData ( GridData.CENTER, GridData.CENTER, true, true, 1, 1 ) );
    figure.add ( pvFigure, new GridData ( GridData.CENTER, GridData.CENTER, true, true, 1, 2 ) );
    figure.add ( rvFigure, new GridData ( GridData.CENTER, GridData.CENTER, true, true, 1, 3 ) );

    figure.add ( rmvFigure, new GridData ( GridData.CENTER, GridData.CENTER, true, true, 1, 1 ) );

    figure.add ( mvFigure, new GridData ( GridData.CENTER, GridData.CENTER, true, true, 1, 1 ) );
    figure.add ( new Figure (), new GridData ( GridData.CENTER, GridData.CENTER, true, true, 1, 1 ) ); // placeholder

    connectionLayer.add ( this.p2rConnection = createConnection ( this.pvRect, this.rvRect ) );
    connectionLayer.add ( this.m2rConnection = createConnection ( this.mvRect, this.rvRect ) );

    connectionLayer.add ( this.rp2pConnection = createConnection ( this.rpvRect, this.pvRect ) );
    connectionLayer.add ( this.rm2pConnection = createConnection ( this.rmvRect, this.pvRect ) );

    root.add ( figureLayer );
    root.add ( connectionLayer );

    return root;
}
 
Example #14
Source File: GroupColumnFigure.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
public GroupColumnFigure() {
    final FlowLayout layout = new FlowLayout();
    setLayoutManager(layout);
}
 
Example #15
Source File: IndexFigure.java    From erflute with Apache License 2.0 4 votes vote down vote up
public IndexFigure() {
    final FlowLayout layout = new FlowLayout();
    setLayoutManager(layout);
}
 
Example #16
Source File: IndexFigure.java    From ermaster-b with Apache License 2.0 4 votes vote down vote up
public IndexFigure() {
	FlowLayout layout = new FlowLayout();
	this.setLayoutManager(layout);
	
}