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


Java SWT.DOUBLE_BUFFERED属性代码示例

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


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

示例1: createDataLabel

protected final DoubleBufferedLabel createDataLabel(int width, boolean centered) {
	width = (int)(width * width_multiplier );
	assertConstructing();
	DoubleBufferedLabel result = new DoubleBufferedLabel(splash, (centered ? SWT.CENTER : SWT.NULL) | SWT.DOUBLE_BUFFERED );
    result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);
    result.setText("");
    result.addMouseListener(this.mListener);
    result.addMouseMoveListener(this.mMoveListener);
    if (this.hSize == -1) {
    	throw new RuntimeException("must add fixed text label first!");
    }
    result.setSize(width, hSize);
    result.setLocation(this.xSize, 0);
    result.setMenu(this.menu);
    this.xSize += width + 3;
    return result;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:17,代码来源:MiniBar.java

示例2: BufferedLabel

public
BufferedLabel(
	Composite	composite,
	int			attrs )
{
	super((attrs&SWT.DOUBLE_BUFFERED)==0?new Label( composite, attrs ):new DoubleBufferedLabel( composite, attrs ));

	label = (Control)getWidget();

	ClipboardCopy.addCopyToClipMenu(
		label,
		new ClipboardCopy.copyToClipProvider()
		{
			@Override
			public String
			getText()
			{
				return( BufferedLabel.this.getText());
			}
		});
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:21,代码来源:BufferedLabel.java

示例3: initialize

public void initialize(Composite composite, int defaultOrientation) {
	display = composite.getDisplay();
	composite.addDisposeListener((DisposeListener) this::dispose);
	
	tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED );
	table = tableViewer.getTable();
	
       GridData gridData = new GridData();
       gridData.verticalAlignment = GridData.FILL;
       gridData.horizontalSpan = 2;
       gridData.grabExcessHorizontalSpace = true;
       gridData.grabExcessVerticalSpace = true;
       gridData.horizontalAlignment = GridData.FILL;
       tableViewer.getControl().setLayoutData(gridData);
	
	tableViewer.setContentProvider((ILazyContentProvider) rowIndex -> tableViewer.replace(contentProvider().getTableEntries().get(rowIndex), rowIndex));
	table.addListener(SWT.Selection, event-> {
		TableItem item = (TableItem) event.item;
		contentProvider().setCursorIndex(contentProvider().getRowIndex((RankedItem<T>) item.getData()));
		handleSelection();
	});
	composite.getShell().addListener(SWT.Resize, event ->  autoAdjustColumnWidths(composite));
	
	// TODO try throttleLast or custom scheduler
	//subjectFilter.debounce(0, TimeUnit.MILLISECONDS).subscribe( filter -> handleRefresh(filter));

}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:27,代码来源:KaviList.java

示例4: ImageLabel

public
ImageLabel(
	Composite 	parent,
	Image		_image )
{
	super( parent, SWT.DOUBLE_BUFFERED );

	image	= _image;

	addPaintListener(this);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:11,代码来源:SBC_SearchResultsView.java

示例5: DoubleBufferedLabel

public DoubleBufferedLabel(
	Composite 	parent,
	int 		style )
{
	super( parent, style | SWT.DOUBLE_BUFFERED );

		// only support GridLayout I'm afraid...

	GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);

	setLayoutData(gridData);

	addPaintListener(this);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:14,代码来源:DoubleBufferedLabel.java

示例6: main

public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(1200, 500);
	shell.setLayout(new GridLayout());
	shell.setLocation(100, 150);

	Figure root = new Figure();
	root.setFont(shell.getFont());
	//		XYLayout layout = new XYLayout();
	//		root.setLayoutManager(layout);

	org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
	layout.horizontalSpacing = 100;
	root.setLayoutManager(layout);

	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));

	createDiagram(root);

	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);

	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:32,代码来源:TestFigure.java

示例7: main

public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(1200, 500);
	shell.setLayout(new GridLayout());
	shell.setLocation(100, 150);
	
	Figure root = new Figure();
	root.setFont(shell.getFont());
	//		XYLayout layout = new XYLayout();
	//		root.setLayoutManager(layout);
	
	org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
	layout.horizontalSpacing = 100;
	root.setLayoutManager(layout);
	
	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	MatrixWidget widget = new MatrixWidget();
	MockArray array = new MockArray("int[]", new int[]{1,2,3}, new int[]{4,5,6}, new int[]{7,8,9}, new int[]{10,11,12});
	root.add(widget.createFigure(array));
	
	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);
	
	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:34,代码来源:TestMatrixWidget.java

示例8: main

public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(365, 280);
	shell.setLayout(new GridLayout());

	Figure root = new Figure();
	root.setFont(shell.getFont());
	XYLayout layout = new XYLayout();
	root.setLayoutManager(layout);

	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));

	VarParser parser = new VarParser("src/pt/iscte/pandionj/tests/Test.java");
	parser.run();
	System.out.println(parser.toText());
	
	createDiagram(root, parser);
	
	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);
	

	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:32,代码来源:TestFigureParser.java

示例9: CustomFigureCanvas

