Class linkData

java.lang.Object
  |
  +--linkData

public class linkData
extends java.lang.Object

Details of all the links in the system and details of the link currently being adjusted.


Constructor Summary
linkData(javax.swing.JPanel panel)
          Constructor that takes a panel to be every link's parent.
 
Method Summary
 singleLink getLink(operator op, javax.swing.JLabel connection)
          Returns the link that terminates at the specified operator/connection.
 java.util.ArrayList getLinks()
          Returns an ArrayList containing all the links in the system.
 javax.swing.JPanel getPanel()
           
 boolean linkExists(operator op, javax.swing.JLabel connection)
          Returns true if there is a link in the system that terminates at the specified operator/connection.
 void loadLink(java.io.StreamTokenizer tokenizer, java.util.ArrayList names, java.util.ArrayList operators)
           
 void removeLink(operator toOp, javax.swing.JLabel toCon)
          Removes a link described by the terminating operator and connection.
 void removeLink(singleLink link)
          Removes a link both graphically from the UI and internally from the image routing between operators.
 java.lang.String saveLinks()
          Returns a String representing all the links in the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

linkData

public linkData(javax.swing.JPanel panel)
Constructor that takes a panel to be every link's parent.
Parameters:
panel - the parent panel of the links
Method Detail

getPanel

public javax.swing.JPanel getPanel()

saveLinks

public java.lang.String saveLinks()
Returns a String representing all the links in the system.
Returns:
String representing all the links

loadLink

public void loadLink(java.io.StreamTokenizer tokenizer,
                     java.util.ArrayList names,
                     java.util.ArrayList operators)
              throws java.io.IOException

removeLink

public void removeLink(operator toOp,
                       javax.swing.JLabel toCon)
Removes a link described by the terminating operator and connection.
Parameters:
toOp - the operator that the link terminates at
toCon - the connection (IN1 or IN2) that the link terminates at (this uniquely identifies the link to be removed as only one link can terminate at a connection)

removeLink

public void removeLink(singleLink link)
Removes a link both graphically from the UI and internally from the image routing between operators.
Parameters:
link - the link to be removed

getLink

public singleLink getLink(operator op,
                          javax.swing.JLabel connection)
Returns the link that terminates at the specified operator/connection.
Parameters:
op - the operator where the link terminates
connection - the connection where the link terminates
Returns:
the unique link terminating here (null if none)

getLinks

public java.util.ArrayList getLinks()
Returns an ArrayList containing all the links in the system.
Returns:
all the links

linkExists

public boolean linkExists(operator op,
                          javax.swing.JLabel connection)
Returns true if there is a link in the system that terminates at the specified operator/connection.
Parameters:
op - the operator being tested
connection - the connection being tested
Returns:
true if a link exists, false if not