Issue Details (XML | Word | Printable)

Key: BEAM-955
Type: Bug Bug
Status: Open Open
Priority: Trivial Trivial
Assignee: Norman Fomferra
Reporter: Olaf Kock
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
BEAM

Text colour for pins incorrectly used, enhancement of 'glow' display

Created: 06/Feb/09 11:17 AM   Updated: 04/Jun/09 08:53 AM
Component/s: None
Affects Version/s: 4.5, 4.5.1
Fix Version/s: None


 Description  « Hide
Reason for the problem is an error in the colour-calculation in org.esa.beam.glayer.PlacemarkLayer.
(actually only the first part of the summary is a bug, the second part of this ticket is a feature, but as both are minor changes affecting the same method, I'm submitting them in one ticket)

The current code in Placemark layer calculates an RGBA colour value using RGGA values in drawTextLabel(). The code in question is

Color selectionColor = new Color(getTextBgColor().getRed(),
                    getTextBgColor().getGreen(),
               __getTextBgColor().getGreen()__,
                    alphas[i]);

Also, usage of BasicStroke could be more specific. The current implementation is:

        int[] alphas = new int[]{64, 128, 192, 255};
        for (int i = 0; i < alphas.length; i++) {
            BasicStroke selectionStroke = new BasicStroke((alphas.length - i));
            ......
        }

Suggestion is to change two aspects:
* make maxStrokeWidth different from alphas.length
* use specific end- and join-style for BasicStroke instead of default (given suggestion looks nicer on linux - at least on my box - but should provide the same behaviour on all platforms.)

        int[] alphas = new int[]{64, 128, 192, 255};
        float maxStrokeWidth = 4.0f;
        for (int i = 0; i < alphas.length; i++) {
            float strokeWidth = maxStrokeWidth * (1.0f - (float) i / alphas.length);
BasicStroke selectionStroke = new BasicStroke(strokeWidth, BasicStroke.JOIN_ROUND, BasicStroke.CAP_ROUND);
           ....
        }

...hoping the code examples will stay readable...

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Norman Fomferra added a comment - 06/Feb/09 11:29 AM
Thanks! Norman