public CustomFigureCanvas(Composite parent, LightweightSystem lws, CustomPaletteViewer toolViewer, PaletteRoot paletteRoot,ELTGraphicalEditor editor) {
    this(SWT.DOUBLE_BUFFERED, parent, lws, toolViewer, paletteRoot,editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:3,代码来源:CustomFigureCanvas.java

示例10: buildRouteComponent

private void
 buildRouteComponent(
int			rows )
 {
  boolean	changed = false;

  if ( rows <= route_labels.length ){

	  for ( int i=rows;i<route_labels.length;i++){

		  for ( int j=0;j<3;j++){

			  route_labels[i][j].setText( "" );
		  }
	  }
  }else{

	  Control[] labels = route_comp.getChildren();
	  for (int i = 0; i < labels.length; i++){
			labels[i].dispose();
	  }

	  Label h1 = new Label( route_comp, SWT.NULL );
	  Utils.setLayoutData(h1,  new GridData(GridData.FILL_HORIZONTAL ));
	  h1.setText( MessageText.getString( "label.route" ));
	  Label h2 = new Label( route_comp, SWT.NULL );
	  Utils.setLayoutData(h2,  new GridData(GridData.FILL_HORIZONTAL ));
	  h2.setText( MessageText.getString( "tps.type.incoming" ));
	  Label h3 = new Label( route_comp, SWT.NULL );
	  Utils.setLayoutData(h3,  new GridData(GridData.FILL_HORIZONTAL ));
	  h3.setText( MessageText.getString( "label.outgoing" ));

	  new Label( route_comp, SWT.NULL );
	  new Label( route_comp, SWT.NULL );
	  new Label( route_comp, SWT.NULL );

	  route_labels = new BufferedLabel[rows][3];

	  for ( int i=0;i<rows;i++ ){

		  for ( int j=0;j<3;j++){
			  BufferedLabel l = new BufferedLabel( route_comp, SWT.DOUBLE_BUFFERED );
			  GridData gridData = new GridData(GridData.FILL_HORIZONTAL );
			  Utils.setLayoutData(l,  gridData );
			  route_labels[i][j] = l;
		  }
	  }

	  changed = true;
  }

  Point size = route_comp.computeSize(route_comp.getParent().getSize().x, SWT.DEFAULT);

  changed = changed || !route_comp.getSize().equals( size );

  route_comp.setSize(size);

  if ( !changed ){

	  	// sometimes things get layouted when not visibel and things don't work proper when visibilized ;(
	  	// look for something zero height that shouldn't be

	  for ( int i=0;i<route_labels.length;i++){
		  for (int j=0;j<3;j++){
			  BufferedLabel lab = route_labels[i][j];
			  if ( lab.getControl().getSize().y == 0 &&  lab.getText().length() > 0 ){
				  changed = true;
			  }
		  }
	  }
  }

  if ( changed ){

	  route_comp.getParent().layout( true, true );
  }

  route_comp.update();
 }
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:79,代码来源:TransferStatsView.java

示例11: RuntimeViewer

RuntimeViewer(Composite parent) {
	super(parent, SWT.BORDER);
	instance = this;

	setLayout(new FillLayout());
	setBackground(PandionJConstants.Colors.VIEW_BACKGROUND);
	scroll = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL);
	scroll.setBackground(PandionJConstants.Colors.VIEW_BACKGROUND);
	canvas = new Canvas(scroll, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
	scroll.setContent(canvas);
	addMenu();

	//				rootFig = new ScalableLayeredPane();
	//				((ScalableLayeredPane) rootFig).setScale(2);
	rootFig = new Figure();
	rootFig.setOpaque(true);
	rootGrid = new GridLayout(2, false);
	rootGrid.horizontalSpacing = PandionJConstants.STACK_TO_OBJECTS_GAP;
	rootGrid.marginWidth = PandionJConstants.MARGIN;
	rootGrid.marginHeight = PandionJConstants.MARGIN;
	rootFig.setLayoutManager(rootGrid);

	stackFig = new StackContainer();
	rootFig.add(stackFig);
	org.eclipse.draw2d.GridData d = new org.eclipse.draw2d.GridData(SWT.BEGINNING, SWT.BEGINNING, true, true);
	d.widthHint = Math.max(PandionJConstants.STACKCOLUMN_MIN_WIDTH, stackFig.getPreferredSize().width);
	rootGrid.setConstraint(stackFig, d);

	objectContainers = new ArrayList<>();
	objectContainer = ObjectContainer.create(true);
	rootFig.add(objectContainer);
	rootGrid.setConstraint(objectContainer, new org.eclipse.draw2d.GridData(SWT.FILL, SWT.FILL, true, true));

	lws = new LightweightSystem(canvas);
	lws.setContents(rootFig);
	pointersMap = new HashMap<>();
	pointersMapOwners = ArrayListMultimap.create();

}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:41,代码来源:RuntimeViewer.java

示例12: Breadcrumb

/**
 * Constructs a new instance of this class given its parent
 * and a style value describing its behavior and appearance.
 * <p>
 * The style value is either one of the style constants defined in
 * class <code>SWT</code> which is applicable to instances of this
 * class, or must be built by <em>bitwise OR</em>'ing together 
 * (that is, using the <code>int</code> "|" operator) two or more
 * of those <code>SWT</code> style constants. The class description
 * lists the style constants that are applicable to the class.
 * Style bits are also inherited from superclasses.
 * </p>
 *
 * @param parent a composite control which will be the parent of the new instance (cannot be null)
 * @param style the style of control to construct
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
 *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
 * </ul>
 *
 * @see Widget#getStyle()
 */
public Breadcrumb(final Composite parent, final int style) {
	super(parent, checkStyle(style) | SWT.DOUBLE_BUFFERED);
	this.items = new ArrayList<BreadcrumbItem>();
	this.hasBorder = (style & SWT.BORDER) != 0;
	addListeners();
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:32,代码来源:Breadcrumb.java


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