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


Java PlatformDefaults类代码示例

本文整理汇总了Java中net.miginfocom.layout.PlatformDefaults的典型用法代码示例。如果您正苦于以下问题:Java PlatformDefaults类的具体用法?Java PlatformDefaults怎么用?Java PlatformDefaults使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getPixelUnitFactor

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
public final float getPixelUnitFactor(boolean isHor) {
	switch (PlatformDefaults.getLogicalPixelBase()) {
	case PlatformDefaults.BASE_FONT_SIZE:
		BitmapFont bmf = getFont();
		if (bmf == null) {
			return 1f;
		}
		float f = isHor ? bmf.getLineWidth("W") / 5f : bmf.getPreferredSize() / 13f;
		return f;
	case PlatformDefaults.BASE_SCALE_FACTOR:
		Float s = isHor ? PlatformDefaults.getHorizontalScaleFactor() : PlatformDefaults.getVerticalScaleFactor();
		if (s != null) {
			return s.floatValue();
		}
		return (isHor ? getHorizontalScreenDPI() : getVerticalScreenDPI())
				/ (float) PlatformDefaults.getDefaultDPI();

	default:
		return 1f;
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:22,代码来源:AbstractWrapper.java

示例2: init

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
@Override
public void init() {
    JDialog.setDefaultLookAndFeelDecorated(true);
    JFrame.setDefaultLookAndFeelDecorated(true);

    try {
        UIManager.setLookAndFeel(lookAndFeel);
        initUIDefaults();
        initButtonsKeyBinding();
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
            | UnsupportedLookAndFeelException e) {
        throw new RuntimeException(e);
    }

    if (marginSize != null) {
        UnitValue marginValue = new UnitValue(marginSize);
        PlatformDefaults.setPanelInsets(marginValue, marginValue, marginValue, marginValue);
    }

    if (spacingSize != null) {
        UnitValue spacingValue = new UnitValue(spacingSize);
        PlatformDefaults.setGridCellGap(spacingValue, spacingValue);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:25,代码来源:DesktopThemeImpl.java

示例3: getPixelUnitFactor

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
public final float getPixelUnitFactor(boolean isHor) {
	switch (PlatformDefaults.getLogicalPixelBase()) {
	case PlatformDefaults.BASE_FONT_SIZE:
		Font font = c.getFont();
		FontMetrics fm = c.getFontMetrics(font != null ? font : SUBST_FONT);
		Point.Float p = FM_MAP.get(fm);
		if (p == null) {
			Rectangle2D r = fm.getStringBounds("X", c.getGraphics());
			p = new Point.Float(((float) r.getWidth()) / 6f, ((float) r.getHeight()) / 13.27734375f);
			FM_MAP.put(fm, p);
		}
		return isHor ? p.x : p.y;

	case PlatformDefaults.BASE_SCALE_FACTOR:

		Float s = isHor ? PlatformDefaults.getHorizontalScaleFactor() : PlatformDefaults.getVerticalScaleFactor();
		if (s != null)
			return s;
		return (isHor ? getHorizontalScreenDPI() : getVerticalScreenDPI())
				/ (float) PlatformDefaults.getDefaultDPI();

	default:
		return 1f;
	}
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:26,代码来源:SwingComponentWrapper.java

示例4: checkCache

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
/**
 * Check if something has changed and if so recreate it to the cached
 * objects.
 *
 * @param parent
 *            The parent that is the target for this layout manager.
 */
private void checkCache(Object parent) {
	if (parent == null) {
		return;
	}

	checkConstrMap(parent);

	ContainerWrapper par = checkParent(parent);

	// Check if the grid is valid
	int mc = PlatformDefaults.getModCount();
	if (lastModCount != mc) {
		grid = null;
		lastModCount = mc;
	}

	int hash = parent instanceof ElementContainer<?, ?>
			? Long.valueOf(((ElementContainer<?, ?>) parent).getLayoutCounter()).hashCode() : parent.hashCode();
	for (ComponentWrapper cw : ccMap.keySet()) {
		hash ^= cw.getLayoutHashCode();
		hash += 285134905;
	}

	if (hash != lastHash) {
		grid = null;
		lastHash = hash;
	}

	setDebug(par, getDebugMillis() > 0);

	if (grid == null) {
		grid = new Grid(par, lc, rowSpecs, colSpecs, ccMap, callbackList);
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:42,代码来源:MigLayout.java

示例5: getHorizontalScreenDPI

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
public final int getHorizontalScreenDPI() {
	// TODO
	return PlatformDefaults.getDefaultDPI();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:5,代码来源:AbstractWrapper.java

示例6: getVerticalScreenDPI

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
public final int getVerticalScreenDPI() {
	// TODO
	return PlatformDefaults.getDefaultDPI();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:5,代码来源:AbstractWrapper.java

示例7: getHorizontalScreenDPI

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
public final int getHorizontalScreenDPI() {
	return PlatformDefaults.getDefaultDPI();
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:4,代码来源:SwingComponentWrapper.java

示例8: getVerticalScreenDPI

import net.miginfocom.layout.PlatformDefaults; //导入依赖的package包/类
public final int getVerticalScreenDPI() {
	return PlatformDefaults.getDefaultDPI();
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:4,代码来源:SwingComponentWrapper.java


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