projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Allow value other than 0 for marking erased flights
[fw/altos]
/
altosuilib
/
AltosSiteMapTile.java
diff --git
a/altosuilib/AltosSiteMapTile.java
b/altosuilib/AltosSiteMapTile.java
index 136fbd7a23095b00c7b7c2283fd6516e36e0077f..f8b924a82cd7444ed74abf08a380271eb62a0a5b 100644
(file)
--- a/
altosuilib/AltosSiteMapTile.java
+++ b/
altosuilib/AltosSiteMapTile.java
@@
-155,9
+155,16
@@
public class AltosSiteMapTile extends JComponent {
return String.format(format, distance);
}
return String.format(format, distance);
}
- boolean painting;
+ int painting_serial;
+ int painted_serial;
+
+ public void paint_graphics(Graphics2D g2d, Image image, int serial) {
+
+ if (serial < painted_serial)
+ return;
+
+ painted_serial = serial;
- public void paint_graphics(Graphics2D g2d, Image image) {
if (image != null) {
AltosSiteMap.debug_component(this, "paint_graphics");
g2d.drawImage(image, 0, 0, null);
if (image != null) {
AltosSiteMap.debug_component(this, "paint_graphics");
g2d.drawImage(image, 0, 0, null);
@@
-239,7
+246,6
@@
public class AltosSiteMapTile extends JComponent {
}
g2d.drawString(message, x, y);
}
}
g2d.drawString(message, x, y);
}
- painting = false;
}
public void paint(Graphics g) {
}
public void paint(Graphics g) {
@@
-247,26
+253,23
@@
public class AltosSiteMapTile extends JComponent {
Image image = null;
boolean queued = false;
Image image = null;
boolean queued = false;
- if (painting) {
- AltosSiteMap.debug_component(this, "already painting");
- return;
- }
AltosSiteMap.debug_component(this, "paint");
AltosSiteMap.debug_component(this, "paint");
+ ++painting_serial;
+
if (file != null) {
AltosSiteMapImage aimage;
aimage = AltosSiteMapCache.get_image(this, file, px_size, px_size);
if (aimage != null) {
if (file != null) {
AltosSiteMapImage aimage;
aimage = AltosSiteMapCache.get_image(this, file, px_size, px_size);
if (aimage != null) {
- if (aimage.validate())
+ if (aimage.validate(
painting_serial
))
image = aimage.image;
else
queued = true;
}
}
if (!queued)
image = aimage.image;
else
queued = true;
}
}
if (!queued)
- paint_graphics(g2d, image);
- painting = queued;
+ paint_graphics(g2d, image, painting_serial);
}
public void show(int state, Point2D.Double last_pt, Point2D.Double pt)
}
public void show(int state, Point2D.Double last_pt, Point2D.Double pt)