• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextPainter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addSelectedModeStyling

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
/**
 * Add selected styling to the registry.
 *
 * @param configRegistry
 */
private void addSelectedModeStyling(final IConfigRegistry configRegistry) {

    final TextPainter txtPainter = new TextPainter(false, false, true, true);
    final ICellPainter selectedCellPainter = new DataTableBackgroundImagePainter(txtPainter,
                                                                                 selectedBackground,
                                                                                 GUIHelper.getColor(192, 192, 192));

    final CellPainterDecorator selectedHeaderPainter = new CellPainterDecorator(selectedCellPainter,
                                                                                CellEdgeEnum.LEFT,
                                                                                new DataTableImagePainter(context));

    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
                                           selectedHeaderPainter,
                                           DisplayMode.SELECT,
                                           GridRegion.COLUMN_HEADER);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:22,代码来源:DataTableColumnHeaderConfiguration.java


示例2: configureRegistry

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
	registry = configRegistry;
	// editable
	configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,
			IEditableRule.ALWAYS_EDITABLE);
	// style for selected cells
	Style selectStyle = new Style();
	configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, selectStyle, DisplayMode.SELECT);
	// open adjacent editor when we leave the current one during editing
	configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_ADJACENT_EDITOR, Boolean.TRUE,
			DisplayMode.EDIT);
	// style for upper left corner
	BorderStyle borderStyle = new BorderStyle();
	borderStyle.setColor(GUIHelper.COLOR_GRAY);
	configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
			new LineBorderDecorator(new TextPainter(), borderStyle), DisplayMode.NORMAL, GridRegion.CORNER);
	// for each column...
	for (int column = 0; column < headingProvider.getColumnCount(); column++)
		addColumn(column);
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:22,代码来源:Designer.java


示例3: registerColumnFourPainter

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
private void registerColumnFourPainter(IConfigRegistry configRegistry) {
    Style style = new Style();
    style.setAttributeValue(
            CellStyleAttributes.HORIZONTAL_ALIGNMENT,
            HorizontalAlignmentEnum.LEFT);
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_STYLE,
            style,
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_FOUR_LABEL);

    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_PAINTER,
            new GradientBackgroundPainter(new TextPainter(false, false, false, true), true),
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_FOUR_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:18,代码来源:CellPainterExample.java


示例4: addNormalModeStyling

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
/**
 * Add normal styling to the registry.
 *
 * @param configRegistry
 */
private void addNormalModeStyling(final IConfigRegistry configRegistry) {

    final TextPainter txtPainter = new TextPainter(false, false, true, true);
    final ICellPainter bgImagePainter = new DataTableBackgroundImagePainter(txtPainter,
                                                                            defaultBackground,
                                                                            GUIHelper.getColor(192, 192, 192));
    final SortableHeaderTextPainter headerBasePainter = new SortableHeaderTextPainter(bgImagePainter, false, true);

    final CellPainterDecorator headerPainter = new CellPainterDecorator(headerBasePainter,
                                                                        CellEdgeEnum.LEFT,
                                                                        new DataTableImagePainter(context));

    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
                                           headerPainter,
                                           DisplayMode.NORMAL,
                                           GridRegion.COLUMN_HEADER);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
                                           headerBasePainter,
                                           DisplayMode.NORMAL,
                                           GridRegion.CORNER);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:27,代码来源:DataTableColumnHeaderConfiguration.java


示例5: configureRegistry

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
public void configureRegistry(IConfigRegistry configRegistry) {
	ImagePainter keyPainter = new ImagePainter(IconLoader.loadIconNormal("bullet_key"));
	CellPainterDecorator decorator = new CellPainterDecorator(new TextPainter(), CellEdgeEnum.RIGHT,
			keyPainter);
	configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
			new BeveledBorderDecorator(decorator), DisplayMode.NORMAL, "keycolumnintegrated");
	configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
			new BeveledBorderDecorator(keyPainter), DisplayMode.NORMAL, "keycolumnalone");
	BorderStyle borderStyle = new BorderStyle();
	borderStyle.setColor(GUIHelper.COLOR_GRAY);
	configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
			new LineBorderDecorator(new TextPainter(), borderStyle), DisplayMode.NORMAL, GridRegion.CORNER);
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:14,代码来源:Editor.java


