Hei Kurt,
good to know. If you can do define your scaling numerical, then this is
fine. ( I could never do so)
I think what you can do then is also to take the objects of the layer,
scale them and create a new layer with all objects. I guess it is much
faster. But I needed to use "edittransactions", since the objects in a
shown layer are modified.
ohhh.. wait a moment. I may also have a function written in the
MapGEN-Toolbox, called Scale Polygons (or scale buildings?). I think
here the centroid is used as origin. The toolbox is to be found on
sourceforge under plugins.
stefan
Kurt Heston schrieb:
Stefan,
I think you and the Sunburned Surveyor are telling me that fixing this
wouldn't be re-inventing the wheel. That's most of what I was concerned
about. I'm indeed using the scaling tool in the edit toolbar and wanted
to make sure there wasn't another scaling facility I was missing.
I stumbled around building a bean shell script which duplicates
rectangular polygons and places them adjacent to one another and learned
a bit about the object model as a result. My bsh file simply passes the
WorkbenchContext to a class I can debug in Eclipse. The required pieces
that I couldn't find in the scripting tutorials were found using this
method (along with some trial and error). I haven't dedicated the time
yet to turn it into a plug-in.
If I can come up to speed on what the current code does fast enough
using the pointers you've given me, I'll attempt to extend/fix the
current toolset. I'm thinking that with lots of features selected,
perhaps just an outline of the outermost objects would suffice visually
and cause far fewer calls to the event queue. Might take some doing to
implement, but maybe it would work...I'll take a shot at it.
I've got a gun to my head to get some data merged so I may have to just
build a scaling algorithm in the form of a bean shell script not unlike
that described above (using numeric input arguments). However
inelegant, it may help me meet my deadline more predictably, if only
because I've already made something work this way.
Thanks for the tips. I'll certainly post the code if I can get it to
function.
--Kurt
Stefan Steiniger wrote:
Hei Kurt,
I am not sure what kind of functionality you did use (i.e. if we have
maybe two tools for that). But if I assume that you use the function
of the edit toolbar, then the problem is, that one may need some
visual feedback to select the scaling size.
But maybe you are right and it is easier to calculate the bounding
rectangle once (using maybe a checkbox to select the option) and then
only transform this box visually.
however the code for initialization of the toolbox plugin can be found
here:
org.openjump.core.ui.plugin.edittoolbox.ScaleSelectedItemsPlugIn
and the functionality is here:
org.openjump.core.ui.plugin.edittoolbox.cursortools.ScaleSelectedItemsTool
Sorry for the late response, but our mail list server has some problems
if you have done the improvements it would be nice if you could inform
us.
stefan
Kurt Heston wrote:
If I choose more than a couple dozen items and attempt to scale them
all at once, OpenJump pegs the processor and goes out to lunch on
me. I've profiled the process and it appears to be checking the AWT
event queue quite a bit (>50% of the total time). The next largest
amount of time spent is within Math...floor() (2.59%).
I once left it alone for a couple of days and it finally did complete
scaling all of the Polygons. My machine is new and fast, not a
hardware issue.
Unless there's a workaround, I've resigned myself to needing to write
a plug-in that interacts with the GUI less and the features
themselves more. However, if someone wants to point me to where the
same work can be done in OpenJump itself, that would be great, too.
A "repaint when complete" or "disable preview" checkbox would do the
trick I'd imagine...
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users