當前位置: 首頁>>代碼示例>>Java>>正文


Java PreferenceConverter.getFontData方法代碼示例

本文整理匯總了Java中org.eclipse.jface.preference.PreferenceConverter.getFontData方法的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceConverter.getFontData方法的具體用法?Java PreferenceConverter.getFontData怎麽用?Java PreferenceConverter.getFontData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.preference.PreferenceConverter的用法示例。


在下文中一共展示了PreferenceConverter.getFontData方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dumpFonts

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/***************************************************************************
 * 
 **************************************************************************/
private void dumpFonts(IPreferenceStore store, PrintWriter writer)
{
	writer.println("        <fonts>");
	for (FontKey key : FontKey.values())
	{
		try
		{
			FontData data = PreferenceConverter.getFontData(store,
			        key.getPreferenceName());
			String styleStr = "norm";
			if (data.getStyle() == SWT.BOLD) styleStr = "bold";
			if (data.getStyle() == SWT.ITALIC) styleStr = "italic";
			if (data.getStyle() == (SWT.BOLD | SWT.ITALIC)) styleStr = "bold-italic";
			dumpFont(key.tag, data.getName(),
			        Integer.toString((int) data.height), styleStr, writer);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
	writer.println("        </fonts>");
}
 
開發者ID:Spacecraft-Code,項目名稱:SPELL,代碼行數:27,代碼來源:GUIPreferencesSaver.java

示例2: createState_2001

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
 * @generated
 */
public Node createState_2001(EObject domainElement, View containerView,
		int index, boolean persisted, PreferencesHint preferencesHint) {
	Node node = NotationFactory.eINSTANCE.createNode();
	node.getStyles()
			.add(NotationFactory.eINSTANCE.createDescriptionStyle());
	node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(StatemachineVisualIDRegistry
			.getType(StateEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
			.getPreferenceStore();
	FontStyle nodeFontStyle = (FontStyle) node
			.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore,
				IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
				.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
				.intValue());
	}
	Node label5001 = createLabel(node,
			StatemachineVisualIDRegistry
					.getType(StateNameEditPart.VISUAL_ID));
	return node;
}
 
開發者ID:spoenemann,項目名稱:xtext-gef,代碼行數:38,代碼來源:StatemachineViewProvider.java

示例3: getFont

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
@Override
public Font getFont(FontKey code, int size)
{
	FontData data = PreferenceConverter.getFontData(m_preferences, code.getPreferenceName());
	data.height = (float) size;
	return new Font(Display.getDefault(), data);
}
 
開發者ID:Spacecraft-Code,項目名稱:SPELL,代碼行數:8,代碼來源:ConfigurationManager.java

示例4: createTransition_4001

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
 * @generated
 */
public Edge createTransition_4001(EObject domainElement,
		View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE
			.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(
			2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(StatemachineVisualIDRegistry
			.getType(TransitionEditPart.VISUAL_ID));
	edge.setElement(domainElement);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
			.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
			prefStore, IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge,
			NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge
			.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore,
				IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
				.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
				.intValue());
	}
	Routing routing = Routing.get(prefStore
			.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge,
				NotationPackage.eINSTANCE.getRoutingStyle_Routing(),
				routing);
	}
	return edge;
}
 
開發者ID:spoenemann,項目名稱:xtext-gef,代碼行數:53,代碼來源:StatemachineViewProvider.java

示例5: getFontFromPrefStore

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
private Font getFontFromPrefStore() {
    FontData fd = PreferenceConverter.getFontData(mPrefStore,
            LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY);
    return new Font(Display.getDefault(), fd);
}
 
開發者ID:utds3lab,項目名稱:SMVHunter,代碼行數:6,代碼來源:LogCatPanel.java

示例6: getTextEditorFontData

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
 * Gets the {@link FontData} instance representing the basic text font.
 * 
 * @see JFaceResources#TEXT_FONT
 */
public static FontData getTextEditorFontData() {
	FontData textFontData = PreferenceConverter.getFontData(PreferenceConstants.getPreferenceStore(),
			JFaceResources.TEXT_FONT);
	return textFontData;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:11,代碼來源:FontUtils.java

示例7: getDefaultFontData

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
public static GamaFont getDefaultFontData() {
	final FontData fd = PreferenceConverter.getFontData(EditorsPlugin.getDefault().getPreferenceStore(),
			JFaceResources.TEXT_FONT);
	return new GamaFont(fd.getName(), fd.getStyle(), fd.getHeight());
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:6,代碼來源:AutoStartup.java

示例8: getDefaultFont

import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
public static GamaFont getDefaultFont() {
	final FontData fd = PreferenceConverter.getFontData(EditorsPlugin.getDefault().getPreferenceStore(),
			JFaceResources.TEXT_FONT);
	return new GamaFont(fd.getName(), fd.getStyle(), fd.getHeight());
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:6,代碼來源:GamlHighlightingConfiguration.java


注:本文中的org.eclipse.jface.preference.PreferenceConverter.getFontData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。