示例6: registerColumnHeaderStyle

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
private void registerColumnHeaderStyle(IConfigRegistry configRegistry) {

            Image bgImage = GUIHelper.getImageByURL("columnHeaderBg",
                    getClass().getResource("/org/eclipse/nebula/widgets/nattable/examples/resources/column_header_bg.png"));
            Image selectedBgImage = GUIHelper.getImageByURL("selectedColumnHeaderBg",
                    getClass().getResource("/org/eclipse/nebula/widgets/nattable/examples/resources/selected_column_header_bg.png"));

            TextPainter txtPainter = new TextPainter(false, false);

            ICellPainter bgImagePainter =
                    new BackgroundImagePainter(txtPainter, bgImage, GUIHelper.getColor(192, 192, 192));

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER,
                    bgImagePainter,
                    DisplayMode.NORMAL,
                    GridRegion.COLUMN_HEADER);
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER,
                    bgImagePainter,
                    DisplayMode.NORMAL,
                    GridRegion.CORNER);

            ICellPainter selectedHeaderPainter =
                    new BackgroundImagePainter(
                            txtPainter, selectedBgImage, GUIHelper.getColor(192, 192, 192));

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER,
                    selectedHeaderPainter,
                    DisplayMode.SELECT,
                    GridRegion.COLUMN_HEADER);
        }
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:34,代码来源:CellPainterExample.java


示例7: registerColumnSixDoublePainter

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
private void registerColumnSixDoublePainter(IConfigRegistry configRegistry) {
    Style style = new Style();
    style.setAttributeValue(
            CellStyleAttributes.HORIZONTAL_ALIGNMENT,
            HorizontalAlignmentEnum.RIGHT);
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_STYLE,
            style,
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_SIX_LABEL);

    // the CustomLineBorderDecorator needs an additional border label to
    // know where to render a border within the cell
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_PAINTER,
            new CustomLineBorderDecorator(
                    new PaddingDecorator(new TextPainter(), 0, 5, 0, 0),
                    new BorderStyle(2, GUIHelper.COLOR_GREEN, LineStyleEnum.SOLID)),
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_SIX_LABEL);

    // don't forget to register the Double converter!
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.DISPLAY_CONVERTER,
            new DefaultDoubleDisplayConverter(),
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_SIX_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:29,代码来源:CellPainterExample.java


示例8: DataTableRowHeaderConfiguration

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
/**
 * Creates a new instance.
 *
 * @param context
 */
public DataTableRowHeaderConfiguration(DataTableContext context) {
    this.font = context.getFont();
    this.backgroundDefault   = context.getController().getResources().getManagedImage("row_header_bg.png"); //$NON-NLS-1$
    this.backgroundSelected = context.getController().getResources().getManagedImage("selected_row_header_bg.png"); //$NON-NLS-1$
    final TextPainter txtPainter = new TextPainter(false, false);
    final ICellPainter bgImagePainter = new BackgroundImagePainter(txtPainter, backgroundDefault, null);
    this.cellPainter = bgImagePainter;
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:14,代码来源:DataTableRowHeaderConfiguration.java


示例9: addSelectedModeStyling

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
/**
 * Add selected style.
 *
 * @param configRegistry
 */
private void addSelectedModeStyling(final IConfigRegistry configRegistry) {

    final TextPainter txtPainter = new TextPainter(false, false);
    final ICellPainter selectedCellPainter = new BackgroundImagePainter(txtPainter,
                                                                        backgroundSelected,
                                                                        GUIHelper.getColor(192, 192, 192));

    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
                                           selectedCellPainter,
                                           DisplayMode.SELECT,
                                           GridRegion.ROW_HEADER);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:18,代码来源:DataTableRowHeaderConfiguration.java


示例10: createExampleControl

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
public Control createExampleControl(Composite parent) {
    DefaultGridLayer gridLayer = new DefaultGridLayer(
            RowDataListFixture.getList(),
            RowDataListFixture.getPropertyNames(),
            RowDataListFixture.getPropertyToLabelMap());

    DataLayer columnHeaderDataLayer = (DataLayer) gridLayer.getColumnHeaderDataLayer();
    columnHeaderDataLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator());

    final DataLayer bodyDataLayer = (DataLayer) gridLayer
            .getBodyDataLayer();
    IDataProvider dataProvider = bodyDataLayer.getDataProvider();

    // NOTE: Register the accumulator on the body data layer.
    // This ensures that the labels are bound to the column index and are
    // unaffected by column order.
    final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
            bodyDataLayer);
    bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);

    NatTable natTable = new NatTable(parent, gridLayer, false);

    natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
    natTable.addConfiguration(editableGridConfiguration(
            columnLabelAccumulator, dataProvider));

    final ColumnHeaderCheckBoxPainter columnHeaderCheckBoxPainter = new ColumnHeaderCheckBoxPainter(
            bodyDataLayer);
    final ICellPainter column9HeaderPainter = new BeveledBorderDecorator(
            new CellPainterDecorator(new TextPainter(), CellEdgeEnum.RIGHT,
                    columnHeaderCheckBoxPainter));
    natTable.addConfiguration(new AbstractRegistryConfiguration() {
        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER,
                    column9HeaderPainter, DisplayMode.NORMAL,
                    ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 9);
        }

        @Override
        public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
            uiBindingRegistry.registerFirstSingleClickBinding(
                    new CellPainterMouseEventMatcher(
                            GridRegion.COLUMN_HEADER,
                            MouseEventMatcher.LEFT_BUTTON,
                            columnHeaderCheckBoxPainter),
                    new ToggleCheckBoxColumnAction(
                            columnHeaderCheckBoxPainter, bodyDataLayer));
        }
    });

    natTable.configure();

    return natTable;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:58,代码来源:EditableGridExample.java


