org.eclipse.jface.resource.ResourceManager Java Examples
The following examples show how to use
org.eclipse.jface.resource.ResourceManager.
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: YAxisDynamicRenderer.java From neoscada with Eclipse Public License 1.0 | 6 votes |
@Override public Rectangle resize ( final ResourceManager resourceManager, final Rectangle clientRectangle ) { final int width = this.width >= 0 ? this.width : calcWidth ( resourceManager, clientRectangle.height ); if ( this.left ) { this.rect = new Rectangle ( clientRectangle.x, clientRectangle.y, width, clientRectangle.height ); return new Rectangle ( clientRectangle.x + width, clientRectangle.y, clientRectangle.width - width, clientRectangle.height ); } else { this.rect = new Rectangle ( clientRectangle.x + clientRectangle.width - width, clientRectangle.y, width, clientRectangle.height ); return new Rectangle ( clientRectangle.x, clientRectangle.y, clientRectangle.width - width, clientRectangle.height ); } }
Example #2
Source File: InputManager.java From neoscada with Eclipse Public License 1.0 | 6 votes |
public InputManager ( final DataBindingContext dbc, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator ) { this.list = new WritableList ( dbc.getValidationRealm () ); this.dbc = dbc; this.viewer = viewer; this.resourceManager = resourceManager; this.xLocator = xLocator; this.yLocator = yLocator; this.list.addListChangeListener ( this.listener = new IListChangeListener () { @Override public void handleListChange ( final ListChangeEvent event ) { handleListeChange ( event.diff ); } } ); }
Example #3
Source File: ArcController.java From neoscada with Eclipse Public License 1.0 | 6 votes |
public ArcController ( final SymbolController controller, final Arc element, final ResourceManager manager ) { super ( controller, manager ); this.figure = new ArcShape () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; this.figure.setArc ( element.getStart (), element.getLength () ); controller.addElement ( element, this ); applyCommon ( element ); }
Example #4
Source File: ScriptInput.java From neoscada with Eclipse Public License 1.0 | 6 votes |
public ScriptInput ( final ChartViewer viewer, final Realm realm, final ResourceManager resourceManager, final XAxis xAxis, final YAxis yAxis ) { super ( resourceManager ); this.viewer = viewer; this.renderer = new StepRenderer ( viewer.getChartRenderer (), this.dataSeries = new AsyncFunctionSeriesData ( realm, xAxis, yAxis, 0 ) { @Override protected Double eval ( final long timestamp ) { return handleEval ( timestamp ); } } ); viewer.getChartRenderer ().addRenderer ( this.renderer ); attachHover ( viewer, xAxis ); }
Example #5
Source File: XAxisDynamicRenderer.java From neoscada with Eclipse Public License 1.0 | 6 votes |
@Override public Rectangle resize ( final ResourceManager resourceManager, final Rectangle clientRectangle ) { final int height = this.height >= 0 ? this.height : calcHeight ( resourceManager ); if ( this.bottom ) { this.rect = new Rectangle ( clientRectangle.x, clientRectangle.y + clientRectangle.height - height, clientRectangle.width, height ); return new Rectangle ( clientRectangle.x, clientRectangle.y, clientRectangle.width, clientRectangle.height - height ); } else { this.rect = new Rectangle ( clientRectangle.x, clientRectangle.y, clientRectangle.width, height ); return new Rectangle ( clientRectangle.x, clientRectangle.y + height, clientRectangle.width, clientRectangle.height - height ); } }
Example #6
Source File: TitleRenderer.java From neoscada with Eclipse Public License 1.0 | 6 votes |
private Font createFont ( final ResourceManager resourceManager ) { final Font defaultFont = resourceManager.getDevice ().getSystemFont (); if ( defaultFont == null ) { return null; } final FontData fd[] = FontDescriptor.copy ( defaultFont.getFontData () ); if ( fd == null ) { return null; } for ( final FontData f : fd ) { if ( this.fontSize > 0 ) { f.setHeight ( this.fontSize ); } } return resourceManager.createFont ( FontDescriptor.createFrom ( fd ) ); }
Example #7
Source File: TitleRenderer.java From neoscada with Eclipse Public License 1.0 | 6 votes |
@Override public Rectangle resize ( final ResourceManager resourceManager, final Rectangle clientRectangle ) { if ( this.title == null || this.title.isEmpty () ) { return null; } final GC gc = new GC ( resourceManager.getDevice () ); gc.setFont ( createFont ( resourceManager ) ); try { final Point size = gc.textExtent ( this.title ); this.rect = new Rectangle ( clientRectangle.x, clientRectangle.y, clientRectangle.width, size.y + this.padding * 2 ); return new Rectangle ( clientRectangle.x, this.rect.y + this.rect.height, clientRectangle.width, clientRectangle.height - this.rect.height ); } finally { gc.dispose (); } }
Example #8
Source File: MultilineButton.java From SWET with MIT License | 6 votes |
private Font createFont(final ResourceManager resourceManager) { final Font defaultFont = resourceManager.getDevice().getSystemFont(); if (defaultFont == null) { return null; } final FontData fd[] = FontDescriptor.copy(defaultFont.getFontData()); if (fd == null) { return null; } for (final FontData f : fd) { if (this.fontSize > 0) { f.setHeight(this.fontSize); } } return resourceManager.createFont(FontDescriptor.createFrom(fd)); }
Example #9
Source File: TableViewerFontSize.java From codeexamples-eclipse with Eclipse Public License 1.0 | 6 votes |
@PostConstruct public void postConstruct(Composite parent) { ResourceManager resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent); TreeViewer viewer = new TreeViewer(parent); viewer.setContentProvider(new TreeContentProvider()); viewer.getTree().setHeaderVisible(true); viewer.getTree().setLinesVisible(true); viewer.getTree().setFont(resourceManager.createFont(FontDescriptor.createFrom("Arial", 32, SWT.ITALIC))); TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE); viewerColumn.getColumn().setWidth(300); viewerColumn.getColumn().setText("Names"); viewerColumn.setLabelProvider(new ColumnLabelProvider()); viewer.setInput(new String[] { "Simon Scholz", "Lars Vogel", "Dirk Fauth", "Wim Jongman", "Tom Schindl" }); GridLayoutFactory.fillDefaults().generateLayout(parent); }
Example #10
Source File: RootFigure.java From nebula with Eclipse Public License 2.0 | 6 votes |
public RootFigure(ResourceManager resourceManager) { fResourceManager = resourceManager; setStyleProvider(null); fTimeViewDetails = new TimeBaseConverter(this); final BorderLayout layout = new BorderLayout(); layout.setVerticalSpacing(10); setLayoutManager(layout); setOpaque(true); updateStyle(fStyleProvider); fDetailFigure = new DetailFigure(getStyleProvider()); add(fDetailFigure, BorderLayout.CENTER); fOverviewFigure = new OverviewFigure(getStyleProvider()); add(fOverviewFigure, BorderLayout.BOTTOM); }
Example #11
Source File: TabbedPropertyTitle.java From birt with Eclipse Public License 1.0 | 5 votes |
private void updateToolBar( ) { if ( toolbar != null ) { ResourceManager parentResourceManager = JFaceResources.getResources( ); LocalResourceManager localManager = new LocalResourceManager( parentResourceManager ); for ( int i = 0; i < toolbar.getItemCount( ); i++ ) { ToolItem item = toolbar.getItem( i ); IAction action = (IAction) actionMap.get( item ); if ( action != null ) { ImageDescriptor image = null; if ( action.getImageDescriptor( ) != null ) image = action.getImageDescriptor( ); if ( image != null ) item.setImage( localManager.createImageWithDefault( image ) ); item.setToolTipText( action.getToolTipText( ) ); if ( IAction.AS_CHECK_BOX == action.getStyle( ) ) { item.setSelection( action.isChecked( ) ); } item.setEnabled( action.isEnabled( ) ); } } disposeOldImages( ); imageManager = localManager; if ( toolbar.isFocusControl( ) ) toolbar.setFocus( ); } }
Example #12
Source File: XAxisDynamicRenderer.java From neoscada with Eclipse Public License 1.0 | 5 votes |
private int calcHeight ( final ResourceManager resourceManager ) { if ( this.axis == null ) { return 0; } final GC gc = new GC ( resourceManager.getDevice () ); try { gc.setFont ( makeFont ( resourceManager ) ); final DateFormat format = makeFormat ( this.axis.getMax () - this.axis.getMin () ); final Point markerSize = getExtent ( gc, format.format ( new Date () ) ); final Point labelSize = getExtent ( gc, this.axis.getLabel () ); int height = markerSize.y + labelSize.y + this.textPadding * 2 + this.markerSize; if ( labelSize.y > 0 ) { height += this.textPadding; } return height; } finally { gc.dispose (); } }
Example #13
Source File: VisualInterfaceFactory.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override public ViewInstance createViewInstance ( final ViewManager viewManager, final ViewManagerContext viewManagerContext, final ViewInstanceDescriptor descriptor, final Composite viewHolder, final ResourceManager manager, final IWorkbenchPartSite site ) { final VisualInterfaceViewInstance instance = new VisualInterfaceViewInstance ( viewManager, viewManagerContext, viewHolder, descriptor, site.getService ( IEvaluationService.class ) ); instance.init (); return instance; }
Example #14
Source File: JUnitTestRunListener.java From eclipse-extras with Eclipse Public License 1.0 | 5 votes |
public JUnitTestRunListener( ILaunchManager launchManager, ResourceManager resourceManager, ProgressUI progressUI ) { this.launchListener = new LaunchTerminatedListener(); this.resourceManager = resourceManager; this.progressUI = progressUI; this.launchManager = launchManager; this.launchManager.addLaunchListener( launchListener ); }
Example #15
Source File: BasicViewElementFactory.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public BasicViewElementFactory ( final FigureCanvas canvas, final ResourceManager manager, final SymbolLoader symbolLoader, final FactoryContext factoryContext, final Map<URI, XMISymbolLoader> symbolCache ) { this.manager = manager; this.canvas = canvas; this.symbolLoader = symbolLoader; this.symbolCache = symbolCache; this.factoryContext = factoryContext == null ? FactoryContext.DEFAULT : factoryContext; }
Example #16
Source File: AbstractInputViewer.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public AbstractInputViewer ( final DataBindingContext dbc, final DataSeries element, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator ) { this.element = element; this.viewer = viewer; this.dbc = dbc; this.resourceManager = new LocalResourceManager ( resourceManager ); this.xLocator = xLocator; this.yLocator = yLocator; addBinding ( dbc.bindValue ( PojoObservables.observeValue ( this, "x" ), EMFObservables.observeValue ( element, ChartPackage.Literals.DATA_SERIES__X ) ) ); //$NON-NLS-1$ addBinding ( dbc.bindValue ( PojoObservables.observeValue ( this, "y" ), EMFObservables.observeValue ( element, ChartPackage.Literals.DATA_SERIES__Y ) ) ); //$NON-NLS-1$ }
Example #17
Source File: BasicViewElementFactory.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public BasicViewElementFactory ( final FigureCanvas canvas, final ResourceManager manager, final SymbolLoader symbolLoader, final FactoryContext factoryContext ) { this.manager = manager; this.canvas = canvas; this.symbolLoader = symbolLoader; this.symbolCache = new HashMap<URI, XMISymbolLoader> (); this.factoryContext = factoryContext == null ? FactoryContext.DEFAULT : factoryContext; }
Example #18
Source File: DataItemSeriesViewer.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public DataItemSeriesViewer ( final DataBindingContext dbc, final DataItemSeries element, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator ) { super ( dbc, element, viewer, resourceManager, xLocator, yLocator ); this.inputObservable = BeansObservables.observeValue ( this, PROP_INPUT ); this.linePropertiesObservable = EMFObservables.observeValue ( element, ChartPackage.Literals.DATA_ITEM_SERIES__LINE_PROPERTIES ); addBindings ( LinePropertiesBinder.bind ( dbc, this.inputObservable, this.linePropertiesObservable ) ); setInputObserable ( this.inputObservable ); }
Example #19
Source File: ScriptSeriesViewer.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public ScriptSeriesViewer ( final DataBindingContext dbc, final ScriptSeries element, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator ) { super ( dbc, element, viewer, resourceManager, xLocator, yLocator ); this.inputObservable = BeansObservables.observeValue ( this, PROP_INPUT ); this.linePropertiesObservable = EMFObservables.observeValue ( element, ChartPackage.Literals.SCRIPT_SERIES__LINE_PROPERTIES ); addBinding ( dbc.bindValue ( PojoObservables.observeDetailValue ( this.inputObservable, "script", null ), EMFObservables.observeValue ( element, ChartPackage.Literals.SCRIPT_SERIES__SCRIPT ) ) ); //$NON-NLS-1$ addBindings ( LinePropertiesBinder.bind ( dbc, this.inputObservable, this.linePropertiesObservable ) ); setInputObserable ( this.inputObservable ); }
Example #20
Source File: PolygonController.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public PolygonController ( final SymbolController controller, final Polygon element, final ResourceManager manager ) { super ( controller, manager ); this.figure = new PolygonShape () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; final PointList points = new PointList (); for ( final Position pos : element.getPoints () ) { final Point p = new PrecisionPoint ( pos.getX (), pos.getY () ); points.addPoint ( p ); } setPoints ( points ); controller.addElement ( element, this ); applyCommon ( element ); }
Example #21
Source File: TextController.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public TextController ( final FigureCanvas canvas, final SymbolController controller, final Text element, final ResourceManager manager ) { super ( controller, manager ); this.canvas = canvas; this.figure = new Label ( element.getText ()) { @Override public void addNotify () { super.addNotify (); start (); } @Override protected void paintFigure ( final Graphics graphics ) { final Double alpha = getAlpha (); if ( alpha != null ) { graphics.setAlpha ( (int) ( Math.max ( 0.0, Math.min ( 1.0, alpha ) ) * 255.0 ) ); } super.paintFigure ( graphics ); } @Override public void removeNotify () { stop (); super.removeNotify ( ); } }; controller.addElement ( element, this ); applyCommon ( element ); }
Example #22
Source File: EllipseController.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public EllipseController ( final SymbolController controller, final org.eclipse.scada.vi.model.Ellipse element, final ResourceManager manager ) { super ( controller, manager ); final PrecisionRectangle rect = new PrecisionRectangle (); if ( element.getSize () != null ) { rect.setPreciseSize ( element.getSize ().getWidth (), element.getSize ().getHeight () ); } this.figure = new Ellipse () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; this.figure.setBounds ( rect ); controller.addElement ( element, this ); applyCommon ( element ); }
Example #23
Source File: RoundedRectangleController.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public RoundedRectangleController ( final SymbolController controller, final RoundedRectangle element, final ResourceManager manager ) { super ( controller, manager ); this.figure = new org.eclipse.draw2d.RoundedRectangle () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; if ( element.getCorner () != null ) { setCorner ( Double.valueOf ( Math.round ( element.getCorner ().getWidth () ) ).intValue (), Double.valueOf ( Math.round ( element.getCorner ().getWidth () ) ).intValue () ); } else { setCorner ( 0, 0 ); } controller.addElement ( element, this ); applyCommon ( element ); }
Example #24
Source File: LineController.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public LineController ( final SymbolController controller, final Line element, final ResourceManager manager ) { super ( controller, manager ); this.figure = new PolylineShape () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; final PointList points = new PointList (); for ( final Position pos : element.getPoints () ) { final Point p = new PrecisionPoint ( pos.getX (), pos.getY () ); points.addPoint ( p ); } setPoints ( points ); controller.addElement ( element, this ); applyCommon ( element ); }
Example #25
Source File: FigureRenderer.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public FigureRenderer ( final ChartFigure chartFigure, final ResourceManager resourceManager ) { super ( resourceManager ); this.realm = new DisplayRealm ( Display.getCurrent () ); this.chartFigure = chartFigure; this.figureListener = new FigureListenerImpl (); this.chartFigure.addFigureListener ( this.figureListener ); }
Example #26
Source File: ChartController.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public ChartController ( final SymbolController symbolController, final ResourceManager resourceManager, final ChartView view, final SymbolLoader symbolLoader, final FactoryContext context ) { super ( symbolController, resourceManager ); this.context = context; this.symbolLoader = symbolLoader; this.wrapperFigure = new Figure () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; this.wrapperFigure.setOpaque ( false ); this.figure = new ChartFigure ( Display.getCurrent (), resourceManager ); this.wrapperFigure.setLayoutManager ( new StackLayout () ); this.wrapperFigure.add ( this.figure ); this.errorFigure = new ErrorFigure (); symbolController.addElement ( view, this ); applyCommon ( view ); }
Example #27
Source File: ViewElementFactory.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override public Controller create ( final SymbolController controller, final Primitive element, final SymbolLoader symbolLoader, final ResourceManager manager, final BasicViewElementFactory basicViewElementFactory, final FactoryContext context ) { try { final ChartView view = (ChartView)element; return new ChartController ( controller, manager, view, symbolLoader, context ); } catch ( final Exception e ) { return Helper.createErrorController ( e ); } }
Example #28
Source File: ColorUpdater.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public ColorUpdater ( final String name, final ResourceManager manager, final ColorDescriptor defaultColor ) { this.name = name; this.manager = manager; this.defaultColor = defaultColor; JFaceResources.getColorRegistry ().addListener ( this ); refresh (); }
Example #29
Source File: ChartViewFactory.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override public ViewInstance createViewInstance ( final ViewManager viewManager, final ViewManagerContext viewManagerContext, final ViewInstanceDescriptor descriptor, final Composite viewHolder, final ResourceManager manager, final IWorkbenchPartSite site ) { final ChartView view = new ChartView ( viewManagerContext, manager, descriptor, viewHolder, (IEvaluationService)site.getService ( IEvaluationService.class ), true ); view.init (); return view; }
Example #30
Source File: ChartView.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public ChartView ( final ViewManagerContext viewManagerContext, final ResourceManager manager, final ViewInstanceDescriptor descriptor, final Composite viewHolder, final IEvaluationService evaluationService, final boolean showSelector ) { super ( viewManagerContext, descriptor, evaluationService ); this.showSelector = showSelector; this.viewHolder = viewHolder; this.viewManagerContext = viewManagerContext; }