本文整理了Java中org.eclipse.swt.graphics.GC.getAlpha()
方法的一些代码示例,展示了GC.getAlpha()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GC.getAlpha()
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.GC
类名称:GC
方法名:getAlpha
[英]Returns the receiver's alpha value. The alpha value is between 0 (transparent) and 255 (opaque).
[中]返回接收器的alpha值。alpha值介于0(透明)和255(不透明)之间。
代码示例来源:origin: pentaho/pentaho-kettle
public int getAlpha() {
return gc.getAlpha();
}
代码示例来源:origin: pentaho/pentaho-kettle
public int getAlpha() {
return gc.getAlpha();
}
代码示例来源:origin: com.eclipsesource.tabris/tabris
private void doDispatch() {
int lineWidth = gc.getLineWidth();
Color foreground = gc.getForeground();
int alpha = gc.getAlpha();
dispatchOperations();
restoreLastSettings( lineWidth, foreground, alpha );
}
代码示例来源:origin: stefanhaustein/flowgrid
public static void drawHalo(GC gc, int x, int y, int r, Color color) {
Color background = gc.getBackground();
int alpha = gc.getAlpha();
gc.setAlpha(127);
gc.setBackground(color);
gc.fillOval(x - r, y - r, 2 * r, 2 * r);
gc.setAlpha(alpha);
gc.setBackground(background);
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
private void draw(GC gc,float x,float y,float h,DHTControlContact contact,int distance,float error) {
if(x == 0 && y == 0) return;
if(error > 1) error = 1;
int errDisplay = (int) (100 * error);
int x0 = scale.getX(x,y);
int y0 = scale.getY(x,y);
Image img = ImageRepository.getCountryFlag( contact.getTransportContact().getTransportAddress().getAddress(), true );
if ( img != null ){
Rectangle bounds = img.getBounds();
int old = gc.getAlpha();
gc.setAlpha( 150 );
gc.drawImage( img, x0-bounds.width/2, y0-bounds.height);
gc.setAlpha( old );
}
gc.fillRectangle(x0-1,y0-1,3,3);
//int elevation =(int) ( 200*h/(scale.maxY-scale.minY));
//gc.drawLine(x0,y0,x0,y0-elevation);
//String text = /*contact.getTransportContact().getAddress().getAddress().getHostAddress() + " (" + */distance + " ms \nerr:"+errDisplay+"%";
String text = /*contact.getTransportContact().getAddress().getAddress().getHostAddress() + " (" + */distance + " ms "+errDisplay+"%";
int lineReturn = text.indexOf("\n");
int xOffset = gc.getFontMetrics().getAverageCharWidth() * (lineReturn != -1 ? lineReturn:text.length()) / 2;
gc.drawText(text,x0-xOffset,y0,true);
currentPositions.add( new Object[]{ x0, y0, h, contact, x, y, distance });
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void cellPaint(GC gc, TableCellSWT cell) {
Object ds = cell.getDataSource();
if (!(ds instanceof TorrentOpenFileOptions)) {
return;
}
TorrentOpenFileOptions tfi = (TorrentOpenFileOptions) ds;
float pct = tfi.lSize / (float) tfi.parent.getTorrent().getSize();
Rectangle bounds = cell.getBounds();
bounds.width = (int) (bounds.width * pct);
if (bounds.width > 2) {
bounds.x++;
bounds.y++;
bounds.height -= 2;
bounds.width -= 2;
gc.setBackground(gc.getForeground());
int alpha = gc.getAlpha();
gc.setAlpha(10);
gc.fillRectangle(bounds);
gc.setAlpha(alpha);
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
&& gc.getAlpha() == 255) {
clipping = gc.getClipping();
gc.setAdvanced(false);
代码示例来源:origin: com.googlecode.gstreamer-java/gstreamer-java
if (alpha != gc.getAlpha())
gc.setAlpha(alpha);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
private void handleDrawRequest(GC gc, int x, int y, int w, int h) {
int startLine= fTextWidget.getLineIndex(y);
int endLine= fTextWidget.getLineIndex(y + h - 1);
if (startLine <= endLine && startLine < fTextWidget.getLineCount()) {
// avoid painting into the margins:
Rectangle clipping= gc.getClipping();
Rectangle clientArea= fTextWidget.getClientArea();
int leftMargin= fTextWidget.getLeftMargin();
int rightMargin= fTextWidget.getRightMargin();
clientArea.x+= leftMargin;
clientArea.width-= leftMargin + rightMargin;
clipping.intersect(clientArea);
gc.setClipping(clientArea);
if (fIsAdvancedGraphicsPresent) {
int alpha= gc.getAlpha();
gc.setAlpha(fAlpha);
drawLineRange(gc, startLine, endLine, x, w);
gc.setAlpha(alpha);
} else {
drawLineRange(gc, startLine, endLine, x, w);
}
gc.setClipping(clipping);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
private void handleDrawRequest(GC gc, int x, int y, int w, int h) {
int startLine= fTextWidget.getLineIndex(y);
int endLine= fTextWidget.getLineIndex(y + h - 1);
if (startLine <= endLine && startLine < fTextWidget.getLineCount()) {
// avoid painting into the margins:
Rectangle clipping= gc.getClipping();
Rectangle clientArea= fTextWidget.getClientArea();
int leftMargin= fTextWidget.getLeftMargin();
int rightMargin= fTextWidget.getRightMargin();
clientArea.x+= leftMargin;
clientArea.width-= leftMargin + rightMargin;
clipping.intersect(clientArea);
gc.setClipping(clientArea);
if (fIsAdvancedGraphicsPresent) {
int alpha= gc.getAlpha();
gc.setAlpha(fAlpha);
drawLineRange(gc, startLine, endLine, x, w);
gc.setAlpha(alpha);
} else {
drawLineRange(gc, startLine, endLine, x, w);
}
gc.setClipping(clipping);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt
final int oldAlpha = gc.getAlpha();
代码示例来源:origin: BiglySoftware/BiglyBT
byte proficiency = columnInfo.getProficiency();
if (proficiency > 0 && proficiency < profText.length) {
int alpha = gc.getAlpha();
gc.setAlpha(0xA0);
GCStringPrinter.printString(gc,
代码示例来源:origin: org.xworker/xworker_swt
int alpha = gc.getAlpha();
try{
int linesTyle = gc.getLineStyle();
代码示例来源:origin: BiglySoftware/BiglyBT
int alpha = gc.getAlpha();
gc.setAlpha(0x40);
sp.printString(gc, cellBounds, style);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
int oldAlpha = gc.getAlpha ();
boolean oldAdvanced = gc.getAdvanced ();
int oldAntialias = gc.getAntialias ();
内容来源于网络,如有侵权,请联系作者删除!