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

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

?? skin.java

?? XP Look And Feel
?? JAVA
字號:
// Beta
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*	XP Look and Feel                                                       *
*                                                                              *
*  (C) Copyright 2002, by Stefan Krause                                        *
*                                                                              *
*                                                                              *
*   This library is free software; you can redistribute it and/or modify it    *
*   under the terms of the GNU Lesser General Public License as published by   *
*   the Free Software Foundation; either version 2.1 of the License, or (at    *
*   your option) any later version.                                            *
*                                                                              *
*   This library is distributed in the hope that it will be useful,            *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of             *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                       *
*   See the GNU Lesser General Public License for more details.                *
*                                                                              *
*   You should have received a copy of the GNU General Public License along    *
*   with this program; if not, write to the Free Software Foundation, Inc.,    *
*   59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.                    *
*                                                                              *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

package com.stefankrause.xplookandfeel.skin;

import java.awt.Dimension;
import java.awt.Graphics;

/**
 * This class is for a skin that can be used to "skin" a component.
 * It's most important feature is to draw an image that can be scaled
 * to fit onto the component. All in all there are nine regions that
 * are treated differently. These regions can be grouped in three cases:
 * 1. The corners are not stretched at all, but take the space as described by
 * the members ulX,ulY,lrX and lrY. 
 * They denote the distance from the corner of the image to the rectangle that
 * will be scaled to fit the component. This means that the rectangle (0,0)-(ulX,ulY)
 * will not be scaled at all, the rectangle (ulX,0)-(sizeX-lrX-1,ulY) is scaled only 
 * horizontally and (sizeX-lrX,ulY) will not be scaled again.  
 * For the upper left corner this means that
 * the Rectangle (0,0) - (ulX,ulY) is painted with the same rectangle from the skin
 * image.
 * 2. The edges of the component. These are the rectangles that fit in between the corners.
 * They will be stretched but only either horizontally or vertically.
 * 3. The center. This is the remaining space of the skin. It will be scaled both
 * horizontally and vertically.
 * 
 * Note that if ulX,ulY,lrX and lrY are set to zero there will be a optimization to
 * improve speed for components that have a fixed size (The skin should be as big as
 * the component in this case). 
 * 
 * Each skin file consists of several images that are place next to each other.
 * The constructor for Skin takes the number of images as an argument. When the
 * skin is painted there's an argument for the index of the subimage to be used.
 * The index starts with 0. 
 * 
 * @see com.stefankrause.xplookandfeel.skin.SkinSimpleButtonIndexModel
 * @see com.stefankrause.xplookandfeel.skin.SkinToggleButtonIndexModel
 * */
public class Skin extends SkinElement {
    /** the number of subimages in the skin*/
	private int nrImages;
    /** the horizontal size of each subimage */ 
	private int hsize;
    /** the vertical size of each subimage */
    private int vsize;
    /** the distance from the left edge to the scaling region of the skin */
	private int ulX;
    /** the distance from the top edge to the scaling region of the skin */
    private int ulY;
    /** the distance from the right edge to the scaling region of the skin */
    private int lrX;
    /** the distance from the bottom edge to the scaling region of the skin */
    private int lrY;
    
    /** true if roundedSize==0 => optimization */    
	private boolean noBorder = false;

	/**
     * Creates a new skin from the image file with fileName fileName and the number of
     * images passed in <code>nrImages</code>. The scaling region of the image is given
     * by ulX,ulY,lrX,lrY
	 * @param fileName the filename of the image file
	 * @param nrImages the number of subimages in the image file
	 * @param ulX the distance from the left edge to the scaling region of the skin
	 * @param ulY the distance from the top edge to the scaling region of the skin
	 * @param lrX the distance from the right edge to the scaling region of the skin
	 * @param lrY the distance from the bottom edge to the scaling region of the skin
	 */
    public Skin(String fileName, int nrImages, int ulX, int ulY, int lrX, int lrY) {
		super(fileName, true);
		this.nrImages = nrImages;
		this.ulX = ulX;
		this.ulY = ulY;
		this.lrX = lrX;
		this.lrY = lrY;
		calculateSizes();
	}

    /**
     * Creates a new skin from the image file with fileName fileName and the number of
     * images passed in <code>nrImages</code>. The size of the corners is given
     * by roundedSize. 
     * @param fileName the filename of the image file
     * @param nrImages the number of subimages in the image file
     * @param rounded the distance from the each edge to the scaling region of the skin
     */
	public Skin(String fileName, int nrImages, int roundedSize) {
		this(fileName, nrImages, roundedSize, roundedSize, roundedSize, roundedSize);
		if (roundedSize == 0)
			noBorder = true;
	}

	/**
	 * Use the image with index index to paint the component with size sizeX,
	 * sizeY
	 * @param g
	 * @param index index of the image in the skin file
	 * @param sizeX horizontal size of the component
	 * @param sizeY vertical size of the component
	 */
	public void draw(Graphics g, int index, int sizeX, int sizeY) {

		int offset = index * getHsize();
		if (!noBorder) {
			// lo
			g.drawImage(getImage(), 0, 0, ulX, ulY, offset + 0, 0, offset + ulX, ulY, null);

			// mo
			g.drawImage(getImage(), ulX, 0, sizeX - lrX, ulY, offset + ulX, 0, offset + hsize - lrX, ulY, null);

			// ro
			g.drawImage(getImage(), sizeX - lrX, 0, sizeX, ulY, offset + hsize - lrX, 0, offset + hsize, ulY, null);

			// lm
			g.drawImage(getImage(), 0, ulY, ulX, sizeY - lrY, offset + 0, ulY, offset + ulX, vsize - lrY, null);

			// rm
			g.drawImage(getImage(), sizeX - lrX, ulY, sizeX, sizeY - lrY, offset + hsize - lrX, ulY, offset + hsize, vsize - lrY, null);

			// lu
			g.drawImage(getImage(), 0, sizeY - lrY, ulX, sizeY, offset + 0, vsize - lrY, offset + ulX, vsize, null);

			// mu
			g.drawImage(getImage(), ulX, sizeY - lrY, sizeX - lrX, sizeY, offset + ulX, vsize - lrY, offset + hsize - lrX, vsize, null);

			// ru
			g.drawImage(getImage(), sizeX - lrX, sizeY - lrY, sizeX, sizeY, offset + hsize - lrX, vsize - lrY, offset + hsize, vsize, null);

			g.drawImage(getImage(), ulX, ulY, sizeX - lrX, sizeY - lrY, offset + ulX, ulY, offset + hsize - lrX, vsize - lrY, null);
		} else {
			g.drawImage(getImage(), 0, 0, sizeX, sizeY, offset, 0, offset + hsize, vsize, null);
		}

//		System.out.println("TIME :" + (summedTime/timesCalled) );
	}

	/**
	 * Use the image with index index to paint the component at point x,
	 * y with dimension sizeX, sizeY
	 * @param g
	 * @param index index of the image in the skin file
	 * @param x x coordiante of the point where the skin is painted
	 * @param y y coordiante of the point where the skin is painted
	 * @param sizeX horizontal size of the component
	 * @param sizeY vertical size of the component
	 */
	public void draw(Graphics g, int index, int x, int y, int sizeX, int sizeY) {

		int offset = index * getHsize();
		if (!noBorder) {

			// lo
			g.drawImage(getImage(), x + 0, y + 0, x + ulX, y + ulY, offset + 0, 0, offset + ulX, ulY, null);

			// mo
			g.drawImage(getImage(), x + ulX, y + 0, x + sizeX - lrX, y + ulY, offset + ulX, 0, offset + hsize - lrX, ulY, null);

			// ro
			g.drawImage(getImage(), x + sizeX - lrX, y + 0, x + sizeX, y + ulY, offset + hsize - lrX, 0, offset + hsize, ulY, null);

			// lm
			g.drawImage(getImage(), x + 0, y + ulY, x + ulX, y + sizeY - lrY, offset + 0, ulY, offset + ulX, vsize - lrY, null);

			// rm
			g.drawImage(getImage(), x + sizeX - lrX, y + ulY, x + sizeX, y + sizeY - lrY, offset + hsize - lrX, ulY, offset + hsize, vsize - lrY, null);

			// lu
			g.drawImage(getImage(), x + 0, y + sizeY - lrY, x + ulX, y + sizeY, offset + 0, vsize - lrY, offset + ulX, vsize, null);

			// mu
			g.drawImage(getImage(), x + ulX, y + sizeY - lrY, x + sizeX - lrX, y + sizeY, offset + ulX, vsize - lrY, offset + hsize - lrX, vsize, null);

			// ru
			g.drawImage(getImage(), x + sizeX - lrX, y + sizeY - lrY, x + sizeX, y + sizeY, offset + hsize - lrX, vsize - lrY, offset + hsize, vsize, null);
			g.drawImage(getImage(), x + ulX, y + ulY, x + sizeX - lrX, y + sizeY - lrY, offset + ulX, ulY, offset + hsize - lrX, vsize - lrY, null);
		} else {
			g.drawImage(getImage(), x, y, x+sizeX, y+sizeY, offset, 0, offset + hsize, vsize, null);
		}

	}

	/**
	 * Use the image with index index to paint the component with its
	 * natural size centred in a rectangle with dimension sizeX, sizeY
	 * @param g
	 * @param index index of the image in the skin file
	 * @param sizeX horizontal size of the component
	 * @param sizeY vertical size of the component
	 */
	public void drawCentered(Graphics g, int index, int sizeX, int sizeY) {
		int offset = index * getHsize();

		int w = getHsize();
		int h = getVsize();

		int sx = (sizeX - w) / 2;
		int sy = (sizeY - h) / 2;

		g.drawImage(getImage(), sx, sy, sx + w, sy + h, offset, 0, offset + w, h, null);

	}
	
	/**
	 * Use the image with index index to paint the component with its
	 * natural size centred in a rectangle with dimension sizeX, sizeY
	 * @param g
	 * @param index index of the image in the skin file
	 * @param x x coordiante of the point where the skin is painted
	 * @param y y coordiante of the point where the skin is painted
     *  @param    sizeX horizontal size of the component
	 * @param sizeY vertical size of the component
	 */
	public void drawCentered(Graphics g, int index, int x, int y, int sizeX, int sizeY) {

		int offset = index * getHsize();

		int w = getHsize();
		int h = getVsize();

		int sx = (sizeX - w) / 2;
		int sy = (sizeY - h) / 2;

		g.drawImage(getImage(), x+sx, y+sy, x+sx + w, y+sy + h, offset, 0, offset + w, h, null);

	}	

    /**
     * Returns the horizontal size of the skin, this is the width of each subimage
     * @return int
     */
	public int getHsize() {
		return hsize;
	}

    /**
     * Returns the vertical size of the skin, this is the height of each subimage
     * @return int
     */
	public int getVsize() {
		return vsize;
	}
	
    /**
     * Returns the size of the skin, this is the height of each subimage
     * @return Dimension
     */
	public Dimension getSize()
	{
		return new Dimension(hsize,vsize);	
	}

    /**
     * Calculates the size for each subimage
     */
	protected void calculateSizes() {
		hsize = (getImage().getWidth(null)) / nrImages;
		vsize = getImage().getHeight(null);
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲国产日本综合| 日韩午夜精品电影| 国产高清在线精品| 韩国成人精品a∨在线观看| 三级亚洲高清视频| 七七婷婷婷婷精品国产| 日韩国产欧美在线视频| 日本不卡免费在线视频| 日本va欧美va瓶| 国产自产高清不卡| 成人深夜在线观看| 91看片淫黄大片一级在线观看| 成人黄色片在线观看| caoporen国产精品视频| 91免费版在线| 国产欧美一区二区精品秋霞影院| 久久综合久久鬼色中文字| 国产欧美日产一区| 亚洲欧美一区二区三区久本道91 | www.av精品| 色婷婷av一区二区三区之一色屋| av福利精品导航| 欧美日韩一区久久| 日韩午夜在线观看视频| 欧美激情一区二区在线| 樱花影视一区二区| 久久精品国产精品亚洲综合| 国内精品在线播放| 色欧美乱欧美15图片| 91精品国产综合久久久久久久 | 国精产品一区一区三区mba视频 | 国产亚洲欧美色| 成人免费高清在线| 一本久久a久久精品亚洲| 欧美精选一区二区| 日本一区二区三级电影在线观看 | 欧美性大战久久久久久久蜜臀| 717成人午夜免费福利电影| 精品国产乱码久久久久久久久| 国产精品午夜免费| 日本中文字幕一区| 97国产精品videossex| 91精品黄色片免费大全| 18涩涩午夜精品.www| 蜜臀av性久久久久蜜臀aⅴ流畅 | 亚洲婷婷在线视频| 精品一区二区成人精品| 色成年激情久久综合| 欧美精品一区二| 天堂在线一区二区| 色八戒一区二区三区| 久久久久久免费网| 蜜臀精品久久久久久蜜臀| 91亚洲资源网| 国产精品污网站| 精品在线亚洲视频| 欧美一区二区三区成人| 亚洲人成在线播放网站岛国| 国产精品99久久不卡二区| 欧美一区三区四区| 亚洲6080在线| 欧美日韩国产精品自在自线| 中文字幕亚洲综合久久菠萝蜜| 精品影院一区二区久久久| 欧美久久久久久久久中文字幕| 亚洲欧美色图小说| www.日本不卡| 国产女人18水真多18精品一级做| 99re成人在线| 久久精品日韩一区二区三区| 蜜臀av亚洲一区中文字幕| 在线播放视频一区| 日韩国产一区二| 91精品中文字幕一区二区三区| 亚洲成人av电影在线| 色94色欧美sute亚洲线路二| 亚洲欧美日韩中文字幕一区二区三区| 成人综合激情网| 国产精品久久久一本精品| 成人午夜免费av| 亚洲欧美色图小说| 欧美无乱码久久久免费午夜一区 | 久久久亚洲精华液精华液精华液 | 洋洋av久久久久久久一区| 91香蕉视频污在线| 夜夜夜精品看看| 91精品国产美女浴室洗澡无遮挡| 天堂久久久久va久久久久| 日韩欧美另类在线| 国产69精品久久777的优势| 日本一二三四高清不卡| 91麻豆123| 日本美女一区二区| 国产午夜精品久久| 在线观看91视频| 蜜臀av一级做a爰片久久| 国产视频在线观看一区二区三区 | 黄色日韩网站视频| 国产精品视频在线看| 色一情一乱一乱一91av| 三级久久三级久久久| 久久久精品日韩欧美| 色综合av在线| 久久国产夜色精品鲁鲁99| 中文字幕巨乱亚洲| 欧美日韩精品一区二区三区 | 国产精品毛片高清在线完整版| 色偷偷久久一区二区三区| 青青草原综合久久大伊人精品优势 | 精品中文字幕一区二区| 国产精品不卡一区二区三区| 欧美视频第二页| 国产精品原创巨作av| 亚洲另类春色校园小说| 日韩欧美电影一区| 色综合一区二区| 黑人精品欧美一区二区蜜桃| 亚洲桃色在线一区| 久久综合给合久久狠狠狠97色69| 91色九色蝌蚪| 国产剧情av麻豆香蕉精品| 亚洲国产成人91porn| 久久精品亚洲国产奇米99| 欧美日韩免费观看一区二区三区| 国产剧情在线观看一区二区| 亚洲成a人片在线观看中文| 中文字幕成人网| 欧美电影精品一区二区| 欧美性videosxxxxx| 高潮精品一区videoshd| 免费人成精品欧美精品| 亚洲精品ww久久久久久p站| 国产午夜精品久久久久久免费视 | 91精品国产品国语在线不卡| 99精品国产91久久久久久| 国模娜娜一区二区三区| 午夜免费久久看| 亚洲欧美激情一区二区| 欧美激情一区二区在线| 精品国产伦一区二区三区免费| 欧美亚洲综合另类| 色综合天天综合网天天狠天天| 国产成人综合亚洲网站| 韩国三级在线一区| 捆绑紧缚一区二区三区视频| 日韩精品国产欧美| 日日夜夜免费精品| 丝袜美腿亚洲一区二区图片| 亚洲一区视频在线| 亚洲午夜私人影院| 亚洲成人综合在线| 亚洲国产视频一区二区| 亚洲精选免费视频| 一区二区三区四区五区视频在线观看| 国产精品的网站| 亚洲欧美另类在线| 亚洲最新视频在线播放| 一区二区三区在线视频播放| 亚洲欧美aⅴ...| 亚洲在线一区二区三区| 亚洲成人综合网站| 日本不卡免费在线视频| 久久超碰97人人做人人爱| 国产一区二区三区最好精华液| 久草在线在线精品观看| 国产成人在线视频网址| 成人18视频在线播放| 94-欧美-setu| 欧美日韩另类国产亚洲欧美一级| 欧美精品日韩精品| 精品国产免费一区二区三区四区| 久久久久久综合| 18欧美乱大交hd1984| 午夜精品久久久久久久久| 蜜桃视频一区二区| 国产mv日韩mv欧美| 欧美性猛交一区二区三区精品| 欧美一区二区在线观看| 国产日韩精品视频一区| 最新国产精品久久精品| 午夜电影一区二区三区| 精品一区二区三区免费| www.一区二区| 欧美一区二区三区日韩视频| 国产肉丝袜一区二区| 亚洲免费在线观看视频| 蜜臀久久99精品久久久久久9| 国产·精品毛片| 欧美日韩精品福利| 中文字幕电影一区| 天堂av在线一区| 99天天综合性| 日韩久久免费av| 一区二区三区久久久| 精品一区二区三区在线播放| 色综合一区二区三区| 2021国产精品久久精品| 亚洲欧洲制服丝袜| 韩国av一区二区| 欧美视频在线播放|