public void setNetwork(HaplotypeNetwork hapNet) {
		this.hapNet = hapNet;
		maxCardinality = 0;
		maxDist = 0;
		
		//Go through all haplotypes and create haplotypeElements for each one
		ArrayList<NetworkNode> haps = hapNet.getAllNodes();
		for(NetworkNode node : haps) {
			Haplotype hap = (Haplotype)node;
			if (hap.getCardinality()>maxCardinality)
				maxCardinality = hap.getCardinality();
			HaplotypeElement hapEl = new HaplotypeElement(this, hap);
			hapEl.setScale(1.0, 1.0, null); //We need some sort of values for xFactor and yFactor to calculate node positions, since they depend on marker size
			super.addElement(hapEl);
			hapElements.add(hapEl);
			hapEl.setCanConfigure(true);
		}
		
		//Go through all possible pairs of haplotypes and, if any two are connected, create a new
		//edge element that draws the connection
		for(int i=0; i<hapElements.size(); i++) {
			for(int j=i+1; j<hapElements.size(); j++) {
				if (areConnected(hapElements.get(i), hapElements.get(j))) {
					double dist = hapNet.getEdgeForPair(hapElements.get(i).getHap(), hapElements.get(j).getHap()).getWeight();
					HapEdgeElement edgeEl = new HapEdgeElement(this, hapElements.get(i), hapElements.get(j), (int)dist );
					if (maxDist < dist) {
						maxDist = dist;
					}
					edgeElements.add(edgeEl);
					edgeEl.setZPosition(-5); //paint these underneath
					super.addElement(edgeEl);
				}
			}
		}	
		
		//We need to make an educated guess regarding the appropriate scaling for marker sizes
		// vs. edge lengths. The following value multiplies all edge lengths during node
		//layout, so it makes things leggier and nodes smaller. 
		//If edge lengths and haplotype cardinalities are comparable, then this number should be about
		//one. If cardinalities are big and edge lengths short (low theta-scenario), then this number should
		//be about ten
		defaultEdgeLengthPerRadius =  2*maxCardinality / maxDist; //This should be small if edge lengths are very long
		adjustedEdgeLengthPerRadius = defaultEdgeLengthPerRadius * edgeLengthMultiplier;
		
		arranger.setEdgeLengthPerRadius(adjustedEdgeLengthPerRadius);
	
		for(HaplotypeElement hapEl : hapElements) {
			hapEl.setRadius( Math.sqrt((double)hapEl.getHap().getCardinality()));
			hapEl.setBaseRadius( Math.sqrt((double)hapEl.getHap().getCardinality()));
		}
		
		//The NodeArranger requires that nodes are in a list of type Node2D...
		List<Node2D> nodes = new ArrayList<Node2D>(hapElements.size());
		nodes.addAll(hapElements);
		nodeNetwork = new NodeCollection2D(nodes);
		
		setMarkerColor(initMarkerColor);
		//setMarkerSizeFactor(initMarkerSize); //This calls arrange and rescale(), so we don't need to do it again
		
		recentered = false;
	}