In VASL, maps are surrounded by a white area, used for off-board counters and informational counters. The color of the background is set in Vassal.build.module.map but can be changed by changing its value in the VASL buildFile.
I would like to find an easier way to change the background, either via a preference or accessing the bgColor property in vassal.build.module.map.
VASL has a class ASLMap which extends vassal.build.module.map. ASLMap’s constructor calls super(); as its first action. I tried the following after that call, but it did not work:
super.bgColor = Color.cyan;
repaint();
I have tried to access other methods from vassal.build.module.map with an equal lack of success.
Map.clearMapBorder() is supposed to be called only when the Map component is being painted. It should not be called from anywhere else.
If you want to change the background color, you can do that by setting the BACKGROUND_COLOR property that Map has. Alternatively, bgColor is a protected member of Map and since ASLMap is a subclass, this means you have access to it and can set it directly: bgColor = Color.cyan;
That’s what he was trying in his first message to the thread and it wasn’t working.
Maybe instead of directly calling clearMapBorder, the right thing to do is a full paint() of “the whole map”?
So:
bgColor = Color.cyan;
paint(getComponent().getGraphics());
So maybe that?
Of course then I don’t understand why “repaint()” doesn’t do it, but then again I’m on record as never understanding the difference between paint()/repaint()/update() in swing.
that did it. I was resetting the color too soon - in the ASLMap constuctor and it was getting overwritten when the Map class was being built. I moved it else where in ASLMap class and it worked perfectly: set the new color, call repaint().