org.eclipse.draw2d.SchemeBorder Java Examples

The following examples show how to use org.eclipse.draw2d.SchemeBorder. 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: TableBorderFigure.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public TableBorderFigure( )
{
	outer = new SchemeBorder( raisedBorderScheme );
	titleBar = new TitleBarBorder( );
	inner = new CompoundBorder( titleBar, new SimpleLoweredBorder( 5 ) );
	titleBar.setTextColor( Display.getCurrent( )
			.getSystemColor( SWT.COLOR_TITLE_FOREGROUND ) );
	titleBar.setTextAlignment( 1 );
	titleBar.setPadding( 3 );
}
 
Example #2
Source File: TankExample.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	final Shell shell = new Shell();
	shell.setSize(300, 250);
    shell.open();
    
    //use LightweightSystem to create the bridge between SWT and draw2D
	final LightweightSystem lws = new LightweightSystem(shell);		
	
	//Create widget
	final TankFigure tank = new TankFigure();
	
	//Init widget
	tank.setBackgroundColor(
			XYGraphMediaFactory.getInstance().getColor(255, 255, 255));
	
	tank.setBorder(new SchemeBorder(SchemeBorder.SCHEMES.ETCHED));
	
	tank.setRange(-100, 100);
	tank.setLoLevel(-50);
	tank.setLoloLevel(-80);
	tank.setHiLevel(60);
	tank.setHihiLevel(80);
	tank.setMajorTickMarkStepHint(50);
	
	lws.setContents(tank);		
	
	//Update the widget in another thread.
	ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
	ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
		
		public void run() {
			Display.getDefault().asyncExec(new Runnable() {					
				public void run() {
					tank.setValue(Math.sin(counter++/10.0)*100);						
				}
			});
		}
	}, 100, 100, TimeUnit.MILLISECONDS);		
	
    Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    future.cancel(true);
    scheduler.shutdown();
   
}
 
Example #3
Source File: ThermometerExample.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	final Shell shell = new Shell();
	shell.setSize(300, 250);
    shell.open();
    
    //use LightweightSystem to create the bridge between SWT and draw2D
	final LightweightSystem lws = new LightweightSystem(shell);		
	
	//Create widget
	final ThermometerFigure thermo = new ThermometerFigure();
	
	//Init widget
	thermo.setBackgroundColor(
			XYGraphMediaFactory.getInstance().getColor(255, 255, 255));
	
	thermo.setBorder(new SchemeBorder(SchemeBorder.SCHEMES.ETCHED));
	
	thermo.setRange(-100, 100);
	thermo.setLoLevel(-50);
	thermo.setLoloLevel(-80);
	thermo.setHiLevel(60);
	thermo.setHihiLevel(80);
	thermo.setShowHi(false);
	thermo.setMajorTickMarkStepHint(50);
	
	lws.setContents(thermo);		
	
	//Update the widget in another thread.
	ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
	ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
		
		public void run() {
			Display.getDefault().asyncExec(new Runnable() {					
				public void run() {
					thermo.setValue(Math.sin(counter++/10.0)*100);						
				}
			});
		}
	}, 100, 100, TimeUnit.MILLISECONDS);		
	
    Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    future.cancel(true);
    scheduler.shutdown();
   
}
 
Example #4
Source File: MeterExample.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	final Shell shell = new Shell();
	shell.setSize(300, 150);
    shell.open();
    
    //use LightweightSystem to create the bridge between SWT and draw2D
	final LightweightSystem lws = new LightweightSystem(shell);		
	
	//Create Gauge
	final MeterFigure meterFigure = new MeterFigure();
	
	//Init gauge
	meterFigure.setBackgroundColor(
			XYGraphMediaFactory.getInstance().getColor(255, 255, 255));
	
	meterFigure.setBorder(new SchemeBorder(SchemeBorder.SCHEMES.ETCHED));
	
	meterFigure.setRange(-100, 100);
	meterFigure.setLoLevel(-50);
	meterFigure.setLoloLevel(-80);
	meterFigure.setHiLevel(60);
	meterFigure.setHihiLevel(80);
	meterFigure.setMajorTickMarkStepHint(50);
	
	lws.setContents(meterFigure);		
	
	//Update the gauge in another thread.
	ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
	ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
		
		public void run() {
			Display.getDefault().asyncExec(new Runnable() {					
				public void run() {
					meterFigure.setValue(Math.sin(counter++/10.0)*100);						
				}
			});
		}
	}, 100, 100, TimeUnit.MILLISECONDS);		
	
    Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    future.cancel(true);
    scheduler.shutdown();
   
}
 
