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

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

?? iframe.java

?? ibm的窗體
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:

package com.ibm.iwt;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.BufferedImage;

import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.border.AbstractBorder;
import javax.swing.border.Border;

import com.ibm.iwt.event.WindowChangeEvent;
import com.ibm.iwt.event.WindowChangeListener;
import com.ibm.iwt.util.IWTUtilities;
import com.ibm.iwt.window.IBorderComponent;
import com.ibm.iwt.window.IContentPane;
import com.ibm.iwt.window.IWindowTitleBar;

/**
 * <p>The IFrame is the main class that is used to create 
 * a custom frame.  In addition to the methods
 * inherited from the IFrame's superclass, JFrame, 
 * there are public methods added to the IFrame that 
 * allow you to change some basic look and feel components on your frame.
 * <p>The default IFrame behaves exactly the same as a JFrame does so that a 
 * JFrame and default IFrame can be interchangeable.  However, by calling some of the 
 * public methods available in the IFrame, you can quickly change the look of 
 * your window with only a few lines of code.
 * <p><b>Note:</b> The IFrame functions <code>getIContentPane()</code>
 * and <code>setIContentPane()</code> should be used in place
 * of the JFrame equivelent <code>getContentPane()</code> and
 * <code>setContentPane()</code>.  All components that get
 * added to the IFrame should call <code>myIFrame.getIContentPane().add()</code>.
 * Adding components to the IFrame using <code>getContentPane()</code>
 * or setting the content pane using <code>setContentPane()</code>
 * will lead to unpredictable and most likely incorrect behavior.
 * @author MAbernethy
 * <p><font size=-1><b>Known Issues</b>
 * <br>+ When user clicks on transparent region of IFrame, IFrame is sent to back of all
 *		open windows, instead of just the window clicked on.
 * <br>+ There is no minimum size for the windows, which can lead to layout issues on
 * 		default title bars and disappearing windows which have 1 pixel width or height.
 * <br>+ When the window loses focus, and then regains focus, it does not recapture
 * 		the screen shot.  For example, but minimizing a window behind the IFrame,
 * 		correct behavior would be to recapture the screen shot without that minimized
 * 		window.  The solution causes slow performance when the IFrame regains 
 * 		focus and has been omitted.  As a workaround, code can be added to 
 * 		windowDeactived() to forcefully minimize the window when it loses focus.
 * </font>
 */
public class IFrame extends JFrame implements WindowChangeListener, WindowListener, MouseListener, MouseMotionListener
{
	/** the instance of the title panel inside the frame */
	protected IWindowTitleBar titleBar;
	/** the instance of the icontent pane inside the frame */
	protected IContentPane iContentPane;
	
	private static int RESTORE_WIDTH = 0;
	private static int RESTORE_HEIGHT = 0;
	private static int RESTORE_X = 0;
	private static int RESTORE_Y = 0;
	
	/** constant to turn on transparency when frame is initialized */
	protected int TRANSPARENT_STARTUP = -1;
	/** constant to turn off transparency */
	protected int TRANSPARENT_NONE = 0;
	/** contant to turn on transparency */
	protected int TRANSPARENT_ON = 1;

	private int direction = WindowChangeEvent.RESIZE_NONE;
	private int X = 0;
	private int Y = 0;
	private ResizeThread r;
	private boolean isDrawingTransparent = false;
	private IBorderComponent pressedComponent = null;
	
	/** the screenshot that is used to draw transparency */
	protected BufferedImage screenShot = null;
	/** the robot instance that captures screen shots */
	protected Robot robot;
	/** the rectangle that defines the screen dimensions */
	protected Rectangle rect;
	/** the frame's transparency status - when off it will speed performance */
	protected int transparentState = TRANSPARENT_STARTUP;

	/**
	 * Creates an IFrame.
	 */
	public IFrame()
	{
		super();
		setUndecorated(true);
		initialize();
	}
	
	/**
	 * A convenience static method that returns the current application size in pixels.
	 * Subclasses of the IBorderComponent may find this method useful.
	 * @return the size of the frame in pixels
	 */
	public static Dimension getApplicationSize()
	{
		return new Dimension(RESTORE_WIDTH, RESTORE_HEIGHT);
	}

