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

Java GUIHelper类代码示例

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

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



GUIHelper类属于org.eclipse.nebula.widgets.nattable.util包,在下文中一共展示了GUIHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: getForegroundColor

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
private Color getForegroundColor(final ITableCell tableCell, final ILayerCell layerCell, final IStyle style) {
    final Color defaultForeground = style.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR);

    if (DisplayMode.NORMAL.equals(layerCell.getDisplayMode())) {
        final IColorConstant foreground = tableCell.getForegroundColor();
        if (foreground != null) {
            return foregroundColorCache.getColor(foreground);
        }
    }
    else if (DisplayMode.SELECT.equals(layerCell.getDisplayMode())) {
        IColorConstant selectedForeground = tableCell.getSelectedForegroundColor();
        if (selectedForeground == null) {
            selectedForeground = defaultSelectedForegroundColor;
        }
        if (selectedForeground != null) {
            return selectedForegroundColorCache.getColor(selectedForeground);
        }
    }
    return defaultForeground != null ? defaultForeground : GUIHelper.COLOR_LIST_FOREGROUND;
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:21,代码来源:JoCellTextPainter.java


示例3: configureRegistry

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


示例4: registerColumnThreePasswordPainter

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
private void registerColumnThreePasswordPainter(IConfigRegistry configRegistry) {
    Style style = new Style();
    style.setAttributeValue(
            CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
            GUIHelper.COLOR_WHITE);
    style.setAttributeValue(
            CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
            GUIHelper.COLOR_RED);

    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_STYLE,
            style,
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_THREE_LABEL);

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


示例5: addColumnHighlight

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
private void addColumnHighlight(IConfigRegistry configRegistry) {
    Style style = new Style();
    style.setAttributeValue(
            CellStyleAttributes.BACKGROUND_COLOR,
            GUIHelper.COLOR_RED);

    configRegistry.registerConfigAttribute(
            // attribute to apply
            CellConfigAttributes.CELL_STYLE,
            // value of the attribute
            style,
            // apply during normal rendering i.e not
            // during selection or edit
            DisplayMode.NORMAL,
            // apply the above for all cells with this label
            CELL_LABEL);

    // Override the selection style on the highlighted cells.
    // Note: This is achieved by specifying the display mode.
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_STYLE,
            style,
            DisplayMode.SELECT,
            CELL_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:26,代码来源:Applying_style_to_a_cell.java


示例6: 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


示例7: fireEvent

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
/**
 * Checks the selected items and fires an event on changes
 */
private void fireEvent() {
    Set<String> selection = new HashSet<String>();
    for (TableItem item : table.getItems()) {
        if (item.getChecked()) {
            selection.add(item.getText());
        }
    }
    if (model != null) {
        
        if (selection.equals(model.getSelectedQuasiIdentifiers())) {
            return;
        }
        
        if (selection.size() <= model.getRiskModel().getMaxQiSize()) {
            model.setSelectedQuasiIdentifiers(selection);
            controller.update(new ModelEvent(ViewRisksQuasiIdentifiers.this, ModelPart.SELECTED_QUASI_IDENTIFIERS, selection));
            label.setText(Resources.getMessage("ViewRisksQuasiIdentifiers.3") + (int)(Math.pow(2, selection.size())-1)); //$NON-NLS-1$
            label.setForeground(GUIHelper.COLOR_BLACK);
        } else {
            label.setText(Resources.getMessage("ViewRisksQuasiIdentifiers.4") + (int)(Math.pow(2, selection.size())-1)); //$NON-NLS-1$
            label.setForeground(GUIHelper.COLOR_RED);
        }
    }
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:28,代码来源:ViewRisksQuasiIdentifiers.java


示例8: newFlowGraphNode

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
private GraphNode newFlowGraphNode(Stream stream){
	GraphNode node=new GraphNode(flowGraph, SWT.ALPHA);
	String text=getFlowGraphNodeText(stream);
	node.setText(text);
	node.setData(stream.getUniqueName());
	Color color=getInstanceColor(stream);
	node.setBackgroundColor(color);	
	node.setBorderColor(color);
	node.setHighlightColor(color);
	node.setBorderHighlightColor(GUIHelper.COLOR_BLACK);
	flowGraph.setData(stream.getUniqueName(), node);
	return node;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:14,代码来源:WorkerInstancesComposite2.java


示例9: getCellColor

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
public Color getCellColor(int columnIndex, int rowIndex) {
	StreamContainer sc=locateStreamContainer(columnIndex, rowIndex);
	if(sc!=null){
		InstanceStat insStat=clw.getContainerStatMap().get(sc.getUniqueName());
		return InstanceColorFactory.getInstanceColor(insStat);
	}
	return GUIHelper.COLOR_WHITE;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:9,代码来源:InstanceTable.java


示例10: setupGC

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
@Override
void setupGC(final GC gc, final ILayerCell layerCell, final IStyle cellStyle) {
    final ITableCell tableCell = (ITableCell) layerCell.getDataValue();

    this.originalFont = gc.getFont();
    this.originalForeground = gc.getForeground();

    gc.setAntialias(GUIHelper.DEFAULT_ANTIALIAS);
    gc.setTextAntialias(GUIHelper.DEFAULT_TEXT_ANTIALIAS);
    gc.setFont(getFont(tableCell, cellStyle));
    gc.setForeground(getForegroundColor(tableCell, layerCell, cellStyle));
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:13,代码来源:JoCellTextPainter.java


示例11: configureRegistry

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    IStyle style = new Style();
    style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_BLUE);
    style.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);

    configRegistry
            .registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.NORMAL, ACTIVE_LABEL);

    configRegistry
            .registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.SELECT, ACTIVE_LABEL);
}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:13,代码来源:ActiveTableStyleConfiguration.java


示例12: configureRegistry

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


示例13: setupGCFromConfig

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
/**
 * Setup the GC by the values defined in the given cell style.
 *
 * @param gc
 * @param cellStyle
 */
public void setupGCFromConfig(GC gc, IStyle cellStyle) {
	Color fg = cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR);
	Color bg = cellStyle.getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR);
	Font font = cellStyle.getAttributeValue(CellStyleAttributes.FONT);

	gc.setAntialias(GUIHelper.DEFAULT_ANTIALIAS);
	gc.setTextAntialias(GUIHelper.DEFAULT_TEXT_ANTIALIAS);
	gc.setFont(font);
	gc.setForeground(fg != null ? fg : GUIHelper.COLOR_LIST_FOREGROUND);
	gc.setBackground(bg != null ? bg : GUIHelper.COLOR_LIST_BACKGROUND);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:18,代码来源:RichTextCellPainter.java


示例14: 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


示例15: registerColumnTwoTextPainterStyle

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
private void registerColumnTwoTextPainterStyle(IConfigRegistry configRegistry) {
    Style style = new Style();
    style.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
            new BorderStyle(2, GUIHelper.COLOR_BLUE, LineStyleEnum.DASHDOT));

    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_STYLE,
            style,
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_TWO_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:12,代码来源:CellPainterExample.java


示例16: registerColumnSixDoublePainter

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


示例17: registerColumnEightCheckboxPainter

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
private void registerColumnEightCheckboxPainter(IConfigRegistry configRegistry) {
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.CELL_PAINTER,
            new CheckBoxPainter(GUIHelper.getImage("arrow_up"), GUIHelper.getImage("arrow_down")),
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_EIGHT_LABEL);

    // using a CheckBoxCellEditor also needs a Boolean conversion to
    // work correctly
    configRegistry.registerConfigAttribute(
            CellConfigAttributes.DISPLAY_CONVERTER,
            getGenderBooleanConverter(),
            DisplayMode.NORMAL,
            CellPainterExample.COLUMN_EIGHT_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:16,代码来源:CellPainterExample.java


示例18: paint

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
/**
 * Paint.
 *
 * @param gc
 */
private void paint(GC gc) {
	Point size = shell.getSize();
    Point offsets = gc.textExtent(version);
    gc.setAdvanced(true);
    gc.setAntialias(SWT.ON);
    gc.setInterpolation(SWT.ON);
    gc.drawImage(splash, 0,  0, splash.getBounds().width, splash.getBounds().height, 0, 0, size.x,  size.y);
    gc.setForeground(GUIHelper.COLOR_BLACK);
    gc.drawString(version, size.x - (int)offsets.x - 10, size.y - (int)offsets.y - 10, true);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:16,代码来源:MainSplash.java


示例19: getFont

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
/**
 * Returns the font.
 *
 * @return
 */
private static Font getFont(){

    FontData fontdata = GUIHelper.DEFAULT_FONT.getFontData()[0];
    fontdata.setHeight(9);
    return GUIHelper.getFont(fontdata);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:12,代码来源:HierarchyWizardEditorRenderer.java


示例20: createControl

import org.eclipse.nebula.widgets.nattable.util.GUIHelper; //导入依赖的package包/类
@Override
public void createControl(final Composite parent) {
    
    final GridData ldata = SWTUtil.createFillHorizontallyGridData();
    if (multi) {
        text = new Text(parent, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
        ldata.heightHint = 60;
    } else {
        text = new Text(parent, SWT.SINGLE | SWT.BORDER);
    }
    ldata.minimumWidth = 60;
    text.setText(getValue());
    text.setLayoutData(ldata);
    text.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(final ModifyEvent arg0) {
            if (accepts(text.getText())) {
                setValue(text.getText());
                text.setForeground(GUIHelper.COLOR_BLACK);
                if (ok != null) ok.setEnabled(true);
            } else {
                text.setForeground(GUIHelper.COLOR_RED);
                if (ok != null) ok.setEnabled(false);
            }
        }
    });
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:28,代码来源:EditorString.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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