當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。