org.eclipse.swt.widgets.Composite#getClientArea ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Composite#getClientArea ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: nebula   文件: GanttHeaderSpacedLayout.java
protected void layout(final Composite composite, final boolean flushCache) {
    if (flushCache || !_calculated) {
        recalculate(composite);
    }

    final Control[] children = composite.getChildren();

    final Rectangle bounds = composite.getClientArea();

    int y = _ganttHeaderSize;
    for (int i = 0; i < children.length; i++) {
        final Control child = children[i];
        final Point wantedSize = child.computeSize(SWT.DEFAULT, SWT.DEFAULT);

        child.setLocation(0, y);
        child.setSize(bounds.width, bounds.height - y);
        y += wantedSize.y;
    }

}
 
源代码2 项目: birt   文件: StyleChartViewer.java
public void paintControl( PaintEvent e )
{
	idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, e.gc );
	Composite co = (Composite) e.getSource( );
	Rectangle re = co.getClientArea( );
	Bounds bo = BoundsImpl.create( 0, 0, re.width, re.height );
	bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
	
	Generator gr = Generator.instance( );
	try
	{
		gr.render( idr, gr.build( idr.getDisplayServer( ),
				cm,
				bo,
				null,
				null,
				StyleProcessor.instance( ) ) );
	}
	catch ( ChartException ce )
	{
		ce.printStackTrace( );
	}
}
 
源代码3 项目: nebula   文件: CTreeLayout.java
protected void layout(Composite composite, boolean flushCache) {
	Rectangle area = composite.getClientArea();
	if(area.isEmpty()) return;
	
	if(flushCache) computeSize(composite, -1, -1, flushCache);

	ctree.getHeader().setBounds(
			area.x,
			area.y,
			area.width,
			headerSize.y
		);

	Point origin = ctree.getScrollPosition();
	int height = area.height-headerSize.y;
	ctree.body.setBounds(
			area.x-origin.x,
			area.y+headerSize.y-origin.y,
			(gtk ? Math.max(area.width, headerSize.x) : area.width),
			(gtk ? Math.max(height, contentHeight) : height)
		);
	
	layoutHeader();
	
	layoutContent();
	
	updateScrollBars();
}
 
/**
 * {@inheritDoc}
 */
@Override
public void layout(final Composite composite, final boolean force) {
	final Rectangle rect = composite.getClientArea();
	final Control[] children = composite.getChildren();
	for (final Control child : children) {
		child.setSize(rect.width, rect.height);
	}
}
 
源代码5 项目: xds-ide   文件: TabPageIndentation.java
@Override
public void layout(Composite composite, boolean force) {
    Rectangle rect = composite.getClientArea();
    Control[] children = composite.getChildren();
    for (int i = 0; i < children.length; i++) {
        children[i].setSize(rect.width, rect.height);
    }
}
 
源代码6 项目: xds-ide   文件: TabLineWrapping.java
@Override
public void layout(Composite composite, boolean force) {
    Rectangle rect = composite.getClientArea();
    Control[] children = composite.getChildren();
    for (int i = 0; i < children.length; i++) {
        children[i].setSize(rect.width, rect.height);
    }
}
 
源代码7 项目: APICloud-Studio   文件: FormatterModifyTabPage.java
public void layout(Composite composite, boolean force)
{
	Rectangle rect = composite.getClientArea();
	Control[] children = composite.getChildren();
	for (int i = 0; i < children.length; i++)
	{
		children[i].setSize(rect.width, rect.height);
	}
}
 
@Override
public void layout(Composite composite, boolean force) {
	Rectangle rect = composite.getClientArea();
	Control[] children = composite.getChildren();
	for (int i = 0; i < children.length; i++) {
		children[i].setSize(rect.width, rect.height);
	}
}
 
源代码9 项目: translationstudio8   文件: TSWizardDialog.java
/**
 * Returns the client area for the given composite according to this
 * layout.
 * 
 * @param c
 *            the composite
 * @return the client area rectangle
 */
public Rectangle getClientArea(Composite c) {
	Rectangle rect = c.getClientArea();
	rect.x = rect.x + marginWidth;
	rect.y = rect.y + marginHeight;
	rect.width = rect.width - 2 * marginWidth;
	rect.height = rect.height - 2 * marginHeight;
	return rect;
}
 
源代码10 项目: tmxeditor8   文件: TSWizardDialog.java
/**
 * Returns the client area for the given composite according to this
 * layout.
 * 
 * @param c
 *            the composite
 * @return the client area rectangle
 */
public Rectangle getClientArea(Composite c) {
	Rectangle rect = c.getClientArea();
	rect.x = rect.x + marginWidth;
	rect.y = rect.y + marginHeight;
	rect.width = rect.width - 2 * marginWidth;
	rect.height = rect.height - 2 * marginHeight;
	return rect;
}
 
