On 24/03/2019 12:01, Robert Hanson wrote: Not sure how that would work. There are two designers here --- web-page and Java. The web-page designer can do anything they want on the page, though modifying the Java-as-JavaScript is probably not recommended. I was thinking of it as a clear division of responsibility:
- Java designer adds the capability to allow the identification of frames by the web-page designer, either by specifying the syntax of the frame name (as we are doing here) or reading it from Info parameters. But what about frames the java designer has no control of, e.g. alert panels. You then force the Java designer to 'Unswingify' their app (which I guess we've had to do any how). - Web-page designer can designate any div they want, dynamically or statically. They could also create a listener to window events if they wish, I suppose. That's just a simple interface. But the catch there is that this is done once, during frame creation, so there is a chicken and egg issue there. However, there is a little-used listener for ALL AWTQueue events that can be tapped by JavaScript. Then you would see every single event that is happening, including frame creating, I think. You can filter those. I have used that listener for debugging, but I haven't tried filtering. See https://docs.oracle.com/javase/7/docs/api/java/awt/Toolkit.html#addAWTEventListener(java.awt.event.AWTEventListener,%20long) way too low level for a web designer. IMHO. Java2Script needs to provide a friendly JavaScript event hook. But in the end, it's just a single line in JavaScript: myDiv.appendChild(frameOuterDiv) So that's pretty trivial. Easy enough to discover frameOuterDiv using jQuery. agreed. The key is that you can do anything you want with the frame's outer div. But it is best to do it via Java, because then the correctly undecorated frame is created properly, and Java will need to know the width and height, for sure. Returning to 'separation' - one has to assume the Java app has already been told to be 'embedded'. The front-end designer will then want to do their own thing with *everything* - including refocus and resize divs. This is no different to any other layout manager in Java so providing the resize/relayout events are passed back to java there's going to be no need to do anything special in Java to allow dynamic relocation of any frame.... or have I missed something here ? The bottom line is that having to modify *java* is a massive barrier to adoption - and a battle that IMHO is not worth fighting. We (as in JalviewJS) can do what we can and respond to requests, of course, but for Java2Script'ed systems in general, a really really simple way for front-end developers to avoid floating windows unexpectedly appearing and ruining the page design would be very useful I expect. Anyhow - too much tech for Sunday :) Jim. The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________ Jalview-dev mailing list [email protected] http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev
