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

📄 raisedborderresource.java

📁 定要上载质量高而定要上载质量高而定要上载质量高而定要上载质量高而定要上载质量高而
💻 JAVA
字号:
/*
 * Created on 04.03.2005
 */
package org.flexdock.plaf.resources.border;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;

import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;

import org.flexdock.plaf.resources.ResourceHandler;

/**
 * @author Claudio Romano
 */
public class RaisedBorderResource extends ResourceHandler {
    
    public Object getResource(String data) {
		return new RaisedBorder();
	}
	
	private static final class RaisedBorder extends AbstractBorder { 
	    private static final Color HIGHLIGHT_COLOR = UIManager.getColor("controlLtHighlight");
	    private static final Color CONTROL_SHADOW = UIManager.getColor("controlShadow");
	    
	    private static final Insets INSETS = new Insets(1, 1, 1, 0);
	
	    public Insets getBorderInsets(Component c) {
	        return INSETS;
	    }
	
	    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
	        g.setColor(HIGHLIGHT_COLOR);
	        g.fillRect(0, 0, w, 1);
	        g.fillRect(0, 1, 1, h - 1);
	        g.setColor(CONTROL_SHADOW);
	        g.fillRect(0, h - 1, w, 1);
	    }
	}
}

⌨️ 快捷键说明

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