⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cab2bhyperlinkui.java

📁 Document will be uploaded soon
💻 JAVA
字号:

package com.component;

import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Rectangle;

import javax.swing.AbstractButton;

import org.jdesktop.swingx.plaf.basic.BasicHyperlinkUI;

public class Cab2bHyperlinkUI extends BasicHyperlinkUI
{

	public Cab2bHyperlinkUI()
	{
		super();
	}

	protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text)
	{
		super.paintText(g, b, textRect, text);
		//if (b.getModel().isRollover()) {
		/* By Default Cab2bHyperlink will have hyperlinks underlined, instead of
		 * underlining hyperlinks on mouse rollover */
		paintUnderline(g, b, textRect, text);
		//}
	}

	private void paintUnderline(Graphics g, AbstractButton b, Rectangle rect, String text)
	{
		// JW: copied from JXTable.LinkRenderer
		FontMetrics fm = g.getFontMetrics();
		int descent = fm.getDescent();

		// REMIND(aim): should we be basing the underline on
		// the font's baseline instead of the text bounds?
		g.drawLine(rect.x + getTextShiftOffset(), (rect.y + rect.height) - descent + 1
				+ getTextShiftOffset(), rect.x + rect.width + getTextShiftOffset(),
				(rect.y + rect.height) - descent + 1 + getTextShiftOffset());
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -