Java Code Examples for org.eclipse.swt.SWT#NO_BACKGROUND

The following examples show how to use org.eclipse.swt.SWT#NO_BACKGROUND . 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: HopGui.java    From hop with Apache License 2.0 6 votes vote down vote up
protected void addPerspectivesToolbar() {
  // We can't mix horizontal and vertical toolbars so we need to add a composite.
  //
  shell.setLayout( new FormLayout() );
  mainHopGuiComposite = new Composite( shell, SWT.NO_BACKGROUND );
  mainHopGuiComposite.setLayout( new FormLayout() );
  FormData formData = new FormData();
  formData.left = new FormAttachment( 0, 0 );
  formData.right = new FormAttachment( 100, 0 );
  formData.top = new FormAttachment( mainToolbar, 0 );
  formData.bottom = new FormAttachment( 100, 0 );
  mainHopGuiComposite.setLayoutData( formData );

  perspectivesToolbar = new ToolBar( mainHopGuiComposite, SWT.WRAP | SWT.RIGHT | SWT.VERTICAL );
  props.setLook( perspectivesToolbar, PropsUi.WIDGET_STYLE_TOOLBAR );
  FormData fdToolBar = new FormData();
  fdToolBar.left = new FormAttachment( 0, 0 );
  fdToolBar.top = new FormAttachment( 0, 0 );
  fdToolBar.bottom = new FormAttachment( 100, 0 );
  perspectivesToolbar.setLayoutData( fdToolBar );

  perspectivesToolbarWidgets = new GuiToolbarWidgets();
  perspectivesToolbarWidgets.registerGuiPluginObject( this );
  perspectivesToolbarWidgets.createToolbarWidgets( perspectivesToolbar, GUI_PLUGIN_PERSPECTIVES_PARENT_ID );
  perspectivesToolbar.pack();
}
 
Example 2
Source File: SwtLiveChartViewer.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * execute application
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display, SWT.CLOSE );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	c3dViewer = new SwtLiveChartViewer( shell, SWT.NO_BACKGROUND );
	c3dViewer.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	c3dViewer.addPaintListener( c3dViewer );


	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 3
Source File: PieceDistributionView.java    From BiglyBT with GNU General Public License v2.0 6 votes vote down vote up
private void createPieceDistPanel() {
	comp.setLayout(new FillLayout());
	//pieceDistComposite = new Composite(parent, SWT.NONE);
	pieceDistCanvas = new Canvas(comp,SWT.NO_BACKGROUND);
	pieceDistCanvas.addListener(SWT.Paint, new Listener() {
		@Override
		public void handleEvent(Event event) {
			if ( pem==null || pem.isDestroyed()){
				event.gc.fillRectangle(event.x, event.y, event.width, event.height);
			}else{
				if (imgToPaint != null && !imgToPaint.isDisposed()) {
					event.gc.drawImage(imgToPaint, 0, 0);
				}
			}
		}
	});
}
 
Example 4
Source File: BlurredPanel.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Show the blurred panel
 */
public void show() {
	if (parent.isDisposed()) {
		SWT.error(SWT.ERROR_WIDGET_DISPOSED);
	}

	panel = new Shell(parent, SWT.APPLICATION_MODAL | SWT.NO_TRIM);
	panel.setLayout(new FillLayout());

	panel.addListener(SWT.KeyUp, event -> {
		event.doit = false;
	});

	canvas = new Canvas(panel, SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED);
	canvas.addPaintListener(event -> {
		paintCanvas(event);
	});

	panel.setBounds(panel.getDisplay().map(parent, null, parent.getClientArea()));
	panel.open();

}
 
Example 5
Source File: CalendarComposite.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public CalendarComposite(Composite parent, Calendar selectedDay, Calendar disallowBeforeDate, Calendar disallowAfterDate, IColorManager colorManager, ISettings settings,
		boolean dateRange, Calendar rangeStart, Calendar rangeEnd) {
	super(parent, SWT.NO_BACKGROUND | SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED);
	this.mSelectedDay = selectedDay;
	this.mCalendar = selectedDay;
	this.mColorManager = colorManager;
	this.mSettings = settings;
	this.mDisallowBeforeDate = disallowBeforeDate;
	this.mDisallowAfterDate = disallowAfterDate;
	this.mDateRange = dateRange;
	if (dateRange) {
		this.mMouseDownDay = rangeStart;
		this.mMouseUpDay = rangeEnd;
	}

	init();

	build();
}
 
Example 6
Source File: TimeGraphMarkerAxis.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Contructor
 *
 * @param parent
 *            The parent composite object
 * @param colorScheme
 *            The color scheme to use
 * @param timeProvider
 *            The time data provider
 */
public TimeGraphMarkerAxis(Composite parent, @NonNull TimeGraphColorScheme colorScheme, @NonNull ITimeDataProvider timeProvider) {
    super(parent, colorScheme, SWT.NO_BACKGROUND | SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED);
    fTimeProvider = timeProvider;
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDown(MouseEvent e) {
            Point size = getSize();
            Rectangle bounds = new Rectangle(0, 0, size.x, size.y);
            TimeGraphMarkerAxis.this.mouseDown(e, bounds, fTimeProvider.getNameSpace());
        }
    });
}
 
Example 7
Source File: BeamJobConfigDialog.java    From kettle-beam with Apache License 2.0 5 votes vote down vote up
private void addParametersTab() {
  wParametersTab = new CTabItem( wTabFolder, SWT.NONE );
  wParametersTab.setText( "Parameters" );

  wParametersComp = new Composite( wTabFolder, SWT.NO_BACKGROUND );
  props.setLook( wParametersComp );
  wParametersComp.setLayout( new FormLayout() );

  ColumnInfo[] columnInfos = new ColumnInfo[] {
    new ColumnInfo( "Name", ColumnInfo.COLUMN_TYPE_TEXT, false, false ),
    new ColumnInfo( "Value", ColumnInfo.COLUMN_TYPE_TEXT, false, false ),
  };

  wParameters = new TableView( space, wParametersComp, SWT.BORDER, columnInfos, config.getParameters().size(), null, props );
  props.setLook( wParameters );
  FormData fdParameters = new FormData();
  fdParameters.left = new FormAttachment( 0, 0 );
  fdParameters.right = new FormAttachment( 100, 0 );
  fdParameters.top = new FormAttachment( 0, 0 );
  fdParameters.bottom = new FormAttachment( 100, 0 );
  wParameters.setLayoutData( fdParameters );

  FormData fdParametersComp = new FormData();
  fdParametersComp.left = new FormAttachment( 0, 0 );
  fdParametersComp.right = new FormAttachment( 100, 0 );
  fdParametersComp.top = new FormAttachment( 0, 0 );
  fdParametersComp.bottom = new FormAttachment( 100, 0 );
  wParametersComp.setLayoutData( fdParametersComp );

  wParametersTab.setControl( wParametersComp );
}
 
Example 8
Source File: GISFileViewer.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void createPartControl(final Composite composite) {
	final Composite parent = GamaToolbarFactory.createToolbars(this, composite);
	displayInfoString();
	pane = new SwtMapPane(parent, SWT.NO_BACKGROUND, new StreamingRenderer(), content);
	pane.setBackground(GamaColors.system(SWT.COLOR_WHITE));
	pane.redraw();
}
 
Example 9
Source File: TextIconButton.java    From swt-bling with MIT License 5 votes vote down vote up
public TextIconButton(Composite parent, int style, ColorPalette colorPalette, ButtonRenderer buttonRenderer,
    ButtonStyles buttonStyles) {
  super(parent, style | SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
  this.colorPalette = colorPalette;
  this.buttonRenderer = buttonRenderer;
  this.buttonStyles = buttonStyles;
  this.currentStyle = buttonStyles.getNormal();
  initializeBackground();
  addListeners();
}
 
Example 10
Source File: Regression_139334_swt.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	Regression_139334_swt siv = new Regression_139334_swt(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Bar Chart" );
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 11
Source File: SimpleDemo.java    From lwjgl3-swt with MIT License 5 votes vote down vote up
public static void main(String[] args) {
    // Create the Vulkan instance
    VkInstance instance = createInstance();

    // Create SWT Display, Shell and VKCanvas
    final Display display = new Display();
    final Shell shell = new Shell(display, SWT.SHELL_TRIM | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE);
    shell.setLayout(new FillLayout());
    shell.addListener(SWT.Traverse, new Listener() {
        public void handleEvent(Event event) {
            switch (event.detail) {
            case SWT.TRAVERSE_ESCAPE:
                shell.close();
                event.detail = SWT.TRAVERSE_NONE;
                event.doit = false;
                break;
            }
        }
    });
    VKData data = new VKData();
    data.instance = instance; // <- set Vulkan instance
    final VKCanvas canvas = new VKCanvas(shell, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE, data);
    shell.setSize(800, 600);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    canvas.dispose();
    display.dispose();
}
 
Example 12
Source File: SWTSkinObjectBrowser.java    From BiglyBT with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param skin
 * @param properties
 * @param sID
 * @param sConfigID
 * @param parent
 */
public SWTSkinObjectBrowser(SWTSkin skin, SWTSkinProperties properties,
		String sID, String sConfigID, SWTSkinObject parent) {
	super(skin, properties, sID, sConfigID, "browser", parent);

	cParent = parent == null ? skin.getShell()
			: (Composite) parent.getControl();

	cArea = cParent;
	cArea = new Canvas(cParent, SWT.NO_BACKGROUND);
	cArea.setLayout(new FormLayout());

	setControl(cArea);

	if (cParent.isVisible()) {
		init();
	} else {
		addListener(new SWTSkinObjectListener() {
			@Override
			public Object eventOccured(SWTSkinObject skinObject, int eventType,
			                           Object params) {
				if (eventType == EVENT_SHOW) {
					removeListener(this);
					init();
				}
				return null;
			}
		});
	}
}
 
Example 13
Source File: OSMFileViewer.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void createPartControl(final Composite composite) {
	final Composite parent = GamaToolbarFactory.createToolbars(this, composite);
	final SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL | SWT.NULL);
	displayInfoString();
	mapLayerTable = new MapLayerComposite(sashForm, SWT.BORDER);
	pane = new SwtMapPane(sashForm, SWT.BORDER | SWT.NO_BACKGROUND, new StreamingRenderer(), content);
	pane.setBackground(GamaColors.system(SWT.COLOR_WHITE));
	mapLayerTable.setMapPane(pane);
	sashForm.setWeights(new int[] { 1, 4 });
	pane.redraw();

}
 
Example 14
Source File: Chart3DViewer.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * execute application
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	Chart3DViewer c3dViewer = new Chart3DViewer( shell, SWT.NO_BACKGROUND );
	c3dViewer.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	c3dViewer.addPaintListener( c3dViewer );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "&Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "3D Bar Chart" ); //$NON-NLS-1$
	cbType.add( "3D Line Chart" );//$NON-NLS-1$
	cbType.add( "3D Area Chart" );//$NON-NLS-1$
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "&Update" );//$NON-NLS-1$
	btn.addSelectionListener( c3dViewer );
	btn.setToolTipText( "Update" );//$NON-NLS-1$
	
	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 15
Source File: Regression_143809_swt.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	Regression_143809_swt siv = new Regression_143809_swt(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Pie Chart" );
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 16
Source File: CheckBoxVar.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public CheckBoxVar( final VariableSpace space, final Composite composite, int flags, String variable ) {
  super( composite, SWT.NONE );

  props.setLook( this );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;

  this.setLayout( formLayout );

  // add a text field on it...
  wBox = new Button( this, flags );
  props.setLook( wBox );
  wText = new TextVar( space, this, flags | SWT.NO_BACKGROUND );
  wText.getTextWidget().setForeground( GUIResource.getInstance().getColorRed() ); // Put it in a red color to make it
                                                                                  // shine...
  wText.getTextWidget().setBackground( composite.getBackground() ); // make it blend in with the rest...

  setVariableOnCheckBox( variable );

  controlDecoration = new ControlDecoration( wBox, SWT.CENTER | SWT.LEFT );
  Image image = GUIResource.getInstance().getImageVariable();
  controlDecoration.setImage( image );
  controlDecoration.setDescriptionText( BaseMessages.getString( PKG, "CheckBoxVar.tooltip.InsertVariable" ) );
  controlDecoration.addSelectionListener( new SelectionAdapter() {

    @Override
    public void widgetSelected( SelectionEvent arg0 ) {
      String variableName = VariableButtonListenerFactory.getVariableName( composite.getShell(), space );
      if ( variableName != null ) {
        setVariableOnCheckBox( "${" + variableName + "}" );
      }
    }
  } );

  FormData fdBox = new FormData();
  fdBox.top = new FormAttachment( 0, 0 );
  fdBox.left = new FormAttachment( 0, image.getBounds().width );
  wBox.setLayoutData( fdBox );

  FormData fdText = new FormData();
  fdText.top = new FormAttachment( 0, 0 );
  fdText.left = new FormAttachment( wBox, Const.MARGIN );
  fdText.right = new FormAttachment( 100, 0 );
  wText.setLayoutData( fdText );
}
 
Example 17
Source File: SWTToggleVisibilityViewer.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	SWTToggleVisibilityViewer siv = new SWTToggleVisibilityViewer(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Area Chart" );
	cbType.add( "Bar Chart" );
	cbType.add( "Line Chart" );
	cbType.add( "Meter Chart" );
	cbType.add( "Pie Chart" );
	cbType.add( "Scatter Chart" );
	cbType.add( "Stock Chart" );
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 18
Source File: SWTURLRedirectViewer.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	SWTURLRedirectViewer siv = new SWTURLRedirectViewer(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Area Chart" );
	cbType.add( "Bar Chart" );
	cbType.add( "Line Chart" );
	cbType.add( "Meter Chart" );
	cbType.add( "Pie Chart" );
	cbType.add( "Scatter Chart" );
	cbType.add( "Stock Chart" );
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 19
Source File: SWTHighlightViewer.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	SWTHighlightViewer siv = new SWTHighlightViewer(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Area Chart" ); //$NON-NLS-1$
	cbType.add( "Bar Chart" ); //$NON-NLS-1$
	cbType.add( "Line Chart" );//$NON-NLS-1$
	cbType.add( "Meter Chart" );//$NON-NLS-1$
	cbType.add( "Pie Chart" );//$NON-NLS-1$
	cbType.add( "Scatter Chart" );//$NON-NLS-1$
	cbType.add( "Stock Chart" );//$NON-NLS-1$
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example 20
Source File: SWTSplashWindow.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public SWTSplashWindow(Display display) {
	super(new Shell(display, SWT.NO_TRIM | SWT.NO_BACKGROUND));
	
	this.getControl().setLayout(new FillLayout());
	this.getControl().addPaintListener(new SWTPaintListener(this));
}