Пример #1
0
 public virtual void paintComponent(Graphics g)
 {
   Graphics2D graphics2D = (Graphics2D) g;
   Dimension size = ((Component) this).getSize();
   Insets insets = this.getInsets();
   Rectangle2D.Double @double = new Rectangle2D.Double((double) insets.left, (double) insets.top, size.getWidth() - (double) insets.left - (double) insets.right - 1.0, size.getHeight() - (double) insets.top - (double) insets.bottom - 1.0);
   graphics2D.setPaint(this.paint);
   graphics2D.fill((Shape) @double);
   graphics2D.setPaint((Paint) Color.black);
   graphics2D.draw((Shape) @double);
 }
Пример #2
0
        public override void paint(Graphics g)
        {
            g.setColor(new Color(0xffffff));
            g.fillRect(0, 0, 256, 192);
            for (int i = 0; i < 256; i++)
            {
                int k = memoryUse[i + updateCounter & 0xff];
                g.setColor(new Color(k + 28 << 16));
                g.fillRect(i, 100 - k, 1, k);
            }

            g.setColor(Color.BLACK);
            for (int j = 0; j < displayStrings.Length; j++)
            {
                string s = displayStrings[j];
                if (s != null)
                {
                    g.drawString(s, 32, 116 + j*16);
                }
            }
        }
Пример #3
0
 public virtual void paintComponent(Graphics g)
 {
   Graphics2D graphics2D = (Graphics2D) g;
   graphics2D.setRenderingHint((RenderingHints.Key) RenderingHints.KEY_ANTIALIASING, (object) RenderingHints.VALUE_ANTIALIAS_OFF);
   Dimension size = ((Component) this).getSize();
   Insets insets = this.getInsets();
   double num1 = size.getWidth() - (double) insets.left - (double) insets.right;
   double num2 = size.getHeight() - (double) insets.top - (double) insets.bottom;
   graphics2D.setStroke((Stroke) new BasicStroke(1f));
   double num3 = (double) insets.top;
   double num4 = num3 + num2;
   double num5 = (double) insets.left;
   Line2D.Double @double = new Line2D.Double();
   int izV = 0;
   for (; num5 <= (double) insets.left + num1; ++num5)
   {
     ++izV;
     ((Line2D) @double).setLine(num5, num3, num5, num4);
     graphics2D.setPaint((Paint) this.palette.getColor(izV));
     graphics2D.draw((Shape) @double);
   }
 }
		internal GraphicsState(Graphics graphics, Matrix matrix, bool resetState)
		{
			_compositingMode = graphics.CompositingMode;
			_compositingQuality = graphics.CompositingQuality;
			_clip = graphics.ScaledClip;
			_baseClip = graphics.NativeObject.getClip();
			_interpolationMode = graphics.InterpolationMode;
			_pageScale = graphics.PageScale;
			_pageUnit = graphics.PageUnit;
			_pixelOffsetMode = graphics.PixelOffsetMode;
			
			// FIXME: render orign is not implemented yet
			//_renderingOrigin = new Point( g.RenderingOrigin.X, g.RenderingOrigin.Y );

			_smoothingMode = graphics.SmoothingMode;
			_transform = graphics.Transform;
			_baseTransform = graphics.BaseTransform;

			_textContrast = graphics.TextContrast;
			_textRenderingHint = graphics.TextRenderingHint;

			if (resetState)
				ResetState(graphics, matrix);
		}
Пример #5
0
 public virtual void paintComponent(Graphics g)
 {
   Graphics2D graphics2D = (Graphics2D) g;
   graphics2D.setRenderingHint((RenderingHints.Key) RenderingHints.KEY_ANTIALIASING, (object) RenderingHints.VALUE_ANTIALIAS_ON);
   Dimension size = ((Component) this).getSize();
   Insets insets = this.getInsets();
   double num1 = (double) insets.left;
   double num2 = (double) insets.top;
   double num3 = size.getWidth() - (double) insets.left - (double) insets.right;
   double num4 = size.getHeight() - (double) insets.top - (double) insets.bottom;
   Point2D.Double double1 = new Point2D.Double(num1 + 6.0, num2 + num4 / 2.0);
   Point2D.Double double2 = new Point2D.Double(num1 + num3 - 6.0, num2 + num4 / 2.0);
   Ellipse2D.Double double3 = new Ellipse2D.Double(((Point2D) double1).getX() - 5.0, ((Point2D) double1).getY() - 5.0, 10.0, 10.0);
   Ellipse2D.Double double4 = new Ellipse2D.Double(((Point2D) double2).getX() - 6.0, ((Point2D) double2).getY() - 5.0, 10.0, 10.0);
   graphics2D.draw((Shape) double3);
   graphics2D.fill((Shape) double3);
   graphics2D.draw((Shape) double4);
   graphics2D.fill((Shape) double4);
   Line2D.Double double5 = new Line2D.Double((Point2D) double1, (Point2D) double2);
   if (this.stroke == null)
     return;
   graphics2D.setStroke(this.stroke);
   graphics2D.draw((Shape) double5);
 }
		internal void RestoreBaseClip(Graphics graphics) {
			graphics.NativeObject.setClip(_baseClip);
		}
Пример #7
0
		/// <summary>
		/// Paints the popup menu's border if the <code>borderPainted</code>
		/// property is <code>true</code>.
		/// </summary>
		protected void paintBorder(Graphics @g)
		{
		}
Пример #8
0
 protected internal virtual void paintComponent(Graphics g)
 {
   if (this.image == null)
     g.fillRect(0, 0, ((JComponent) this).getWidth(), ((JComponent) this).getHeight());
   else if (((Boolean) this.__\u003C\u003EaspectKept.getValue()).booleanValue())
   {
     int num1 = (int) ((Component) this).getBounds().width;
     int num2 = (int) ((Component) this).getBounds().height;
     double num3 = Math.min((double) num1 / (double) this.image.getWidth(), (double) num2 / (double) this.image.getHeight());
     g.drawImage((Image) this.image, ByteCodeHelper.d2i((double) num1 - num3 * (double) this.image.getWidth()) / 2, ByteCodeHelper.d2i((double) num2 - num3 * (double) this.image.getHeight()) / 2, ByteCodeHelper.d2i(((double) num1 + num3 * (double) this.image.getWidth()) / 2.0), ByteCodeHelper.d2i((double) num2 + num3 * (double) this.image.getHeight()) / 2, 0, 0, this.image.getWidth(), this.image.getHeight(), (ImageObserver) null);
   }
   else
     g.drawImage((Image) this.image, 0, 0, ((JComponent) this).getWidth(), ((JComponent) this).getHeight(), 0, 0, this.image.getWidth(), this.image.getHeight(), (ImageObserver) null);
 }
Пример #9
0
		/// <summary>
		/// Prints each of the components in this container.
		/// </summary>
		public void printComponents(Graphics @g)
		{
		}
Пример #10
0
		/// <summary>
		/// Paints a component <code>c</code> on an arbitrary graphics
		/// <code>g</code> in the specified rectangle, specifying a Rectangle object.
		/// </summary>
		static public void paintComponent(Graphics @g, Component @c, Container @p, Rectangle @r)
		{
		}
Пример #11
0
		/// <summary>
		/// Returns the <A HREF="../../java/awt/font/LineMetrics.html" title="class in java.awt.font"><CODE>LineMetrics</CODE></A> object for the specified
		/// <A HREF="../../java/text/CharacterIterator.html" title="interface in java.text"><CODE>CharacterIterator</CODE></A> in the specified <A HREF="../../java/awt/Graphics.html" title="class in java.awt"><CODE>Graphics</CODE></A>
		/// context.
		/// </summary>
		public LineMetrics getLineMetrics(CharacterIterator @ci, int @beginIndex, int @limit, Graphics @context)
		{
			return default(LineMetrics);
		}
