On 15.07.2024 15:08, János Tamás Kis wrote:
Hi Ede,

The site is a great for start and I must say: Thank you!

my pleasure

The clone of OpenJump and HelloWorldPlugin builds/runs from Eclipse, my own 
plugin (based on an old HelloWorldPlugin) works well also, but I have a few 
more questions:

1.
If I copy the HelloWorldPlugin's java files into my own struct, an empty package (like 
"kjt.openjump.myHelloWorld") and fix the references (or Eclipse will fix it if 
it can), I get the following errors:

HelloWorldExtension.java
- The method get(String) in the type I18N is not applicable for the arguments 
(String, Object[])

HelloWorldPlugin.java
- The method getIcon() of type HelloWorldPlugin must override or implement a 
supertype method
- The method getInstance() in the type EnableCheckFactory is not applicable for 
the arguments (WorkbenchContext)

Then, what and where else should I fix?
(I want to rewrite my existing plugin using I18N, but I can't see what I'm 
doing wrong.)

let me fix up our HelloWorld extension to implement some different languages as 
the yare suosed to be implemented. that should guide you. give me some time.

2.
How should an existing project be opened automatically?

you can add it as command line parameter. run OJ with '--help' and it will tell 
you the parameters and the syntax expected

3.
How to open a new project from a plugin?

have a look how OJ does it
 
https://github.com/openjump-gis/openjump/blob/HEAD/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java

4.
How to automatically add a map to the project after starting?

you add that as a command line parameter as well.

5.
How can I set style when I open an exisiting map?

you mean map as a data file? usually you would open it, set a style and then 
save the project which will remember the style on the next time you open the 
project

6.
I can load and use shp files, for example:

    ShapefileReader s = new ShapefileReader();
    DriverProperties dp = new DriverProperties( 
System.getProperty("user.dir")+"\\tryIt.shp" );
    FeatureCollection fc;
    try {
       fc = s.read(dp);
       pluginContext.getLayerManager().addLayer("MyCategory", "MyLayer", fc);
    } catch (Exception ex) {
       ex.printStackTrace();
    }

but how can I transfer data from e.g. postgis?

you mean reading a dataset from Postgis programmatically? i will cc Mike as 
that is more in his corner.
@Mike: do you have some code you can point to?

I am unable to find an example of this and I an too lame so to extract it from 
the documentation.
But maybe these go beyond helloworld... 😳


it indeed does. but anyway. you have the sources of the complete project, which 
already does what you want in several places. i suggest you run OJ, set debug 
points, run the functionality you are interested in and check out what the code 
does.

sunny regards.. ede


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to