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


Java Constraint类代码示例

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


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

示例1: getDefaultComponentSize

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
@Override
protected Dimension getDefaultComponentSize(Panel component) {
	Component[] children = component.getChildren();
	Rectangle[] areas = new Rectangle[children.length];
	Constraint[][] constraints = new Constraint[children.length][];
	for(int i = 0; i < children.length; i++) {
		Component child = children[i];
		Dimension size = child.getTheme().getUIForComponent(child)
				.getDefaultSize(child);
		areas[i] = new Rectangle(0, 0, size.width, size.height);
		constraints[i] = component.getConstraints(child);
	}
	return component.getLayoutManager().getOptimalPositionedSize(areas,
			constraints);
}
 
开发者ID:CheataClient,项目名称:CheataClientSrc,代码行数:16,代码来源:SimplePanelUI.java

示例2: getDefaultComponentSize

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
@Override
protected Dimension getDefaultComponentSize(Panel component) {
    Component[] children = component.getChildren();
    Rectangle[] areas = new Rectangle[children.length];
    Constraint[][] constraints = new Constraint[children.length][];
    for (int i = 0; i < children.length; i++) {
        Component child = children[i];
        Dimension size = child.getTheme().getUIForComponent(child).getDefaultSize(child);
        areas[i] = new Rectangle(0, 0, size.width, size.height);
        constraints[i] = component.getConstraints(child);
    }
    return component.getLayoutManager().getOptimalPositionedSize(areas, constraints);
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:14,代码来源:WurstPanelUI.java

示例3: add

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
@Override
public void add(Component child, Constraint... constraints) {
    synchronized (children) {
        Container parent = child.getParent();
        if (parent != null && parent.hasChild(child)) parent.remove(child);
        children.put(child, constraints);
        if (!enabled) child.setEnabled(false);
        if (!visible) child.setVisible(false);
        child.setParent(this);
        child.setTheme(getTheme());

        layoutChildren();
    }
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:15,代码来源:AbstractContainer.java

示例4: getConstraints

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
@Override
public Constraint[] getConstraints(Component child) {
    if (child == null) throw new NullPointerException();
    synchronized (children) {
        Constraint[] constraints = children.get(child);
        return constraints != null ? constraints : new Constraint[0];
    }
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:9,代码来源:AbstractContainer.java

示例5: layoutChildren

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
@Override
public void layoutChildren() {
    synchronized (children) {
        Component[] components = children.keySet().toArray(new Component[children.size()]);
        Rectangle[] areas = new Rectangle[components.length];
        for (int i = 0; i < components.length; i++) {
            areas[i] = components[i].getArea();
        }
        Constraint[][] allConstraints = children.values().toArray(new Constraint[children.size()][]);
        if (getTheme() != null) layoutManager.reposition(ui.getChildRenderArea(this), areas, allConstraints);
        for (Component child : components) {
            if (child instanceof Container) ((Container) child).layoutChildren();
        }
    }
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:16,代码来源:AbstractContainer.java

示例6: add

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
void add(Component child, Constraint... constraints); 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:2,代码来源:Container.java

示例7: getConstraints

import org.darkstorm.minecraft.gui.layout.Constraint; //导入依赖的package包/类
Constraint[] getConstraints(Component child); 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:2,代码来源:Container.java


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