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


Java GUIHelper.getColor方法代码示例

本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.util.GUIHelper.getColor方法的典型用法代码示例。如果您正苦于以下问题:Java GUIHelper.getColor方法的具体用法?Java GUIHelper.getColor怎么用?Java GUIHelper.getColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.nebula.widgets.nattable.util.GUIHelper的用法示例。


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

示例1: addSelectedModeStyling

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的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: addNormalModeStyling

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的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

示例3: registerColumnHeaderStyle

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的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

示例4: addSelectedModeStyling

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的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

示例5: getRawStreamColor

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的package包/类
public static Color getRawStreamColor(RawStreamStat rawStat){
	ColorCalculator colorCalc=map.get(RawStream.class.getSimpleName());
	RGB rgb=colorCalc.getRGB(rawStat.getOutputRateSec());
	return GUIHelper.getColor(rgb);
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:6,代码来源:InstanceColorFactory.java

示例6: getInstanceColor

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的package包/类
public static Color getInstanceColor(InstanceStat insStat){
	ColorCalculator colorCalc=map.get(insStat.getType());
	RGB rgb=colorCalc.getRGB(insStat.getOutputRateSec());
	return GUIHelper.getColor(rgb);
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:6,代码来源:InstanceColorFactory.java

示例7: createTableStyling

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入方法依赖的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.util.GUIHelper.getColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。