예제 #1
0
 public static TextDrawerWithDefaults <TVertexParameters> WithDefaults <TVertexParameters>(
     this ITextDrawer <TVertexParameters> textDrawer, float fontHeight, float alignHorizontal, float alignVertical,
     Vector3 unitRightDp, Vector3 unitDownDp, TVertexParameters parameters)
 {
     return(new TextDrawerWithDefaults <TVertexParameters>(
                textDrawer, fontHeight, alignHorizontal, alignVertical, unitRightDp, unitDownDp, parameters));
 }
예제 #2
0
        protected void DrawText(Graphics oGraphics, Rectangle oTreemapRectangle, Nodes oNodes)
        {
            this.AssertValid();
            ITextDrawer textDrawer = this.CreateTextDrawer();

            textDrawer.DrawTextForAllNodes(oGraphics, oTreemapRectangle, oNodes);
        }
예제 #3
0
        public ShowcaseView(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle)
        {
            // Get the attributes for the ShowcaseView
            var styled = context.Theme.ObtainStyledAttributes(attrs, Resource.Styleable.ShowcaseView, Resource.Attribute.showcaseViewStyle, Resource.Style.ShowcaseView);

            mBackgroundColor = styled.GetColor(Resource.Styleable.ShowcaseView_sv_backgroundColor, Color.Argb(128, 80, 80, 80));
            var showcaseColor = styled.GetColor(Resource.Styleable.ShowcaseView_sv_showcaseColor, Color.ParseColor("#33B5E5"));

            int titleTextAppearance  = styled.GetResourceId(Resource.Styleable.ShowcaseView_sv_titleTextAppearance, Resource.Style.TextAppearance_ShowcaseView_Title);
            int detailTextAppearance = styled.GetResourceId(Resource.Styleable.ShowcaseView_sv_detailTextAppearance, Resource.Style.TextAppearance_ShowcaseView_Detail);

            buttonText = styled.GetString(Resource.Styleable.ShowcaseView_sv_buttonText);
            styled.Recycle();

            metricScale = Context.Resources.DisplayMetrics.Density;
            mEndButton  = (Button)LayoutInflater.From(context).Inflate(Resource.Layout.showcase_button, null);

            mShowcaseDrawer = new ClingDrawer(Resources, showcaseColor);

            // TODO: This isn't ideal, ClingDrawer and Calculator interfaces should be separate
            mTextDrawer = new TextDrawer(metricScale, mShowcaseDrawer);
            mTextDrawer.SetTitleStyling(context, titleTextAppearance);
            mTextDrawer.SetDetailStyling(context, detailTextAppearance);

            var options = new ConfigOptions();

            options.ShowcaseId = Id;

            ConfigurationOptions = options;

            Init();
        }
예제 #4
0
 public Form1()
 {
     InitializeComponent();
     _textBitmapCreator = new TextBitmapCreator();
     _webServer         = new WebServer(request => {
         var number         = Convert.ToInt32(request.Url.AbsolutePath.Split('/').Last());
         _numberLastUpdated = DateTime.Now;
         _numberLastValue   = number;
         return($"Received: {_numberLastValue} at {_numberLastUpdated}");
     }, exception => { }, HttpListenerPrefix);
     _webServer.Run();
 }
예제 #5
0
 public TextDrawerWithDefaults(ITextDrawer <TVertexParameters> drawer,
                               float fontHeight, float alignHorizontal, float alignVertical,
                               Vector3 unitRightDP, Vector3 unitDownDP, TVertexParameters parameters
                               )
 {
     this.drawer          = drawer;
     this.fontHeight      = fontHeight;
     this.alignHorizontal = alignHorizontal;
     this.alignVertical   = alignVertical;
     this.unitRightDP     = unitRightDP;
     this.unitDownDP      = unitDownDP;
     this.parameters      = parameters;
 }
예제 #6
0
        protected void DrawNodeAsSelected(Node oNode, Graphics oGraphics, Rectangle oTreemapRectangle)
        {
            Debug.Assert(oNode != null);
            oNode.AssertValid();
            Debug.Assert(oGraphics != null);
            int   penWidthPx = this.SetNodePenWidthForSelection(oNode);
            Brush brush      = new SolidBrush(this.m_oSelectedBackColor);
            Pen   pen        = new Pen(brush, (float)oNode.PenWidthPx);

            pen.Alignment = PenAlignment.Inset;
            oGraphics.DrawRectangle(pen, oNode.RectangleToDraw);
            pen.Dispose();
            brush.Dispose();
            oNode.PenWidthPx = penWidthPx;
            ITextDrawer textDrawer = this.CreateTextDrawer();

            textDrawer.DrawTextForSelectedNode(oGraphics, oNode);
        }
예제 #7
0
        public StartScreen(IEventAggregator eventAggregator, ITextDrawer textDrawer,
                           IScreenConfiguration screenConfiguration, ITextConfiguration textConfiguration)
        {
            _eventAggregator     = eventAggregator;
            _textDrawer          = textDrawer;
            _screenConfiguration = screenConfiguration;
            _textConfiguration   = textConfiguration;

            _titleText         = "Ping Em Down";
            _titleTextPosition = new Vector2(_screenConfiguration.ScreenWidth / 2.0f, _screenConfiguration.ScreenHeight / 4.0f);

            _takeActionText        = "Press any key to start";
            _showTakeActionText    = true;
            _takActionTextPosition = new Vector2(_screenConfiguration.ScreenWidth / 2.0f,
                                                 _screenConfiguration.ScreenHeight / 2.0f);

            _textBlickTimeSpan  = TimeSpan.FromMilliseconds(750);
            _timeSinceLastBlick = TimeSpan.Zero;
        }
예제 #8
0
        public ShowcaseView(Context context, IAttributeSet attrs, int defStyle)
            : base(context, attrs, defStyle)
        {
            // Get the attributes for the ShowcaseView
            var styled = context.Theme.ObtainStyledAttributes(attrs, Resource.Styleable.ShowcaseView, Resource.Attribute.showcaseViewStyle, Resource.Style.ShowcaseView);
            mBackgroundColor = styled.GetColor(Resource.Styleable.ShowcaseView_sv_backgroundColor, Color.Argb(128, 80, 80, 80));
            var showcaseColor = styled.GetColor(Resource.Styleable.ShowcaseView_sv_showcaseColor, Color.ParseColor("#33B5E5"));

            int titleTextAppearance = styled.GetResourceId(Resource.Styleable.ShowcaseView_sv_titleTextAppearance, Resource.Style.TextAppearance_ShowcaseView_Title);
            int detailTextAppearance = styled.GetResourceId(Resource.Styleable.ShowcaseView_sv_detailTextAppearance, Resource.Style.TextAppearance_ShowcaseView_Detail);

            buttonText = styled.GetString(Resource.Styleable.ShowcaseView_sv_buttonText);
            styled.Recycle();

            metricScale = Context.Resources.DisplayMetrics.Density;
            mEndButton = (Button)LayoutInflater.From(context).Inflate(Resource.Layout.showcase_button, null);

            mShowcaseDrawer = new ClingDrawer(Resources, showcaseColor);

            // TODO: This isn't ideal, ClingDrawer and Calculator interfaces should be separate
            mTextDrawer = new TextDrawer(metricScale, mShowcaseDrawer);
            mTextDrawer.SetTitleStyling(context, titleTextAppearance);
            mTextDrawer.SetDetailStyling(context, detailTextAppearance);

            var options = new ConfigOptions();
            options.ShowcaseId = Id;

            ConfigurationOptions = options;

            Init();
        }