diff options
author | Keith Packard <keithp@keithp.com> | 2011-07-16 22:34:44 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-07-16 22:34:44 -0700 |
commit | 0a4d934f6e2914bfe2d965630543f029a1576c11 (patch) | |
tree | 4e8331d9c0edb19a10e8f9b5b6c6f949aadaca4d /altosui/AltosSiteMapTile.java | |
parent | abb8510b97ce9cbbff0275cc31f74780fe1ce138 (diff) |
altosui: Display full map preload area in view.
This involved fixing the map view to support arbitrary sizes, and then
exposing a synchronous tile loading API so that the progress bar could
be used to show tile loading progress.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosSiteMapTile.java')
-rw-r--r-- | altosui/AltosSiteMapTile.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/altosui/AltosSiteMapTile.java b/altosui/AltosSiteMapTile.java index 8301f42b..66da7c54 100644 --- a/altosui/AltosSiteMapTile.java +++ b/altosui/AltosSiteMapTile.java @@ -35,11 +35,16 @@ public class AltosSiteMapTile extends JLayeredPane { JLabel mapLabel; JLabel draw; Graphics2D g2d; + int px_size; public void loadMap(ImageIcon icn) { mapLabel.setIcon(icn); } + public void clearMap() { + fillLabel(mapLabel, Color.GRAY, px_size); + } + static Color stateColors[] = { Color.WHITE, // startup Color.WHITE, // idle @@ -90,7 +95,8 @@ public class AltosSiteMapTile extends JLayeredPane { return g; } - public AltosSiteMapTile(int px_size) { + public AltosSiteMapTile(int in_px_size) { + px_size = in_px_size; setPreferredSize(new Dimension(px_size, px_size)); mapLabel = new JLabel(); |