void update2(Graphics g) {

		if (repaintBlocked) {
			paintPleaseWait(g);
			return;
		}

		super.update2(g);

		Graphics2D g2 = (Graphics2D) g;

		savedAT = g2.getTransform();
		if (selectedComponent instanceof GayBerneParticle) {
			int k = ((GayBerneParticle) selectedComponent).getIndex();
			for (int i = 0; i < k; i++)
				renderParticle(gb[i], g2);
			for (int i = k + 1; i < nParticle; i++)
				renderParticle(gb[i], g2);
			renderParticle(gb[k], g2);
		} else {
			for (int i = 0; i < nParticle; i++)
				renderParticle(gb[i], g2);
		}

		for (int i = 0; i < nParticle; i++) {
			gb[i].renderMeasurements(g2);
			gb[i].renderMeanPosition(g2);
			gb[i].renderMeanForce(g2);
		}

		if (showAngularMomenta) {
			g2.setStroke(ViewAttribute.THIN);
			g2.setColor(Color.green);
			g2.fillRoundRect(10, 10, 20, 10, 5, 5);
			g2.setColor(Color.red);
			g2.fillRoundRect(10, 30, 20, 10, 5, 5);
			g2.setColor(contrastBackground());
			g2.drawRoundRect(10, 10, 20, 10, 5, 5);
			g2.drawRoundRect(10, 30, 20, 10, 5, 5);
			g2.setFont(ViewAttribute.SMALL_FONT);
			g2.drawString("Anti-Clockwise", 35, 20);
			g2.drawString("Clockwise", 35, 40);
		}

		paintSteering(g2);

		if (actionID == DELE_ID || actionID == MARK_ID || actionID == COUN_ID) {
			g2.setStroke(ViewAttribute.THIN);
			g2.setColor(contrastBackground());
			g2.draw(selectedArea);
		}

		if (getEnergizer())
			energizer.paint(g2);

		if (model.heatBathActivated() && showHeatBath) {
			g2.setFont(ViewAttribute.SMALL_FONT);
			g2.setColor(contrastBackground());
			IconPool.getIcon("heat bath").paintIcon(this, g2, 8, 8);
		}

		if (actionID == CPOS_ID || actionID == CNEG_ID) {
			if (selectedComponent instanceof GayBerneParticle) {
				GayBerneParticle p = (GayBerneParticle) selectedComponent;
				String str = p.getCharge() + "";
				int sw = g2.getFontMetrics().stringWidth(str) + 8;
				int sh = g2.getFontMetrics().getHeight() + 6;
				g2.setStroke(ViewAttribute.THIN);
				g2.setColor(SystemColor.info);
				g2.fillRect((int) p.getRx(), (int) p.getRy() - sh, sw, sh);
				g2.setColor(contrastBackground());
				g2.drawRect((int) p.getRx(), (int) p.getRy() - sh, sw, sh);
				g2.setColor(Color.black);
				g2.drawString(str, (int) p.getRx() + 4, (int) p.getRy() - sh / 2 + 4);
			}
		} else if (actionID == IPOL_ID || actionID == DPOL_ID) {
			if (selectedComponent instanceof GayBerneParticle) {
				GayBerneParticle p = (GayBerneParticle) selectedComponent;
				String str = p.getDipoleMoment() + "";
				int sw = g2.getFontMetrics().stringWidth(str) + 8;
				int sh = g2.getFontMetrics().getHeight() + 6;
				g2.setStroke(ViewAttribute.THIN);
				g2.setColor(SystemColor.info);
				g2.fillRect((int) p.getRx(), (int) p.getRy() - sh, sw, sh);
				g2.setColor(contrastBackground());
				g2.drawRect((int) p.getRx(), (int) p.getRy() - sh, sw, sh);
				g.setColor(Color.black);
				g.drawString(str, (int) p.getRx() + 4, (int) p.getRy() - sh / 2 + 4);
			}
		} else if (actionID == IRES_ID || actionID == DRES_ID) {
			if (selectedComponent instanceof GayBerneParticle) {
				GayBerneParticle p = (GayBerneParticle) selectedComponent;
				if (p.getRestraint() != null) {
					g.setColor(contrastBackground());
					g.drawString(p.getRestraint().toString(), (int) p.getRx(), (int) p.getRy());
				}
			}
		} else if (actionID == IDMP_ID || actionID == DDMP_ID) {
			if (selectedComponent instanceof GayBerneParticle) {
				GayBerneParticle p = (GayBerneParticle) selectedComponent;
				g.setColor(contrastBackground());
				g.drawString(p.getFriction() + "", (int) p.getRx(), (int) p.getRy());
			}
		} else if (actionID == ADGB_ID) {
			if (addGBIndicator.x >= 0 && addGBIndicator.y >= 0 && addGBIndicator.x + addGBIndicator.width <= boundary.getWidth() && addGBIndicator.y + addGBIndicator.height <= boundary.getHeight()) {
				AffineTransform savedAT = g2.getTransform();
				AffineTransform at = new AffineTransform();
				at.setToRotation(GayBerneConfigure.theta, addGBIndicator.x + 0.5f * addGBIndicator.width, addGBIndicator.y + 0.5f * addGBIndicator.height);
				g2.transform(at);
				g2.setStroke(ViewAttribute.THIN_DASHED);
				g2.setColor(contrastBackground());
				g2.draw(addGBIndicator);
				g2.setTransform(savedAT);
			}
		} else if (actionID == HEAT_ID) {
			g2.setStroke(ViewAttribute.THIN);
			pointHeater.paint(g2, true);
		} else if (actionID == COOL_ID) {
			g2.setStroke(ViewAttribute.THIN);
			pointHeater.paint(g2, false);
		}

		g2.setStroke(ViewAttribute.THIN);
		if (getClockPainted())
			paintInfo(g);
		paintLayeredComponents(g, Layered.IN_FRONT_OF_PARTICLES);
		paintShapeDrawing(g);

	}