Hi Thomas,
I don't think the SWT module in GeoTools is maintained (cc'ing Andrea
Antonello for
confirmation). Wondering if you are interested in the module enough to
contribute
fixes and improvements to it?

Cheers
Andrea


On Thu, Feb 11, 2016 at 11:41 PM, Thomas Wunder <[email protected]>
wrote:

> Hello Ian,
> Thanks a million for your reply. When I tried your Cartouche example the
> first thing I noticed was that I forgot to mention that my application is
> SWT based whereas Cartouche is based on swing.
>
> I had to  change some minor things to make it work in my setup however in
> the swing based map view getWorldToScreen() and getScreenArea() both are
> working. However the (Feature) map (and the DirectLayer) are shown only for
> a split second upon e.g. reszing the map view (or panning etc.) and turn
> completely white afterwards (as well as before that).
>
> To see what's happening with SwtMapFrame instead I changed the code a bit
> (see attachment, and please excuse me for hardwiring the filename). These
> are my observations so far:
> - Map is drawn perfectly and stays that way when panning resizing, zooming
> etc.
> - A NullPointerException is being thrown in line 68 (println of the
> getWorldToScreen() )
>   java.lang.NullPointerException
>         at
> org.geotools.referencing.operation.matrix.XAffineTransform.getScaleX0(XAffineTransform.java:569)
>         at
> org.geotools.referencing.operation.matrix.XAffineTransform.getScale(XAffineTransform.java:596)
>         at
> org.geotools.renderer.lite.RendererUtilities.calculateOGCScaleAffine(RendererUtilities.java:507)
>         at org.geotools.JSurvey.SwtCartouche.draw(SwtCartouche.java:132)
>         at
> org.geotools.renderer.lite.StreamingRenderer$RenderDirectLayerRequest.execute(StreamingRenderer.java:3450)
>         at
> org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3504)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> - DirectLayer (Cartouche) is never being drawn (correctly)
> - When commenting out line 68 (println...):
> -- getScreenArea() returns a (0,0,0,0) rectangle as in my original
> application
> -- Cartouche is not visible, presumably due to incorrect size values from
> getScreenArea()
>
> Does my SWT version of Cartouche work for you?
>
> Thanks again!
>  Thomas
>
> On Thursday 11 February 2016 14:47:22 you wrote:
> > Here is an example of my Cartouche (
> > https://en.wikipedia.org/wiki/Cartouche_(cartography)) layer -
> > https://gitlab.com/snippets/14766 in case that helps
> >
> > Ian
> >
> > On 11 February 2016 at 14:43, Ian Turton <[email protected]> wrote:
> > > It sounds like you have a problem somewhere, I regularly use Rectangle
> > > size = viewport.getScreenArea(); in my directlayers and it is fine. Can
> > > you
> > > post some code and I can see if I can spot the problem for you,
> > >
> > > Ian
> > >
> > > On 11 February 2016 at 14:17, Thomas Wunder <[email protected]>
> > >
> > > wrote:
> > >> Hello,
> > >> I'm trying to extend the DirectLayer class but when I'm trying to use
> > >> getWorldToScreen() on the viewport argument inside the draw(...)
> method
> > >> it's
> > >> always returning null. Is this the intended behaviour of that method
> in
> > >> GeoTools 14? If so, how am I supposed to get the worldToScreen
> transform
> > >> otherwise?
> > >>
> > >> By the way viewport.getScreenArea() always returns a (0,0,0,0)
> rectangle,
> > >> whereas viewport.getBounds() seems to work properly. The getBounds()
> of
> > >> my
> > >> DirectLayer subclass I have implemented in a way that it returns
> sensible
> > >> values and a valid CRS.
> > >>
> > >>
> > >> I would really appreciate some hints on what could be going wrong here
> > >> and how
> > >> to get things working properly.
> > >>
> > >> Thanks in advance and best regards!
> > >>
> > >>  Thomas
> > >>
> > >>
> -------------------------------------------------------------------------
> > >> ----- Site24x7 APM Insight: Get Deep Visibility into Application
> > >> Performance APM + Mobile APM + RUM: Monitor 3 App instances at just
> > >> $35/Month
> > >> Monitor end-to-end web transactions and take corrective actions now
> > >> Troubleshoot faster and improve end-user experience. Signup Now!
> > >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> > >> _______________________________________________
> > >> GeoTools-GT2-Users mailing list
> > >> [email protected]
> > >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> > >
> > > --
>
> > > Ian Turton
> --
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to