You can accomplish resizing with this:
// This very fast and quick workaround that looks like working correctly.// I
would agree that I would be great if someone would reengineer and rewrite the
whole MapPane.// There is DragBox, I want to have DragLine, DragMultiLine and
other kind of tools for MapPane. Right now there is no support for that, some
mechanism should be implemented that would allow to add these tools I wrote to
MapPane.// MapLayerTable looks limited too.
private ReferencedEnvelope[] viewArea = new ReferencedEnvelope[2];
// ... code ... this.getMapPane().addMapPaneListener(new MapPaneListener()
{ @Override public void onNewContext(MapPaneEvent ev) { }
@Override public void onNewRenderer(MapPaneEvent ev) { }
@Override public void onResized(MapPaneEvent ev) {
GISApp.this.getMapPane().setDisplayArea(GISApp.this.viewArea[1]); }
@Override public void onDisplayAreaChanged(MapPaneEvent ev) {
ReferencedEnvelope view = GISApp.this.getMapPane().getDisplayArea(); if
(!view.equals(GISApp.this.viewArea)) { ReferencedEnvelope viewCopy =
new ReferencedEnvelope(view.getMinX(), view.getMaxX(),
view.getMinY(), view.getMaxY(), view.getCoordinateReferenceSystem());
GISApp.this.viewArea[1] = GISApp.this.viewArea[0];
GISApp.this.viewArea[0] = viewCopy; } }
@Override public void onRenderingStarted(MapPaneEvent ev) { }
@Override public void onRenderingStopped(MapPaneEvent ev) { }
@Override public void onRenderingProgress(MapPaneEvent ev) { }
});
> Date: Tue, 6 Apr 2010 15:56:29 +1000
> Subject: Re: [Geotools-gt2-users] MapPane turning off auto reset on resize
> From: [email protected]
> To: [email protected]; [email protected];
> [email protected]
>
> Hi Ryan,
>
> Many thanks for your reply. It's right on the money both in terms of
> what JMapPane offers and how to adapt it to your own requirements.
>
> As discussed in another thread recently, JMapPane (and the gt-swing
> module more generally) is never going to cater for all users' needs.
> That being said, it's always good to get suggestions and if they seem
> generally useful (especially for use with the GeoTools example apps)
> I'll open an issue for it. I think this one falls into that category.
> In fact, I find the present behaviour annoying :-)
>
> <chuckle> After typing that I see Andrea has beaten me to it with
> almost the same words...
>
> http://jira.codehaus.org/browse/GEOT-3015
>
> cheers
> Michael
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users