源代码11 项目: birt   文件: ExpressionValueCellEditor.java
public void layout( Composite editor, boolean force )
{
	Rectangle bounds = editor.getClientArea( );
	Point size = btnPopup.computeSize( SWT.DEFAULT, SWT.DEFAULT, force );
	expressionText.setBounds( 0,
			0,
			bounds.width - size.x,
			bounds.height );
	btnPopup.setBounds( bounds.width - size.x, 0, size.x, bounds.height );
}
 
源代码12 项目: birt   文件: AutoDataBindingViewer.java
public void paintControl( PaintEvent e )
{
	idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, e.gc );
	Composite co = (Composite) e.getSource( );
	Rectangle re = co.getClientArea( );
	Bounds bo = BoundsImpl.create( 0, 0, re.width, re.height );
	bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
	
	RunTimeContext context = new RunTimeContext( );
	context.setULocale( ULocale.getDefault( ) );
	
	String[] set = {
			"Items", "Amounts"};//$NON-NLS-1$ //$NON-NLS-2$
	Object[][] data = {
			{
					"A", "B", "C"//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
			}, {
					Integer.valueOf( 7 ), Integer.valueOf( 2 ), Integer.valueOf( 5 )
			}
	};
	dree = new SimpleDataRowExpressionEvaluator( set, data );
	Generator gr = Generator.instance( );
	try
	{
		gr.bindData( dree, cm, context );
		gr.render( idr, gr.build( idr.getDisplayServer( ),
				cm,
				bo,
				null,
				context,
				null ) );
	}
	catch ( ChartException ce )
	{
		ce.printStackTrace( );
	}
}
 
源代码13 项目: birt   文件: ExpressionValueCellEditor.java
public void layout( Composite editor, boolean force )
{
	Rectangle bounds = editor.getClientArea( );
	Point size = btnPopup.computeSize( SWT.DEFAULT, SWT.DEFAULT, force );
	expressionText.setBounds( 0,
			0,
			bounds.width - size.x,
			bounds.height );
	btnPopup.setBounds( bounds.width - size.x, 0, size.x, bounds.height );
}
 
源代码14 项目: birt   文件: ExpressionValue.java
public void layout( Composite editor, boolean force )
{
	Rectangle bounds = editor.getClientArea( );
	Point size = btnPopup.computeSize( SWT.DEFAULT, SWT.DEFAULT, force );
	valueText.setBounds( 0, 0, bounds.width - size.x, bounds.height );
	btnPopup.setBounds( bounds.width - size.x, 0, size.x, bounds.height );
}
 
源代码15 项目: birt   文件: ExpressionValueCellEditor.java
public void layout( Composite editor, boolean force )
{
	Rectangle bounds = editor.getClientArea( );
	Point size = btnPopup.computeSize( SWT.DEFAULT, SWT.DEFAULT, force );
	expressionText.setBounds( 0,
			0,
			bounds.width - size.x,
			bounds.height );
	btnPopup.setBounds( bounds.width - size.x, 0, size.x, bounds.height );
}
 
源代码16 项目: birt   文件: CGridLayout.java
protected void layout( Composite composite, boolean flushCache )
{
	Rectangle rect = composite.getClientArea( );
	layout( composite,
			true,
			rect.x,
			rect.y,
			rect.width,
			rect.height,
			flushCache );
}
 
源代码17 项目: birt   文件: ExpressionCellEditor.java
public void layout( Composite editor, boolean force )
{
	Rectangle bounds = editor.getClientArea( );
	Point size = button.computeSize( SWT.DEFAULT, SWT.DEFAULT, force );
	if ( contents != null )
	{
		contents.setBounds( 0, 0, bounds.width - size.x, bounds.height );
	}
	button.setBounds( bounds.width - size.x, 0, size.x, bounds.height );
}
 
源代码18 项目: ice   文件: FileComboBoxCellEditor.java
@Override
public void layout(Composite editor, boolean force) {
	Rectangle bounds = editor.getClientArea();
	Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
	if (contents != null) {
		contents.setBounds(0, 0, bounds.width - size.x, bounds.height);
	}
	button.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
}
 
源代码19 项目: Pydev   文件: PromptOverlay.java
@Override
protected void layout(Composite composite, boolean flushCache) {
    if (styledText != null && !styledText.isDisposed()) {
        Rectangle bounds = composite.getClientArea();

        int height = bounds.height;
        int perc = (int) (height * percSize); // 30% to the input

        interactiveConsoleTextWidget.setBounds(bounds.x, bounds.y + height - perc, bounds.width,
                perc);
        styledText.setBounds(bounds.x, bounds.y, bounds.width, height - perc);
    }
}
 
源代码20 项目: olca-app   文件: DialogCellEditor.java
@Override
public void layout(Composite editor, boolean force) {
	Rectangle bounds = editor.getClientArea();
	Point size = hyperlink.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
	if (contents != null) {
		contents.setBounds(0, 0, bounds.width - size.x, bounds.height);
	}
	hyperlink
			.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
}