//------------------------------------------ public void Draw( CContextDessinObjetGraphique ctx, IElementDeSchemaReseau element, C2iObjetGraphique objetGraphique) { ApplyOnSymbole(element); if (m_symbole != null) { m_symbole.Transparency = 100; Matrix oldMat = ctx.Graphic.Transform; C2iLienDeSchemaReseau lien = objetGraphique as C2iLienDeSchemaReseau; if (lien != null) { //Se place au centre du lien Point pt = lien.GetPointCentral(); pt.Offset(-m_symbole.Width / 2, -m_symbole.Height / 2); ctx.Graphic.TranslateTransform(pt.X, pt.Y); } else { float fEchelleX = (float)objetGraphique.Size.Width / (float)m_symbole.Size.Width; float fEchelleY = (float)objetGraphique.Size.Height / (float)m_symbole.Size.Height; ctx.Graphic.InterpolationMode = InterpolationMode.HighQualityBilinear; ctx.Graphic.TranslateTransform(objetGraphique.Position.X, objetGraphique.Position.Y); ctx.Graphic.ScaleTransform(fEchelleX, fEchelleY); } m_symbole.Draw(ctx); ctx.Graphic.Transform = oldMat; } }
//---------------------------------------------------------- public override void RemoveChild(I2iObjetGraphique child) { C2iObjetGraphique objet = child as C2iObjetGraphique; if (objet != null && m_listeFils.Contains(objet)) { m_listeFils.Remove(objet); } }
//---------------------------------------------------------- public override void FrontToBack(I2iObjetGraphique child) { C2iObjetGraphique objet = child as C2iObjetGraphique; if (objet != null && ContainsChild(objet)) { m_listeFils.Remove(objet); m_listeFils.Add(objet); } }
//---------------------------------------------------------- public override void BringToFront(I2iObjetGraphique child) { C2iObjetGraphique objet = child as C2iObjetGraphique; if (objet != null && ContainsChild(objet)) { m_listeFils.Remove(objet); m_listeFils.Insert(0, objet); } }
//--------------------------------------------------------------------------- protected bool DessinSupplementaireItem(CContextDessinObjetGraphique ctx, C2iObjetGraphique objet) { CWorkflowEtapeDessin dessinEtape = objet as CWorkflowEtapeDessin; if (dessinEtape != null) { CTypeEtapeWorkflow typeEtape = dessinEtape.TypeEtape; if (typeEtape != null) { CEtapeWorkflow etape = WorkflowAffiche.GetEtapeForType(typeEtape); if (etape != null) { Brush br = null; switch ((EEtatEtapeWorkflow)etape.EtatCode) { case EEtatEtapeWorkflow.ADemarrer: br = new SolidBrush(Color.FromArgb(64, Color.Blue)); break; case EEtatEtapeWorkflow.Démarrée: br = new SolidBrush(Color.FromArgb(64, Color.Green)); break; case EEtatEtapeWorkflow.Erreur: br = new SolidBrush(Color.FromArgb(64, Color.Red)); break; case EEtatEtapeWorkflow.Terminée: br = new SolidBrush(Color.FromArgb(64, Color.Gray)); break; case EEtatEtapeWorkflow.Annulée: br = new SolidBrush(Color.FromArgb(64, Color.Orange)); break; default: break; } if (br != null) { Point[] pts = etape.TypeEtape.Bloc.GetPolygoneDessin(dessinEtape); ctx.Graphic.FillPolygon(br, pts); br.Dispose(); } } } } return(true); }
public bool DoDessinSupplementaireAfter(CContextDessinObjetGraphique ctx, C2iObjetGraphique objet) { C2iObjetDeSchema objetDeSchema = objet as C2iObjetDeSchema; if (objetDeSchema == null || objetDeSchema.ElementDeSchema == null) { return(true); } CInfoElementDeSchemaSupervise infoSupervision = null; if (!m_dicElementDeSchemaToInfoSupervision.TryGetValue(objetDeSchema.ElementDeSchema.Id, out infoSupervision)) { return(true); } infoSupervision.AfterDrawObjet(ctx, objetDeSchema); return(true); }
//---------------------------------------------------------- public override void DeleteChild(I2iObjetGraphique child) { C2iObjetGraphique objet = child as C2iObjetGraphique; if (objet != null && m_listeFils.Contains(objet)) { IWorflowDessin wkf = child as IWorflowDessin; if (wkf != null) { CResultAErreur result = wkf.Delete(); if (!result) { return; } } } base.DeleteChild(child); }
public bool DoDessinSupplementaireBefore(CContextDessinObjetGraphique ctx, C2iObjetGraphique objet) { C2iLienDeSchemaReseau dessinLien = objet as C2iLienDeSchemaReseau; if (dessinLien == null) //Optim : seuls les liens sont dessinés avant. Pour le moment, les autres non { return(true); } //Dessine sous les segments CInfoElementDeSchemaSupervise infoSupervision = null; if (!m_dicElementDeSchemaToInfoSupervision.TryGetValue(dessinLien.ElementDeSchema.Id, out infoSupervision)) { return(true); } infoSupervision.BeforeDrawObjet(ctx, dessinLien); return(true); }
public bool AfterDrawElement(CContextDessinObjetGraphique ctx, C2iObjetGraphique objetGraphique) { C2iObjetDeSchema objetDessine = objetGraphique as C2iObjetDeSchema; if (objetDessine == null || objetDessine.ElementDeSchema == null) { return(true); } IElementDeSchemaReseau elementDeSchema = objetDessine.ElementDeSchema.ElementAssocie; if (elementDeSchema == null) { return(true); } Type tp = elementDeSchema.GetType(); CParametreRepresentationSymbole parametre = this[tp]; if (parametre == null) { return(true); } parametre.Draw(ctx, elementDeSchema, objetGraphique); return(true); }