JMapPane: Labels not displayed when a layer is hidden then shown
----------------------------------------------------------------

                 Key: GEOT-2920
                 URL: http://jira.codehaus.org/browse/GEOT-2920
             Project: GeoTools
          Issue Type: Bug
          Components: ext mappane
    Affects Versions: 2.6.0
            Reporter: Michael Bedward
            Assignee: Michael Bedward
             Fix For: 2.6.2, 2.7-M0


Copy of report on the user list posted by Oliver Gottwald...

a number of attempts where made to get the labels to appear and not appear from 
a legend via layer setVisible(true) and setVisible(false)
the assumption is that after a window size that labels will then be changed.
unfortunately that will not work on my end

the issue is with the labelCache.clear() (which labelCache is unfortunately 
private) in JMapPane needs to be called.

The following is a solution:

before STEP #2 below I do the following:
Note: wrappedPane is my JMapPane
STEP #1
wrappedPane.dispatchEvent(
                new ComponentEvent(wrappedPane, 
ComponentEvent.COMPONENT_RESIZED));

doing the above line will get your displayArea and also call labelCache.clear();
which should eliminate the resize on the window

STEP #2
//i have timing related things going on so I have code for the repaint like 
this:

            ReferencedEnvelope displayArea = wrappedPane.getDisplayArea();
            if (displayArea == null) {
                wrappedPane.repaint();
            } else {
                System.out.println("FIRED DisplayArea refresh");
                wrappedPane.setDisplayArea(displayArea);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to