Skip to content

Commit

Permalink
Get N(exus)Frame as JFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed Jan 23, 2025
1 parent 091b5cc commit ac38fbf
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.zyneonstudios.nexus</groupId>
<artifactId>base-desktop</artifactId>
<version>2025.1</version>
<version>2025.1.1</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ public void setTitlebar(String title, Color background, Color foreground, List<I
setTitle(title);
setIconImages(icons);
}

public JFrame getAsJFrame() {
return this;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.zyneonstudios.nexus.desktop.frame.nexus;

import com.zyneonstudios.nexus.desktop.NexusDesktop;
import com.zyneonstudios.nexus.desktop.frame.web.NexusWebSetup;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
Expand Down Expand Up @@ -175,13 +172,7 @@ public void setTitle(String title) {
super.setTitle(title);
}

public static void main(String[] args) {
NexusDesktop.init();
NexusWebSetup setup = new NexusWebSetup("libs/jcef/");
setup.setup();
NexusWebFrame f = new NexusWebFrame(setup.getWebClient(),"https://google.com",false);
f.setVisible(true);
f.setTitle("Test");
f.setTitle("NEXUS CUSTOM FRAME");
public JFrame getAsJFrame() {
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.zyneonstudios.nexus.desktop.NexusDesktop;
import com.zyneonstudios.nexus.desktop.events.AsyncWebFrameConnectorEvent;
import com.zyneonstudios.nexus.desktop.events.WebFrameConnectorEvent;
import com.zyneonstudios.nexus.desktop.frame.web.WebFrame;
import org.cef.CefClient;
import org.cef.CefSettings;
import org.cef.browser.CefBrowser;
Expand All @@ -11,7 +12,7 @@

import java.awt.*;

public class NexusWebFrame extends NexusFrame {
public class NexusWebFrame extends NexusFrame implements WebFrame {

private final CefBrowser browser;
private boolean browserFocus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import java.awt.*;

public class NWebFrame extends NFrame {
public class NWebFrame extends NFrame implements WebFrame {

private final CefBrowser browser;
private boolean browserFocus;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.zyneonstudios.nexus.desktop.frame.web;

import com.zyneonstudios.nexus.desktop.events.AsyncWebFrameConnectorEvent;
import com.zyneonstudios.nexus.desktop.events.WebFrameConnectorEvent;
import org.cef.browser.CefBrowser;

import javax.swing.*;

public interface WebFrame {

AsyncWebFrameConnectorEvent getAsyncWebFrameConnectorEvent();

WebFrameConnectorEvent getWebFrameConnectorEvent();

void setAsyncWebFrameConnectorEvent(AsyncWebFrameConnectorEvent asyncWebFrameConnectorEvent);

void setWebFrameConnectorEvent(WebFrameConnectorEvent webFrameConnectorEvent);

CefBrowser getBrowser();

boolean isBrowserFocussed();

void executeJavaScript(String... scripts);

JFrame getAsJFrame();
}

0 comments on commit ac38fbf

Please sign in to comment.