亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? paints.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.graphics;import java.awt.*;import java.awt.geom.*;import java.awt.font.*;import java.awt.image.*;/** A demonstration of Java2D transformations */public class Paints implements GraphicsExample {    static final int WIDTH = 800, HEIGHT = 375;  // Size of our example    public String getName() { return "Paints"; } // From GraphicsExample    public int getWidth() { return WIDTH; }      // From GraphicsExample    public int getHeight() { return HEIGHT; }    // From GraphicsExample    /** Draw the example */    public void draw(Graphics2D g, Component c) {	// Paint the entire background using a GradientPaint.	// The background color varies diagonally from deep red to pale blue	g.setPaint(new GradientPaint(0, 0, new Color(150, 0, 0),				     WIDTH, HEIGHT, new Color(200, 200, 255)));	g.fillRect(0, 0, WIDTH, HEIGHT);          // fill the background	// Use a different GradientPaint to draw a box.	// This one alternates between deep opaque green and transparent green.	// Note: the 4th arg to Color() constructor specifies color opacity	g.setPaint(new GradientPaint(0, 0, new Color(0, 150, 0),				     20, 20, new Color(0, 150, 0, 0), true));	g.setStroke(new BasicStroke(15));         // use wide lines	g.drawRect(25, 25, WIDTH-50, HEIGHT-50);  // draw the box	// The glyphs of fonts can be used as Shape objects, which enables	// us to use Java2D techniques with letters Just as we would with	// any other shape.  Here we get some letter shapes to draw.	Font font = new Font("Serif", Font.BOLD, 10);  // a basic font	Font bigfont =                                 // a scaled up version	    font.deriveFont(AffineTransform.getScaleInstance(30.0, 30.0));	GlyphVector gv = bigfont.createGlyphVector(g.getFontRenderContext(),						   "JAV");	Shape jshape = gv.getGlyphOutline(0);   // Shape of letter J	Shape ashape = gv.getGlyphOutline(1);   // Shape of letter A	Shape vshape = gv.getGlyphOutline(2);   // Shape of letter V	// We're going to outline the letters with a 5-pixel wide line	g.setStroke(new BasicStroke(5.0f));	// We're going to fake shadows for the letters using the	// following Paint and AffineTransform objects	Paint shadowPaint = new Color(0, 0, 0, 100);     // Translucent black	AffineTransform shadowTransform =	    AffineTransform.getShearInstance(-1.0, 0.0); // Shear to the right	shadowTransform.scale(1.0, 0.5);                 // Scale height by 1/2	// Move to the baseline of our first letter	g.translate(65, 270);	// Draw the shadow of the J shape	g.setPaint(shadowPaint);	g.translate(15,20);     // Compensate for the descender of the J	// transform the J into the shape of its shadow, and fill it	g.fill(shadowTransform.createTransformedShape(jshape));	g.translate(-15,-20);   // Undo the translation above	// Now fill the J shape with a solid (and opaque) color	g.setPaint(Color.blue);     // Fill with solid, opaque blue	g.fill(jshape);             // Fill the shape	g.setPaint(Color.black);    // Switch to solid black	g.draw(jshape);             // And draw the outline of the J	// Now draw the A shadow	g.translate(75, 0);         // Move to the right	g.setPaint(shadowPaint);    // Set shadow color	g.fill(shadowTransform.createTransformedShape(ashape)); // draw shadow	// Draw the A shape using a solid transparent color	g.setPaint(new Color(0, 255, 0, 125));  // Transparent green as paint	g.fill(ashape);                         // Fill the shape	g.setPaint(Color.black);                // Switch to solid back	g.draw(ashape);                         // Draw the outline		// Move to the right and draw the shadow of the letter V	g.translate(175, 0);	g.setPaint(shadowPaint);	g.fill(shadowTransform.createTransformedShape(vshape));	// We're going to fill the next letter using a TexturePaint, which	// repeatedly tiles an image. The first step is to obtain the image.	// We could load it from an image file, but here we create it 	// ourselves by drawing a into an off-screen image.  Note that we use	// a GradientPaint to fill the off-screen image, so the fill pattern	// combines features of both Paint classes.	BufferedImage tile =                   // Create an image	    new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB);	Graphics2D tg = tile.createGraphics(); // Get its Graphics for drawing	tg.setColor(Color.pink);       	tg.fillRect(0, 0, 50, 50);     // Fill tile background with pink	tg.setPaint(new GradientPaint(40, 0, Color.green,  // diagonal gradient				      0, 40, Color.gray)); // green to gray	tg.fillOval(5, 5, 40, 40);     // Draw a circle with this gradient	// Use this new tile to create a TexturePaint and fill the letter V	g.setPaint(new TexturePaint(tile, new Rectangle(0, 0, 50, 50)));	g.fill(vshape);                        // Fill letter shape	g.setPaint(Color.black);               // Switch to solid black	g.draw(vshape);                        // Draw outline of letter	// Move to the right and draw the shadow of the final A	g.translate(160, 0);	g.setPaint(shadowPaint);	g.fill(shadowTransform.createTransformedShape(ashape));	// For the last letter, use a custom Paint class to fill with a 	// complex mathematically defined pattern.  The GenericPaint	// class is defined later in the chapter.	g.setPaint(new GenericPaint() {		public int computeRed(double x, double y) { return 128; }		public int computeGreen(double x, double y) {		    return (int)((Math.sin(x/7) + Math.cos(y/5) + 2)/4 *255);		}		public int computeBlue(double x, double y) {		    return ((int)(x*y))%256;		}		public int computeAlpha(double x, double y) {		    return ((int)x%25*8+50) + ((int)y%25*8+50);		}	    });	g.fill(ashape);                // Fill letter A	g.setPaint(Color.black);       // Revert to solid black	g.draw(ashape);                // Draw the outline of the A    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区系列电影| 亚洲色图欧美激情| 国产精品电影院| 日韩影院在线观看| 国产精品一卡二| 欧美精品 日韩| 一区二区欧美视频| 国产成人免费在线视频| 91精品麻豆日日躁夜夜躁| 亚洲日穴在线视频| 丁香婷婷综合色啪| 日韩欧美亚洲一区二区| 亚洲国产一区在线观看| 91丨porny丨中文| 久久精品人人爽人人爽| 青青草国产精品97视觉盛宴| 在线欧美日韩精品| 亚洲三级视频在线观看| www.av亚洲| 国产精品视频yy9299一区| 开心九九激情九九欧美日韩精美视频电影| 91免费在线播放| 日韩激情中文字幕| 99久久亚洲一区二区三区青草| 精品处破学生在线二十三| 午夜影视日本亚洲欧洲精品| 一本大道久久a久久精二百| 国产午夜久久久久| 国产精品12区| 国产欧美精品在线观看| 福利视频网站一区二区三区| 国产日韩av一区二区| 高清不卡在线观看av| 国产性色一区二区| 国产v日产∨综合v精品视频| 欧美成人在线直播| 蜜桃在线一区二区三区| 日韩亚洲欧美在线| 久久成人免费网站| 久久新电视剧免费观看| 国产乱人伦精品一区二区在线观看 | 日韩电影在线一区二区| 欧美绝品在线观看成人午夜影视| 亚洲成av人片在线观看| 555www色欧美视频| 日韩精品1区2区3区| 日韩精品一区二| 国产精品99久久久久久久vr| 亚洲欧洲日韩在线| 在线视频国内自拍亚洲视频| 五月婷婷欧美视频| 日韩欧美成人午夜| 国产98色在线|日韩| 中文字幕一区二区三中文字幕| 99re视频精品| 亚洲一区二区三区美女| 欧美人与性动xxxx| 国产精品毛片a∨一区二区三区| 欧美激情一区二区三区不卡| 欧美一区二区视频在线观看2022| 日韩av网站免费在线| 精品国产乱码久久| 日韩精品一区二区三区在线观看| 亚洲视频一区二区在线观看| 成人不卡免费av| 亚洲成人av免费| 2017欧美狠狠色| 色哟哟国产精品| 麻豆一区二区三| 亚洲人成在线播放网站岛国| 欧美一级国产精品| 91小视频免费看| 美腿丝袜亚洲一区| 成人免费一区二区三区在线观看| 在线不卡欧美精品一区二区三区| 激情综合五月婷婷| 夜夜精品浪潮av一区二区三区| 精品人伦一区二区色婷婷| 97久久精品人人澡人人爽| 美女视频一区在线观看| 一区二区三区四区精品在线视频| 欧美成人福利视频| 欧美伊人精品成人久久综合97| 国产激情精品久久久第一区二区| 夜夜嗨av一区二区三区| 欧美激情一二三区| 欧美一三区三区四区免费在线看| 99久久国产免费看| 国产麻豆成人传媒免费观看| 日韩有码一区二区三区| 伊人色综合久久天天人手人婷| 欧美精品一区二区精品网| 欧美色窝79yyyycom| 成人av免费网站| 国产麻豆精品95视频| 奇米影视一区二区三区| 亚洲一区二区三区国产| 最新国产精品久久精品| 洋洋av久久久久久久一区| 欧美激情在线一区二区| 欧美成人精品福利| 欧美日韩第一区日日骚| 99re亚洲国产精品| 激情综合色综合久久综合| 日韩国产欧美在线观看| 亚洲日本一区二区| 国产精品国产三级国产aⅴ中文 | 91精选在线观看| 波波电影院一区二区三区| 精品一区二区三区在线视频| 首页亚洲欧美制服丝腿| 亚洲成人综合视频| 五月天视频一区| 日韩女优av电影| 91精品国产91综合久久蜜臀| 欧美日韩日日夜夜| 欧美精品乱码久久久久久按摩| 欧美影院午夜播放| 欧美日本视频在线| 国产精品久久久久四虎| 亚洲国产成人一区二区三区| 亚洲国产精品黑人久久久| 国产精品美女久久久久久久| 日韩美女视频19| 一级日本不卡的影视| 亚洲伊人色欲综合网| 日韩福利电影在线观看| 久久精品国产精品亚洲综合| 精品一二三四在线| 国产精品2024| av男人天堂一区| 色爱区综合激月婷婷| 欧美日韩二区三区| 欧美精品一区二区精品网| 国产日韩精品一区二区浪潮av| 国产精品午夜春色av| 亚洲欧美另类在线| 午夜精品影院在线观看| 精品在线一区二区| 99久久综合色| 欧美日韩精品二区第二页| 欧美v日韩v国产v| 精品国产亚洲在线| 中文字幕一区二区三区在线播放| 中文字幕永久在线不卡| 夜色激情一区二区| 日韩电影免费一区| 一区二区三区高清在线| 亚洲福利一二三区| 久久国产精品色婷婷| 国产一区999| 99久久婷婷国产综合精品| 91精品蜜臀在线一区尤物| 亚洲国产经典视频| 日韩电影网1区2区| 9久草视频在线视频精品| 欧美日韩国产首页| 国产精品萝li| 日本欧美加勒比视频| 9久草视频在线视频精品| 日韩女同互慰一区二区| 一区二区激情小说| 国产福利一区二区三区视频| 欧美亚洲精品一区| 日本一区二区三区免费乱视频| 亚洲高清一区二区三区| 成人免费高清在线| 欧美一区二区精美| 综合av第一页| 韩国成人精品a∨在线观看| 欧美无砖砖区免费| 国产精品白丝在线| 九一久久久久久| 91精品婷婷国产综合久久竹菊| **欧美大码日韩| 国产成人一区在线| 制服丝袜国产精品| 一区二区三区丝袜| 不卡av电影在线播放| ww久久中文字幕| 久久黄色级2电影| 欧美日韩国产经典色站一区二区三区 | 日日骚欧美日韩| 在线看不卡av| 亚洲男人的天堂av| 波多野结衣中文一区| 国产亚洲婷婷免费| 国产自产v一区二区三区c| 欧美浪妇xxxx高跟鞋交| 一二三区精品视频| 欧美自拍偷拍午夜视频| 中文字幕在线免费不卡| 国产91精品在线观看| 2022国产精品视频| 老司机一区二区| 日韩色在线观看| 韩国女主播成人在线观看| 精品国产乱码久久久久久蜜臀| 日韩国产精品91| 日韩免费一区二区|