Class JtvDesktop
public class JtvDesktop
extends JtvGroup
The desktop group that acts as the container for all application windows.
TDesktop sits between the menu bar and the status line, occupying the
middle portion of the JtvProgram screen. Its back-most child is a
JtvBackground that provides the characteristic textured fill. All other
children are user windows.
The desktop handles the cmNext and cmPrev commands to cycle
window focus, and provides tile and cascade operations that
arrange all ViewFlags.ofTileable windows within a given rectangle.
org.viktor44.jtvision.core.JtvDesktop
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvDesktop(JtvRect bounds) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| public static final | defaultBkgrnd | char |
| private | background | org.viktor44.jtvision.core.JtvBackground |
| private | tileColumnsFirst | boolean |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | handleEvent(JtvEvent event) | void |
| protected | initBackground(JtvRect r) | org.viktor44.jtvision.core.JtvBackground |
| public | cascade(JtvRect r) | void |
| public | tile(JtvRect r) | void |
| public | tileError() | void |
| private static | tileable(JtvView v) | boolean |
| public | getBackground() | org.viktor44.jtvision.core.JtvBackground |
Constructors
JtvDesktop(JtvRect bounds)
Constructs a desktop covering bounds
Parameters
bounds- the desktop area (normally the screen minus menu and status line rows)
Fields
char defaultBkgrnd
No description provided
org.viktor44.jtvision.core.JtvBackground background
The background tile view inserted as the bottom-most child.
boolean tileColumnsFirst
When true, tile columns are arranged before rows; default is false.
Methods
handleEvent(JtvEvent event)
Overrides:
handleEvent(JtvEvent event) in org.viktor44.jtvision.views.JtvGroup
Handles cmNext (cycle to next window) and cmPrev (cycle to previous
window) commands, then delegates all other events to the inherited handler.
Parameters
event- the event to process
initBackground(JtvRect r)
Default background factory: creates a JtvBackground filled with defaultBkgrnd covering the full desktop rectangle.
Parameters
r- the desktop extent
Returns
a new background view
cascade(JtvRect r)
Arranges all tileable visible windows in a cascaded (staircase) pattern within r.
Each window is offset one row and one column from the previous.
Calls tileError() if the windows are too large to fit.
Parameters
r- the rectangle within which to cascade windows
tile(JtvRect r)
Arranges all tileable visible windows in a grid within r, dividing the area
as evenly as possible. The number of columns and rows is derived from the window count.
Calls tileError() if the area is too small.
Parameters
r- the rectangle within which to tile windows
tileError()
Called when tile or cascade cannot fit the windows in the available space. The default implementation is a no-op; override to show an error message.
tileable(JtvView v)
Returns true if v is tileable and currently visible.
Parameters
v
getBackground()
The background tile view inserted as the bottom-most child.