Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Overview not visible in Chrome (Read 3656 times)
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Overview not visible in Chrome
Jan 4th, 2013 at 8:16pm
Print Post  
Hi,

I have a diagram on which an Overview appears in the upper left corner (see attached screenshot).
The Overview is rendered fine in Firefox, IE and Safari but does NOT appear in Chrome.

I also note that the AppletStartedScript does not appear to run on Chrome (I put an alert in the script and it did not fire). I have tested Chrome to see if Java is enabled by visiting this site: https://java.com/en/download/testjava.jsp and its says My Java is working.

The diagram itself renders fine; only the Overview is missing.

Here's the diagram and overview declaration:
Code (HTML)
Select All
<div style="margin: 0px; padding-top: 10px;">
                    <div style="clear: both; margin-top: 2px; margin-left: 10px; margin-right: 10px;
                        position: absolute; left: 05; top: 145; z-index: 2;">
                        <ndiag:Overview ID="Overview1" runat="server" DiagramViewID="DiagramView3" JarLocation="./Java/JDiagram.jar"
                            FitAll="true" Visible="true" Style="background-color: white; width: 200px; height: 200px;" />
                    </div>
                    <div style="z-index: 1; position: absolute;">
                        <ndiag:DiagramView ID="DiagramView3" runat="server" Behavior="Pan" Height="1000px"
                            Width="2000px" ClientSideMode="JavaApplet" JsLibraryLocation="./Js/MindFusion.Diagramming.js"
                            JarLocation="./Java/JDiagram.jar" AppletStartedScript="onAppletStarted">
                        </ndiag:DiagramView>
                    </div>
                </div> 



Any ideas?

Thanks

Jim
  

NetDiargarm_-_Overview_Not_Displaying_in_Chrome.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview not visible in Chrome
Reply #1 - Jan 7th, 2013 at 7:42am
Print Post  
Hi,

If you see nothing from the Overview control at all, I suppose Chrome might be showing its applet behind the DiagramView's one. You might have to reverse the order of applets' divs when the target browser is Chrome. You could check that by offsetting the DiagramView a bit to the right or bottom. Alternatively, you might display an overview window in a separate frame of the DiagramView's applet by setting DiagramView.ShowOverview = true.

Regarding AppletStarted in Chrome, it looks Chrome does not allow the diagram applet to inject its startup JS function. You could add your own and call it from document.onLoad - this works in all browsers I tried:

Code
Select All
<body onload="initApplet('onAppletStarted', 10)">

function onAppletStarted()
{
	// your original handler here
}

function initApplet(appletStartedScript, attempts)
{
	var applet = <%= diagramView.AppletElement %>;
	var loaded = false;
	try
	{
		loaded = applet.appletLoadedCheck();
	}
	catch (e) {}
	if (loaded)
	{
		window[appletStartedScript].call();
	}
	else if (attempts>0)
	{
		setTimeout(function() {
			initApplet(appletStartedScript, attempts - 1)
		}, 100);
	}
}; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Re: Overview not visible in Chrome
Reply #2 - Jan 11th, 2013 at 12:01am
Print Post  
Hi Stoyan,

I used your "DiagramView.ShowOverview = true" and that works well, except that this separate window will disappear as soon as you click anywhere on the page housing the applet.

Is there anyway to keep this new window always on top?

Thanks in advance for any assistance.

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview not visible in Chrome
Reply #3 - Jan 11th, 2013 at 10:24am
Print Post  
This would make the window always on top in a desktop application, but JRE doesn' t allow it from an applet and throws a security exception:

Code
Select All
function getRootFrame(component)
{
	if (component.toString().indexOf("JFrame") != -1)
		return component;
	return getRootFrame(component.getParent());
}

function onAppletStarted()
{
	var applet = <%= diagramView.AppletElement %>;
	var overview = applet.getOverview();
	var overviewFrame = getRootFrame(overview);
	overviewFrame.setAlwaysOnTop(true);
} 



so you'll have to keep it on the side of the browser window, or otherwise move the overview to the applet's frame:

Code
Select All
function onAppletStarted()
{
	var applet = <%= diagramView.AppletElement %>;
	var scriptHelper = applet.getScriptHelper();
	var overview = applet.getOverview();
	var overviewFrame = getRootFrame(overview);

	var overviewPane = overview.getParent().getParent();
	overviewPane.setPreferredSize(scriptHelper.createSize(200, 200));
	applet.getContentPane().add(overviewPane, "East", -1);

	overviewFrame.setVisible(false);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview not visible in Chrome
Reply #4 - Feb 14th, 2013 at 2:14pm
Print Post  
This version calls the AppletStartedScript from a JavaScript onload handler instead from Java, so it should work fine in Chrome:
https://mindfusion.eu/_beta/NetDiagram5.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint