当前位置: 首页>>代码示例>>Java>>正文


Java FXCanvas.setLayoutData方法代码示例

本文整理汇总了Java中javafx.embed.swt.FXCanvas.setLayoutData方法的典型用法代码示例。如果您正苦于以下问题:Java FXCanvas.setLayoutData方法的具体用法?Java FXCanvas.setLayoutData怎么用?Java FXCanvas.setLayoutData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.embed.swt.FXCanvas的用法示例。


在下文中一共展示了FXCanvas.setLayoutData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDialogArea

import javafx.embed.swt.FXCanvas; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite area = (Composite) super.createDialogArea(parent);
	Composite container = new Composite(area, SWT.NONE);
	container.setLayout(new GridLayout(1, false));
	container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	FXCanvas fxCanvas = new FXCanvas(container, SWT.NONE);
	fxCanvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	VBox vBox = new VBox();
	Scene scene = new Scene(vBox);
	fxCanvas.setScene(scene);
	vBox.getChildren().add(createTraceWidget(extractor1, "First Trace", scene.widthProperty()));
	vBox.getChildren().add(createTraceWidget(extractor2, "Second Trace", scene.widthProperty()));
	
	return area;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:17,代码来源:TraceSectionsDialog.java

示例2: createGUI

import javafx.embed.swt.FXCanvas; //导入方法依赖的package包/类
private void createGUI(final Composite parent)
{
    final GridLayout layout = new GridLayout(1, false);
    parent.setLayout(layout);

    ModelBasedPlot plot;
    try
    {
        plot = new ModelBasedPlot(true);
    }
    catch (Exception e1)
    {
        e1.printStackTrace();
        return;
    }
    final FXCanvas canvas = new FXCanvas(parent, SWT.NONE);
    canvas.setScene(new Scene(plot.getPlot()));
    canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, layout.numColumns, 1));

    // [Done] button to end demo
    final Button ok = new Button(parent, SWT.PUSH);
    ok.setText("Done");
    ok.setLayoutData(new GridData(SWT.RIGHT, 0, true, false));
    ok.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            run = false;
        }
    });

    //        plot.addListener(listener);

    // Create demo samples
    final List<PlotSample> values = new ArrayList<PlotSample>();
    for (int i=1; i<10; ++i)
        values.add(new PlotSample("Test", TestHelper.makeValue(i)));
    values.add(new PlotSample("Test", TestHelper.makeError(15, "Disconnected")));
    // Single value. Line should continue until the following 'disconnect'.
    values.add(new PlotSample("Test", TestHelper.makeValue(17)));
    values.add(new PlotSample("Test", TestHelper.makeError(18, "Disconnected")));

    for (int i=20; i<30; ++i)
        values.add(new PlotSample("Test", TestHelper.makeValue(i)));

    final PlotSampleArray samples = new PlotSampleArray();
    samples.set(values);

    // Add item with demo samples
    final ModelItem item = new ModelItem("Demo")
    {
        @Override
        public PlotSamples getSamples()
        {
            return samples;
        }

        @Override
        public void write(final PrintWriter writer)
        {
            // NOP
        }
    };
    //TODO: Fix or remove
    //item.setColor(new RGB(0, 0, 255));
    plot.addTrace(item);

    //        start_time = VTypeHelper.getTimestamp(samples.getSample(0).getValue());
    //        end_time = VTypeHelper.getTimestamp(samples.getSample(samples.getSize()-1).getValue());
    //        plot.setTimeRange(start_time, end_time);
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:73,代码来源:PlotDemo.java

示例3: createPageControl

import javafx.embed.swt.FXCanvas; //导入方法依赖的package包/类
/**
	 * Creates custom control for user-defined query text.
	 * @throws IOException 
	 */
	private Control createPageControl( Composite parent ) throws IOException
	{
		Composite composite = new Composite( parent, SWT.NONE );
		composite.setLayout( new GridLayout( 1, false ) );
//		GridData gridData = new GridData( GridData.HORIZONTAL_ALIGN_FILL
//				| GridData.VERTICAL_ALIGN_FILL );
//		composite.setLayoutData( gridData );

		FXCanvas fxCanvas = new FXCanvas(composite, SWT.NONE);
		
		FXMLLoader loader = new FXMLLoader(getClass().getResource("/Scene.fxml"));
		Parent root = (Parent) loader.load();
		
		Scene scene = new Scene(root);
		fxCanvas.setScene(scene);

		Platform.setImplicitExit(false);
		GridData webData = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
		fxCanvas.setLayoutData( webData );
		controller = ((FXMLController) loader.getController());
		controller.addQueryAreaChangeListener(new ChangeListener<String>() {
		    @Override
		    public void changed(ObservableValue<? extends String> observable,
		            String oldValue, String newValue) {
		    	validateData();
		    }
		});
		
		try {
			java.util.Properties connProps = 
					DesignSessionUtil.getEffectiveDataSourceProperties( 
							getInitializationDesign().getDataSourceDesign() );
			String hostName = connProps.getProperty("hostName");
			String port = connProps.getProperty("port");
			String path = connProps.getProperty("path");
			controller.setSearchFieldText("http://"+hostName+":"+port+path);
			controller.search();
			
		} catch (OdaException e) {
			e.printStackTrace();
		}
		
		setPageComplete( false );
		return composite;
	}
 
开发者ID:Kratos-ISE,项目名称:birt-kairosdb-datasource-plugin,代码行数:50,代码来源:CustomDataSetWizardPage.java


注:本文中的javafx.embed.swt.FXCanvas.setLayoutData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。