コード例 #1
0
ファイル: graphics.cs プロジェクト: maikebing/IKVM.NetCore
 public override void setFont(java.awt.Font f)
 {
     if (f != null && f != font)
     {
         netfont = f.getNetFont();
         font    = f;
     }
 }
コード例 #2
0
ファイル: graphics.cs プロジェクト: maikebing/IKVM.NetCore
 protected NetGraphics(Graphics g, java.awt.Font font, Color fgcolor, Color bgcolor)
 {
     if (font == null)
     {
         font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12);
     }
     this.font    = font;
     netfont      = font.getNetFont();
     this.color   = fgcolor;
     this.bgcolor = bgcolor;
     init(g);
 }
コード例 #3
0
ファイル: graphics.cs プロジェクト: maikebing/IKVM.NetCore
        public override void drawGlyphVector(java.awt.font.GlyphVector gv, float x, float y)
        {
            java.awt.Font javaFont = gv.getFont();
            if (javaFont == null)
            {
                javaFont = font;
            }
            int count = gv.getNumGlyphs();

            char[] text = new char[count];
            for (int i = 0; i < count; i++)
            {
                text[i] = (char)gv.getGlyphCode(i);
            }
            java.awt.font.FontRenderContext frc = gv.getFontRenderContext();
            Matrix matrix = null;

            try
            {
                if (frc != null && !frc.getTransform().equals(getTransform()))
                {
                    // save the old context and use the transformation from the renderContext
                    matrix      = g.Transform;
                    g.Transform = J2C.ConvertTransform(frc.getTransform());
                }
                g.DrawString(new string(text), javaFont.getNetFont(), brush, x, y - javaFont.getSize(), StringFormat.GenericTypographic);
            }
            finally
            {
                // Restore the old context if needed
                if (matrix != null)
                {
                    g.Transform = matrix;
                }
            }
        }
コード例 #4
0
        protected NetGraphics(Graphics g, java.awt.Font font, Color fgcolor, Color bgcolor)
        {
            if (font == null)
            {
                font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12);
            }
            this.font = font;
            netfont = font.getNetFont();
			this.color = fgcolor;
            this.bgcolor = bgcolor;
            composite = CompositeHelper.Create(javaComposite, g);
            init(g);
        }
コード例 #5
0
ファイル: graphics.cs プロジェクト: ikvm/IKVM.NET-cvs-clone
        protected NetGraphics(Graphics g, java.awt.Font font, Color fgcolor, Color bgcolor)
        {
            if (font == null)
            {
                font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12);
            }
            this.font = font;
            netfont = font.getNetFont();
			this.color = fgcolor;
            this.bgcolor = bgcolor;
            init(g);
        }
コード例 #6
0
ファイル: graphics.cs プロジェクト: Semogj/ikvm-fork
        protected NetGraphics(Graphics g, Object destination, java.awt.Font font, Color fgcolor, Color bgcolor) //: base( new sun.java2d.SurfaceData(destination) )
        {
            if (font == null)
            {
                font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12);
            }
            this.font = font;
            netfont = font.getNetFont();
			this.color = fgcolor;
            this.bgcolor = bgcolor;
            composite = CompositeHelper.Create(javaComposite, g);
            init(g);
        }