private void quadriller(Graphics2D g) { float dash[] = {2f, 0f, 2f}; BasicStroke pointilles = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1.0f, dash, 2f); g.setStroke(pointilles); for (int i = 1; i <= Parametres.NB_TRAVEES - 1; i++) { g.drawLine( Parametres.LARGEUR_TRAVEE * i, 0, Parametres.LARGEUR_TRAVEE * i, Parametres.NB_RANGEES * Parametres.HAUTEUR_RANGEE - 1); } for (int i = 1; i <= Parametres.NB_RANGEES - 1; i++) { g.drawLine( 0, Parametres.HAUTEUR_RANGEE * i, Parametres.NB_TRAVEES * Parametres.LARGEUR_TRAVEE - 1, Parametres.HAUTEUR_RANGEE * i); } }
private void tracerVisualisations(Graphics2D g) { float dash[] = {2f, 0f, 2f}; BasicStroke pointilles = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1.0f, dash, 2f); g.setStroke(pointilles); g.setColor(Color.red); for (PlanSalle.Poste poste : modele.listerPostes()) { int centreX = Parametres.centrePersonneX(poste.getPosition().getTravee(), poste.getOrientation()); int centreY = Parametres.centrePersonneY(poste.getPosition().getRangee(), poste.getOrientation()); for (PlanSalle.Poste posteVisible : poste.getPostesVisibles()) { int visibleX = Parametres.centrePositionX(posteVisible.getPosition().getTravee()); int visibleY = Parametres.centrePositionY(posteVisible.getPosition().getRangee()); g.drawLine(centreX, centreY, visibleX, visibleY); } } }