FocusNavigationEvent.java

net.minecraft.client.gui.navigation.FocusNavigationEvent

信息

  • 全限定名:net.minecraft.client.gui.navigation.FocusNavigationEvent
  • 类型:public interface
  • 包:net.minecraft.client.gui.navigation
  • 源码路径:src/main/java/net/minecraft/client/gui/navigation/FocusNavigationEvent.java
  • 起始行号:L8
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

  • net.minecraft.client.gui.navigation.FocusNavigationEvent.ArrowNavigation

    • 类型: record
    • 修饰符: public
    • 源码定位: L12
    • 说明:

      TODO

  • net.minecraft.client.gui.navigation.FocusNavigationEvent.InitialFocus

    • 类型: class
    • 修饰符: public static
    • 源码定位: L28
    • 说明:

      TODO

  • net.minecraft.client.gui.navigation.FocusNavigationEvent.TabNavigation

    • 类型: record
    • 修饰符: public
    • 源码定位: L36
    • 说明:

      TODO

构造器

方法

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

ScreenDirection getVerticalDirectionForInitialFocus() @ L9

  • 方法名:getVerticalDirectionForInitialFocus
  • 源码定位:L9
  • 返回类型:ScreenDirection
  • 修饰符:package-private

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public interface FocusNavigationEvent {
    ScreenDirection getVerticalDirectionForInitialFocus();
 
    @OnlyIn(Dist.CLIENT)
    public record ArrowNavigation(ScreenDirection direction, @Nullable ScreenRectangle previousFocus) implements FocusNavigationEvent {
        public ArrowNavigation(ScreenDirection direction) {
            this(direction, null);
        }
 
        @Override
        public ScreenDirection getVerticalDirectionForInitialFocus() {
            return this.direction.getAxis() == ScreenAxis.VERTICAL ? this.direction : ScreenDirection.DOWN;
        }
 
        public FocusNavigationEvent.ArrowNavigation with(ScreenRectangle previousFocus) {
            return new FocusNavigationEvent.ArrowNavigation(this.direction(), previousFocus);
        }
    }
 
    @OnlyIn(Dist.CLIENT)
    public static class InitialFocus implements FocusNavigationEvent {
        @Override
        public ScreenDirection getVerticalDirectionForInitialFocus() {
            return ScreenDirection.DOWN;
        }
    }
 
    @OnlyIn(Dist.CLIENT)
    public record TabNavigation(boolean forward) implements FocusNavigationEvent {
        @Override
        public ScreenDirection getVerticalDirectionForInitialFocus() {
            return this.forward ? ScreenDirection.DOWN : ScreenDirection.UP;
        }
    }
}

引用的其他类