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