当前位置: 首页>>代码示例>>Java>>正文


Java JList.getFont方法代码示例

本文整理汇总了Java中javax.swing.JList.getFont方法的典型用法代码示例。如果您正苦于以下问题:Java JList.getFont方法的具体用法?Java JList.getFont怎么用?Java JList.getFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JList的用法示例。


在下文中一共展示了JList.getFont方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getListCellRendererComponent

import javax.swing.JList; //导入方法依赖的package包/类
/**
 * Method description
 * 
 * @see
 * @param objPjList
 * @param objPobject
 * @param intPindex
 * @param bolPselected
 * @param bolPfocused
 * @return
 */
@Override public Component getListCellRendererComponent(JList<? extends Style> objPjList,
														Style objPstyle,
														int intPindex,
														boolean bolPselected,
														boolean bolPfocused) {

	if (objPstyle == null) {
		return this;
	}
	final Font objLfont = objPjList.getFont();

	final int intLstyleLinesNumber = objPstyle.bytGstyleA.length / (2 * Constants.bytS_ENGINE_COORDONATES_NUMBER);
	final Siteswap objLsiteswap = this.objGcontrolJFrame.getJuggleMasterPro().objGsiteswap;
	final boolean bolLcurrentSiteswapCompatible =
													objLsiteswap.bytGstatus < 0
														|| ((intLstyleLinesNumber % objLsiteswap.intGrecurrentThrowsNumber == 0 || objLsiteswap.intGrecurrentThrowsNumber
																																	% intLstyleLinesNumber == 0) && (!objLsiteswap.bolGsynchro || intLstyleLinesNumber % 2 == 0));
	this.setEnabled(bolLcurrentSiteswapCompatible);

	this.setForeground(bolPselected ? Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR : objPjList.getForeground());
	this.setBackground(bolPselected ? objPjList.getSelectionBackground() : Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR);
	this.setText(objPstyle.strGstyle);
	this.setToolTipText(objPstyle.strGstyle);
	this.setHorizontalAlignment(SwingConstants.LEFT);
	this.setFont(objLfont);
	this.setOpaque(true);
	return this;
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:40,代码来源:StylesJComboBoxRenderer.java

示例2: getListCellRendererComponent

import javax.swing.JList; //导入方法依赖的package包/类
/**
 * Method description
 * 
 * @see
 * @param objPjList
 * @param objPobject
 * @param intPindex
 * @param bolPselected
 * @param bolPfocused
 * @return
 */
@Override final public Component getListCellRendererComponent(	JList<? extends Object> objPjList,
																Object objPobject,
																int intPindex,
																boolean bolPselected,
																boolean bolPfocused) {

	final boolean bolLpattern = objPobject instanceof Pattern;
	final PatternsManager objLpatternsManager = this.objGcontrolJFrame.getPatternsManager();
	Font objLfont = objPjList.getFont();

	if (bolLpattern) {
		final StringBuilder objLstringBuilder = new StringBuilder(64);
		final Pattern objLpattern = (Pattern) objPobject;
		final boolean bolLpatternName =
										objLpatternsManager.bytGpatternsManagerType == Constants.bytS_MANAGER_NO_PATTERN
											&& objLpatternsManager.getPatternsFileManager().bolGstyleFound
											|| objLpatternsManager.bytGpatternsManagerType == Constants.bytS_MANAGER_FILES_PATTERNS;
		if (bolLpatternName) {
			if (objLpattern.bolGlocalValueAA[Constants.bytS_BOOLEAN_LOCAL_EDITION][Constants.bytS_UNCLASS_CURRENT]) {
				objLstringBuilder.append(Siteswap.getBallsNumberString(objLpattern.intGballsNumberA[Constants.bytS_UNCLASS_CURRENT], false));
				objLstringBuilder.append(" - ");
			}
			objLstringBuilder.append(objLpattern.strGlocalAA[Constants.bytS_STRING_LOCAL_PATTERN][Constants.bytS_UNCLASS_CURRENT]);
		}
		this.setForeground(bolPselected ? Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR : objPjList.getForeground());
		this.setBackground(bolPselected ? objPjList.getSelectionBackground() : Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR);
		this.setEnabled(objLpattern.bolGplayableA[Constants.bytS_UNCLASS_CURRENT]);

		this.setText(Strings.doConcat(Strings.strS_SPACES, objLstringBuilder));
		if (objLpattern.bolGlocalValueAA[Constants.bytS_BOOLEAN_LOCAL_EDITION][Constants.bytS_UNCLASS_CURRENT]
			&& (!this.objGcontrolJFrame.isBooleanLocal(Constants.bytS_BOOLEAN_LOCAL_SITESWAP) || objLpattern.bolGlocalValueAA[Constants.bytS_BOOLEAN_LOCAL_SITESWAP][Constants.bytS_UNCLASS_CURRENT])) {
			objLstringBuilder.append(Strings.doConcat(	" | ",
														objLpattern.strGlocalAA[Constants.bytS_STRING_LOCAL_SITESWAP][Constants.bytS_UNCLASS_CURRENT]));
		}
		this.setToolTipText(objLstringBuilder.toString());
	} else {
		objLfont = objLfont.deriveFont(Font.BOLD);
		this.setForeground(bolPselected ? Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR : Constants.objS_PEN_COLORS_DARK_GREEN_COLOR);
		this.setBackground(bolPselected ? objPjList.getSelectionBackground() : Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR);
		this.setText(Strings.doConcat(objPobject, Strings.strS_SPACE));
		this.setBackground(Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR);
	}
	final boolean bolLspecialPatternsManager =
												this.objGcontrolJFrame.getPatternsManager().bytGpatternsManagerType == Constants.bytS_MANAGER_JM_PATTERN
													|| this.objGcontrolJFrame.getPatternsManager().bytGpatternsManagerType == Constants.bytS_MANAGER_NO_PATTERN
													|| this.objGcontrolJFrame.getPatternsManager().bytGpatternsManagerType == Constants.bytS_MANAGER_NEW_PATTERN
													|| this.objGcontrolJFrame.getFilteredPatternsNumber() == 0;
	this.setHorizontalAlignment(bolLspecialPatternsManager ? SwingConstants.CENTER : SwingConstants.LEFT);
	this.setFont(objLfont);
	this.setEnabled(!bolLspecialPatternsManager);
	this.setOpaque(true);
	return this;
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:65,代码来源:ObjectsJListCellRenderer.java


注:本文中的javax.swing.JList.getFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。