	/**
	 * Sets the frame visibility and also, if transparency is turned on, captures
	 * the screen shot.
	 * @param isVisible the visibility of the frame
	 */
	public void setVisible(boolean isVisible)
	{
		if (isVisible && transparentState != TRANSPARENT_NONE)
		{
			if (transparentState == TRANSPARENT_STARTUP)
				transparentState = TRANSPARENT_NONE;
			captureScreenShot();
		}
		super.setVisible(isVisible);
	}
	
	/**
	 * Sets the size of the frame.
	 * @param width the width in pixels
	 * @param height the height in pixels
	 */
	public void setSize(int width, int height)
	{
		super.setSize(width, height);
		repaint();
	}
	
	/**
	 * Sets the size of the frame.
	 * @param size the size of the frame in pixels
	 */
	public void setSize(Dimension size)
	{
		setSize((int)size.getWidth(), (int)size.getHeight());
	}
	
	
	/**
	 * Sets the bounds of the frame.
	 * @param r the rectangle that defines the bounds
	 */
	public void setBounds(Rectangle r)
	{
		setBounds(r.x, r.y, r.width, r.height);
	}
	
	/**
	 * Sets the location of the frame.
	 * @param x the x position
	 * @param y the y position
	 */
	public void setLocation(int x, int y)
	{
		super.setLocation(x, y);
		RESTORE_X = x;
		RESTORE_Y = y;
	}

	/**
	 * Sets the title of the frame and passes the title on to the current title bar.
	 * @param title the title of the frame
	 */
	public void setTitle(String title)
	{
		super.setTitle(title);
		getTitleBar().setTitle(title);
	}
	
	/**
	 * Sets the icon image of the frame and passes the icon on to the current title bar.
	 * @param i the icon of the frame
	 */
	public void setIconImage(Image i)
	{
		super.setIconImage(i);
		getTitleBar().setLogo(new ImageIcon(i));
	}
	

	private void initialize()
	{
		addWindowListener(this);
		getContentPane().setLayout(new BorderLayout());
		getContentPane().add(getTitleBar(), BorderLayout.NORTH);
		getContentPane().add(getIContentPane(), BorderLayout.CENTER);
		this.setSize(IWTUtilities.getScreenSize(this));
		RESTORE_WIDTH = getWidth();
		RESTORE_HEIGHT = getHeight();
		r = new ResizeThread(this, 0, 0, getWidth(), getHeight());
		getRootPane().addMouseListener(this);
		getRootPane().addMouseMotionListener(this);
	}

	/**
	 * Returns the instance of the icontent pane that is being used by the frame.
	 * <p><b>Important Note:</b> This method should be used to add components to the 
	 * interior of the frame, not <code>getContentPane()</code>.  Using <code>
	 * getContentPane()</code> will cause unpredictable and most likely incorrect 
	 * behavior.  By default, the icontent pane instance has a BorderLayout layout and
	 * a default Windows 2000 border.
	 * @return the current icontent pane
	 */
	public IContentPane getIContentPane()
	{
		if (iContentPane == null)
		{
			iContentPane = new IContentPane();
			iContentPane.setBorder(new DefaultBorder());
			iContentPane.setLayout(new BorderLayout());
			iContentPane.addWindowChangeListener(this);
		}
		return iContentPane;
	}	
	
	/**
	 * Sets the current icontent pane of the frame.  
	 * @param contentPane the new icontent pane
	 */
	public void setIContentPane(IContentPane contentPane)
	{
		getContentPane().add(contentPane, BorderLayout.CENTER);
		iContentPane = contentPane;
		iContentPane.addWindowChangeListener(this);
	}	

	/**
	 * Returns the current title bar being used by the frame.  
	 * @return the current title bar
	 */
	public IWindowTitleBar getTitleBar()
	{
		if (titleBar == null)
		{
			titleBar = new IWindowTitleBar();
			titleBar.addWindowChangeListener(this);
		}
		return titleBar;
	}
	