Пример #12
0
		/// <summary>
		/// Returns the <A HREF="../../java/awt/font/LineMetrics.html" title="class in java.awt.font"><CODE>LineMetrics</CODE></A> object for the specified
		/// character array in the specified <A HREF="../../java/awt/Graphics.html" title="class in java.awt"><CODE>Graphics</CODE></A> context.
		/// </summary>
		public LineMetrics getLineMetrics(char[] @chars, int @beginIndex, int @limit, Graphics @context)
		{
			return default(LineMetrics);
		}
 protected internal virtual void paintComponent(Graphics g)
 {
   Dimension size = ((Component) this).getSize();
   switch (((Integer) this.__\u003C\u003Edisplay.getValue()).intValue())
   {
     case 0:
       g.setColor(!this.connected ? (Color) this.__\u003C\u003Enegative.getValue() : (Color) this.__\u003C\u003Epositive.getValue());
       g.fill3DRect(0, 0, (int) size.width, (int) size.height, true);
       break;
     case 1:
       g.setColor(!this.connected ? (Color) this.__\u003C\u003Enegative.getValue() : (Color) this.__\u003C\u003Epositive.getValue());
       g.fill3DRect(0, 0, (int) size.width, (int) size.height, false);
       break;
     case 2:
       g.setColor(((Component) this).getBackground());
       g.fillRect(0, 0, (int) size.width, (int) size.height);
       g.setColor(!this.connected ? (Color) this.__\u003C\u003Enegative.getValue() : (Color) this.__\u003C\u003Epositive.getValue());
       g.fillRoundRect(0, 0, (int) size.width, (int) size.height, 8, 8);
       break;
     default:
       g.setColor(!this.connected ? (Color) this.__\u003C\u003Enegative.getValue() : (Color) this.__\u003C\u003Epositive.getValue());
       g.fillRect(0, 0, (int) size.width, (int) size.height);
       break;
   }
 }
Пример #14
0
		/// <summary>
		/// This is invoked during a printing operation.
		/// </summary>
		protected void printComponent(Graphics @g)
		{
		}
Пример #15
0
		/// <summary>
		/// Prints this component's children.
		/// </summary>
		protected void printChildren(Graphics @g)
		{
		}
Пример #16
0
		/* Higher Level Drawing Methods */

		/**
		 * Handles painting entire contents of DelaunayPanel.
		 * Called automatically; requested via call to repaint().
		 * @param g the Graphics context
		 */
		protected override void paintComponent(Graphics g)
		{
			// fixme: jsc has trouble calling base...
			//base.paintComponent(g);
			this.g = g;

			// Flood the drawing area with a "background" color
			Color temp = g.getColor();
			if (!isVoronoi) g.setColor(delaunayColor);
			else if (dt.contains(initialTriangle)) g.setColor(this.getBackground());
			else g.setColor(voronoiColor);
			g.fillRect(0, 0, this.getWidth(), this.getHeight());
			g.setColor(temp);

			// Draw the appropriate picture
			if (isVoronoi)
			{
				drawAllVoronoi();
				drawAllSites();
			}
			else drawAllDelaunay();

			// Draw any extra info due to the mouse-entry switches
			temp = g.getColor();
			if (isVoronoi) g.setColor(delaunayColor);
			else g.setColor(voronoiColor);
			if (showCircles) drawAllCircles();
			if (showDelaunay) drawAllDelaunay();
			if (showVoronoi) drawAllVoronoi();
			g.setColor(temp);
		}
Пример #17
0
		/// <summary>
		/// Paints a component <code>c</code> on an arbitrary graphics
		/// <code>g</code> in the
		/// specified rectangle, specifying the rectangle's upper left corner
		/// and size.
		/// </summary>
		static public void paintComponent(Graphics @g, Component @c, Container @p, int @x, int @y, int @w, int @h)
		{
		}
Пример #18
0
		/// <summary>
		/// Returns the <A HREF="../../java/awt/font/LineMetrics.html" title="class in java.awt.font"><CODE>LineMetrics</CODE></A> object for the specified
		/// <code>String</code> in the specified <A HREF="../../java/awt/Graphics.html" title="class in java.awt"><CODE>Graphics</CODE></A> context.
		/// </summary>
		public LineMetrics getLineMetrics(string @str, Graphics @context)
		{
			return default(LineMetrics);
		}
Пример #19
0
		/// <summary>
		/// Prints the container.
		/// </summary>
		public void print(Graphics @g)
		{
		}
