Recent Posts

Pages: [1] 2 3 ... 10
1
Hi,

Credit where credit's due : this is not my own implementation but I found it here.

Something interresting to know is that jArchi uses Nashorn which is the JavaScript engine embedded inside any JVM. This means that you have access to the whole underlying Java environment, ie. all classes.

This is very similar to NodeJS with the main difference being that NodeJS also provides a DOM (like any browser) to ease HTML document manipulation.

If you google it a bit, you'll find several code snippets and tips & tricks for Nashorn, including some polyfills to make it react a bit more like NodeJS. Some people also succeeded in loading a full-JS DOM implementation, making it easy to manipulate HTML document before loading them in the browser window included with jArchi.

Here are some links of interrest:

Regards,

JB
2
I wanted to do something similar and I ended up repurposing smileham's import from CSV in this community script:
https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d
4
Archi Development / Re: Help with blurry interface?
« Last post by chriswarbs on Today at 09:37:48 »
Thanks for the prompt reply.

From what I've read I'm pretty sure this is a feature of eclipse.

I don't use any other eclipse based tools, but happy to find one to test against.

Which version of eclipse does archi use?

cheers

Chris
5
Archi Development / Re: Help with blurry interface?
« Last post by Phil Beauvoir on Today at 09:25:39 »
Hi Chris, I can't help with this as I don't have such a setup. It would interesting to know if Eclipse itself or any other Eclipse-based app did the same.
6
Archi Development / Help with blurry interface?
« Last post by chriswarbs on Today at 09:22:36 »
Hello All,

Not sure whether to raise this as a bug/issue, happy to do that if it helps, but if anyone's got a workaround it'd be great.

On windows 10, when I drag archi from my laptop display to an external display, the UI becomes blurry. This is most common after I've been working on my laptop undocked, hibernated, then docked and unhibernated. If I quit and restart archi on the external display there's no blurring, so I'm happy each display is ok.

My laptop display is 3000x2000, and the two external displays (via USB-C dock) are 1920x1080.

I've done a bit of research and know there are other applications that have the same issue, I've had this problem with other applications in the past (chrome, outlook) but as they've updated themselves, it's gone away. I know there are "compatibility" settings in W10 too, but I've yet to find a combination that works effectively for archi.

I know this isn't core archi, but anyone got any ideas?

cheers

Chris
7
General Archi Discussion / Re: Jarchi support for readfile from local filesystem
« Last post by rfamans on January 14, 2019, 21:07:01 PM »
 :) Much appreciated!
8
Hi,

Here it is:
Code: [Select]
function readFully(url) {
    var result = "";
    var imports = new JavaImporter(java.net, java.lang, java.io);

    with (imports) {

        var urlObj = null;

        try {
            urlObj = new URL(url);
        } catch (e) {
            // If the URL cannot be built, assume it is a file path.
            urlObj = new URL(new File(url).toURI().toURL());
        }

        var reader = new BufferedReader(new InputStreamReader(urlObj.openStream()));

        var line = reader.readLine();
        while (line != null) {
            result += line + "\n";
            line = reader.readLine();
        }

        reader.close();
    }

    return result;
}

Add this function to your jArchi script and you'll then be ale to use the readFully(url_or_filename) function.

Regards,

JB
9
General Archi Discussion / Re: Jarchi support for readfile from local filesystem
« Last post by rfamans on January 14, 2019, 11:39:21 AM »
Ok, that would be great!
10
Hi,

In fact you can already do it through Nashorn (the JAVA-based JavaScript engine). I have an example on another laptop. I will share it later today.

Regards,

JB
Pages: [1] 2 3 ... 10