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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? iwindowtitlebar.java

?? ibm的窗體
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):

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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
大胆亚洲人体视频| av成人老司机| 亚洲成人免费电影| 中文字幕巨乱亚洲| 欧美电影免费观看高清完整版在线观看| 成人午夜精品在线| 国产一区二区三区黄视频 | 日本一区二区三区久久久久久久久不 | 成人激情动漫在线观看| 欧美电视剧在线看免费| 成人av影院在线| 久久久亚洲精品石原莉奈| 欧美亚男人的天堂| 欧美视频一区二区在线观看| 风间由美性色一区二区三区| 成人午夜精品在线| 国产精品综合av一区二区国产馆| 亚洲一区在线观看视频| 欧美精品一区视频| 欧美精品久久99| 日韩成人av影视| 国产夫妻精品视频| 麻豆高清免费国产一区| 青草av.久久免费一区| 一区二区三区在线免费| 亚洲日本在线看| 亚洲乱码国产乱码精品精的特点| 亚洲男同性恋视频| 樱花影视一区二区| 亚洲国产精品一区二区www| 一区二区三区国产精品| 亚洲一二三四久久| 视频一区在线视频| 蜜桃av一区二区在线观看| 五月天视频一区| 亚洲国产aⅴ天堂久久| 六月丁香婷婷久久| 激情五月婷婷综合| 波多野结衣精品在线| 91一区二区在线观看| 欧美色欧美亚洲另类二区| 91精品国产欧美一区二区成人| 日韩午夜电影在线观看| 久久精品无码一区二区三区| 亚洲精品一区二区三区在线观看| 久久精品亚洲精品国产欧美kt∨ | 三级在线观看一区二区| 丝袜国产日韩另类美女| 麻豆精品一区二区三区| 国产高清不卡一区| 91影院在线观看| 色美美综合视频| 欧美一级二级在线观看| 精品久久久久久久一区二区蜜臀| 亚洲猫色日本管| 国产免费久久精品| 亚洲蜜桃精久久久久久久| 亚洲日本韩国一区| 九九热在线视频观看这里只有精品| 樱桃视频在线观看一区| 免费人成黄页网站在线一区二区| 欧美性极品少妇| 一区二区三区日韩在线观看| 欧美精品乱码久久久久久按摩 | 欧美xxxx老人做受| 国产精品电影一区二区三区| 亚洲成av人片观看| 一区二区三区四区在线免费观看 | 成人黄色av电影| 精品视频资源站| 久久精品夜色噜噜亚洲aⅴ| 亚洲最大成人综合| 经典一区二区三区| 色屁屁一区二区| 国产色一区二区| 日韩国产欧美三级| 99久久免费视频.com| 欧美日韩mp4| 国产精品护士白丝一区av| 三级欧美韩日大片在线看| 99久久亚洲一区二区三区青草| 日韩一区二区不卡| 综合色天天鬼久久鬼色| 奇米色777欧美一区二区| 91免费在线视频观看| 久久综合国产精品| 视频一区免费在线观看| 99精品国产视频| 久久精品人人做人人爽97| 日本视频免费一区| 欧美在线影院一区二区| 欧美国产激情一区二区三区蜜月| 日产国产高清一区二区三区| 色狠狠综合天天综合综合| 欧美激情一区二区三区四区| 青娱乐精品在线视频| 欧美在线观看一二区| 国产精品久久毛片| 国产一区二区美女| 精品国产91洋老外米糕| 精品一区二区三区免费观看| 日韩亚洲欧美高清| 久久精品久久久精品美女| 欧美一激情一区二区三区| 日韩中文字幕av电影| 欧美精品一二三| 国产精品视频看| 国产欧美一区二区精品久导航 | aaa亚洲精品一二三区| 欧美午夜影院一区| 国产一区二区视频在线| jlzzjlzz国产精品久久| 色美美综合视频| 在线免费观看一区| 日韩一区二区精品葵司在线| 精品久久久久av影院| 7777女厕盗摄久久久| 日本精品一级二级| jlzzjlzz欧美大全| eeuss影院一区二区三区| 麻豆国产精品官网| 亚洲成人av在线电影| 亚洲视频在线观看三级| 国产高清不卡一区| 国产精品电影院| 精品视频免费在线| 久久国内精品自在自线400部| 日韩欧美一区中文| 国产美女在线精品| 亚洲欧美日本韩国| 91精品国产一区二区三区| 免费的国产精品| 国产欧美日韩精品a在线观看| 色综合久久综合网欧美综合网| 午夜影视日本亚洲欧洲精品| 日韩你懂的在线播放| 成人精品电影在线观看| 亚洲黄网站在线观看| 欧美一区二区在线视频| 国产福利精品一区| 亚洲线精品一区二区三区| 精品不卡在线视频| 91免费观看在线| 理论片日本一区| 亚洲美女淫视频| 欧美一区二区三区在线视频| 国产精品系列在线播放| 夜夜精品浪潮av一区二区三区| 欧美一级免费大片| 91麻豆视频网站| 另类小说视频一区二区| 亚洲男人都懂的| 日韩欧美国产三级| 99在线精品免费| 蜜臀av国产精品久久久久| 中文字幕中文字幕中文字幕亚洲无线| 欧美群妇大交群的观看方式| 国产精品一区二区果冻传媒| 亚洲综合成人在线| 亚洲国产精品精华液ab| 欧美一区午夜精品| aaa欧美大片| 国产在线精品免费| 亚洲国产中文字幕在线视频综合 | 欧美精品一区二区不卡 | 亚洲三级理论片| 成人av在线电影| 一区二区三区成人| 91麻豆精东视频| 日韩女优av电影| 国产午夜精品一区二区三区视频 | 色综合久久中文综合久久牛| 国产一区二区视频在线| 1024成人网色www| 91精品久久久久久久久99蜜臂| 美女网站在线免费欧美精品| 日本一区二区三区dvd视频在线| 在线视频综合导航| 国产酒店精品激情| 国产精品美女久久久久久2018 | 欧美激情一区二区在线| 日av在线不卡| 欧美欧美欧美欧美首页| 99久久精品一区| 一区二区三区色| 欧美激情综合五月色丁香| 日韩免费一区二区| 正在播放亚洲一区| 欧美福利视频一区| 欧美色涩在线第一页| 欧美在线视频日韩| 一本一道综合狠狠老| www.亚洲精品| 成人综合在线网站| 国产成人精品午夜视频免费| 激情综合五月天| 久久黄色级2电影| 久久国产精品露脸对白| 青草国产精品久久久久久| 日韩av电影一区|