Class JtvProgram
public abstract class JtvProgram
extends JtvGroup
Abstract base class for JT Vision applications.
JtvProgram is the top-level group that fills the entire screen and owns three
standard subviews: a JtvMenuBar at the top, a JtvDesktop in the middle, and a
JtvStatusLine at the bottom. These are created via injectable factory functions so
that applications can supply custom implementations without subclassing the factories.
The event loop (inherited from TGroup.execute()) runs until endModal is
called. TProgram.getEvent() polls the platform event queue, dispatches key events
to the status line, and calls idle() when no events are waiting.
Applications should normally subclass JtvApplication rather than TProgram
directly, since TApplication also initialises the platform Screen and EventQueue
subsystems.
org.viktor44.jtvision.core.JtvProgram
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvProgram() |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private static | statusLine | org.viktor44.jtvision.views.JtvStatusLine |
| private static | menuBar | org.viktor44.jtvision.menus.JtvMenuBar |
| private static | desktop | org.viktor44.jtvision.core.JtvDesktop |
| private static | application | org.viktor44.jtvision.core.JtvProgram |
| private static final | clipboard | java.awt.datatransfer.Clipboard |
| public static | appPalette | int |
| public static | eventTimeoutMs | int |
| protected | pending | org.viktor44.jtvision.core.JtvEvent |
| private static final | cpAppColor | org.viktor44.jtvision.core.JtvPalette |
| private static final | cpAppBlackWhite | org.viktor44.jtvision.core.JtvPalette |
| private static final | cpAppMonochrome | org.viktor44.jtvision.core.JtvPalette |
| private static | customAppPalette | org.viktor44.jtvision.core.JtvPalette |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | canMoveFocus() | boolean |
| public | executeDialog(JtvDialog pD, Object data) | int |
| public | getEvent(JtvEvent event) | org.viktor44.jtvision.core.JtvEvent |
| public | getPalette() | org.viktor44.jtvision.core.JtvPalette |
| public static | setAppPalette(JtvPalette palette) | void |
| public static | getClipboard() | java.awt.datatransfer.Clipboard |
| private static | initClipboard() | java.awt.datatransfer.Clipboard |
| public | handleEvent(JtvEvent event) | void |
| public | idle() | void |
| public | initScreen() | void |
| public | putEvent(JtvEvent event) | void |
| public | run() | void |
| public | setScreenMode(int mode) | void |
| public | validView(JtvView p) | org.viktor44.jtvision.views.JtvView |
| public | insertWindow(JtvWindow pWin) | org.viktor44.jtvision.views.JtvWindow |
| protected | initDesktop(JtvRect r) | org.viktor44.jtvision.core.JtvDesktop |
| protected | initMenuBar(JtvRect r) | org.viktor44.jtvision.menus.JtvMenuBar |
| protected | initStatusLine(JtvRect r) | org.viktor44.jtvision.views.JtvStatusLine |
| public static | getStatusLine() | org.viktor44.jtvision.views.JtvStatusLine |
| public static | getMenuBar() | org.viktor44.jtvision.menus.JtvMenuBar |
| public static | getDesktop() | org.viktor44.jtvision.core.JtvDesktop |
| public static | getApplication() | org.viktor44.jtvision.core.JtvProgram |
Constructors
JtvProgram()
Constructs a TProgram. Creates the standard subviews by calling
initDesktop(JtvRect), initStatusLine(JtvRect), and
initMenuBar(JtvRect), which subclasses may override to supply custom
implementations. A method may return null to omit that subview.
Fields
org.viktor44.jtvision.views.JtvStatusLine statusLine
The current application's status line, or null if none.
org.viktor44.jtvision.menus.JtvMenuBar menuBar
The current application's menu bar, or null if none.
org.viktor44.jtvision.core.JtvDesktop desktop
The current application's desktop, or null if none.
org.viktor44.jtvision.core.JtvProgram application
Reference to the running TProgram instance (set in the constructor).
java.awt.datatransfer.Clipboard clipboard
Shared clipboard: system clipboard when available, local fallback otherwise.
int appPalette
The active color palette mode. One of the ap* constants from
ViewFlags (e.g. apColor, apBlackWhite, apMonochrome).
int eventTimeoutMs
Maximum milliseconds to wait for a platform event before calling idle().
Default is 20 ms.
org.viktor44.jtvision.core.JtvEvent pending
Buffered event injected by putEvent and consumed on the next getEvent call.
org.viktor44.jtvision.core.JtvPalette cpAppColor
Master application palette — 135 entries for color mode.