Пример #20
0
		/// <summary>
		/// Returns the <A HREF="../../java/awt/font/LineMetrics.html" title="class in java.awt.font"><CODE>LineMetrics</CODE></A> object for the specified
		/// <code>String</code> in the specified <A HREF="../../java/awt/Graphics.html" title="class in java.awt"><CODE>Graphics</CODE></A> context.
		/// </summary>
		public LineMetrics getLineMetrics(string @str, int @beginIndex, int @limit, Graphics @context)
		{
			return default(LineMetrics);
		}
Пример #21
0
		/// <summary>
		/// Updates the container.
		/// </summary>
		public void update(Graphics @g)
		{
		}
Пример #22
0
		/// <summary>
		/// Returns the bounds for the character with the maximum bounds
		/// in the specified <code>Graphics</code> context.
		/// </summary>
		public Rectangle2D getMaxCharBounds(Graphics @context)
		{
			return default(Rectangle2D);
		}
Пример #23
0
 public virtual void paint(Graphics g)
 {
 }
Пример #24
0
		/// <summary>
		/// Returns the bounds of the characters indexed in the specified
		/// <code>CharacterIterator</code> in the
		/// specified <code>Graphics</code> context.
		/// </summary>
		public Rectangle2D getStringBounds(CharacterIterator @ci, int @beginIndex, int @limit, Graphics @context)
		{
			return default(Rectangle2D);
		}
		void ResetState(Graphics graphics, Matrix matrix)
		{
			//should be set before the base transform is changed
			if (_baseClip == null)
				graphics.IntersectScaledClipWithBase(graphics.VisibleShape);

			graphics.CompositingMode = CompositingMode.SourceOver;
			graphics.CompositingQuality = CompositingQuality.Default;
			graphics.ScaledClip = Region.InfiniteRegion;
			graphics.InterpolationMode = InterpolationMode.Bilinear;
			graphics.PageScale = 1.0f;
			graphics.PageUnit = GraphicsUnit.Display;
			graphics.PixelOffsetMode = PixelOffsetMode.Default;
			
			// FIXME: render orign is not implemented yet
			//graphics.RenderingOrigin = new Point(0, 0);

			graphics.SmoothingMode = SmoothingMode.None;
			graphics.ResetTransform();
			graphics.PrependBaseTransform(Graphics.GetFinalTransform(_transform.NativeObject, _pageUnit, _pageScale));
			graphics.PrependBaseTransform(matrix.NativeObject);
			graphics.TextContrast = 4;
			graphics.TextRenderingHint = TextRenderingHint.SystemDefault;
		}
Пример #26
0
		/// <summary>
		/// Returns the bounds of the specified <code>String</code> in the
		/// specified <code>Graphics</code> context.
		/// </summary>
		public Rectangle2D getStringBounds(string @str, Graphics @context)
		{
			return default(Rectangle2D);
		}
		internal GraphicsState(Graphics graphics, bool resetState) 
			: this(graphics, Matrix.IdentityTransform, resetState) {}
Пример #28
0
		/// <summary>
		/// Returns the bounds of the specified <code>String</code> in the
		/// specified <code>Graphics</code> context.
		/// </summary>
		public Rectangle2D getStringBounds(string @str, int @beginIndex, int @limit, Graphics @context)
		{
			return default(Rectangle2D);
		}
		internal void RestoreState(Graphics graphics)
		{
			graphics.CompositingMode = _compositingMode;
			graphics.CompositingQuality = _compositingQuality;
			graphics.ScaledClip = _clip;
			graphics.InterpolationMode = _interpolationMode;
			graphics.PageScale = _pageScale;
			graphics.PageUnit = _pageUnit;
			graphics.PixelOffsetMode = _pixelOffsetMode;
	
			// FIXME: render orign is not implemented yet
			//graphics.RenderingOrigin = new Point( _renderingOrigin.X, _renderingOrigin.Y );

			graphics.SmoothingMode = _smoothingMode;
			graphics.Transform = _transform;
			graphics.BaseTransform = _baseTransform;
			graphics.TextContrast = _textContrast;
			graphics.TextRenderingHint = _textRenderingHint;

			// must be set after the base transform is restored
			graphics.NativeObject.setClip(_baseClip);
		}
Пример #30
0
 /// <summary>
 /// Prints this component and all of its subcomponents.
 /// </summary>
 public void printAll(Graphics @g)
 {
 }