public boolean isPortConnected(int index) {
   Circuit circ = context.getCircuit();
   Location loc = comp.getEnd(index).getLocation();
   return circ.isConnected(loc, comp);
 }
 public Circuit getCircuit() {
   return context.getCircuit();
 }