示例11: createTableStyling

import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; //导入依赖的package包/类
/**
 * Creates the table styling.
 *
 * @param natTable
 */
private void createTableStyling(final NatTable natTable) {

    final DefaultNatTableStyleConfiguration natTableConfiguration = new DefaultNatTableStyleConfiguration();
    natTableConfiguration.bgColor = GUIHelper.getColor(249, 172, 7);
    natTableConfiguration.fgColor = GUIHelper.getColor(0, 0, 0);
    natTableConfiguration.hAlign = HorizontalAlignmentEnum.LEFT;
    natTableConfiguration.vAlign = VerticalAlignmentEnum.TOP;
    natTableConfiguration.font = this.font;

    // A custom painter can be plugged in to paint the cells differently
    natTableConfiguration.cellPainter = new PaddingDecorator(new TextPainter(), 1);

    // Setup even odd row colors - row colors override the NatTable default colors
    final DefaultRowStyleConfiguration rowStyleConfiguration = new DefaultRowStyleConfiguration();
    rowStyleConfiguration.oddRowBgColor = GUIHelper.getColor(254, 251, 243);
    rowStyleConfiguration.evenRowBgColor = GUIHelper.COLOR_WHITE;

    // Setup selection styling
    final DefaultSelectionStyleConfiguration selectionStyle = new DefaultSelectionStyleConfiguration();
    selectionStyle.selectionFont = this.font;
    selectionStyle.selectionBgColor = GUIHelper.getColor(220, 220, 220);
    selectionStyle.selectionFgColor = GUIHelper.COLOR_BLACK;
    selectionStyle.anchorBorderStyle = new BorderStyle(1, GUIHelper.COLOR_DARK_GRAY, LineStyleEnum.SOLID);
    selectionStyle.anchorBgColor = GUIHelper.getColor(220, 220, 220);
    selectionStyle.anchorFgColor = GUIHelper.getColor(0, 0, 0);
    selectionStyle.selectedHeaderBgColor = GUIHelper.getColor(156, 209, 103);
    selectionStyle.selectedHeaderFont = this.font;

    // Add all style configurations to NatTable
    natTable.addConfiguration(natTableConfiguration);
    natTable.addConfiguration(rowStyleConfiguration);
    natTable.addConfiguration(selectionStyle);

    // Column/Row header style and custom painters
    natTable.addConfiguration(new DataTableRowHeaderConfiguration(context));
    natTable.addConfiguration(new DataTableColumnHeaderConfiguration(context));

    // Make corner resizable
    natTable.addConfiguration(new AbstractUiBindingConfiguration() {

        @Override
        public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
            // Mouse move - Show resize cursor
            uiBindingRegistry.registerFirstMouseMoveBinding(new ColumnResizeEventMatcher(SWT.NONE,
                                                                                         GridRegion.CORNER,
                                                                                         0),
                                                            new ColumnResizeCursorAction());
            uiBindingRegistry.registerMouseMoveBinding(new MouseEventMatcher(), new ClearCursorAction());

            // Column resize
            uiBindingRegistry.registerFirstMouseDragMode(new ColumnResizeEventMatcher(SWT.NONE,
                                                                                      GridRegion.CORNER,
                                                                                      1),
                                                         new ColumnResizeDragMode());

            uiBindingRegistry.registerDoubleClickBinding(new ColumnResizeEventMatcher(SWT.NONE,
                                                                                      GridRegion.CORNER,
                                                                                      1),
                                                         new AutoResizeColumnAction());
            uiBindingRegistry.registerSingleClickBinding(new ColumnResizeEventMatcher(SWT.NONE,
                                                                                      GridRegion.CORNER,
                                                                                      1), new NoOpMouseAction());
        }
    });
    
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:72,代码来源:ComponentDataTable.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServerUtils类代码示例发布时间:2022-05-23
下一篇:
Java CombinerAggregatorInitImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap