Beispiel #1
0
        public LabelStyle(StyleFont font,
						  StyleBrush foreground,
						  StyleBrush background,
						  Point2D offset,
						  Size2D collisionBuffer,
						  HorizontalAlignment horizontalAlignment,
						  VerticalAlignment verticalAlignment)
            : base(font, foreground, background, offset, collisionBuffer, horizontalAlignment, verticalAlignment)
        {}
Beispiel #2
0
 public LabelStyle(StyleFont font, StyleBrush foreground)
     : this(font,
            foreground,
            new SolidStyleBrush(StyleColor.Transparent),
            Point2D.Empty,
            Size2D.Empty,
            HorizontalAlignment.Left,
            VerticalAlignment.Middle)
 {
 }
Beispiel #3
0
 public LabelStyle(StyleFont font,
                   StyleBrush foreground,
                   StyleBrush background,
                   Point2D offset,
                   Size2D collisionBuffer,
                   HorizontalAlignment horizontalAlignment,
                   VerticalAlignment verticalAlignment)
 {
     _font                = font;
     _foreground          = foreground;
     _background          = background;
     _collisionBuffer     = collisionBuffer;
     _offset              = offset;
     _horizontalAlignment = horizontalAlignment;
     _verticalAlignment   = verticalAlignment;
 }
Beispiel #4
0
 /// <summary>
 /// Creates a new pen with the given <see cref="StyleBrush"/>
 /// and <paramref name="width"/>.
 /// </summary>
 /// <param name="backgroundBrush">
 /// The StyleBrush which describes the color of the line.
 /// </param>
 /// <param name="width">The width of the line.</param>
 public StylePen(StyleBrush backgroundBrush, Double width)
 {
     _backgroundBrush = backgroundBrush;
     _width           = width;
 }
Beispiel #5
0
 public LabelStyle(StyleFont font, StyleBrush foreground) : base(font, foreground)
 {}
Beispiel #6
0
		/// <summary>
		/// Creates a new pen with the given <see cref="StyleBrush"/>
		/// and <paramref name="width"/>.
		/// </summary>
		/// <param name="backgroundBrush">
		/// The StyleBrush which describes the color of the line.
		/// </param>
		/// <param name="width">The width of the line.</param>
        public StylePen(StyleBrush backgroundBrush, double width)
        {
            _backgroundBrush = backgroundBrush;
            _width = width;
		}
 private StyleBrush interpolateBrush(StyleBrush min, StyleBrush max, Double attr)
 {
     return new SolidStyleBrush(StyleColor.Interpolate(min.Color, max.Color, fraction(attr)));
 }