	/**
	 * Sets the title bar on the frame.
	 * @param windowTitleBar the new title bar
	 */
	public void setTitleBar(IWindowTitleBar windowTitleBar)
	{
		getContentPane().remove(titleBar);
		titleBar = windowTitleBar;
		titleBar.addWindowChangeListener(this);
		getContentPane().add(windowTitleBar, BorderLayout.NORTH);		
		repaint();
	}
	
	private void captureScreenShot()
	{
		try
		{
			robot = new Robot();
			rect = new Rectangle(0, 0, IWTUtilities.getScreenWidth(), IWTUtilities.getScreenHeight());
			screenShot = robot.createScreenCapture(rect);
		}
		catch (java.awt.AWTException ex) {}
	}
	
	/**
	 * Sets a region on the specified component transparent to the pixels behind the 
	 * frame.  To improve performance, the region that is being drawn transparent
	 * should be small, as painting the transparent regions is a relatively slow
	 * process compared to other repaints.  Also, calls to this function should
	 * be called from the caller's <code>paint()</code> so that the transparent
	 * region repaints itself properly as well.
	 * @param c the component that will have the transparent region
	 * @param g the Graphics instance
	 * @param x the x coordinate of the rectangular transparent region
	 * @param y the y coordinate of the rectangular transparent region
	 * @param w the width of the rectangular transparent region
	 * @param h the height of the rectangular transparent region
	 */
	public void setTransparent(JComponent c, Graphics g, int x, int y, int w, int h)
	{
		transparentState = TRANSPARENT_ON;
		Point p = new Point(x,y);
		SwingUtilities.convertPointToScreen(p,c);
		if (p.x+w > screenShot.getWidth())
			w = screenShot.getWidth() - p.x;
		if (p.y+h > screenShot.getHeight())
			h = screenShot.getHeight() - p.y;
		BufferedImage i = screenShot.getSubimage(Math.max(0,p.x), Math.max(0,p.y), w, h);
		ImageIcon icon = new ImageIcon(i);
		Point p2 = new Point(Math.max(0, p.x), Math.max(0, p.y));
		SwingUtilities.convertPointFromScreen(p2, c);
		icon.paintIcon(c, g, p2.x, p2.y);
	}

	/**
	 * Sets the solid background color of the title bar.
	 * @param background the background color
	 */
	public void setTitleBarBackground(Color background)
	{
		getTitleBar().setBackground(background);
	}
	
	/**
	 * Gets the background color of the title bar.
	 * @return the background color
	 */
	public Color getTitleBarBackground()
	{
		return getTitleBar().getBackground();
	}
	
	/**
	 * Sets the height of the title bar.
	 * @param height the height in pixels
	 */
	public void setTitleBarHeight(int height)
	{
		getTitleBar().setPreferredSize(new Dimension(1500, height));
	}
	
	/**
	 * Gets the height of the title bar.
	 * @return the height in pixels
	 */
	public int getTitleBarHeight()
	{
		return (int)getTitleBar().getPreferredSize().getHeight();
	}
	
	/**
	 * Sets the foreground and the background colors of the title bar buttons.
	 * @param foreground the foreground color
	 * @param background the background color
	 */
	public void setTitleBarButtonColors(Color foreground, Color background)
	{
		getTitleBar().setWindowButtonColors(background, foreground);
	}
	
	/**
	 * Gets the background color of the title bar buttons.
	 * @return the background color - note that since every title bar button can 
	 * have a different color, this will be the background color of the first title bar
	 * button
	 */
	public Color getTitleBarButtonBackground()
	{
		return getTitleBar().getWindowButtonBackground();
	}

	/**
	 * Gets the foreground color of the title bar buttons.
	 * @return the foreground color - note that since every title bar button can 
	 * have a different color, this will be the foreground color of the first title bar
	 * button
	 */	
	public Color getTitleBarButtonForeground()
	{
		return getTitleBar().getWindowButtonForeground();
	}
	
	/**
	 * Sets the size of the title bar buttons.
	 * @param size the size in pixels
	 */
	public void setTitleBarButtonSize(Dimension size)
	{
		getTitleBar().setWindowButtonSize(size);
	}

