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


Java ResourceManager类代码示例

本文整理汇总了Java中org.eclipse.jface.resource.ResourceManager的典型用法代码示例。如果您正苦于以下问题:Java ResourceManager类的具体用法?Java ResourceManager怎么用?Java ResourceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: resize

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:YAxisDynamicRenderer.java

示例2: resize

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@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 ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:TitleRenderer.java

示例3: createFont

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:25,代码来源:TitleRenderer.java

示例4: resize

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:XAxisDynamicRenderer.java

示例5: InputManager

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 );
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:InputManager.java

示例6: ScriptInput

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:19,代码来源:ScriptInput.java

示例7: TextController

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:35,代码来源:TextController.java

示例8: ArcController

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:ArcController.java

示例9: draw

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@Override
public void draw(TextAttribute textAttr, Graphics graphics, ResourceManager resourceManager) {
  Color fgColor = graphics.getForegroundColor();
  java.awt.Color color = textAttr.textColor.asColor();
  if (color != null) {
    Color rgb = resourceManager.createColor(new RGB(color.getRed(), color.getGreen(), color.getBlue()));
    graphics.setForegroundColor(rgb);
  }

  try {
    String text = textAttr.text.getExpression();
    int fontSize = ((IntToken) textAttr.textSize.getToken()).intValue();
    String fontFamily = textAttr.fontFamily.stringValue();
    boolean italic = ((BooleanToken) textAttr.italic.getToken()).booleanValue();
    boolean bold = ((BooleanToken) textAttr.bold.getToken()).booleanValue();
    int style = SWT.NORMAL | (italic ? SWT.ITALIC : SWT.NORMAL) | (bold ? SWT.BOLD : SWT.NORMAL);
    Font f = resourceManager.createFont(FontDescriptor.createFrom(fontFamily, fontSize, style));
    graphics.setFont(f);

    Point tlp = getTopLeftLocation(textAttr);
    graphics.drawText(text, tlp);
  } catch (IllegalActionException e) {
    LOGGER.error("Error reading properties for " + textAttr.getFullName(), e);
  }
  graphics.setForegroundColor(fgColor);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:27,代码来源:TextDrawingStrategy.java

示例10: getDimension

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@Override
protected Dimension getDimension(TextAttribute textAttr, ResourceManager resourceManager) {
  try {
    String text = textAttr.text.getExpression();
    int fontSize = ((IntToken) textAttr.textSize.getToken()).intValue();
    String fontFamily = textAttr.fontFamily.stringValue();
    boolean italic = ((BooleanToken) textAttr.italic.getToken()).booleanValue();
    boolean bold = ((BooleanToken) textAttr.bold.getToken()).booleanValue();
    int style = SWT.NORMAL | (italic ? SWT.ITALIC : SWT.NORMAL) | (bold ? SWT.BOLD : SWT.NORMAL);
    Font f = resourceManager.createFont(FontDescriptor.createFrom(fontFamily, fontSize, style));
    return FigureUtilities.getTextExtents(text, f);
  } catch (IllegalActionException e) {
    LOGGER.error("Error reading dimensions for " + textAttr.getFullName(), e);
    return new Dimension(0, 0);
  }
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:17,代码来源:TextDrawingStrategy.java

示例11: postConstruct

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@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);
}
 
开发者ID:vogellacompany,项目名称:codeexamples-eclipse,代码行数:21,代码来源:TableViewerFontSize.java

示例12: calcHeight

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:32,代码来源:XAxisDynamicRenderer.java

示例13: createViewInstance

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
@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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:VisualInterfaceFactory.java

示例14: AbstractInputViewer

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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$
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:AbstractInputViewer.java

示例15: DataItemSeriesViewer

import org.eclipse.jface.resource.ResourceManager; //导入依赖的package包/类
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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:DataItemSeriesViewer.java


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