things in the middle UIs i guess
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
package net.ayyalasomayajula.net;
|
||||
|
||||
|
||||
public class App
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class App
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(App.class);
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
logger.info("Logging is functional");
|
||||
ClientServerSelect lp = new ClientServerSelect();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="net.ayyalasomayajula.net.ClientServerSelect">
|
||||
<grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="300" width="500" height="120"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="32922" class="javax.swing.JButton" binding="serverButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Server"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="cbab1">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="bfbb0" class="javax.swing.JButton" binding="clientButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Client"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="b601d" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Client or Server?"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.ayyalasomayajula.net;
|
||||
|
||||
import net.ayyalasomayajula.net.client.ClientConnect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.LoggerFactoryFriend;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
|
||||
public class ClientServerSelect extends JFrame{
|
||||
private JButton serverButton;
|
||||
private JButton clientButton;
|
||||
private JPanel panel;
|
||||
private static final Logger logger = LoggerFactory.getLogger(ClientServerSelect.class);
|
||||
|
||||
public ClientServerSelect(){
|
||||
setContentPane(panel);
|
||||
setSize(1024,1024);
|
||||
setVisible(true);
|
||||
clientButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
logger.info("Client button triggered.");
|
||||
|
||||
|
||||
ClientConnect connector = new ClientConnect();
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
serverButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
logger.info("Server Button triggered");
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="net.ayyalasomayajula.net.client.ClientConnect">
|
||||
<grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="573" height="416"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none" title="ConnectionDetails"/>
|
||||
<children>
|
||||
<component id="c508d" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Connection DetIals and Creds"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="c6c7c">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="4" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="9832a" class="javax.swing.JTextField" binding="hostname">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="hostname"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="21011" class="javax.swing.JTextField" binding="authToken">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="password"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="2732b" class="javax.swing.JTextField" binding="portNumber">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="port"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f0abb" class="javax.swing.JButton" binding="goButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Go!"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.ayyalasomayajula.net.client;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
public class ClientConnect extends JFrame{
|
||||
private JPanel panel;
|
||||
private JTextField hostname;
|
||||
private JTextField portNumber;
|
||||
private JTextField authToken;
|
||||
private JButton goButton;
|
||||
private static final Logger logger = LoggerFactory.getLogger(ClientConnect.class);
|
||||
public ClientConnect(){
|
||||
setTitle("Client Connection Details");
|
||||
setContentPane(panel);
|
||||
setSize(1024,1024);
|
||||
setVisible(true);
|
||||
goButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
logger.info("Triggered a Connection request."
|
||||
});
|
||||
}
|
||||
}
|
||||
13
src/main/resources/logback.xml
Normal file
13
src/main/resources/logback.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<configuration>
|
||||
<!-- Console appender (log to console) -->
|
||||
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Root logger -->
|
||||
<root level="debug">
|
||||
<appender-ref ref="Console"/>
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user