	/**
	 * Gets the size of the title bar buttons.
	 * @return the size - note that since every title bar button can 
	 * have a different size, this will be the size of the first title bar
	 * button
	 */	
	public Dimension getTitleBarButtonSize()
	{
		return getTitleBar().getWindowButtonSize();
	}
	
	/**
	 * Sets the border of the current icontent pane.
	 * @param b the new border
	 */
	public void setIContentPaneBorder(Border b)
	{
		getIContentPane().setBorder(b);
	}
	
	/**
	 * Gets the border of the current icontent pane.
	 * @return the border of the icontent pane
	 */
	public Border getIContentPaneBorder()
	{
		return getIContentPane().getBorder();
	}
	
	/** 
	 * Sets the border of the current title bar.
	 * @param b the new border
	 */
	public void setTitleBarBorder(Border b)
	{
		getTitleBar().setBorder(b);
	}
	
	/**
	 * Gets the border of the current title bar.
	 * @return the border of the title bar
	 */
	public Border getTitleBarBorder()
	{
		return getTitleBar().getBorder();
	}

	/**
	 * Sets the bounds of the frame.
	 * @param x the x coordinate for the upper left corner of the frame
	 * @param y the y coordinate for the upper left corner of the frame
	 * @param width the width of the frame
	 * @param height the height of the frame
	 */
	public void setBounds(int x, int y, int width, int height)
	{
		super.setBounds(x, y, width, height);
		if (getRootPane() != null)
			getContentPane().setBounds(0, 0, width, height);
		repaint();	
	}
	
