本文整理汇总了Java中org.eclipse.swt.widgets.Display.getSystemColor方法的典型用法代码示例。如果您正苦于以下问题:Java Display.getSystemColor方法的具体用法?Java Display.getSystemColor怎么用?Java Display.getSystemColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Display
的用法示例。
在下文中一共展示了Display.getSystemColor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createControl
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
* (non-Javadoc) Method declared on IDialogPage.
*/
@Override
public void createControl(Composite parent) {
setPageComplete(true);
initializeDialogUnits(parent);
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
new Label(composite, SWT.NONE).setText("Messages:");
createErrorGroup(composite);
Display display = getShell().getDisplay();
highlightColor = display.getSystemColor(SWT.COLOR_RED);
setControl(composite);
}
示例2: getColor
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private Color getColor(int c) {
Display display = getControl().getShell().getDisplay();
switch (c) {
case -2: return display.getSystemColor (SWT.COLOR_GRAY);
case -1: return display.getSystemColor (SWT.COLOR_GRAY);
default:
case 0: return display.getSystemColor (SWT.COLOR_BLACK);
case 1: return display.getSystemColor (SWT.COLOR_RED);
case 2: return display.getSystemColor (SWT.COLOR_GREEN);
case 3: return display.getSystemColor (SWT.COLOR_YELLOW);
case 4: return display.getSystemColor (SWT.COLOR_BLUE);
case 5: return display.getSystemColor (SWT.COLOR_MAGENTA);
case 6: return display.getSystemColor (SWT.COLOR_CYAN);
case 7: return display.getSystemColor (SWT.COLOR_WHITE);
}
}
示例3: setStyledText
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private void setStyledText(ViewerCell cell, TreeObject obj) {
/* Calcul du texte. */
String mainText = obj.getMainText();
if (mainText == null) {
return;
}
String subText = obj.getSubText();
String subTextFinal = subText == null ? "" : (" : " + subText);
String fullText = mainText + subTextFinal;
cell.setText(fullText);
/* Calcul du style. */
List<StyleRange> styles = new ArrayList<>();
StyleRange styleMainText = new StyleRange(0, mainText.length(), null, null);
styles.add(styleMainText);
if (!subTextFinal.isEmpty()) {
Display display = Display.getCurrent();
Color blue = display.getSystemColor(SWT.COLOR_DARK_YELLOW);
StyleRange styleSubText = new StyleRange(mainText.length(), subTextFinal.length(), blue, null);
styles.add(styleSubText);
}
cell.setStyleRanges(styles.toArray(new StyleRange[0]));
}
示例4: setColor
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/** Sets the color of the {@link GC} depending on the edge type. */
void setColor(GC gc) {
Display displ = Display.getCurrent();
Color color = GraphUtils.getColor(50, 50, 50);
if (isDead || cfTypes.contains(ControlFlowType.DeadCode)) {
color = displ.getSystemColor(SWT.COLOR_GRAY);
} else {
for (ControlFlowType cfType : cfTypes) {
switch (cfType) {
case LoopEnter:
case LoopReenter:
case LoopInfinite:
case Break:
case Continue:
case Return:
color = displ.getSystemColor(SWT.COLOR_BLUE);
break;
case Throw:
color = displ.getSystemColor(SWT.COLOR_RED);
break;
default:
break;
}
}
}
gc.setForeground(color);
}
示例5: getBackgroundColor
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public Color getBackgroundColor() {
Color col = null;
if (isDeadCode) {
Display displ = Display.getCurrent();
col = displ.getSystemColor(SWT.COLOR_GRAY);
} else {
col = super.getBackgroundColor();
}
return col;
}
示例6: AnimatedGif
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public AnimatedGif(Display display, Canvas animationCanvas, String animatedGifFile) {
this.display = display;
this.animationCanvas = animationCanvas;
try {
loader = new ImageLoader();
} catch (SWTException ex) {
ConvertigoPlugin.logException(ex, "There was an error loading the GIF", false);
loader = null;
}
imageDataArray = loader.load(getClass().getResourceAsStream(animatedGifFile));
animationCanvasGC = new GC(animationCanvas);
shellBackground = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
}
示例7: getColor
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
* Returns the system {@link Color} matching the specific ID.
*
* @param systemColorID
* the ID value for the color
* @return the system {@link Color} matching the specific ID
*/
public static Color getColor(int systemColorID) {
Display display = Display.getCurrent();
return display.getSystemColor(systemColorID);
}