/// <summary> /// Initialize a pen and a brush for drawing the constraint /// outlines and contents. /// </summary> /// <param name="classStyleSet">StyleSet</param> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); IORMFontAndColorService colorService = (Store as IORMToolServices).FontAndColorService; BrushSettings brushSettings = new BrushSettings(); brushSettings.Color = colorService.GetForeColor(ORMDesignerColor.Constraint); classStyleSet.AddBrush(CardinalityTextAlethicBrush, DiagramBrushes.ShapeBackground, brushSettings); brushSettings.Color = colorService.GetForeColor(ORMDesignerColor.DeonticConstraint); classStyleSet.AddBrush(CardinalityTextDeonticBrush, DiagramBrushes.ShapeBackground, brushSettings); }
/// <summary> /// Override the connection line pen with a dashed pen /// </summary> /// <param name="classStyleSet"></param> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); IORMFontAndColorService colorService = (this.Store as IORMToolServices).FontAndColorService; Color constraintColor = colorService.GetForeColor(ORMDesignerColor.Constraint); Color activeColor = colorService.GetBackColor(ORMDesignerColor.ActiveConstraint); PenSettings settings = new PenSettings(); settings.Color = constraintColor; settings.DashStyle = DashStyle.Dash; settings.Width = 1.0F / 72.0F; // 1 Point. 0 Means 1 pixel, but should only be used for non-printed items #if VISUALSTUDIO_10_0 classStyleSet.AddPen(CustomConnectionLinePen, DiagramPens.ConnectionLine, settings); #else classStyleSet.OverridePen(DiagramPens.ConnectionLine, settings); #endif settings.Color = activeColor; classStyleSet.AddPen(ORMDiagram.StickyBackgroundResource, DiagramPens.ConnectionLine, settings); settings = new PenSettings(); settings.Width = 1.0F / 72.0F; // Soften the arrow a bit settings.Color = constraintColor; classStyleSet.OverridePen(DiagramPens.ConnectionLineDecorator, settings); settings.Color = activeColor; classStyleSet.AddPen(ORMDiagram.StickyForegroundResource, DiagramPens.ConnectionLineDecorator, settings); BrushSettings brushSettings = new BrushSettings(); brushSettings.Color = constraintColor; classStyleSet.OverrideBrush(DiagramBrushes.ConnectionLineDecorator, brushSettings); brushSettings.Color = activeColor; classStyleSet.AddBrush(ORMDiagram.StickyForegroundResource, DiagramBrushes.ConnectionLineDecorator, brushSettings); }
/// <summary> /// Change the outline pen to a thin black line for all instances /// of this shape. /// </summary> /// <param name="classStyleSet">The style set to modify</param> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); IORMFontAndColorService colorService = (this.Store as IORMToolServices).FontAndColorService; Color lineColor = colorService.GetForeColor(ORMDesignerColor.Constraint); Color stickyColor = colorService.GetBackColor(ORMDesignerColor.ActiveConstraint); Color activeColor = colorService.GetBackColor(ORMDesignerColor.RolePicker); PenSettings penSettings = new PenSettings(); penSettings.Width = 1.8F / 72.0F; // 1.8 Point. 0 Means 1 pixel, but should only be used for non-printed items penSettings.Alignment = PenAlignment.Center; penSettings.Color = lineColor; classStyleSet.OverridePen(DiagramPens.ConnectionLine, penSettings); //Supporting Dashed subtypefacts when not primary penSettings.DashStyle = DashStyle.Dash; classStyleSet.AddPen(NonPrimaryNormalResource, DiagramPens.ConnectionLine, penSettings); penSettings.DashStyle = DashStyle.Solid; penSettings.Color = stickyColor; classStyleSet.AddPen(ORMDiagram.StickyBackgroundResource, DiagramPens.ConnectionLine, penSettings); penSettings.DashStyle = DashStyle.Dash; classStyleSet.AddPen(NonPrimaryStickyResource, DiagramPens.ConnectionLine, penSettings); penSettings.DashStyle = DashStyle.Solid; penSettings.Color = activeColor; classStyleSet.AddPen(ORMDiagram.ActiveBackgroundResource, DiagramPens.ConnectionLine, penSettings); penSettings.DashStyle = DashStyle.Dash; classStyleSet.AddPen(NonPrimaryActiveResource, DiagramPens.ConnectionLine, penSettings); penSettings.DashStyle = DashStyle.Solid; penSettings = new PenSettings(); penSettings.Width = 1.4F / 72.0F; // Soften the arrow a bit penSettings.Color = lineColor; classStyleSet.OverridePen(DiagramPens.ConnectionLineDecorator, penSettings); penSettings.Color = stickyColor; classStyleSet.AddPen(ORMDiagram.StickyConnectionLineDecoratorResource, DiagramPens.ConnectionLineDecorator, penSettings); penSettings.Color = activeColor; classStyleSet.AddPen(ORMDiagram.ActiveConnectionLineDecoratorResource, DiagramPens.ConnectionLineDecorator, penSettings); BrushSettings brushSettings = new BrushSettings(); brushSettings.Color = lineColor; classStyleSet.OverrideBrush(DiagramBrushes.ConnectionLineDecorator, brushSettings); brushSettings.Color = stickyColor; classStyleSet.AddBrush(ORMDiagram.StickyConnectionLineDecoratorResource, DiagramBrushes.ConnectionLineDecorator, brushSettings); brushSettings.Color = activeColor; classStyleSet.AddBrush(ORMDiagram.ActiveConnectionLineDecoratorResource, DiagramBrushes.ConnectionLineDecorator, brushSettings); }
protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); classStyleSet.AddBrush(m_backgroundBrushId, m_backgroundBrushId, new BrushSettings() { Color = Color.PeachPuff }); }
/// <summary> /// Sets up the Brush to be used to draw the object and adds it to the StyleSet /// </summary> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); IORMFontAndColorService colorService = (Store as IORMToolServices).FontAndColorService; BrushSettings brushSettings = new BrushSettings(); brushSettings.Color = colorService.GetForeColor(ORMDesignerColor.RoleName); classStyleSet.AddBrush(RoleNameTextBrush, DiagramBrushes.ShapeBackground, brushSettings); }
/// <summary> /// Initializes style set resources for this shape type /// </summary> /// <param name="classStyleSet">The style set for this shape class</param> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); BrushSettings backgroundBrush = new BrushSettings(); backgroundBrush.Color = Color.White; classStyleSet.AddBrush(InnerAreaField.Background, DiagramBrushes.ShapeBackground, backgroundBrush); }
/// <summary> /// Add error brushes to the styleSet /// </summary> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); IORMFontAndColorService colorService = (Store as IORMToolServices).FontAndColorService; BrushSettings brushSettings = new BrushSettings(); //UNDONE: This color isn't permanent. probably want a better color for the errors. brushSettings.ForeColor = Color.LightPink; //brushSettings.ForeColor = colorService.GetForeColor(ORMDesignerColor.ConstraintError); brushSettings.HatchStyle = HatchStyle.LightDownwardDiagonal; brushSettings.BrushType = typeof(HatchBrush); classStyleSet.AddBrush(ORMDiagram.ErrorBackgroundResource, DiagramBrushes.DiagramBackground, brushSettings); brushSettings.ForeColor = ORMDiagram.ModifyLuminosity(brushSettings.ForeColor); brushSettings.BackColor = ORMDiagram.ModifyLuminosity(((SolidBrush)classStyleSet.GetBrush(DiagramBrushes.DiagramBackground)).Color); classStyleSet.AddBrush(ORMDiagram.HighlightedErrorBackgroundResource, DiagramBrushes.DiagramBackground, brushSettings); BrushSettings transBrush = new BrushSettings(); transBrush.ForeColor = Color.Transparent; classStyleSet.AddBrush(ORMDiagram.TransparentBrushResource, DiagramBrushes.DiagramBackground, transBrush); }
/// <summary> /// Initialize a pen and a brush for drawing the constraint /// outlines and contents. /// </summary> /// <param name="classStyleSet">StyleSet</param> protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); PenSettings penSettings = new PenSettings(); IORMFontAndColorService colorService = (Store as IORMToolServices).FontAndColorService; Color constraintColor = colorService.GetForeColor(ORMDesignerColor.Constraint); penSettings.Color = constraintColor; penSettings.Width = 1.35F / 72.0F; // 1.35 Point. classStyleSet.OverridePen(DiagramPens.ShapeOutline, penSettings); BrushSettings brushSettings = new BrushSettings(); brushSettings.Color = constraintColor; classStyleSet.AddBrush(ExternalConstraintBrush, DiagramBrushes.ShapeBackground, brushSettings); penSettings.Color = colorService.GetBackColor(ORMDesignerColor.ActiveConstraint); classStyleSet.AddPen(ORMDiagram.StickyBackgroundResource, DiagramPens.ShapeOutline, penSettings); }
protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); classStyleSet.AddBrush(m_brushId, m_brushId, new BrushSettings() { Color = Color.PapayaWhip }); FontSettings fontSettings = new FontSettings(); fontSettings.Style = System.Drawing.FontStyle.Bold; fontSettings.Size = 8 / 72.0F; classStyleSet.AddFont(m_FontId, DiagramFonts.ShapeText, fontSettings); // set text color for fields BrushSettings textBrush = new BrushSettings(); textBrush.Color = Color.FromKnownColor(KnownColor.Maroon); classStyleSet.OverrideBrush(DiagramBrushes.ShapeText, textBrush); classStyleSet.OverrideBrush(DiagramBrushes.ShapeTextSelected, textBrush); }
protected override void InitializeResources(StyleSet classStyleSet) { base.InitializeResources(classStyleSet); classStyleSet.AddBrush(m_headFootBrushId, m_headFootBrushId, new BrushSettings() { Color = Color.Azure }); FontSettings fontSettings = new FontSettings(); fontSettings.Style = System.Drawing.FontStyle.Bold; fontSettings.Size = 8 / 72.0F; classStyleSet.AddFont(m_FontId, DiagramFonts.ShapeText, fontSettings); // set text color for fields BrushSettings textBrush = new BrushSettings(); textBrush.Color = Color.FromKnownColor(KnownColor.Maroon); classStyleSet.OverrideBrush(DiagramBrushes.ShapeText, textBrush); classStyleSet.OverrideBrush(DiagramBrushes.ShapeTextSelected, textBrush); VDHTMLTagShape.AssociateValueWith(this.Store, VDHTMLTag.TagNameDomainPropertyId); VDHTMLTagShape.AssociateValueWith(this.Store, VDHTMLTag.TagTextDomainPropertyId); }