revival commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/* Author: Maple
|
||||
* Dec. 12 2025
|
||||
* */
|
||||
|
||||
package org.openautonomousconnection.webclient.ui;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public abstract class BrowserFrame extends JFrame {
|
||||
public BrowserFrame() {
|
||||
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Author: Maple
|
||||
* Dec. 12 2025
|
||||
* */
|
||||
|
||||
package org.openautonomousconnection.webclient.ui;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class DOMPanel extends JPanel {
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* Author: Maple
|
||||
* Dec. 12 2025
|
||||
* */
|
||||
|
||||
package org.openautonomousconnection.webclient.ui;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.openautonomousconnection.webclient.network.website.tab.Tab;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
|
||||
public final class MainFrame extends BrowserFrame{
|
||||
@Getter
|
||||
private Tab openTab;
|
||||
|
||||
public MainFrame() {
|
||||
this.setSize(800, 600);
|
||||
|
||||
try {
|
||||
this.openTab = new Tab(
|
||||
URI.create("web://open-autonomous-connection.org").toURL()
|
||||
);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/* Author: Maple
|
||||
* Dec. 12 2025
|
||||
* */
|
||||
|
||||
package org.openautonomousconnection.webclient.ui.tab;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import org.openautonomousconnection.webclient.network.website.tab.Tab;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Button that contains Tab data
|
||||
*/
|
||||
@Getter @Setter
|
||||
public class TabButton extends JButton {
|
||||
private Tab tab;
|
||||
|
||||
public TabButton(@NonNull String infoName) throws MalformedURLException {
|
||||
this(URI.create(infoName).toURL());
|
||||
}
|
||||
|
||||
public TabButton(@NonNull URL infoName) {
|
||||
this.tab = new Tab(infoName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/* Author: Maple
|
||||
* Dec. 12 2025
|
||||
* */
|
||||
|
||||
package org.openautonomousconnection.webclient.ui.tab;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* View at the top of the screen that contains the tabs
|
||||
*/
|
||||
public class TabButtonView extends JPanel {
|
||||
@Getter
|
||||
private final List<TabButton> tabButtons;
|
||||
|
||||
public TabButtonView() {
|
||||
this(Collections.emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor with preset buttons
|
||||
* @param tabButtons already created buttons
|
||||
*/
|
||||
public TabButtonView(Collection<TabButton> tabButtons) {
|
||||
this.tabButtons = (List<TabButton>) tabButtons;
|
||||
|
||||
FlowLayout layoutStyle = new FlowLayout(FlowLayout.LEFT, 0, 0);
|
||||
|
||||
this.setLayout(layoutStyle);
|
||||
|
||||
}
|
||||
|
||||
public void addButton(TabButton tabButton) {
|
||||
this.tabButtons.add(tabButton);
|
||||
}
|
||||
|
||||
public TabButton getButton(int index) {
|
||||
return this.tabButtons.get(index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user