Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1b36eeb
toString method created for the abstract class OctetArray.java
LukasBauza Feb 10, 2025
c4bcf43
OctetArray.java created for the generalisation of the IPAddress.java …
LukasBauza Feb 13, 2025
81ff314
Removed the gui/ package, as no longer need to use other directories …
LukasBauza Feb 22, 2025
a935204
Re-added the gui/ package, as it will make it easier to organise and …
LukasBauza Feb 22, 2025
a40fe27
Basic JFrame.
LukasBauza Feb 22, 2025
4a10fda
Icons for PC and Router.
LukasBauza Feb 23, 2025
0a9a01b
Removal of gui package, and Frame class. Too complicated to deal with
LukasBauza Feb 23, 2025
db8e119
Simple buttons added, with two panels.
LukasBauza Feb 23, 2025
3ea8800
Branch created for setting up the new main menu.
LukasBauza Mar 10, 2025
b80c093
Custom/preconfigured network button options template.
LukasBauza Mar 10, 2025
33aeceb
Added label for the user, and changed the font settings.
LukasBauza Mar 10, 2025
bfdf094
Removed necessary methods from master branch.
LukasBauza Mar 10, 2025
ddd60d4
Window dynamically changes between custom network display, and prebui…
LukasBauza Mar 10, 2025
cd02a5b
Created PC and Router objects for buttons.
LukasBauza Mar 11, 2025
2d1af77
Typo
LukasBauza Mar 15, 2025
5eaa55b
Typo
LukasBauza Mar 16, 2025
ffec7ca
Able to keep track of the NIC connections more easily, and whether an…
LukasBauza Mar 16, 2025
2a8c72e
Made sure that only one instance of the NICManager is available withi…
LukasBauza Mar 16, 2025
328b084
Basic layout of devices for the prebuilt layout.
LukasBauza Mar 16, 2025
0670163
createdNICs was null, causing an error when trying to add a NIC to it.
LukasBauza Mar 16, 2025
327b450
Added comments.
LukasBauza Mar 16, 2025
92f08d6
Added comments.
LukasBauza Mar 16, 2025
6cbb061
Removed an old TODO
LukasBauza Mar 16, 2025
e905e6c
Generates a random MACAddress for the NIC, and make sure that there i…
LukasBauza Mar 16, 2025
34963f4
Updated use of NIC constructor.
LukasBauza Mar 16, 2025
bd2e354
Object for creating lines on the GUI, to be used for showing connecti…
LukasBauza Mar 16, 2025
c8a9188
Created the visual connections between the devices.
LukasBauza Mar 16, 2025
e0ee9ba
Removed old NICManager parameter from constructor.
LukasBauza Mar 17, 2025
fe371a4
Overloaded constructor for PC, with only the name required.
LukasBauza Mar 17, 2025
76acd2d
Removed NICManager from the Router constructor.
LukasBauza Mar 17, 2025
2ae0ddd
RouterButton for coupling the Router and JButton together.
LukasBauza Mar 17, 2025
9827844
PCButton for coupling the PC and JButton together.
LukasBauza Mar 17, 2025
6366d78
PCButton and RouterButton implemented, providing cohesion with the bu…
LukasBauza Mar 17, 2025
c7ba168
Merge pull request #25 from LukasBauza/main_menu
LukasBauza Mar 17, 2025
33d5d63
Created windows for the devices on the prebuilt network.
LukasBauza Mar 17, 2025
8c81d10
Created windows for the devices on the prebuilt network.
LukasBauza Mar 17, 2025
8f10fe3
Change display size for PC info.
LukasBauza Mar 17, 2025
db793ea
Able to return the whole ArrayList of NICs from the Router.
LukasBauza Mar 17, 2025
c121404
Router's have a window with their information displayed, although cha…
LukasBauza Mar 17, 2025
b339730
Router buttons now can now update the name only.
LukasBauza Mar 18, 2025
2feca7f
TODO removed
LukasBauza Mar 24, 2025
9b630ad
Abstracted the button methods from PCButton to DeviceInfoFrame and In…
LukasBauza Mar 24, 2025
41fc138
Device information is now in tabs.
LukasBauza Mar 24, 2025
46a2f70
PC buttons are now abstracted with their own PC information displayed.
LukasBauza Mar 24, 2025
e8c14ae
DeviceInfoFrame.java and DeviceButton.java renamed.
LukasBauza Mar 24, 2025
e575321
Created the JLabels for the ports, just need to display them.
LukasBauza Mar 30, 2025
b2b1b05
Can now set the IP and Subnet of a Router at the same time.
LukasBauza Mar 30, 2025
4329253
Port lables added to devices.
LukasBauza Mar 31, 2025
d907433
Actual connections setup between devices, not just visual connections.
LukasBauza Mar 31, 2025
a0cab72
Added OSPF information and fixed error checking for setting the subne…
LukasBauza Apr 6, 2025
07189e4
Typo
LukasBauza Apr 6, 2025
c6ede70
OSPF neighbours pane for routers
LukasBauza Apr 6, 2025
590c183
RID for routers.
LukasBauza Apr 6, 2025
a8a1dd2
RID for routers.
LukasBauza Apr 6, 2025
18e5d92
RID for routers.
LukasBauza Apr 6, 2025
e02695d
RID for routers and OSPF neighbour pane.
LukasBauza Apr 6, 2025
d06e356
OSPF ping animation with path setup.
LukasBauza Apr 28, 2025
1f4fc5f
Showing the cost of the paths to the user.
LukasBauza Apr 28, 2025
ebb84c9
Path changes now working, and changed the icons for the Routers and P…
LukasBauza Apr 28, 2025
a7c8900
Add images for the Routers and PC buttons.
LukasBauza Apr 28, 2025
3184a88
Show PC name on mouse hover.
LukasBauza Apr 28, 2025
fc5d156
Ping now goes back and forth 4 times, instead of just going once to t…
LukasBauza Apr 29, 2025
70b141b
Commented out
LukasBauza May 1, 2025
c81e5fb
Better animation
LukasBauza May 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added images/icons8-letter-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons8-letter-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons8-pc-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons8-router-symbol-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons8-router-symbol-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pc_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/router_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions network_protocol_simulation.iml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/src/test" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Expand All @@ -17,5 +19,31 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="JUnit5.8.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
3 changes: 1 addition & 2 deletions src/Device.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.util.ArrayList;

