Class Vaadoom

java.lang.Object
com.vaadin.flow.component.Component
org.vaadin.addons.enverhaase.vaadoom.Vaadoom
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

@Tag("vaadoom-viewport") @JsModule("./vaadoom-viewport.js") public class Vaadoom extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize
Vaadoom — a Flow component that renders a DOOM viewport.

DOOM runs inside a NOMMU Linux which itself runs on Adrian Cable's single-instruction SUBLEQ virtual machine, compiled to WebAssembly and driven from a Web Worker. The worker paints the emulated framebuffer onto an OffscreenCanvas inside the <vaadoom-viewport> custom element.

The DOOM framebuffer is 800×512. By default the component is sized to those pixels; use HasSize.setWidth(String) / HasSize.setHeight(String) (from HasSize) to scale the viewport.

Note: this 0.1.0 release ships a placeholder renderer (an animated test pattern) so the Directory packaging and Flow integration can be verified before the WebAssembly DOOM engine is wired in.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Native height, in pixels, of the DOOM framebuffer.
    static final int
    Native width, in pixels, of the DOOM framebuffer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a Vaadoom viewport sized to the native DOOM framebuffer (800×512).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    setAutostart(boolean autostart)
    Whether the emulator starts automatically when the component is attached.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasSize

    bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

    • FB_WIDTH

      public static final int FB_WIDTH
      Native width, in pixels, of the DOOM framebuffer.
      See Also:
    • FB_HEIGHT

      public static final int FB_HEIGHT
      Native height, in pixels, of the DOOM framebuffer.
      See Also:
  • Constructor Details

    • Vaadoom

      public Vaadoom()
      Creates a Vaadoom viewport sized to the native DOOM framebuffer (800×512).
  • Method Details

    • setAutostart

      public void setAutostart(boolean autostart)
      Whether the emulator starts automatically when the component is attached. Defaults to true.
      Parameters:
      autostart - true to start on attach
    • isAutostart

      public boolean isAutostart()
      Returns:
      whether the emulator starts automatically on attach