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

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

?? iwindowtitlebar.java

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

package com.ibm.iwt.window;

import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.util.Vector;

import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.AbstractBorder;

import com.ibm.iwt.event.WindowChangeEvent;
import com.ibm.iwt.layout.GroupFlowLayout;
import com.ibm.iwt.layout.GroupFlowLayoutConstraints;
import com.ibm.iwt.util.IWTUtilities;

/**
 * The IWindowTitleBar acts as the title bar for all IFrames.  It provides
 * multiple functions for displaying and manipulating the title bar to simulate
 * a real title bar that you would find on a native frame.
 * <p>The default implementation of IWindowTitleBar will paint itself like
 * the title bar on a Windows 2000 machine and will handle its own mouse events
 * that it receives from the frame's rootpane.  It will also handle its own
 * cursor changes.  This default implementation assumes only a rectangular title bar.
 * <p>Basic functions have been added to manipulate the colors, fonts, layouts,
 * and buttons on the title bar.  Users who wish to simply change the properties
 * on the title bar without changing its shape can simply call these functions.  
 * <p>More advanced windows will need to subclass IWindowTitleBar to paint
 * more complex looks and to customize where the borders are located and how they
 * should behave.  Subclasses should override the <code>isMouseOnBorder</code>
 * function to define where the borders are on the title bar and <code>isInsideTitleBar</code>
 * to define where the title bar is located.
 * @author MAbernethy
 */
public class IWindowTitleBar extends IBorderComponent implements ActionListener
{
	/** the instance of the title label used by the default implementation */
	protected JLabel lblTitle;
	/** the instance of the logo used by the default implementation */
	protected JLabel lblLogo;
	
	/** contains all the buttons on the title bar */
	protected Vector vctWindowButtons = new Vector();
	
	/** the border around the title bar */
	protected Insets borderSize;
	
	/**
	 * Creates an IWindowTitleBar that is by default:
	 * <br>22 pixels high
	 * <br>A background color of medium blue (default Windows 2000)
	 * <br>Has a Windows border
	 * <br>Displays the 3 title bar buttons on the right side
	 */
	public IWindowTitleBar()
	{
		super();
		setPreferredSize(new Dimension(0, 22));
		setBackground(new Color(106, 128, 168));
		setBorder(new DefaultBorder());
		setBorderSize(new Insets(2, 2, 0, 2));
		GroupFlowLayout absLayout = new GroupFlowLayout();
		setLayout(absLayout);	
		addAllWindowButtons();	
	}

	/**
	 * Returns the minimum size that this title bar can be.  By default
	 * the title bar cannot change its height.
	 * @return the minimum size
	 */
	public Dimension getMinimumSize()
	{
		return getPreferredSize();
	}
	
	/**
	 * Returns the maximum size that this title bar can be.  By default
	 * the title bar cannot change its height.
	 */
	public Dimension getMaximumSize()
	{
		return getPreferredSize();
	}
	
	/**
	 * Returns the border size of the border around the title bar.
	 * @return the border in pixels
	 */
	public Insets getBorderSize()
	{
		return borderSize;
	}
	
	/**
	 * Sets the border size of the border around the title bar.
	 * @param borderSize the border in pixels
	 */
	public void setBorderSize(Insets borderSize)
	{
		this.borderSize = borderSize;
	}

	/**
	 * Returns whether the coordinates are inside the title bar.  By default
	 * this returns true since the default title bar takes up the entire panel.
	 * <br>More advanced subclasses that don't use the entire
	 * panel as the title bar will override this method to return true only
	 * when the coordinates are within the desired title bar.
	 * @param x the x coordinate
	 * @param y the y coordinate
	 * @return whether the coordinates are inside the title bar
	 */
	protected boolean isInsideTitleBar(int x, int y)
	{
		return true;	
	}	

	/**
	 * Returns whether the coordinates are on a border of the title bar.  By
	 * default, this returns true if the coordinates are within the border size
	 * defined by <code>borderSize</code> and is a rectangular shape.
	 * <br>More advanced subclasses will override this method to return true
	 * only when the coordinates lie on a border.
	 * @param x the x coordinates
	 * @param y the y coordinates
	 */
	protected void isMouseOnBorder(int x, int y)
	{
		if (y < borderSize.top)
			isMouseOnBorder = true;
		else if (x < borderSize.left)
			isMouseOnBorder = true;
		else if (x > getWidth() - borderSize.right)
			isMouseOnBorder = true;
		else
			isMouseOnBorder = false;
	}

	/**
	 * After computing the appropriate coordinates, it tells any listeners
	 * that the window should be resized or moved.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mouseDragged(MouseEvent e)
	{
		if (isWindowMaximized())
			return;
			
		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;
		
		WindowChangeEvent event = new WindowChangeEvent(this, e.getX(), e.getY(), e.getX()-X, e.getY()-Y, direction, true);
		if (isMouseOnBorder)
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_RESIZED, event);
		else
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_MOVED, event);	
	}
	
	/**
	 * Computes the coordinates where the mouse is first pressed.  Uses these
	 * coordinates as a basis for all mouse movements.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mousePressed(MouseEvent e)
	{
		if (isWindowMaximized())
			return;

		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;		
		
		X = e.getX();
		Y = e.getY();	
		isMouseOnBorder(X, Y);	
		handleDirections(e, true);
	}
	
	/**
	 * Computes the coordinates where the mouse is released and tells any listeners
	 * that the window should stop resizing or moving.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mouseReleased(MouseEvent e)
	{	
		if (isWindowMaximized())
			return;
			
		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;
			
		WindowChangeEvent event = new WindowChangeEvent(this, e.getX(), e.getY(), e.getX()-X, e.getY()-Y, direction, false);
		if (isMouseOnBorder)
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_RESIZED, event);	
		else
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_MOVED, event);	
	}
	
	/**
	 * Computes the coordinates where the mouse enters.  Only changes the cursor.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mouseEntered(MouseEvent e)
	{
		if (isWindowMaximized())
			return;
			
		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;
			
		handleDirections(e, false);
	}
	
	/** 
	 * Computes the coordinates where the mouse exits.  Changes the cursor back
	 * to the default cursor.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mouseExited(MouseEvent e)
	{
		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;
		setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
	}
	
	/**
	 * Computes the coordinates where the mouse moves.  Only changes the cursor.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mouseMoved(MouseEvent e)
	{
		if (isWindowMaximized())
			return;
			
		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;
			
		handleDirections(e, false);
	}	
	
	/**
	 * Computes the coordinates where the mouse is clicked.  Maximizes
	 * the window when it is double clicked.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	public void mouseClicked(MouseEvent e)
	{
		if (!isInsideTitleBar(e.getX(), e.getY()))
			return;
			
		if (e.getClickCount() == 2 && SwingUtilities.isLeftMouseButton(e))
		{	
			changeRestoreButton();
			WindowChangeEvent event = new WindowChangeEvent();
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_MAXIMIZED, event);
		}
	}
	
	/**
	 * Based on the coordinates contained in the MouseEvent, computes whether
	 * the mouse is over the border and draws the appropriate cursor.  It also
	 * determines the direction which is used for window change events.
	 * @param e the MouseEvent from the frame's rootpane
	 */
	private void handleDirections(MouseEvent e, boolean changeDirection)
	{
		if (e.getY() < borderSize.top && e.getX() < IWTUtilities.DIAGONAL_RESIZE_SIZE)
		{
			setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
			if (changeDirection)
				direction = WindowChangeEvent.RESIZE_NORTH_WEST;
		}
		else if (e.getY() < borderSize.top && e.getX() > getWidth() -IWTUtilities.DIAGONAL_RESIZE_SIZE)
		{
			setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
			if (changeDirection)
				direction = WindowChangeEvent.RESIZE_NORTH_EAST;
		}
		else if (e.getY() < borderSize.top)
		{
			setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
			if (changeDirection)
				direction = WindowChangeEvent.RESIZE_NORTH;
		}
		
		if (e.getX() < borderSize.left)
		{
			setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
			if (changeDirection)
				direction = WindowChangeEvent.RESIZE_NORTH_WEST;
		}
		if (e.getX() > getWidth() - borderSize.right)
		{
			setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
			if (changeDirection)
				direction = WindowChangeEvent.RESIZE_NORTH_EAST;
		}
		
		if (e.getX() > borderSize.right && e.getX() < getWidth()-borderSize.right &&
		e.getY() > borderSize.top && e.getY() < getHeight()-borderSize.bottom)
		{
			setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
			if (changeDirection)
				direction = WindowChangeEvent.RESIZE_NONE;
		}
		
	}

	/**
	 * Captures events from the title bar buttons and fires the appropriate
	 * window change event to the listeners
	 * @param e the ActionEvent
	 */
	public void actionPerformed(ActionEvent e)
	{
		IWindowButton b = (IWindowButton)e.getSource();
		if (b.getButtonType() == IWindowButton.MINIMIZE)
		{
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_MINIMIZED, new WindowChangeEvent());
		}
		else if (b.getButtonType() == IWindowButton.RESTORE_MAX || b.getButtonType() == IWindowButton.RESTORE_MIN)
		{
			changeRestoreButton();
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_MAXIMIZED, new WindowChangeEvent());	
		}
		else if (b.getButtonType() == IWindowButton.CLOSE)
		{
			fireWindowChangeEvent(WindowChangeEvent.WINDOW_CLOSED, new WindowChangeEvent());
		}
	}
	
	/**
	 * Sets the restore button state as either restore maximized or restore minimized.
	 * @param isMaximized if the restore state is mazimized

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久午夜夜伦鲁鲁| 免费人成网站在线观看欧美高清| 国产精品免费人成网站| 国产日韩v精品一区二区| 国产亚洲综合色| 国产日韩欧美在线一区| 久久久不卡网国产精品一区| 久久精品夜色噜噜亚洲aⅴ| 国产婷婷色一区二区三区| 国产亚洲va综合人人澡精品| 久久久青草青青国产亚洲免观| 久久久噜噜噜久噜久久综合| 国产视频一区不卡| 国产精品女人毛片| 亚洲人一二三区| 亚洲综合视频网| 丝袜美腿亚洲色图| 麻豆精品视频在线观看| 国产一区二区精品在线观看| 成人听书哪个软件好| eeuss鲁片一区二区三区在线看| 97精品久久久午夜一区二区三区 | 久草中文综合在线| 国产一区二区h| 9l国产精品久久久久麻豆| 色综合久久久网| 欧美亚洲一区二区三区四区| 在线不卡一区二区| 欧美xxxx老人做受| 中文字幕乱码久久午夜不卡| 樱桃视频在线观看一区| 日韩福利电影在线观看| 国产一区不卡在线| 91蝌蚪porny九色| 欧美高清dvd| 国产三级精品视频| 亚洲综合免费观看高清在线观看| 日韩1区2区日韩1区2区| 国产精品夜夜嗨| 色88888久久久久久影院按摩| 欧美丰满嫩嫩电影| 国产精品久久久久影院亚瑟| 午夜精品免费在线| 国产精品18久久久久久久久久久久 | 欧美午夜精品久久久久久超碰| 欧美无乱码久久久免费午夜一区| 精品国产一区二区精华| 亚洲欧美欧美一区二区三区| 久久99精品久久久久久久久久久久| 成人av午夜电影| 日韩欧美激情四射| 一区二区三区资源| 蜜桃精品在线观看| 色婷婷久久久久swag精品 | 亚洲成人精品一区二区| 国产成人精品一区二| 欧美日韩精品一区二区天天拍小说| 国产午夜三级一区二区三| 亚洲国产精品一区二区尤物区| 国产91精品露脸国语对白| 欧美理论片在线| 亚洲欧美色综合| 国产精品影视网| 欧美一级二级三级蜜桃| 一区二区久久久| 成人h版在线观看| 日韩欧美国产三级电影视频| 亚洲精品视频一区二区| 国产成人av电影在线观看| 欧美一区二区三区在线电影| 尤物在线观看一区| 不卡一区二区中文字幕| 欧美精品一区二区三区久久久| 亚洲国产日日夜夜| 91啪九色porn原创视频在线观看| 久久一留热品黄| 蜜臀av亚洲一区中文字幕| 欧美性生活久久| 一区二区三区四区不卡在线 | 欧美性色欧美a在线播放| 国产精品久久久久久亚洲毛片| 久久国产精品第一页| 欧美精品亚洲一区二区在线播放| 亚洲欧美另类久久久精品2019| 国产不卡在线一区| 久久精品一区八戒影视| 国产一区二区三区电影在线观看| 日韩一区二区三区电影在线观看 | 国产精品三级在线观看| 国内精品自线一区二区三区视频| 欧美丰满少妇xxxxx高潮对白| 亚洲国产精品自拍| 精品污污网站免费看| 亚洲韩国精品一区| 在线观看亚洲a| 亚洲国产裸拍裸体视频在线观看乱了| 色综合视频在线观看| 亚洲人成人一区二区在线观看| 不卡视频一二三四| 中文成人av在线| 成人avav影音| 亚洲免费视频成人| 一本久久综合亚洲鲁鲁五月天 | 日本一区二区电影| 成人黄页在线观看| 国产精品白丝在线| 一本一道久久a久久精品| 亚洲激情综合网| 欧美亚洲尤物久久| 日韩电影免费在线看| 日韩一区二区影院| 久久91精品久久久久久秒播| 久久久久88色偷偷免费| jiyouzz国产精品久久| 亚洲精品福利视频网站| 欧美性感一区二区三区| 免费人成在线不卡| 久久亚洲精华国产精华液 | 91麻豆精品国产无毒不卡在线观看| 石原莉奈在线亚洲二区| 欧美刺激午夜性久久久久久久| 狠狠色狠狠色合久久伊人| 久久久久久夜精品精品免费| 成人午夜精品在线| 亚洲精品中文在线| 欧美精品在线一区二区三区| 久久精品国产精品亚洲综合| 亚洲国产精品成人综合色在线婷婷 | 日本欧美韩国一区三区| 2021国产精品久久精品| a在线欧美一区| 亚洲电影在线免费观看| 精品999久久久| 91视频免费看| 天天亚洲美女在线视频| 久久欧美中文字幕| 色噜噜狠狠色综合中国| 青青青爽久久午夜综合久久午夜 | 午夜精品一区二区三区三上悠亚| 欧美草草影院在线视频| 成人h精品动漫一区二区三区| 亚洲福利视频一区| 国产三级精品三级在线专区| 欧美私人免费视频| 久久97超碰色| 亚洲综合丁香婷婷六月香| 日韩精品最新网址| 色又黄又爽网站www久久| 美女精品一区二区| 亚洲图片欧美激情| 日韩一二在线观看| 一本色道久久加勒比精品| 久久国产精品99精品国产| 亚洲欧美一区二区视频| 精品日韩在线一区| 日本伦理一区二区| 国产电影一区在线| 婷婷六月综合网| 中文字幕av免费专区久久| 制服丝袜激情欧洲亚洲| 91丝袜美腿高跟国产极品老师 | 亚洲成人av在线电影| 中文字幕国产精品一区二区| 欧美一区二区免费视频| 97久久人人超碰| 国产精品一区二区果冻传媒| 婷婷开心久久网| 亚洲精选视频免费看| 国产午夜亚洲精品羞羞网站| 在线不卡免费欧美| 在线观看www91| 99久久精品免费| 国产精品一区在线| 日本成人在线看| 亚洲一区在线观看免费 | 亚洲精选视频在线| 日本一区二区三区国色天香| 91精品国产色综合久久不卡电影| 97久久久精品综合88久久| 国产成人高清视频| 精品在线视频一区| 免费视频一区二区| 五月天久久比比资源色| 亚洲人成网站色在线观看| 久久无码av三级| 欧美videossexotv100| 欧美日韩国产不卡| 色视频一区二区| 91美女片黄在线观看91美女| 顶级嫩模精品视频在线看| 韩国精品久久久| 美女www一区二区| 蜜臀精品一区二区三区在线观看 | 欧美日韩激情在线| 色综合天天综合狠狠| jlzzjlzz亚洲日本少妇| 成人国产亚洲欧美成人综合网| 国产在线精品免费av| 国产一区二区三区免费观看| 极品少妇xxxx精品少妇偷拍|