abstract public class Device {
// Abstract class for holding data memebers and methods that are common within the Router and PC child classes.
// Abstract class for holding data members and methods that are common within the Router and PC child classes.

private String name; // Name of the device
private ARPTable arpTable = new ARPTable(); // ARP table for the device.
Expand All @@ -23,5 +23,4 @@ public Device(String name) {
public void setNICList(ArrayList<NIC> nicList) { this.nicList = nicList; }

public ArrayList<NIC> getNICList() { return this.nicList; }

}
4 changes: 2 additions & 2 deletions src/IPAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ public boolean equals(Object object) {
if(object == null || this.getClass() != object.getClass()) return false;
// Cast the object to the SubnetMask object class.
IPAddress ipAddress = (IPAddress) object;
// Check if all of the subnet mask values match, if not then return false.
// Check if all the subnet mask values match, if not then return false.
if(this.ipAddress[0] != ipAddress.getIpAddress()[0]) return false;
if(this.ipAddress[1] != ipAddress.getIpAddress()[1]) return false;
if(this.ipAddress[2] != ipAddress.getIpAddress()[2]) return false;
if(this.ipAddress[3] != ipAddress.getIpAddress()[3]) return false;
// Once all conditions are met, then the objects equal.
return true;
}
}
}
57 changes: 57 additions & 0 deletions src/InfoField.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import javax.swing.*;
import java.awt.*;

public class InfoField extends JPanel {
private JLabel label;
private JTextField textField;

InfoField(String labelText, String textFieldText) {
super.setLayout(new GridLayout(1, 2));
super.setBorder(BorderFactory.createLineBorder(Color.lightGray));

this.label = new JLabel(labelText);
this.label.setHorizontalAlignment(SwingConstants.LEFT);
super.add(label);

this.textField = new JTextField(textFieldText);
super.add(textField);
}

InfoField(String labelTest) {
super.setLayout(new GridLayout(1, 2));
super.setBorder(BorderFactory.createLineBorder(Color.lightGray));

this.label = new JLabel(labelTest);
this.label.setHorizontalAlignment(SwingConstants.LEFT);
super.add(label);
}

public void setLabelText(String labelText) {
this.label.setText(labelText);
updateComponents();
}

public void setTextFieldText(String textFieldText) {
this.textField.setText(textFieldText);
updateComponents();
}

public void setEditable(boolean editable) {
this.textField.setEditable(editable);
}

public JLabel getLabel() {
return label;
}

public JTextField getTextField() {
return textField;
}

private void updateComponents() {
super.removeAll();
super.add(label);
super.add(textField);
}

}
23 changes: 23 additions & 0 deletions src/Line.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import javax.swing.*;
import java.awt.*;

public class Line extends JPanel {
private int x1, y1, x2, y2;
private Color color;

public Line(int x1, int y1, int x2, int y2, Color color) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.color = color;
}

// Method to draw the line
public void draw(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
g2D.setColor(color);
g2D.setStroke(new BasicStroke(5)); // Set line thickness
g2D.drawLine(x1, y1, x2, y2);
}
}
2 changes: 0 additions & 2 deletions src/MACAddress.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO: Need to add subnet for PC.

import java.util.Random;

public class MACAddress {
Expand Down
Loading