![JAR search and dependency download from the Maven repository](/logo.png)
freeseawind.lf.basic.menuitem.LuckMenuItemUIBundle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of littleluck Show documentation
Show all versions of littleluck Show documentation
Java Swing cross platform LookAndFeel
The newest version!
package freeseawind.lf.basic.menuitem;
import java.awt.Color;
import javax.swing.BorderFactory;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import freeseawind.lf.cfg.LuckResourceBundle;
import freeseawind.lf.img.LuckIcon;
/**
* MenuItemUI资源绑定类。
*
*
A MenuItemUI resource bundle class.
*
* @author freeseawind@github
* @version 1.0
*
*/
public class LuckMenuItemUIBundle extends LuckResourceBundle
{
/**
* MenuItem选中时背景颜色属性key。
*
* MenuItem background color properties when selected.
*/
public static final String SELECTIONBG = "MenuItem.selectionBackground";
/**
* MenuItem选中时字体颜色属性key。
*
* MenuItem font color properties when selected.
*/
public static final String SELECTIONFG = "MenuItem.selectionForeground";
/**
* MenuItem背景颜色属性key。
*
* MenuItem background color properties.
*/
public static final String BACKGROUND = "MenuItem.background";
/**
* MenuItem边框属性key。
*
* MenuItem border properties.
*/
public static final String BORDER = "MenuItem.border";
/**
* MenuItem单选框图标属性key。
*
* MenuItem check icon properties.
*/
public static final String CHECK_ICON = "MenuItem.checkIcon";
/**
* MenuItem箭头图标属性key。
*
* MenuItem arrow icon properties.
*/
public static final String ARROW_ICON = "MenuItem.arrowIcon";
/**
* MenuItem文本和复选框图标间距属性key。
*
* MenuItem after check icon gap properties.
*/
public static final String AFTERCHECKICONGAP = "MenuItem.afterCheckIconGap";
/**
* MenuItem最小文本偏移宽度属性key。
*
* MenuItem minimum text offset properties.
*/
public static final String MINIMUMTEXTOFFSET = "MenuItem.minimumTextOffset";
/**
* MenuItem复选框图标偏移x轴距离属性key。
*
* MenuItem check icon offset properties.
*/
public static final String CHECKICONOFFSET = "MenuItem.checkIconOffset";
@Override
protected void installColor(UIDefaults table)
{
table.put(SELECTIONBG, getColorRes(60, 175, 210));
table.put(SELECTIONFG, getColorRes(Color.WHITE));
table.put(BACKGROUND, getColorRes(Color.WHITE));
}
@Override
protected void installBorder(UIDefaults table)
{
table.put(BORDER, getBorderRes(BorderFactory.createEmptyBorder()));
}
@Override
protected void loadImages(UIDefaults table)
{
table.put(CHECK_ICON, getIconRes(new LuckIcon(0, 0)));
table.put(ARROW_ICON, getIconRes(new LuckIcon(0, 0)));
}
@Override
protected void installOther(UIDefaults table)
{
UIManager.put(AFTERCHECKICONGAP, 4);
UIManager.put(MINIMUMTEXTOFFSET, 0);
UIManager.put(CHECKICONOFFSET, 4);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy