|
|||||||||
| 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.NetworkEdit
public class NetworkEdit
Network editing mode.
| Field Summary | |
|---|---|
private LAN |
from
LAN when placing a Host. |
private java.awt.Point |
lastPos
Placement last position. |
private boolean |
lastTest
Last add test result. |
private MainWindow |
mainWindow
The MainWindow. |
static int |
MODIFY_OBJECT
Modifying object state. |
private boolean |
mouseDown
Mouse up/down state. |
private int |
mouseOrtho
Host horizontal/vertical type. |
private java.awt.Point |
mousePos
Placement current position. |
private java.awt.Point |
mouseStart
Placement start position. |
private java.lang.Object |
moved
Component being moved. |
private java.util.HashSet<Host> |
movedHosts
Hosts being moved with a LAN. |
private LAN |
moveLAN
Original LAN when moving a Host. |
private java.awt.Point |
movePos
Movement current position. |
private java.awt.Point |
moveStart
Movement start position. |
private boolean |
moving
Moving status. |
private Network |
network
The Network. |
static int |
NONE
"NONE" |
static int |
ORTHO_HORIZ
Horizontal Host. |
static int |
ORTHO_VERTI
Vertical Host. |
static int |
PLACING_BRIDGE
Placing Bridge state. |
static int |
PLACING_HOST
Placing Host state. |
static int |
PLACING_LAN
Placing LAN state. |
private int |
state
Current state. |
private boolean |
validMove
Valid move flag. |
| Fields inherited from interface uk.org.arlott.simon.hw.f24.lbsta.CommonInterface |
|---|
MOUSE_PRIMARY, MOUSE_SECONDARY |
| Constructor Summary | |
|---|---|
NetworkEdit(Network network,
MainWindow mainWindow)
Creates a new NetworkEdit object. |
|
| Method Summary | |
|---|---|
private void |
abort(boolean all)
Aborts the current operation. |
private void |
finishMove(boolean abort)
Finish moving components. |
private static java.awt.Point |
getOrthoLine(java.awt.Point start,
java.awt.Point finish)
Gets an orthognonal line for two positions. |
int |
getState()
Gets the current state. |
void |
hide()
Switches from this mode. |
boolean |
keyPressed(int keyCode)
Handles keyboard input. |
boolean |
mouseClick(int button,
java.lang.Object hover)
Handles mouse clicks. |
boolean |
mouseMoved(java.awt.Point position,
java.lang.Object hover)
Handles mouse movement. |
void |
paint(java.awt.Graphics g,
java.awt.Dimension size)
Draws additional information on the network. |
void |
setState(int state)
Sets the current state and updates the status text. |
void |
show()
Switches to this mode. |
void |
stateChanged(javax.swing.event.ChangeEvent ce)
Handles the setting of component being edited changing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int MODIFY_OBJECT
public static final int PLACING_LAN
public static final int PLACING_HOST
public static final int PLACING_BRIDGE
public static final int ORTHO_HORIZ
public static final int ORTHO_VERTI
private Network network
Network.
private MainWindow mainWindow
MainWindow.
private boolean mouseDown
private java.awt.Point mouseStart
private java.awt.Point mousePos
private java.awt.Point lastPos
private boolean lastTest
private int mouseOrtho
private int state
private LAN from
private boolean moving
private java.awt.Point moveStart
private java.awt.Point movePos
private LAN moveLAN
private boolean validMove
private java.lang.Object moved
private java.util.HashSet<Host> movedHosts
| Constructor Detail |
|---|
public NetworkEdit(Network network,
MainWindow mainWindow)
NetworkEdit object.
network - The Network.mainWindow - The MainWindow.| Method Detail |
|---|
public void show()
show in interface CommonInterfacepublic void hide()
hide in interface CommonInterfacepublic void stateChanged(javax.swing.event.ChangeEvent ce)
stateChanged in interface javax.swing.event.ChangeListenerce - Ignored.
public boolean mouseClick(int button,
java.lang.Object hover)
mouseClick in interface CommonInterfacebutton - The mouse button used.hover - The network component that the mouse pointer is over.
true if the network should be redrawn.
public boolean mouseMoved(java.awt.Point position,
java.lang.Object hover)
mouseMoved in interface CommonInterfaceposition - The mouse position.hover - The network component that the mouse pointer is over.
true if the network should be redrawn.public boolean keyPressed(int keyCode)
keyPressed in interface CommonInterfacekeyCode - The key pressed.
true if the network should be redrawn.private void abort(boolean all)
all - true to completely abort including removing the side panel.private void finishMove(boolean abort)
abort - true to abort the move and return the components to their original positions.public int getState()
public void setState(int state)
state - The new state of this mode.
public void paint(java.awt.Graphics g,
java.awt.Dimension size)
paint in interface CommonInterfaceg - The Graphics object to draw on.size - The size of the area available.
private static java.awt.Point getOrthoLine(java.awt.Point start,
java.awt.Point finish)
start - The start point.finish - The finish point.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||