Class Screen

java.lang.Object
paletai.mapping.Screen

public class Screen extends Object
Represents a physical or virtual display screen for video mapping.

The Screen class manages the rendering of media content to a specific display, handling both normal rendering and transitions between scenes. Each screen can be assigned to a physical display or used as a virtual screen for preview.

Key features include:

  • Display assignment and configuration
  • Media content rendering with transition effects
  • Offscreen buffer management for efficient rendering
  • Mouse interaction handling for media items
  • XML serialization for project saving/loading
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    processing.opengl.PGraphics2D
    Offscreen buffers for current and next scene rendering
    processing.opengl.PGraphics2D
    Offscreen buffers for current and next scene rendering
  • Constructor Summary

    Constructors
    Constructor
    Description
    Screen(processing.core.PApplet p, int id)
    Constructs a new Screen with the specified ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Assigns this screen to a physical display with specified bounds.
    processing.opengl.PGraphics2D
    Returns the offscreen graphics buffer for this screen.
    void
    moveHoverPoint(float mousex, float mousey)
    Updates hover point position for all media items on this screen.
    void
    render(int mousex, int mousey)
    Renders the screen content and displays it at the correct position.
    void
    setPreviewArea(float px, float py, float pw, float ph)
    Sets the preview area dimensions for media item preview rendering.
    void
    setTransitionState(ArrayList<MediaItem> currentMedia, ArrayList<MediaItem> nextMedia, float progress)
    Sets up transition state between two sets of media items.
    void
    Displays the screen buffer at its assigned position.
    void
    Updates the media list for normal rendering without transitions.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • pg

      public processing.opengl.PGraphics2D pg
      Offscreen buffers for current and next scene rendering
    • nextPg

      public processing.opengl.PGraphics2D nextPg
      Offscreen buffers for current and next scene rendering
  • Constructor Details

    • Screen

      public Screen(processing.core.PApplet p, int id)
      Constructs a new Screen with the specified ID. Initializes with default unassigned dimensions and creates offscreen buffers.
      Parameters:
      p - The parent PApplet instance
      id - The unique identifier for this screen
  • Method Details

    • updateMediaList

      public void updateMediaList(ArrayList<MediaItem> m)
      Updates the media list for normal rendering without transitions. Replaces the current media items and exits transition state.
      Parameters:
      m - The new list of media items to display
    • setTransitionState

      public void setTransitionState(ArrayList<MediaItem> currentMedia, ArrayList<MediaItem> nextMedia, float progress)
      Sets up transition state between two sets of media items. Stores both current and next scene media for cross-fade transition.
      Parameters:
      currentMedia - Media items from the current scene
      nextMedia - Media items from the next scene
      progress - Transition progress (0.0 to 1.0)
      See Also:
    • assignToDisplay

      public void assignToDisplay(Rectangle bounds)
      Assigns this screen to a physical display with specified bounds. Configures screen dimensions and position based on display geometry, recreates offscreen buffers, and updates all assigned media items.
      Parameters:
      bounds - The display bounds to assign this screen to
      See Also:
    • render

      public void render(int mousex, int mousey)
      Renders the screen content and displays it at the correct position. Updates the offscreen buffer with current media and shows the result.
      Parameters:
      mousex - The current x-coordinate of the mouse
      mousey - The current y-coordinate of the mouse
      See Also:
      • updateGraphics(int, int)
      • show()
    • show

      public void show()
      Displays the screen buffer at its assigned position. Only renders if the screen is assigned to a physical display.
    • setPreviewArea

      public void setPreviewArea(float px, float py, float pw, float ph)
      Sets the preview area dimensions for media item preview rendering. Propagates the preview area configuration to all assigned media items.
      Parameters:
      px - Preview area x-coordinate
      py - Preview area y-coordinate
      pw - Preview area width
      ph - Preview area height
      See Also:
    • moveHoverPoint

      public void moveHoverPoint(float mousex, float mousey)
      Updates hover point position for all media items on this screen. Used for interactive media elements that respond to mouse movement.
      Parameters:
      mousex - The current x-coordinate of the mouse
      mousey - The current y-coordinate of the mouse
      See Also:
    • getScreen

      public processing.opengl.PGraphics2D getScreen()
      Returns the offscreen graphics buffer for this screen.
      Returns:
      PGraphics2D buffer containing the rendered screen content