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); } } }
/* 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); }
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; } }
protected internal virtual void paintComponent(Graphics g) { Rectangle bounds1 = ((Component) this).getBounds(); if (this.selectedElement != null) { Rectangle bounds2 = ((Component) this.selectedElement).getBounds(); g.setColor((Color) Color.GRAY); g.drawRoundRect(bounds2.x - 1, bounds2.y - 1, bounds2.width + 1, bounds2.height + 1, 8, 8); } if (!this.showGrid) return; g.setColor(GlassPane.GRID_COLOR); DashboardPrefs prefs = this.frame.getPrefs(); int[] numArray1 = prefs.__\u003C\u003Egrid_widths.getValue(); int[] numArray2 = prefs.__\u003C\u003Egrid_heights.getValue(); int num1 = -1; for (int index1 = 0; index1 < bounds1.width; { int num2; int num3; index1 = num2 + num3; } ) { g.drawLine(index1, 0, index1, (int) bounds1.height); num2 = index1; int[] numArray3 = numArray1; int num2 = num1 + 1; int length = numArray1.Length; int num3 = -1; int index2; num1 = index2 = length != num3 ? num2 % length : 0; num3 = numArray3[index2]; } int num4 = -1; for (int index1 = 0; index1 < bounds1.height; { int num2; int num3; index1 = num2 + num3; } ) { g.drawLine(0, index1, (int) bounds1.width, index1); num2 = index1; int[] numArray3 = numArray2; int num2 = num4 + 1; int length = numArray2.Length; int num3 = -1; int index2; num4 = index2 = length != num3 ? num2 % length : 0; num3 = numArray3[index2]; } }