Class OverlayPlacement
Offsets are pixels from the anchor, measured inward: on a corner anchor a positive
offsetX/offsetY moves the panel away from that corner towards the middle, and the
corner itself sits EDGE px in from the canvas edge. FREE-anchor offsets are the
panel's top-left in canvas pixels, with no edge margin.
Clamping is what keeps a saved FREE position visible on a smaller (or resized) window: the
panel is pushed back inside [0, viewport - size] on both axes; a panel larger than the
viewport sits at 0. Overlap with an earlier panel moves the panel below it (above it for the two
bottom anchors, which grow upwards), then clamps again; when the viewport has no room left the
panels may overlap rather than leave the screen.
Pure: no client, no AWT component, safe on any thread.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHeight of the fixed-size game frame used when the viewport is unknown.static final intFixed-size game frame used when the viewport is unknown.static final intGap between a corner-anchored panel and the canvas edge.static final intGap between stacked panels.static final intHeight assumed for a panel whose content is unmeasured. -
Method Summary
-
Field Details
-
EDGE
public static final int EDGEGap between a corner-anchored panel and the canvas edge.- See Also:
-
GAP
public static final int GAPGap between stacked panels.- See Also:
-
DEFAULT_VIEWPORT_WIDTH
public static final int DEFAULT_VIEWPORT_WIDTHFixed-size game frame used when the viewport is unknown.- See Also:
-
DEFAULT_VIEWPORT_HEIGHT
public static final int DEFAULT_VIEWPORT_HEIGHTHeight of the fixed-size game frame used when the viewport is unknown.- See Also:
-
NOMINAL_HEIGHT
public static final int NOMINAL_HEIGHTHeight assumed for a panel whose content is unmeasured.- See Also:
-
-
Method Details
-
clamp
-