|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.arlott.simon.hw.f24.lbsta.NetworkDraw
public class NetworkDraw
Draws the network.
| Field Summary | |
|---|---|
private static java.awt.Font |
bridgeFont
The bridge font size. |
private static java.awt.Font |
bridgePortFont
the bridge port font size. |
private static java.awt.Font |
normalHostFont
The normal host font size. |
private static boolean |
setFonts
true if font sizes have been set already. |
private static java.awt.Font |
smallHostFont
The small host font size. |
| Constructor Summary | |
|---|---|
NetworkDraw()
|
|
| Method Summary | |
|---|---|
static void |
makeFonts(java.awt.Graphics g)
Sets up the fonts. |
static void |
paintBridges(java.awt.Graphics g,
java.util.Vector<Bridge> bridges,
boolean editMode,
boolean viewMode,
java.lang.Object hover,
java.lang.Object selected)
Draw bridges. |
static void |
paintHosts(java.awt.Graphics g,
java.util.Vector<Host> hosts,
java.lang.Object hover,
java.lang.Object selected)
Draw hosts. |
static void |
paintLANs(java.awt.Graphics g,
java.util.Vector<LAN> lans)
Draw LANs. |
static void |
paintNetwork(java.awt.Graphics g,
Network network,
boolean editMode,
boolean viewMode,
java.lang.Object hover,
java.lang.Object selected)
Draws the network. |
static void |
paintNewBridge(java.awt.Graphics g,
java.awt.Point p)
Draws a bridge being placed. |
static void |
paintNewHost(java.awt.Graphics g,
java.awt.Point p1,
java.awt.Point p2)
Draws a host being placed. |
static void |
paintNewLAN(java.awt.Graphics g,
java.awt.Point p1,
java.awt.Point p2)
Draws a LAN being placed. |
static void |
paintPackets(java.awt.Graphics g,
java.util.Vector<Packet> packets)
Draw packets. |
private static void |
setBridgePortColour(java.awt.Graphics g,
boolean viewMode,
BridgePort b)
Select the appropriate bridge port colour based on its state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static boolean setFonts
true if font sizes have been set already.
private static java.awt.Font smallHostFont
private static java.awt.Font normalHostFont
private static java.awt.Font bridgeFont
private static java.awt.Font bridgePortFont
| Constructor Detail |
|---|
public NetworkDraw()
| Method Detail |
|---|
public static void makeFonts(java.awt.Graphics g)
g - A Graphics object fonts will be drawn on.
public static void paintNetwork(java.awt.Graphics g,
Network network,
boolean editMode,
boolean viewMode,
java.lang.Object hover,
java.lang.Object selected)
g - The Graphics object to draw on.network - The Network to true.editMode - Whether or not the application is in edit mode.viewMode - Whether or not the application is in view mode.hover - The current object being hovered over.selected - The currently selected object.
public static void paintNewLAN(java.awt.Graphics g,
java.awt.Point p1,
java.awt.Point p2)
g - The Graphics object to draw on.p1 - Start position.p2 - End position.
public static void paintNewHost(java.awt.Graphics g,
java.awt.Point p1,
java.awt.Point p2)
g - The Graphics object to draw on.p1 - Start position.p2 - End position.
public static void paintNewBridge(java.awt.Graphics g,
java.awt.Point p)
g - The Graphics object to draw on.p - Position.
public static void paintLANs(java.awt.Graphics g,
java.util.Vector<LAN> lans)
g - The Graphics object to draw on.lans - The LANs to draw.
public static void paintHosts(java.awt.Graphics g,
java.util.Vector<Host> hosts,
java.lang.Object hover,
java.lang.Object selected)
g - The Graphics object to draw on.hosts - The Hosts to draw.hover - The current hover object.selected - The currently selected object.
public static void paintBridges(java.awt.Graphics g,
java.util.Vector<Bridge> bridges,
boolean editMode,
boolean viewMode,
java.lang.Object hover,
java.lang.Object selected)
g - The Graphics object to draw on.bridges - The Bridges to draw.editMode - Whether or not the application is in edit mode.viewMode - Whether or not the application is in view mode.hover - The current hover object.selected - The currently selected object.
private static void setBridgePortColour(java.awt.Graphics g,
boolean viewMode,
BridgePort b)
g - The Graphics object to draw on.viewMode - Whether or not the application is in view mode.b - The BridgePort to choose the colour for.
public static void paintPackets(java.awt.Graphics g,
java.util.Vector<Packet> packets)
g - The Graphics object to draw on.packets - The Packets to draw.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||