SpacerElement.java

net.minecraft.client.gui.layouts.SpacerElement

信息

  • 全限定名:net.minecraft.client.gui.layouts.SpacerElement
  • 类型:public class
  • 包:net.minecraft.client.gui.layouts
  • 源码路径:src/main/java/net/minecraft/client/gui/layouts/SpacerElement.java
  • 起始行号:L9
  • 实现:LayoutElement
  • 职责:

    TODO

字段/常量

  • x

    • 类型: int
    • 修饰符: private
    • 源码定位: L10
    • 说明:

      TODO

  • y

    • 类型: int
    • 修饰符: private
    • 源码定位: L11
    • 说明:

      TODO

  • width

    • 类型: int
    • 修饰符: private final
    • 源码定位: L12
    • 说明:

      TODO

  • height

    • 类型: int
    • 修饰符: private final
    • 源码定位: L13
    • 说明:

      TODO

内部类/嵌套类型

构造器

public SpacerElement(int width, int height) @ L15

  • 构造器名:SpacerElement
  • 源码定位:L15
  • 修饰符:public

参数:

  • width: int
  • height: int

说明:

TODO

public SpacerElement(int x, int y, int width, int height) @ L19

  • 构造器名:SpacerElement
  • 源码定位:L19
  • 修饰符:public

参数:

  • x: int
  • y: int
  • width: int
  • height: int

说明:

TODO

方法

下面的方法块按源码顺序生成。

public static SpacerElement width(int width) @ L26

  • 方法名:width
  • 源码定位:L26
  • 返回类型:SpacerElement
  • 修饰符:public static

参数:

  • width: int

说明:

TODO

public static SpacerElement height(int height) @ L30

  • 方法名:height
  • 源码定位:L30
  • 返回类型:SpacerElement
  • 修饰符:public static

参数:

  • height: int

说明:

TODO

public void setX(int x) @ L34

  • 方法名:setX
  • 源码定位:L34
  • 返回类型:void
  • 修饰符:public

参数:

  • x: int

说明:

TODO

public void setY(int y) @ L39

  • 方法名:setY
  • 源码定位:L39
  • 返回类型:void
  • 修饰符:public

参数:

  • y: int

说明:

TODO

public int getX() @ L44

  • 方法名:getX
  • 源码定位:L44
  • 返回类型:int
  • 修饰符:public

参数:

说明:

TODO

public int getY() @ L49

  • 方法名:getY
  • 源码定位:L49
  • 返回类型:int
  • 修饰符:public

参数:

说明:

TODO

public int getWidth() @ L54

  • 方法名:getWidth
  • 源码定位:L54
  • 返回类型:int
  • 修饰符:public

参数:

说明:

TODO

public int getHeight() @ L59

  • 方法名:getHeight
  • 源码定位:L59
  • 返回类型:int
  • 修饰符:public

参数:

说明:

TODO

public void visitWidgets(Consumer<AbstractWidget> widgetVisitor) @ L64

  • 方法名:visitWidgets
  • 源码定位:L64
  • 返回类型:void
  • 修饰符:public

参数:

  • widgetVisitor: Consumer

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class SpacerElement implements LayoutElement {
    private int x;
    private int y;
    private final int width;
    private final int height;
 
    public SpacerElement(int width, int height) {
        this(0, 0, width, height);
    }
 
    public SpacerElement(int x, int y, int width, int height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }
 
    public static SpacerElement width(int width) {
        return new SpacerElement(width, 0);
    }
 
    public static SpacerElement height(int height) {
        return new SpacerElement(0, height);
    }
 
    @Override
    public void setX(int x) {
        this.x = x;
    }
 
    @Override
    public void setY(int y) {
        this.y = y;
    }
 
    @Override
    public int getX() {
        return this.x;
    }
 
    @Override
    public int getY() {
        return this.y;
    }
 
    @Override
    public int getWidth() {
        return this.width;
    }
 
    @Override
    public int getHeight() {
        return this.height;
    }
 
    @Override
    public void visitWidgets(Consumer<AbstractWidget> widgetVisitor) {
    }
}

引用的其他类