Example #5
Source File: TankExample.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	final Shell shell = new Shell();
	shell.setSize(300, 250);
    shell.open();
    
    //use LightweightSystem to create the bridge between SWT and draw2D
	final LightweightSystem lws = new LightweightSystem(shell);		
	
	//Create widget
	final TankFigure tank = new TankFigure();
	
	//Init widget
	tank.setBackgroundColor(
			XYGraphMediaFactory.getInstance().getColor(255, 255, 255));
	
	tank.setBorder(new SchemeBorder(SchemeBorder.SCHEMES.ETCHED));
	
	tank.setRange(-100, 100);
	tank.setLoLevel(-50);
	tank.setLoloLevel(-80);
	tank.setHiLevel(60);
	tank.setHihiLevel(80);
	tank.setMajorTickMarkStepHint(50);
	
	lws.setContents(tank);		
	
	//Update the widget in another thread.
	ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
	ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
		
		@Override
		public void run() {
			Display.getDefault().asyncExec(new Runnable() {					
				@Override
				public void run() {
					tank.setValue(Math.sin(counter++/10.0)*100);						
				}
			});
		}
	}, 100, 100, TimeUnit.MILLISECONDS);		
	
    Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    future.cancel(true);
    scheduler.shutdown();
   
}
 
Example #6
Source File: ThermometerExample.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	final Shell shell = new Shell();
	shell.setSize(300, 250);
    shell.open();
    
    //use LightweightSystem to create the bridge between SWT and draw2D
	final LightweightSystem lws = new LightweightSystem(shell);		
	
	//Create widget
	final ThermometerFigure thermo = new ThermometerFigure();
	
	//Init widget
	thermo.setBackgroundColor(
			XYGraphMediaFactory.getInstance().getColor(255, 255, 255));
	
	thermo.setBorder(new SchemeBorder(SchemeBorder.SCHEMES.ETCHED));
	
	thermo.setRange(-100, 100);
	thermo.setLoLevel(-50);
	thermo.setLoloLevel(-80);
	thermo.setHiLevel(60);
	thermo.setHihiLevel(80);
	thermo.setShowHi(false);
	thermo.setMajorTickMarkStepHint(50);
	
	lws.setContents(thermo);		
	
	//Update the widget in another thread.
	ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
	ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
		
		@Override
		public void run() {
			Display.getDefault().asyncExec(new Runnable() {					
				@Override
				public void run() {
					thermo.setValue(Math.sin(counter++/10.0)*100);						
				}
			});
		}
	}, 100, 100, TimeUnit.MILLISECONDS);		
	
    Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    future.cancel(true);
    scheduler.shutdown();
   
}
 
Example #7
Source File: MeterExample.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	final Shell shell = new Shell();
	shell.setSize(300, 150);
    shell.open();
    
    //use LightweightSystem to create the bridge between SWT and draw2D
	final LightweightSystem lws = new LightweightSystem(shell);		
	
	//Create Gauge
	final MeterFigure meterFigure = new MeterFigure();
	
	//Init gauge
	meterFigure.setBackgroundColor(
			XYGraphMediaFactory.getInstance().getColor(255, 255, 255));
	
	meterFigure.setBorder(new SchemeBorder(SchemeBorder.SCHEMES.ETCHED));
	
	meterFigure.setRange(-100, 100);
	meterFigure.setLoLevel(-50);
	meterFigure.setLoloLevel(-80);
	meterFigure.setHiLevel(60);
	meterFigure.setHihiLevel(80);
	meterFigure.setMajorTickMarkStepHint(50);
	
	lws.setContents(meterFigure);		
	
	//Update the gauge in another thread.
	ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
	ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
		
		@Override
		public void run() {
			Display.getDefault().asyncExec(new Runnable() {					
				@Override
				public void run() {
					meterFigure.setValue(Math.sin(counter++/10.0)*100);						
				}
			});
		}
	}, 100, 100, TimeUnit.MILLISECONDS);		
	
    Display display = Display.getDefault();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    future.cancel(true);
    scheduler.shutdown();
   
}
 
Example #8
Source File: ImageFrameBorder.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void createBorders() {
    inner = new ImageTitleBarBorder();
    outer = new SchemeBorder(SCHEME_FRAME);
}
 
Example #9
Source File: ImageFrameBorder.java    From erflute with Apache License 2.0 4 votes vote down vote up
@Override
protected void createBorders() {
    inner = new ImageTitleBarBorder();
    outer = new SchemeBorder(SCHEME_FRAME);
}
 
Example #10
Source File: ImageFrameBorder.java    From ermaster-b with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void createBorders() {
	inner = new ImageTitleBarBorder();
	outer = new SchemeBorder(SCHEME_FRAME);
}