项目:openjdk-jdk10
文件:MaskFill.java
public void MaskFill(SunGraphics2D sg2d,SurfaceData sData,Composite comp,int x,int y,int w,int h,byte mask[],int offset,int scan)
{
BufferedImage dstBI =
new BufferedImage(w,h,BufferedImage.TYPE_INT_ARGB);
SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);
// REMIND: This is not pretty. It would be nicer if we
// passed a "FillData" object to the Pixel loops,instead
// of a SunGraphics2D parameter...
Region clip = sg2d.clipRegion;
sg2d.clipRegion = null;
int pixel = sg2d.pixel;
sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
fillop.FillRect(sg2d,tmpData,w,h);
sg2d.pixel = pixel;
sg2d.clipRegion = clip;
maskop.MaskBlit(tmpData,sData,comp,null,x,y,mask,offset,scan);
}
项目:brModelo
文件:Tabela.java
private void FillCampos(Graphics2D g,Rectangle r,boolean normal) {
Composite originalComposite = g.getComposite();
float alfa = 1f - getAlfa();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,alfa));
Paint bkpp = g.getPaint();
g.setColor(getMaster().getBackground()); //# Não: isdisablePainted()? disabledColor :
if (!normal) {
if (isGradiente()) {
g.setColor(getGradienteStartColor());
} else {
g.setColor(getForeColor());
}
}
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,getAlfa()));
g.fill(r);
g.setPaint(bkpp);
g.setComposite(originalComposite);
}
项目:brModelo
文件:Desenhador.java
public void DrawImagem(Graphics2D g) {
BufferedImage imgB = getimagem();
if (imgB == null) {
return;
}
Rectangle rec = getBounds();
rec.grow(-2,-2);
if (imgres == null) {
imgres = imgB.getScaledInstance(rec.width,rec.height,Image.SCALE_SMOOTH);
}
Composite originalComposite = g.getComposite();
if (alfa != 1f) {
int type = AlphaComposite.SRC_OVER;
g.setComposite(AlphaComposite.getInstance(type,alfa));
}
Image img = imgres;
if (isdisablePainted()) {
img = util.Utilidades.dye(new ImageIcon(imgres),disabledColor);
}
g.drawImage(img,rec.x,rec.y,null);
g.setComposite(originalComposite);
}
/**
* Draws the background image (if there is one) aligned within the specified area.
*
* @param g2 the graphics device.
* @param area the area.
*/
protected void drawBackgroundImage(Graphics2D g2,Rectangle2D area) {
if (this.backgroundImage != null) {
Composite originalComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC,this.backgroundAlpha));
Rectangle2D dest = new Rectangle2D.Double(
0.0,0.0,this.backgroundImage.getWidth(null),this.backgroundImage.getHeight(null)
);
Align.align(dest,area,this.backgroundImageAlignment);
g2.drawImage(
this.backgroundImage,(int) dest.getX(),(int) dest.getY(),(int) dest.getWidth() + 1,(int) dest.getHeight() + 1,null
);
g2.setComposite(originalComposite);
}
}
项目:Logisim
文件:SubcircuitFactory.java
@Override
public void paintGhost(InstancePainter painter) {
Graphics g = painter.getGraphics();
Color fg = g.getColor();
int v = fg.getRed() + fg.getGreen() + fg.getBlue();
Composite oldComposite = null;
if (g instanceof Graphics2D && v > 50) {
oldComposite = ((Graphics2D) g).getComposite();
Composite c = AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f);
((Graphics2D) g).setComposite(c);
}
paintBase(painter,g);
if (oldComposite != null) {
((Graphics2D) g).setComposite(oldComposite);
}
}
项目:jdk8u-jdk
文件:MaskFill.java
public void MaskFill(SunGraphics2D sg2d,scan);
}
@Override
public synchronized void Transform(SurfaceData src,SurfaceData dst,Region clip,AffineTransform at,int hint,int srcx,int srcy,int dstx,int dsty,int width,int height){
Blit convertsrc = Blit.getFromCache(src.getSurfaceType(),CompositeType.SrcNoEa,SurfaceType.IntArgbPre);
// use cached intermediate surface,if available
final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null;
// convert source to IntArgbPre
src = convertFrom(convertsrc,src,srcx,srcy,width,height,cachedSrc,BufferedImage.TYPE_INT_ARGB_PRE);
// transform IntArgbPre intermediate surface to OpenGL surface
performop.Transform(src,dst,clip,at,hint,dstx,dsty,height);
if (src != cachedSrc) {
// cache the intermediate surface
srcTmp = new WeakReference<>(src);
}
}
项目:jdk8u-jdk
文件:D3DTextRenderer.java
@Override
protected void validateContext(SunGraphics2D sg2d,Composite comp) {
// assert rq.lock.isHeldByCurrentThread();
D3DSurfaceData d3dDst = (D3DSurfaceData)sg2d.surfaceData;
D3DContext.validateContext(d3dDst,d3dDst,sg2d.getCompClip(),sg2d.paint,sg2d,D3DContext.NO_CONTEXT_FLAGS);
}
项目:brModelo
文件:LivreBase.java
@Override
protected void PinteRegiao(Graphics2D g) {
Composite originalComposite = g.getComposite();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,alfa));
g.setPaint(this.getForeColor());
if (isGradiente()) {
int dist = 0;
int w = getWidth() - dist;
int h = getHeight() - dist;
int L = getLeft();
int T = getTop();
boolean dv = getGDirecao() == VERTICAL;
GradientPaint GP = new GradientPaint(L,T,getGradienteStartColor(),dv ? L : L + w,dv ? T + h : T,getGradienteEndColor(),true);
g.setPaint(GP);
}
if (getTipodesenho() != TipoDraw.tpTexto) {
stroke bkp = g.getstroke();
if (isDashed()) {
g.setstroke(new Basicstroke(1,Basicstroke.CAP_BUTT,Basicstroke.JOIN_BEVEL,new float[]{1,2},0));
}
if (isGradiente()) {
g.fill(getRegiao());
}
g.draw(getRegiao()); //Pinta as eventuais linhas internas do dezenho. Ex. LivreVariosDocumemtos
g.setstroke(bkp);
}
g.setComposite(originalComposite);
}
项目:incubator-netbeans
文件:BalloonManager.java
@Override
protected void paintChildren(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
Composite oldC = g2d.getComposite();
g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER,currentAlpha ) );
super.paintChildren(g);
g2d.setComposite( oldC );
}
项目:openjdk-jdk10
文件:GDIRenderer.java
项目:incubator-netbeans
文件:AquaSlidingButtonUI.java
@Override
protected void paintIcon(Graphics g,AbstractButton b,Rectangle iconRect) {
Graphics2D g2d = (Graphics2D) g;
Composite comp = g2d.getComposite();
if( b.getModel().isRollover() || b.getModel().isSelected() ) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f));
}
super.paintIcon(g,b,iconRect);
g2d.setComposite(comp);
}
项目:jdk8u-jdk
文件:OGLMaskBlit.java
@Override
protected void validateContext(SurfaceData dstData,Region clip)
{
OGLSurfaceData oglDst = (OGLSurfaceData)dstData;
OGLContext.validateContext(oglDst,oglDst,OGLContext.NO_CONTEXT_FLAGS);
}
项目:FreeCol
文件:ReportLabourPanel.java
@Override
public void paint(Graphics g) {
if (selected) {
Graphics2D g2d = (Graphics2D) g;
Composite oldComposite = g2d.getComposite();
Color oldColor = g2d.getColor();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.1f));
g2d.setColor(Color.BLACK);
g2d.fillRect(0,getWidth(),getHeight());
g2d.setComposite(oldComposite);
g2d.setColor(oldColor);
}
super.paint(g);
}
/**
* Plots the data for a given series.
*
* @param g2 the drawing surface.
* @param dataArea the data area.
* @param info collects plot rendering info.
* @param plot the plot.
* @param dataset the dataset.
* @param seriesIndex the series index.
*/
public void drawSeries(Graphics2D g2,Rectangle2D dataArea,PlotRenderingInfo info,PolarPlot plot,XYDataset dataset,int seriesIndex) {
polygon poly = new polygon();
int numPoints = dataset.getItemCount(seriesIndex);
for (int i = 0; i < numPoints; i++) {
double theta = dataset.getXValue(seriesIndex,i);
double radius = dataset.getYValue(seriesIndex,i);
Point p = plot.translateValueThetaradiusToJava2D(theta,radius,dataArea);
poly.addPoint(p.x,p.y);
}
g2.setPaint(getSeriesPaint(seriesIndex));
g2.setstroke(getSeriesstroke(seriesIndex));
if (isSeriesFilled(seriesIndex)) {
Composite savedComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f));
g2.fill(poly);
g2.setComposite(savedComposite);
}
else {
g2.draw(poly);
}
}
项目:jdk8u-jdk
文件:GDIRenderer.java
void doDrawRoundRect(GDIWindowSurfaceData sData,int arcW,int arcH)
{
GraphicsPrimitive.tracePrimitive("GDIDrawRoundRect");
super.doDrawRoundRect(sData,arcW,arcH);
}
项目:brModelo
文件:EapProcesso.java
@Override
public void DoPaint(Graphics2D g) {
Composite bkp = g.getComposite();
Paint p = g.getPaint();
super.DoPaint(g);
g.setPaint(p);
g.setComposite(bkp);
}
/**
* Draws the clip path.
*
* @param g2 current graphics2D.
* @param dataArea the dataArea that the plot is being draw in.
* @param horizontalAxis the horizontal axis.
* @param verticalAxis the vertical axis.
*
* @return the GeneralPath defining the outline
*/
public GeneralPath draw(Graphics2D g2,ValueAxis horizontalAxis,ValueAxis verticalAxis) {
GeneralPath generalPath = generateClipPath(dataArea,horizontalAxis,verticalAxis);
if (this.fillPath || this.drawPath) {
Composite saveComposite = g2.getComposite();
Paint savePaint = g2.getPaint();
stroke savestroke = g2.getstroke();
if (this.fillPaint != null) {
g2.setPaint(this.fillPaint);
}
if (this.composite != null) {
g2.setComposite(this.composite);
}
if (this.fillPath) {
g2.fill(generalPath);
}
if (this.drawstroke != null) {
g2.setstroke(this.drawstroke);
}
if (this.drawPath) {
g2.draw(generalPath);
}
g2.setPaint(savePaint);
g2.setComposite(saveComposite);
g2.setstroke(savestroke);
}
return generalPath;
}
项目:chordatlas
文件:FeatureCache.java
@Override
public void paint( Graphics2D g,PanMouseAdaptor ma ) {
{
Composite old = g.getComposite();
Composite comp = AlphaComposite.getInstance( AlphaComposite.SRC_OVER,0.5f );
g.setComposite( comp );
// draw rectified image at the width of the ortho image...
double height = getRectified().getHeight() / 40.;
g.drawImage( getRectified(),ma.toX( Math.min( start,end ) ),ma.toY( 0 - height ),ma.toZoom( Math.abs(start - end) ),ma.toZoom( height ),null );
g.setComposite( old );
}
// for ( int i = 0; i < miniFacades.size(); i++ )
// miniFacades.get( i ).paint( g,ma );
// for (double d : o.windowCuts)
// g.drawLine( ma.toX(d),ma.toX(d),10000 );
//
g.setColor( Color.orange );
//
// for (double d : o.classCuts)
// g.drawLine( ma.toX(d),10000 );
//
// g.setColor( new Color(255,100,255) );
// if (o.windows != null)
// for (Rectangle2D.Double w : o.windows) {
// g.drawRect( ma.toX( w.x ),ma.toY (-w.y-w.height),ma.toZoom( w.width ),ma.toZoom( w.height ) );
// }
}
项目:openjdk-jdk10
文件:OGLBlitLoops.java
private synchronized void complexClipBlit(SurfaceData src,int sx,int sy,int dx,int dy,int h) {
SurfaceData cachedSrc = null;
if (srcTmp != null) {
// use cached intermediate surface,if available
cachedSrc = srcTmp.get();
}
// We can convert argb_pre data from OpenGL surface in two places:
// - During OpenGL surface -> SW blit
// - During SW -> SW blit
// The first one is faster when we use opaque OGL surface,because in
// this case we simply skip conversion and use color components as is.
// Because of this we align intermediate buffer type with type of
// destination not source.
final int type = typeval == OGLSurfaceData.PF_INT_ARGB_PRE ?
BufferedImage.TYPE_INT_ARGB_PRE :
BufferedImage.TYPE_INT_ARGB;
src = convertFrom(this,sx,sy,type);
// copy intermediate SW to destination SW using complex clip
final Blit performop = Blit.getFromCache(src.getSurfaceType(),dst.getSurfaceType());
performop.Blit(src,dx,dy,h);
if (src != cachedSrc) {
// cache the intermediate surface
srcTmp = new WeakReference<>(src);
}
}
项目:openjdk-jdk10
文件:MaskFill.java
public void DrawAAPgram(SunGraphics2D sg2d,double x,double y,double dx1,double dy1,double dx2,double dy2,double lw1,double lw2)
{
tracePrimitive(drawPgramTarget);
target.DrawAAPgram(sg2d,dx1,dy1,dx2,dy2,lw1,lw2);
}
项目:freecol
文件:FreeColButtonUI.java
@Override
protected void paintButtonpressed(Graphics g,AbstractButton c) {
if (c.isContentAreaFilled()) {
Graphics2D g2d = (Graphics2D) g;
Dimension size = c.getSize();
Composite oldComposite = g2d.getComposite();
Color oldColor = g2d.getColor();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,size.width,size.height);
g2d.setComposite(oldComposite);
g2d.setColor(oldColor);
}
}
@Override
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
Composite oldComposite = g2d.getComposite();
Color oldColor = g2d.getColor();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.1f));
g2d.setColor(Color.BLACK);
g2d.fillRect(0,getHeight());
g2d.setComposite(oldComposite);
g2d.setColor(oldColor);
super.paintComponent(g);
}
项目:freecol
文件:FreeColSelectedPanelUI.java
@Override
public void paint(Graphics g,JComponent c) {
Graphics2D g2d = (Graphics2D) g;
Composite oldComposite = g2d.getComposite();
Color oldColor = g2d.getColor();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,c.getWidth(),c.getHeight());
g2d.setComposite(oldComposite);
g2d.setColor(oldColor);
//super.paintComponent(g);
}
项目:jdk8u-jdk
文件:D3DBlitLoops.java
public void Blit(SurfaceData src,int h)
{
D3DBlitLoops.Blit(src,AffineTransformOp.TYPE_NEAREST_NEIGHBOR,sx+w,sy+h,dx+w,dy+h,typeval,true);
}
项目:jdk8u-jdk
文件:D3DBlitLoops.java
public void Scale(SurfaceData src,int sx1,int sy1,int sx2,int sy2,double dy2)
{
D3DBlitLoops.IsoBlit(src,sx1,sy1,sx2,sy2,true);
}
项目:jdk8u-jdk
文件:OGLTextRenderer.java
@Override
protected void validateContext(SunGraphics2D sg2d,Composite comp) {
// assert rq.lock.isHeldByCurrentThread();
OGLSurfaceData oglDst = (OGLSurfaceData)sg2d.surfaceData;
OGLContext.validateContext(oglDst,OGLContext.NO_CONTEXT_FLAGS);
}
项目:openjdk-jdk10
文件:OGLBlitLoops.java
public void Scale(SurfaceData src,double dy2)
{
OGLBlitLoops.Blit(src,false);
}
/**
* Draws the band.
*
* @param g2 the graphics device.
* @param plotArea the plot area.
* @param dataArea the data area.
* @param x the x-coordinate.
* @param y the y-coordinate.
*/
public void draw(Graphics2D g2,Rectangle2D plotArea,double y) {
double h = getHeight(g2);
Iterator iterator = this.markers.iterator();
while (iterator.hasNext()) {
IntervalMarker marker = (IntervalMarker) iterator.next();
double start = Math.max(
marker.getStartValue(),this.axis.getRange().getLowerBound()
);
double end = Math.min(
marker.getEndValue(),this.axis.getRange().getUpperBound()
);
double s = this.axis.valuetoJava2D(
start,dataArea,RectangleEdge.BottOM
);
double e = this.axis.valuetoJava2D(
end,RectangleEdge.BottOM
);
Rectangle2D r = new Rectangle2D.Double(
s,y + this.topOuterGap,e - s,h - this.topOuterGap - this.bottomOuterGap
);
Composite originalComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER,marker.getAlpha())
);
g2.setPaint(marker.getPaint());
g2.fill(r);
g2.setPaint(marker.getoutlinePaint());
g2.draw(r);
g2.setComposite(originalComposite);
g2.setPaint(Color.black);
drawStringInRect(g2,r,this.font,marker.getLabel());
}
}
项目:jdk8u-jdk
文件:D3DBlitLoops.java
public void Blit(SurfaceData src,int h)
{
D3DBlitLoops.IsoBlit(src,true);
}
项目:openjdk-jdk10
文件:OGLBlitLoops.java
public void Transform(SurfaceData src,int h)
{
OGLBlitLoops.IsoBlit(src,false);
}
项目:jdk8u-jdk
文件:Blit.java
public void Blit(SurfaceData src,int height)
{
tracePrimitive(target);
target.Blit(src,height);
}
项目:openjdk-jdk10
文件:Blit.java
public void Blit(SurfaceData src,height);
}
public void Blit(SurfaceData src,true);
}
项目:jdk8u-jdk
文件:MaskFill.java
public void FillAAPgram(SunGraphics2D sg2d,double dy2)
{
tracePrimitive(fillPgramTarget);
target.FillAAPgram(sg2d,dy2);
}
项目:FreeCol
文件:FreeColButtonUI.java
@Override
protected void paintButtonpressed(Graphics g,size.height);
g2d.setComposite(oldComposite);
g2d.setColor(oldColor);
}
}
public void Blit(SurfaceData srcData,SurfaceData dstData,int height)
{
performop.MaskBlit(srcData,dstData,0);
}
public void Transform(SurfaceData src,false);
}
项目:openjdk-jdk10
文件:MaskBlit.java
/**
* All MaskBlit implementors must have this invoker method
*/
public native void MaskBlit(SurfaceData src,int height,byte[] mask,int maskoff,int maskscan);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。