	/**
	 * Repaints the frame and all of its children.
	 */
	public void repaint()
	{
		super.repaint();
		if (getRootPane() != null)
		{
			getContentPane().invalidate();
			getContentPane().validate();
		}	
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品成人一区二区在线| 欧美日韩和欧美的一区二区| 欧美综合一区二区三区| 欧美电影一区二区| 国产精品久久久久久久久免费相片| 亚洲综合免费观看高清完整版| 韩国v欧美v日本v亚洲v| 在线观看中文字幕不卡| 亚洲国产精品99久久久久久久久| 亚洲成人免费av| 91免费看视频| 欧美经典三级视频一区二区三区| 蜜桃久久久久久| 在线观看中文字幕不卡| 中文字幕在线观看一区二区| 精品亚洲国产成人av制服丝袜| 在线观看av一区| 亚洲精品老司机| a级精品国产片在线观看| 久久伊人中文字幕| 蜜桃av一区二区三区电影| 成人精品国产福利| 久久免费国产精品| 久久99国产精品麻豆| 91精品欧美福利在线观看| 亚洲一二三四区不卡| 色婷婷综合久久久久中文| 亚洲视频一区二区在线观看| 国产成人免费在线观看| 国产片一区二区| 国产成人自拍网| 精品国产乱码久久久久久免费 | 夜色激情一区二区| 99精品视频一区二区三区| 中文字幕成人av| bt欧美亚洲午夜电影天堂| 国产精品欧美久久久久无广告 | 日韩高清不卡一区| 欧美日韩国产高清一区二区三区 | 中文字幕在线不卡一区二区三区| 国产精品99久久久久| 久久久午夜电影| 国产精品一区二区三区乱码| 日本一区二区三级电影在线观看| 国产激情视频一区二区在线观看 | 在线播放中文一区| 日韩电影在线免费看| 国产精品一区二区在线看| 精品日韩成人av| 国产高清在线观看免费不卡| 国产精品视频免费| 97se亚洲国产综合自在线观| 亚洲一区在线看| 日韩精品一区二区三区在线播放| 精品一区二区三区在线播放| 国产亚洲欧美色| 99久久伊人久久99| 亚洲成人tv网| 久久只精品国产| 91在线视频免费91| 日韩中文字幕91| 国产亚洲欧洲997久久综合| 色域天天综合网| 午夜精品视频在线观看| 精品久久99ma| 91九色02白丝porn| 久久99最新地址| 亚洲欧美自拍偷拍| 欧美一区二区三区免费大片| 大陆成人av片| 污片在线观看一区二区| 日本一区二区三区国色天香| 欧美精品高清视频| 成人黄色一级视频| 日韩不卡手机在线v区| 中文字幕国产一区| 91精品国产福利在线观看| 成人一二三区视频| 日本伊人午夜精品| 日韩美女啊v在线免费观看| 91精品国产乱码久久蜜臀| 成人av电影观看| 热久久久久久久| 亚洲精品第1页| 国产精品美女一区二区| 欧美一级艳片视频免费观看| 91麻豆免费看片| 国产精品99久| 国产又黄又大久久| 香蕉影视欧美成人| 久久先锋资源网| 91精品一区二区三区在线观看| 成人午夜大片免费观看| 日韩av电影免费观看高清完整版 | 99久久婷婷国产精品综合| 男女男精品视频网| 亚洲黄色免费电影| 久久久亚洲国产美女国产盗摄| 3d动漫精品啪啪一区二区竹菊| 欧洲一区在线观看| 91丨porny丨首页| 粉嫩绯色av一区二区在线观看| 青青草97国产精品免费观看无弹窗版 | 亚洲日本在线a| 国产欧美日韩久久| 精品国产露脸精彩对白| 91精品国产综合久久福利软件| 91免费在线视频观看| 97久久超碰精品国产| caoporn国产精品| 成人成人成人在线视频| 成人18视频在线播放| 懂色中文一区二区在线播放| 国产高清久久久| 国产精品亚洲第一区在线暖暖韩国| 美女一区二区三区在线观看| 日本不卡一二三| 麻豆国产精品视频| 黑人巨大精品欧美黑白配亚洲| 免费欧美日韩国产三级电影| 日本 国产 欧美色综合| 狠狠久久亚洲欧美| 国产成人精品一区二区三区网站观看| 毛片av一区二区| 激情综合色播激情啊| 激情综合色综合久久综合| 国内精品国产成人| 国产 日韩 欧美大片| 成人av在线网站| 欧洲日韩一区二区三区| 欧美嫩在线观看| 欧美精品一区二区不卡| 中文字幕av在线一区二区三区| 国产精品久久久久久久午夜片| 一区二区三区中文字幕精品精品| 亚洲综合视频网| 免费不卡在线视频| 国产麻豆一精品一av一免费| www.在线欧美| 欧美日韩极品在线观看一区| 欧美成人高清电影在线| 国产精品区一区二区三区| 亚洲卡通动漫在线| 蜜桃久久av一区| 风间由美性色一区二区三区| 91久久精品一区二区| 91麻豆精品国产91久久久| 久久精品一区二区三区av| 亚洲三级免费电影| 日本色综合中文字幕| 国产成a人亚洲精| 在线观看日韩国产| 精品成人一区二区三区四区| 中文字幕一区二区三区不卡| 亚洲成av人片在线| 国产99精品国产| 9191国产精品| 中国av一区二区三区| 日韩国产在线观看| a4yy欧美一区二区三区| 欧美一区二区女人| 亚洲免费av网站| 国产伦精品一区二区三区免费迷 | 91精品啪在线观看国产60岁| 中文字幕精品—区二区四季| 日本视频免费一区| 色女孩综合影院| xnxx国产精品| 亚洲成人777| 99久久精品一区| 欧美精品一区视频| 性欧美大战久久久久久久久| jlzzjlzz欧美大全| 亚洲精品一区在线观看| 亚洲最新在线观看| 不卡大黄网站免费看| 久久久久国产精品麻豆| 老司机免费视频一区二区三区| 欧美亚洲综合在线| 亚洲精品视频免费看| 国产河南妇女毛片精品久久久 | 欧美日韩一区二区三区四区五区| 欧美激情中文不卡| 国产老肥熟一区二区三区| 欧美剧情片在线观看| 一区二区三区四区视频精品免费 | 五月天婷婷综合| 欧日韩精品视频| 一区二区三区产品免费精品久久75| 国产电影一区在线| 久久新电视剧免费观看| 激情欧美一区二区| 精品国产电影一区二区| 免费成人性网站| 精品区一区二区| 国产乱一区二区| 久久丝袜美腿综合| 国产另类ts人妖一区二区| 久久久久国产精品人| 国产精品资源在线看|