Beispiel #8
0
		private string printBrushes(StyleBrush[] brushes)
        {
            if (brushes == null || brushes.Length == 0)
                return String.Empty;

            StringBuilder buffer = new StringBuilder();

            foreach (StyleBrush brush in brushes)
            {
                buffer.Append(brush.ToString());
                buffer.Append(", ");
            }

            buffer.Length -= 2;
            return buffer.ToString();
        }
        /// <summary>
        /// Creates a new GdiRenderObject instance.
        /// </summary>
        /// <param name="text">The text to draw.</param>
        /// <param name="font">The font to use to render the text.</param>
        /// <param name="bounds">The location and size to draw the text.</param>
        /// <param name="fill">
        /// The brush used to fill the path when the state is <see cref="RenderState.Normal"/>.
        /// </param>
        /// <param name="highlightFill">
        /// The brush used to fill the path when the state is <see cref="RenderState.Highlighted"/>.
        /// </param>
        /// <param name="selectFill">
        /// The brush used to fill the path when the state is <see cref="RenderState.Selected"/>.
        /// </param>
        /// <param name="outline">
        /// The pen used to outline the path when the state is <see cref="RenderState.Normal"/>.
        /// </param>
        /// <param name="highlightOutline">
        /// The pen used to outline the path when the state is <see cref="RenderState.Highlighted"/>.
        /// </param>
        /// <param name="selectOutline">
        /// The pen used to outline the path when the state is <see cref="RenderState.Selected"/>.
        /// </param>
        public CairoRenderObject(String text, FontFace font, Rectangle bounds,
                                 StyleBrush fill, StyleBrush highlightFill, StyleBrush selectFill,
                                 StylePen outline, StylePen highlightOutline, StylePen selectOutline)
        {
            _state = RenderState.Normal;
            Path = null;

            Image = null;
            Bounds = new Rectangle();
            AffineTransform = null;
            ColorTransform = null;

            Text = text;
            Font = font;
            Bounds = bounds;
            Fill = fill;
            HighlightFill = highlightFill;
            SelectFill = selectFill;
            Outline = outline;
            HighlightOutline = highlightOutline;
            SelectOutline = selectOutline;
            Line = null;
            HighlightLine = null;
            SelectLine = null;
        }
        /// <summary>
        /// Creates a new GdiRenderObject instance.
        /// </summary>
        /// <param name="image">The symbol to draw.</param>
        /// <param name="imageBounds">The location and size to draw the symbol.</param>
        /// <param name="transform">The affine transform applied to the symbol before drawing.</param>
        /// <param name="colorTransform">The color transform applied to the symbol before drawing.</param>
        public CairoRenderObject(Surface image, Rectangle imageBounds, CairoMatrix transform, CairoMatrix colorTransform)
        {
            _state = RenderState.Normal;
            Image = image;
            Bounds = imageBounds;
            AffineTransform = transform;
            ColorTransform = colorTransform;

            Path = null;
            Fill = null;
            HighlightFill = null;
            SelectFill = null;
            Line = null;
            HighlightLine = null;
            SelectLine = null;
            Outline = null;
            HighlightOutline = null;
            SelectOutline = null;

            Text = null;
            Font = null;
        }
        /// <summary>
        /// Creates a new CairoRenderObject instance.
        /// </summary>
        /// <param name="path">The path to draw.</param>
        /// <param name="fill">
        /// The brush used to fill the path when the state is <see cref="RenderState.Normal"/>.
        /// </param>
        /// <param name="highlightFill">
        /// The brush used to fill the path when the state is <see cref="RenderState.Highlighted"/>.
        /// </param>
        /// <param name="selectFill">
        /// The brush used to fill the path when the state is <see cref="RenderState.Selected"/>.
        /// </param>
        /// <param name="line">
        /// The pen used to draw a line when the state is <see cref="RenderState.Normal"/>.
        /// </param>
        /// <param name="highlightLine">
        /// The pen used to draw a line when the state is <see cref="RenderState.Highlighted"/>.
        /// </param>
        /// <param name="selectLine">
        /// The pen used to draw a line when the state is <see cref="RenderState.Selected"/>.
        /// </param>
        /// <param name="outline">
        /// The pen used to outline the path when the state is <see cref="RenderState.Normal"/>.
        /// </param>
        /// <param name="highlightOutline">
        /// The pen used to outline the path when the state is <see cref="RenderState.Highlighted"/>.
        /// </param>
        /// <param name="selectOutline">
        /// The pen used to outline the path when the state is <see cref="RenderState.Selected"/>.
        /// </param>
        public CairoRenderObject(Path2D path, StyleBrush fill, StyleBrush highlightFill, StyleBrush selectFill,
                                 StylePen line, StylePen highlightLine, StylePen selectLine,
                                 StylePen outline, StylePen highlightOutline, StylePen selectOutline)
        {
            _state = RenderState.Normal;
            Path = path;
            Fill = fill;
            HighlightFill = highlightFill;
            SelectFill = selectFill;
            Line = line;
            HighlightLine = highlightLine;
            SelectLine = selectLine;
            Outline = outline;
            HighlightOutline = highlightOutline;
            SelectOutline = selectOutline;

            Image = null;
            Bounds = new Rectangle();
            AffineTransform = new CairoMatrix();
            ColorTransform = null;

            Text = null;
            Font = null;
        }
Beispiel #12
0
        private static Int32 getStyleBrushesArrayHashCode(StyleBrush[] brushes)
        {
            Int32 hashCode = -1720831040;

            if (brushes != null)
            {
                foreach (StyleBrush brush in brushes)
                {
                    hashCode ^= brush.GetHashCode();
                }
            }

            return hashCode;
        }
 public static StyleBrush Convert(StyleBrush brush)
 {
     return brush;
 }