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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
加勒比av一区二区| 99精品一区二区三区| 国产精品国产三级国产aⅴ无密码| 欧美专区在线观看一区| 久久69国产一区二区蜜臀| 亚洲人成网站色在线观看| 精品福利在线导航| 欧美视频日韩视频| 成人av资源在线| 精品一区二区三区蜜桃| 一区av在线播放| 国产精品污网站| 精品久久久网站| 欧美日韩五月天| 色女孩综合影院| 丰满岳乱妇一区二区三区| 久久99精品久久只有精品| 亚洲成av人片在线| 亚洲免费在线播放| 国产蜜臀97一区二区三区| 日韩欧美国产一区二区三区| 在线精品观看国产| 在线观看亚洲a| 91丨porny丨国产入口| 国产伦精品一区二区三区免费迷| 免费亚洲电影在线| 日本不卡高清视频| 天堂成人国产精品一区| 一区二区三区欧美激情| 亚洲色图.com| 亚洲日本在线天堂| 亚洲视频在线观看三级| 亚洲色图清纯唯美| 亚洲精品日韩专区silk| 中文字幕制服丝袜一区二区三区| 国产欧美日韩久久| 中文字幕欧美区| 中文字幕在线不卡一区| 国产精品人人做人人爽人人添| 久久久久久久免费视频了| 国产日韩三级在线| 日本一区二区视频在线观看| 国产欧美日韩久久| 国产精品女同互慰在线看| 国产日韩精品视频一区| 国产精品污www在线观看| 国产日韩欧美精品在线| 国产精品三级av| 亚洲精品视频免费观看| 亚洲第一成年网| 免费成人美女在线观看.| 久久成人av少妇免费| 国产中文字幕一区| 成人美女在线视频| 在线观看91精品国产入口| 欧美三区在线观看| 91精品国产欧美一区二区18 | 国产乱人伦偷精品视频不卡| 国内国产精品久久| 成人av集中营| 欧美性色综合网| 欧美一区二区视频在线观看2022| 日韩精品一区二区在线| 久久久久国产免费免费| 亚洲欧洲一区二区在线播放| 亚洲高清免费在线| 久国产精品韩国三级视频| 成人污视频在线观看| 欧美日韩一区在线观看| 欧美xxxxx裸体时装秀| 国产精品电影院| 午夜久久久久久电影| 九九在线精品视频| 97精品电影院| 欧美一级在线视频| 国产精品乱码妇女bbbb| 亚洲国产成人tv| 国产高清在线精品| 欧美三电影在线| 久久久精品2019中文字幕之3| 中文字幕av不卡| 日韩影视精彩在线| 国产精品亚洲一区二区三区妖精| 色婷婷久久综合| 精品国精品国产| 亚洲精品日韩一| 国产高清无密码一区二区三区| 欧美亚洲禁片免费| 中文字幕不卡一区| 日本欧洲一区二区| www.66久久| 欧美videos中文字幕| 亚洲日本va午夜在线电影| 麻豆精品视频在线观看免费| 99国产精品久久久久| 日韩欧美精品三级| 亚洲一级在线观看| 成人免费毛片app| 欧美一区二区福利在线| 亚洲免费在线视频| 国产69精品久久99不卡| 日韩欧美一二三| 亚洲在线中文字幕| 成人av网站在线观看免费| 精品欧美久久久| 婷婷综合在线观看| 色综合久久综合中文综合网| 久久五月婷婷丁香社区| 日韩电影一二三区| 欧美日韩中字一区| 亚洲欧美日韩国产综合| 懂色av一区二区三区免费观看| 欧美一区二区三区视频免费播放| 亚洲色图色小说| jiyouzz国产精品久久| www日韩大片| 首页综合国产亚洲丝袜| 欧美系列在线观看| 一区二区三区中文字幕| 91天堂素人约啪| 中文av一区二区| 国产精品一卡二卡| 久久综合一区二区| 老鸭窝一区二区久久精品| 欧美精品一级二级| 亚洲妇女屁股眼交7| 色噜噜狠狠成人中文综合| 亚洲欧美中日韩| 99久久综合狠狠综合久久| 国产精品人成在线观看免费| 丁香网亚洲国际| 中文一区二区完整视频在线观看| 国产乱码精品一区二区三区五月婷 | 亚洲欧美成aⅴ人在线观看| 国产成人8x视频一区二区| 国产日产亚洲精品系列| 国产a区久久久| 国产精品美女久久久久久 | 在线成人高清不卡| 亚洲aⅴ怡春院| 在线成人免费视频| 麻豆成人久久精品二区三区小说| 欧美电影免费观看完整版| 精品综合免费视频观看| 久久亚洲一区二区三区明星换脸| 国内精品国产成人| 日本一区二区电影| 91丨九色丨国产丨porny| 亚洲一区二区三区免费视频| 欧美日韩一区二区三区四区| 午夜精彩视频在线观看不卡| 欧美一级日韩不卡播放免费| 精品无人码麻豆乱码1区2区 | 久久91精品久久久久久秒播| 久久亚洲精品小早川怜子| 成人在线一区二区三区| 亚洲欧美日韩一区二区| 欧美日韩和欧美的一区二区| 蜜臀av亚洲一区中文字幕| 久久免费精品国产久精品久久久久| 国产成人在线视频免费播放| 中文字幕在线观看不卡视频| 在线精品亚洲一区二区不卡| 免费的国产精品| 国产精品日韩精品欧美在线| 欧美色图片你懂的| 国产美女av一区二区三区| 国产精品欧美一级免费| 欧美性xxxxxxxx| 国产九色sp调教91| 一区二区三区在线影院| 日韩午夜小视频| 99精品欧美一区二区三区综合在线| 亚洲一二三专区| 精品国产乱码久久久久久闺蜜| 成人精品视频.| 五月婷婷激情综合网| 久久免费午夜影院| 欧美日韩日本视频| 国产精品一区免费在线观看| 一区二区三区在线观看网站| 欧美成人精品高清在线播放| 99久久精品国产麻豆演员表| 蜜桃av一区二区三区电影| 国产精品看片你懂得| 欧美一级免费观看| 91在线国内视频| 国产综合久久久久久鬼色| 亚洲一二三区视频在线观看| 久久久久高清精品| 91精品国产一区二区三区蜜臀| 99久免费精品视频在线观看| 国模大尺度一区二区三区| 亚洲成人免费在线观看| 亚洲国产精华液网站w| 69av一区二区三区| 91免费在线播放| 粉嫩av一区二区三区粉嫩| 日本女人一区二区三区| 一区二区激情小说|