本文整理匯總了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);
}