Java Code Examples for java.awt.GradientPaint

The following are top voted examples for showing how to use java.awt.GradientPaint. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: VISNode   File: JNodeConnection.java   Source Code and License 7 votes vote down vote up
@Override
protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    Graphics2D g2d = (Graphics2D) g.create();
    g2d.translate(-getX(), -getY());
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2d.setColor(Color.BLUE);
    int[] xs = new int[points.length];
    int[] ys = new int[points.length];
    for (int i = 0; i < points.length; i++) {
        xs[i] = points[i].x;
        ys[i] = points[i].y;
    }
    g2d.setColor(UIHelper.getColor("NodeConnection.border"));
    g2d.setStroke(new BasicStroke(3));
    g2d.drawPolyline(xs, ys, points.length);
    g2d.setPaint(new GradientPaint(points[0], UIHelper.getColor("NodeConnection.color1"), points[points.length - 1], UIHelper.getColor("NodeConnection.color2")));
    g2d.setStroke(new BasicStroke(1.5f));
    g2d.drawPolyline(xs, ys, points.length);
    g2d.dispose();
}
 
Example 2
Project: incubator-netbeans   File: BalloonManager.java   Source Code and License 6 votes vote down vote up
@Override
protected void paintComponent(Graphics g) {
    Graphics2D g2d = (Graphics2D)g;
    
    g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
    
    Composite oldC = g2d.getComposite();
    Shape s = getMask( getWidth(), getHeight() );

    g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 0.25f*currentAlpha ) );
    g2d.setColor( Color.black );
    g2d.fill( getShadowMask(s) );
    
    g2d.setColor( UIManager.getColor( "ToolTip.background" ) ); //NOI18N
    g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, currentAlpha ) );
    Point2D p1 = s.getBounds().getLocation();
    Point2D p2 = new Point2D.Double(p1.getX(), p1.getY()+s.getBounds().getHeight());
    if( isMouseOverEffect )
        g2d.setPaint( new GradientPaint( p2, getMouseOverGradientStartColor(), p1, getMouseOverGradientFinishColor() ) );
    else
        g2d.setPaint( new GradientPaint( p2, getDefaultGradientStartColor(), p1, getDefaultGradientFinishColor() ) );
    g2d.fill(s);
    g2d.setColor( Color.black );
    g2d.draw(s);
    g2d.setComposite( oldC );
}
 
Example 3
Project: incubator-netbeans   File: ContentHeader.java   Source Code and License 6 votes vote down vote up
@Override
protected void paintComponent( Graphics g ) {
    Graphics2D g2d = ( Graphics2D ) g;
    int width = getWidth();
    int height = getHeight();

    g2d.setColor( Utils.getBorderColor() );
    g2d.drawRect( 0, 0, width, 12 );

    if( UIManager.getBoolean( "nb.startpage.defaultbackground" ) ) { //NOI18N
        g2d.setColor( UIManager.getColor("Tree.background") ); //NOI18N
    } else {
        g2d.setPaint( new GradientPaint( 0, 0, COL_GRADIENT_START, 0, 12, COL_GRADIENT_END ) );
    }
    g2d.fillRect( 1, 0, width-2, 12 );

    int imgWidth = IMG_BANNER.getWidth( this );
    int imgX = (width - imgWidth)/2;
    g2d.drawImage( IMG_BANNER, imgX, 13, imgWidth, height-13, this );
    if( imgX > 0 ) {
        g2d.setPaint( COL_BANNER_LEFT );
        g2d.fillRect( 0, 13, imgX, height-13 );
        g2d.setPaint( COL_BANNER_RIGHT );
        g2d.fillRect( width-imgX-1, 13, imgX+1, height-13 );
    }
}
 
Example 4
Project: incubator-netbeans   File: BalloonManager.java   Source Code and License 6 votes vote down vote up
@Override
protected void paintComponent(Graphics g) {
    Graphics2D g2d = (Graphics2D)g;
    
    g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
    
    Composite oldC = g2d.getComposite();
    Shape s = getMask( getWidth(), getHeight() );

    g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 0.25f*currentAlpha ) );
    g2d.setColor( Color.black );
    g2d.fill( getShadowMask(s) );
    
    g2d.setColor( UIManager.getColor( "ToolTip.background" ) ); //NOI18N
    g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, currentAlpha ) );
    Point2D p1 = s.getBounds().getLocation();
    Point2D p2 = new Point2D.Double(p1.getX(), p1.getY()+s.getBounds().getHeight());
    if( isMouseOverEffect )
        g2d.setPaint( new GradientPaint( p2, getMouseOverGradientStartColor(), p1, getMouseOverGradientFinishColor() ) );
    else
        g2d.setPaint( new GradientPaint( p2, getDefaultGradientStartColor(), p1, getDefaultGradientFinishColor() ) );
    g2d.fill(s);
    g2d.setColor( Color.black );
    g2d.draw(s);
    g2d.setComposite( oldC );
}
 
Example 5
Project: incubator-netbeans   File: HeapView.java   Source Code and License 6 votes vote down vote up
/**
 * Paints the grid on top of the ticks.
 */
private void paintGridOverlay(Graphics2D g, int w, int h) {
    int numCells = GRID_COLORS.length / 2;
    int cellSize = (h - numCells - 1) / numCells;
    int c1 = 0xD0CCBC;
    int c2 = 0xEAE7D7;
    g.setPaint(new GradientPaint(
            0, 0, new Color((c1 >> 16) & 0xFF, (c1 >> 8) & 0xFF, c1 & 0xFF, 0x30),
            0, h, new Color((c2 >> 16) & 0xFF, (c2 >> 8) & 0xFF, c2 & 0xFF, 0x40)));
    for (int x = 0; x < w; x += cellSize + 1) {
        g.fillRect(x, 0, 1, h);
    }
    for (int y = h - cellSize - 1; y >= 0; y -= (cellSize + 1)) {
        g.fillRect(0, y, w, 1);
    }
}
 
Example 6
Project: incubator-netbeans   File: HeapView.java   Source Code and License 6 votes vote down vote up
private void paintBackgroundTiles(Graphics2D g, int w, int h) {
    g.translate(1, 2);
    w -= BORDER_W;
    h -= BORDER_H;
    int numCells = GRID_COLORS.length / 2;
    int cellSize = (h - numCells - 1) / numCells;
    for (int i = 0; i < numCells; i++) {
        int colorIndex = i;
        int y = h - cellSize * (i + 1) - i;
        int x = 1;
        g.setPaint(new GradientPaint(0, y, GRID_COLORS[colorIndex * 2],
                0, y + cellSize - 1, GRID_COLORS[colorIndex * 2 + 1]));
        while (x < w) {
            int endX = Math.min(w, x + cellSize);
            g.fillRect(x, y, endX - x, cellSize);
            x = endX + 1;
        }
        y += cellSize + 1;
    }
    g.translate(-1, -2);
}
 
Example 7
Project: rapidminer   File: TableHeaderUI.java   Source Code and License 6 votes vote down vote up
@Override
public void paint(Graphics g) {
	int h = this.getHeight();
	int w = this.getWidth();

	Graphics2D g2 = (Graphics2D) g;
	if (this.isPressed) {
		g2.setColor(Colors.TABLE_HEADER_BACKGROUND_PRESSED);
	} else {
		if (this.rollOver) {
			g2.setColor(Colors.TABLE_HEADER_BACKGROUND_FOCUS);
		} else {
			Paint gp = new GradientPaint(0, 0, Colors.TABLE_HEADER_BACKGROUND_GRADIENT_START, 0, h,
					Colors.TABLE_HEADER_BACKGROUND_GRADIENT_END);
			g2.setPaint(gp);
		}
	}

	g2.fill(createHeaderShape(0, 0, w, h, isLeftmost, isRightmost));
	g2.setColor(Colors.TABLE_HEADER_BORDER);
	g2.draw(createHeaderShape(0, 0, w, h, isLeftmost, isRightmost));

	super.paint(g);
}
 
Example 8
Project: brModelo   File: baseDrawerFromForma.java   Source Code and License 6 votes vote down vote up
protected void PaintGradiente(Graphics2D g) { //, boolean round) {
    int dist = 0;
    DimensioneParaPintura();
    W -= dist;
    H -= dist;
    boolean dv = getGDirecao() == VERTICAL;

    int type = AlphaComposite.SRC_OVER;

    g.setComposite(AlphaComposite.getInstance(type, alfa));

    GradientPaint GP = new GradientPaint(L, T, getGradienteStartColor(), dv ? L : L + W, dv ? T + H : T, getGradienteEndColor(), true);
    g.setPaint(GP);

    if (roundrect > 0 && isPintarBorda()) {
        g.fillRoundRect(L + 1, T + 1, W, H, roundrect, roundrect);
    } else {
        g.fillRect(L + 1, T + 1, W, H);
    }
}
 
Example 9
Project: parabuild-ci   File: WaterfallBarRenderer.java   Source Code and License 6 votes vote down vote up
/**
 * Constructs a new renderer with default values for the bar colors.
 */
public WaterfallBarRenderer() {
    this(
        new GradientPaint(
            0.0f, 0.0f, new Color(0x22, 0x22, 0xFF), 
            0.0f, 0.0f, new Color(0x66, 0x66, 0xFF)
        ), 
        new GradientPaint(
            0.0f, 0.0f, new Color(0x22, 0xFF, 0x22), 
            0.0f, 0.0f, new Color(0x66, 0xFF, 0x66)
        ), 
        new GradientPaint(
            0.0f, 0.0f, new Color(0xFF, 0x22, 0x22), 
            0.0f, 0.0f, new Color(0xFF, 0x66, 0x66)
        ),
        new GradientPaint(
            0.0f, 0.0f, new Color(0xFF, 0xFF, 0x22), 
            0.0f, 0.0f, new Color(0xFF, 0xFF, 0x66)
        )
    );
}
 
Example 10
Project: Mujeed-Arabic-Prolog   File: AquaBarTabbedPaneUI.java   Source Code and License 6 votes vote down vote up
protected void paintTabBackground(Graphics g, int tabPlacement,
		int tabIndex, int x, int y, int w, int h, boolean isSelected) {
	Graphics2D g2d = (Graphics2D) g;
	ColorSet colorSet;

	Rectangle rect = rects[tabIndex];

	if (isSelected) {
		colorSet = selectedColorSet;
	} else if (getRolloverTab() == tabIndex) {
		colorSet = hoverColorSet;
	} else {
		colorSet = defaultColorSet;
	}

	g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
			RenderingHints.VALUE_ANTIALIAS_ON);

	int width = rect.width;
	int xpos = rect.x;
	if (tabIndex > 0) {
		width--;
		xpos++;
	}

	g2d.setPaint(new GradientPaint(xpos, 0, colorSet.topGradColor1, xpos,
			10, colorSet.topGradColor2));
	g2d.fillRect(xpos, 0, width, 10);

	g2d.setPaint(new GradientPaint(0, 10, colorSet.bottomGradColor1, 0, 21,
			colorSet.bottomGradColor2));
	g2d.fillRect(xpos, 10, width, 11);

	if (contentTopBorderDrawn) {
		g2d.setColor(lineColor);
		g2d.drawLine(rect.x, 20, rect.x + rect.width - 1, 20);
	}
}
 
Example 11
Project: JavaPPTX   File: PPWindowImage.java   Source Code and License 6 votes vote down vote up
private void drawTitleBar(Graphics2D g) {
   Graphics2D g2 = (Graphics2D) g.create();
   RoundRectangle2D titleBar = createTitleBarShape();
   double h = SF * (TITLE_BAR_HEIGHT + CORNER_RADIUS) + 1;
   g2.setPaint(new GradientPaint(0, 0, grayColor(GRAY_TOP),
                                 0, (float) h, grayColor(GRAY_BOTTOM)));
   g2.fill(titleBar);
   g2.setColor(Color.DARK_GRAY);
   g2.draw(titleBar);
   g2.setColor(Color.BLACK);
   int scaledSize = (int) Math.round(SF * TITLE_FONT_SIZE);
   g2.setFont(Font.decode(TITLE_FONT_FAMILY + "-" + scaledSize));
   FontMetrics fm = g2.getFontMetrics();
   int x = (int) Math.round((sw - fm.stringWidth(title)) / 2);
   int y = (int) Math.round(SF * (TITLE_BAR_HEIGHT / 2 + TITLE_DY));
   g2.drawString(title, x, y);
   drawBall(g2, RED_BALL, 0);
   drawBall(g2, AMBER_BALL, 1);
   drawBall(g2, GREEN_BALL, 2);
   g2.dispose();
}
 
Example 12
Project: dead-code-detector   File: DeadCodeDetectorUI.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
@Override
protected void paintComponent(Graphics graphics) {
	// Surchargée pour dessiner le fond avec gradient
	final LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
	final String lafName = lookAndFeel != null ? lookAndFeel.getName() : null;
	if ("Substance".equals(lafName)) {
		super.paintComponent(graphics); // le gradient fonctionne mal en substance ?
	}

	final Color startColor = getBackground();
	final Color endColor = GRADIENT_COLOR;
	final int w = getWidth();
	final int h = getHeight();

	// l'image du gradient pourrait ĂȘtre mise en cache, mais ce n'est pas grave
	final Paint paint = new GradientPaint(0, h / 2f, startColor, 1, h, endColor, false);
	final Graphics2D graphix = (Graphics2D) graphics.create();
	graphix.setPaint(paint);
	graphix.fillRect(0, 0, w, h);
	graphix.dispose();
}
 
Example 13
Project: Tarski   File: mxLabelShape.java   Source Code and License 6 votes vote down vote up
/**
 * Draws the glass effect
 */
public static void drawGlassEffect(mxGraphics2DCanvas canvas, mxCellState state) {
  double size = 0.4;
  canvas.getGraphics()
      .setPaint(new GradientPaint((float) state.getX(), (float) state.getY(),
          new Color(1, 1, 1, 0.9f), (float) (state.getX()),
          (float) (state.getY() + state.getHeight() * size), new Color(1, 1, 1, 0.3f)));

  float sw = (float) (mxUtils.getFloat(state.getStyle(), mxConstants.STYLE_STROKEWIDTH, 1)
      * canvas.getScale() / 2);

  GeneralPath path = new GeneralPath();
  path.moveTo((float) state.getX() - sw, (float) state.getY() - sw);
  path.lineTo((float) state.getX() - sw, (float) (state.getY() + state.getHeight() * size));
  path.quadTo((float) (state.getX() + state.getWidth() * 0.5),
      (float) (state.getY() + state.getHeight() * 0.7),
      (float) (state.getX() + state.getWidth() + sw),
      (float) (state.getY() + state.getHeight() * size));
  path.lineTo((float) (state.getX() + state.getWidth() + sw), (float) state.getY() - sw);
  path.closePath();

  canvas.getGraphics().fill(path);
}
 
Example 14
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 6 votes vote down vote up
private void drawUtilizationMulti(double U, Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {

		double x = getProcessorXY().x, y = getProcessorXY().y;
		try {
			occupiedRect = new Rectangle2D.Double(x + PROC_RAD / 2 + ELEMS_GAP / 2, y + cpu * (PROC_RAD - ELEMS_GAP) + ELEMS_GAP * cpu * 3
					- ELEMS_GAP / 2, PROC_RAD - ELEMS_GAP, (PROC_RAD - ELEMS_GAP) * (1 - U / nCpu));
		} catch (Exception e) {
			occupiedRect = new Rectangle2D.Double(x + PROC_RAD / 2 + ELEMS_GAP / 2, y + cpu * (PROC_RAD - ELEMS_GAP) + ELEMS_GAP * cpu * 3
					- ELEMS_GAP / 2, PROC_RAD - ELEMS_GAP, 0);
		}
		occupiedEll = new Ellipse2D.Double(x + PROC_RAD / 2 + ELEMS_GAP / 2, y + cpu * (PROC_RAD - ELEMS_GAP) + ELEMS_GAP * cpu * 3 - ELEMS_GAP / 2,
				PROC_RAD - ELEMS_GAP, PROC_RAD - ELEMS_GAP);
		if (gradientFill) {
			GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
					false);
			g2d.setPaint(gp);
		} else {
			g2d.setPaint(startC);
		}
		occupiedArea = new Area(occupiedEll);
		occupiedArea.subtract(new Area(occupiedRect));
		g2d.fill(occupiedArea);
		g2d.setPaint(Color.BLACK);
		g2d.draw(occupiedArea);

	}
 
Example 15
Project: ramus   File: XMLDiagram.java   Source Code and License 6 votes vote down vote up
private void paintYPin(Graphics2D g, int number) {
    double y = top;
    for (int i = 0; i < number; i++) {
        y += yBounds[i].getSize().getHeight();
    }
    g.setColor(Color.black);

    double max = 6;

    g.setPaint(new GradientPaint(new Point2D.Double(LEFT - max, y - max),
            Color.green, new Point2D.Double(LEFT + max, y + max),
            Color.black));

    GeneralPath path1 = new GeneralPath(Path2D.WIND_EVEN_ODD, 4);
    GeneralPath path2 = new GeneralPath(Path2D.WIND_EVEN_ODD, 4);
    path1.moveTo(LEFT - 5, y);
    path1.lineTo(LEFT - 5 - max, y + max / 2);
    path1.lineTo(LEFT - 5 - max, y - max / 2);
    path1.lineTo(LEFT - 5, y);

    path2.moveTo(5 + LEFT + width, y);
    path2.lineTo(5 + LEFT + width + max, y + max / 2);
    path2.lineTo(5 + LEFT + width + max, y - max / 2);
    path2.lineTo(5 + LEFT + width, y);

    g.fill(path1);
    g.setPaint(new GradientPaint(new Point2D.Double(LEFT + width - max, y
            - max), Color.black, new Point2D.Double(LEFT + max + width, y
            + max), Color.green));
    g.fill(path2);
    g.setColor(Color.gray);
    g.draw(path1);
    g.draw(path2);
}
 
Example 16
Project: batmapper   File: ExitPaintTransformer.java   Source Code and License 6 votes vote down vote up
public Paint transform( Exit exit ) {
    Layout<Room, Exit> layout = vv.getGraphLayout();
    Pair<Room> pair = layout.getGraph().getEndpoints( exit );
    Room begin = pair.getFirst();
    Room end = pair.getSecond();
    Point2D beginPoint = transformer.transform( layout.transform( begin ) );
    Point2D endPoint = transformer.transform( layout.transform( end ) );
    float xFirst = (float) beginPoint.getX();
    float yFirst = (float) beginPoint.getY();
    float xEnd = (float) endPoint.getX();
    float yEnd = (float) endPoint.getY();

    if (selfLoop.evaluate( Context.<Graph<Room, Exit>, Exit>getInstance( layout.getGraph(), exit ) )) {
        xEnd += 50;
        yEnd += 50;
    }

    return new GradientPaint( xFirst, yFirst, getColorFor( begin ), xEnd, yEnd, getColorFor( end ), true );
}
 
Example 17
Project: DicomViewer   File: SliderComponent.java   Source Code and License 6 votes vote down vote up
@Override
protected void paintComponent(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

    int cursorX = valueToPosition(value);

    GradientPaint gradient = new GradientPaint(0, 0, colorLimitMin, sliderWidth(), 0, colorLimitMax, true);

    // slider
    g2.setPaint(gradient);
    fillSlider(g2);
    g2.setColor(Color.black);
    drawSlider(g2);

    // cursor
    Color fillColor = ColorTools.gradiant(colorLimitMin, colorLimitMax, valueAsCoef(value));
    drawCursor(g2, fillColor, Color.black, cursorX);

    if (drawValue) {
       // final String valueAsString = getValueAsString(); //Float.toString(Math.round(value * 10) / 10f);
        printStringOnCursor(g2, getValueAsString(), cursorX, true);
    }
}
 
Example 18
Project: parabuild-ci   File: WaterfallBarRenderer.java   Source Code and License 6 votes vote down vote up
/**
 * Constructs a new renderer with default values for the bar colors.
 */
public WaterfallBarRenderer() {
    this(
        new GradientPaint(
            0.0f, 0.0f, new Color(0x22, 0x22, 0xFF), 0.0f, 0.0f, new Color(0x66, 0x66, 0xFF)
        ), 
        new GradientPaint(
            0.0f, 0.0f, new Color(0x22, 0xFF, 0x22), 0.0f, 0.0f, new Color(0x66, 0xFF, 0x66)
        ), 
        new GradientPaint(
            0.0f, 0.0f, new Color(0xFF, 0x22, 0x22), 0.0f, 0.0f, new Color(0xFF, 0x66, 0x66)
        ),
        new GradientPaint(
            0.0f, 0.0f, new Color(0xFF, 0xFF, 0x22), 0.0f, 0.0f, new Color(0xFF, 0xFF, 0x66)
        )
    );
}
 
Example 19
Project: openjdk-jdk10   File: TSFrame.java   Source Code and License 6 votes vote down vote up
private static void render(Graphics g, int w, int h, boolean useNonOpaque) {
    if (useNonOpaque) {
        Graphics2D g2d = (Graphics2D)g;
        GradientPaint p =
            new GradientPaint(0.0f, 0.0f,
                              new Color(rnd.nextInt(0xffffff)),
                              w, h,
                              new Color(rnd.nextInt(0xff),
                                        rnd.nextInt(0xff),
                                        rnd.nextInt(0xff), 0),
                              true);
        g2d.setPaint(p);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                             RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.fillOval(0, 0, w, h);
    } else {
        g.setColor(new Color(rnd.nextInt(0xffffff)));
        g.fillRect(0, 0, w, h);
    }
}
 
Example 20
Project: cuttlefish   File: PluggableRendererDemo.java   Source Code and License 6 votes vote down vote up
public Paint getFillPaint(Vertex v)
{
    float alpha = transparency.getNumber(v).floatValue();
    if (pi.isPicked(v))
    {
        return new Color(1f, 1f, 0, alpha); 
    }
    else
    {
        if (seed_coloring && v.containsUserDatumKey(BarabasiAlbertGenerator.SEED))
        {
            Color dark = new Color(0, 0, dark_value, alpha);
            Color light = new Color(0, 0, light_value, alpha);
            return new GradientPaint( 0, 0, dark, 10, 0, light, true);
        }
        else
            return new Color(1f, 0, 0, alpha);
    }
        
}
 
Example 21
Project: parabuild-ci   File: StackedXYAreaRendererTests.java   Source Code and License 6 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    StackedXYAreaRenderer r1 = new StackedXYAreaRenderer();
    StackedXYAreaRenderer r2 = new StackedXYAreaRenderer();
    assertEquals(r1, r2);
    assertEquals(r2, r1);
    
    r1.setShapePaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 
            3.0f, 4.0f, Color.green));
    assertFalse(r1.equals(r2));
    r2.setShapePaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 
            3.0f, 4.0f, Color.green));
    assertTrue(r1.equals(r2));
    
    Stroke s = new BasicStroke(1.23f);
    r1.setShapeStroke(s);
    assertFalse(r1.equals(r2));
    r2.setShapeStroke(s);
    assertTrue(r1.equals(r2)); 
}
 
Example 22
Project: parabuild-ci   File: BoxAndWhiskerRendererTests.java   Source Code and License 6 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    BoxAndWhiskerRenderer r1 = new BoxAndWhiskerRenderer();
    BoxAndWhiskerRenderer r2 = new BoxAndWhiskerRenderer();
    assertEquals(r1, r2);
    
    r1.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 
            3.0f, 4.0f, Color.blue));
    assertFalse(r1.equals(r2));
    r2.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 
            3.0f, 4.0f, Color.blue));
    assertEquals(r1, r2);
    
    r1.setFillBox(!r1.getFillBox());
    assertFalse(r1.equals(r2));
    r2.setFillBox(!r2.getFillBox());
    assertEquals(r1, r2);
    
    r1.setItemMargin(0.11);
    assertFalse(r1.equals(r2));
    r2.setItemMargin(0.11);
    assertEquals(r1, r2);
    
}
 
Example 23
Project: parabuild-ci   File: LineRenderer3DTests.java   Source Code and License 6 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    LineRenderer3D r1 = new LineRenderer3D();
    LineRenderer3D r2 = new LineRenderer3D();
    assertEquals(r1, r2);
    
    r1.setXOffset(99.9);
    assertFalse(r1.equals(r2));
    r2.setXOffset(99.9);
    assertTrue(r1.equals(r2));
    
    r1.setYOffset(111.1);
    assertFalse(r1.equals(r2));
    r2.setYOffset(111.1);
    assertTrue(r1.equals(r2));
    
    r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, 
            Color.blue));
    assertFalse(r1.equals(r2));
    r2.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, 
            Color.blue));
    assertTrue(r1.equals(r2));
}
 
Example 24
Project: trashjam2017   File: GradientEffect.java   Source Code and License 5 votes vote down vote up
/**
 * @see org.newdawn.slick.font.effects.Effect#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.newdawn.slick.UnicodeFont, org.newdawn.slick.font.Glyph)
 */
public void draw(BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph) {
	int ascent = unicodeFont.getAscent();
	float height = (ascent) * scale;
	float top = -glyph.getYOffset() + unicodeFont.getDescent() + offset + ascent / 2 - height / 2;
	g.setPaint(new GradientPaint(0, top, topColor, 0, top + height, bottomColor, cyclic));
	g.fill(glyph.getShape());
}
 
Example 25
Project: litiengine   File: Appearance.java   Source Code and License 5 votes vote down vote up
public Paint getBackgroundPaint(double width, double height) {
  if (this.isTransparentBackground()) {
    return null;
  }

  if (this.backgroundColor2 == null) {
    return this.backgroundColor1;
  }

  if (this.horizontalBackgroundGradient) {
    return new GradientPaint(0, 0, this.backgroundColor1, (float) (width / 2.0), 0, this.backgroundColor2);
  } else {
    return new GradientPaint(0, 0, this.backgroundColor1, 0, (float) (height / 2.0), this.backgroundColor2);
  }
}
 
Example 26
Project: incubator-netbeans   File: RendererPanel.java   Source Code and License 5 votes vote down vote up
@Override
public void paintComponent(Graphics g) {
    if (isRoot && colorManager.isAqua() && node.isExpandable() && node.isRenderedWithGradient()) {
        Graphics2D g2d = (Graphics2D) g;
        Paint oldPaint = g2d.getPaint();
        g2d.setPaint(new GradientPaint(0, 0, Color.white, 0, getHeight() / 2, getBackground()));
        g2d.fillRect(0, 0, getWidth(), getHeight());
        g2d.setPaint(oldPaint);
    } else {
        super.paintComponent(g);
    }
}
 
Example 27
Project: jdk8u-jdk   File: TransformedPaintTest.java   Source Code and License 5 votes vote down vote up
private Paint createPaint(PaintType type, int startx, int starty,
                          int w, int h)
{
    // make sure that the blue color doesn't show up when filling a
    // w by h rect
    w++; h++;

    int endx = startx + w;
    int endy = starty + h;
    Rectangle2D.Float r = new Rectangle2D.Float(startx, starty, w, h);
    switch (type) {
        case COLOR: return Color.red;
        case GRADIENT: return
            new GradientPaint(startx, starty, Color.red,
                              endx, endy, Color.green);
        case LINEAR_GRADIENT: return
            new LinearGradientPaint(startx, starty, endx, endy,
                new float[] { 0.0f, 0.999f, 1.0f },
                new Color[] { Color.red, Color.green, Color.blue });
        case RADIAL_GRADIENT: return
            new RadialGradientPaint(startx, starty,
                (float)Math.sqrt(w * w + h * h),
                new float[] { 0.0f, 0.999f, 1.0f },
                new Color[] { Color.red, Color.green, Color.blue },
                CycleMethod.NO_CYCLE);
        case TEXTURE: {
            BufferedImage bi =
                new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g = (Graphics2D) bi.getGraphics();
            g.setPaint(createPaint(PaintType.LINEAR_GRADIENT, 0, 0, w, h));
            g.fillRect(0, 0, w, h);
            return new TexturePaint(bi, r);
        }
    }
    return Color.green;
}
 
Example 28
Project: brModelo   File: LivreTriangulo.java   Source Code and License 5 votes vote down vote up
@Override
protected void PinteRegiao(Graphics2D g) {
    Composite originalComposite = g.getComposite();
    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alfa));
    g.setPaint(this.getForeColor());

    if (isGradiente()) {
        int dist = 0;
        int w = getWidth() - dist;
        int h = getHeight() - dist;
        int L = getLeft();
        int T = getTop();
        boolean dv = getGDirecao() == VERTICAL;

        GradientPaint GP = new GradientPaint(L, T, getGradienteStartColor(), dv ? L : L + w, dv ? T + h : T, getGradienteEndColor(), true);
        g.setPaint(GP);
    }

    Stroke bkp = g.getStroke();
    if (isDashed()) {
        g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{1, 2}, 0));
    }
    if (isGradiente()) {
        g.fill(getRegiao());
    }
    g.draw(getRegiao()); //Pinta as eventuais linhas internas do dezenho. Ex. LivreVariosDocumemtos 

    g.setStroke(bkp);
    g.setComposite(originalComposite);
}
 
Example 29
Project: incubator-netbeans   File: XYBackground.java   Source Code and License 5 votes vote down vote up
public void paint(Graphics2D g, Rectangle dirtyArea, ChartContext context) {
    if (Utils.forceSpeed()) g.setPaint(GRADIENT_BOTTOM);
    else g.setPaint(new GradientPaint(
                    new Point(0, Utils.checkedInt(context.getViewportOffsetY())),
                    GRADIENT_TOP,
                    new Point(0, context.getViewportHeight()),
                    GRADIENT_BOTTOM));
    g.fill(dirtyArea);
}
 
Example 30
Project: jdk8u-jdk   File: SunGraphics2D.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the Paint in the current graphics state.
 * @param paint The Paint object to be used to generate color in
 * the rendering process.
 * @see java.awt.Graphics#setColor
 * @see GradientPaint
 * @see TexturePaint
 */
public void setPaint(Paint paint) {
    if (paint instanceof Color) {
        setColor((Color) paint);
        return;
    }
    if (paint == null || this.paint == paint) {
        return;
    }
    this.paint = paint;
    if (imageComp == CompositeType.SrcOverNoEa) {
        // special case where compState depends on opacity of paint
        if (paint.getTransparency() == Transparency.OPAQUE) {
            if (compositeState != COMP_ISCOPY) {
                compositeState = COMP_ISCOPY;
            }
        } else {
            if (compositeState == COMP_ISCOPY) {
                compositeState = COMP_ALPHA;
            }
        }
    }
    Class<? extends Paint> paintClass = paint.getClass();
    if (paintClass == GradientPaint.class) {
        paintState = PAINT_GRADIENT;
    } else if (paintClass == LinearGradientPaint.class) {
        paintState = PAINT_LIN_GRADIENT;
    } else if (paintClass == RadialGradientPaint.class) {
        paintState = PAINT_RAD_GRADIENT;
    } else if (paintClass == TexturePaint.class) {
        paintState = PAINT_TEXTURE;
    } else {
        paintState = PAINT_CUSTOM;
    }
    validFontInfo = false;
    invalidatePipe();
}
 
Example 31
Project: sbc-qsystem   File: QPanel.java   Source Code and License 5 votes vote down vote up
private void DrawRectangleGradient(Graphics2D g2, int w, int h) {
    /* RenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    qualityHints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
    g2.setRenderingHints(qualityHints); */
    GradientPaint gradient = new GradientPaint(startPoint.x, startPoint.y, startColor,
        endPoint.x,
        endPoint.y, endColor, cycleFillGradient);
    g2.setPaint(gradient);
    g2.fillRect(0, 0, w, h);

    //  RoundGradientPaint rgp = new RoundGradientPaint(w/2, h/2, startColor, new Point2D.Double(w, h),endColor);
    //  g2.setPaint(rgp);
    //  g2.fillRect(0,0,w,h);
}
 
Example 32
Project: rapidminer   File: TabbedPaneUI.java   Source Code and License 5 votes vote down vote up
private static void paintSelectedRight(Graphics g, int x, int y, int w, int h) {
	g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[2]);
	g.drawLine(x, y + 1, x + w - 11, y + 1);

	g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[3]);
	g.drawLine(x, y, x + w - 15, y);

	ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[4];
	g.setColor(c1);

	g.drawLine(w + x - 10, y + 1, w + x - 10, y + 2);
	g.drawLine(w + x - 9, y + 2, w + x - 9, y + 2);
	g.drawLine(w + x - 8, y + 2, w + x - 8, y + 3);
	g.drawLine(w + x - 7, y + 3, w + x - 7, y + 4);
	g.drawLine(w + x - 6, y + 4, w + x - 6, y + 5);

	g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[5]);

	g.drawLine(x, y + 2, x + w - 11, y + 2);
	g.drawLine(x, y + 3, x + w - 9, y + 3);
	g.drawLine(x, y + 4, x + w - 8, y + 4);
	g.drawLine(x, y + 5, x + w - 7, y + 5);

	Graphics2D g2 = (Graphics2D) g;
	g2.setPaint(new GradientPaint(1, y + 6, RapidLookTools.getColors().getTabbedPaneColors()[6], 1, y + h,
			RapidLookTools.getColors().getTabbedPaneColors()[7]));

	int[] xArr = new int[] { x + 4, w + x - 5, w + x - 5, x + 4 };
	int[] yArr = new int[] { y + 6, y + 6, y + h, y + h };
	Polygon p1 = new Polygon(xArr, yArr, 4);

	g2.fillPolygon(p1);

	g.setColor(c1);
	g.drawLine(w + x - 5, y + 6, x + w - 5, y + h - 1);

	g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[1]);
	g.drawLine(x + w - 14, y, x + w - 12, y);
	g.drawLine(w + x - 6, y + 6, x + w - 6, y + 6);
}
 
Example 33
Project: rapidminer   File: MenuBarBackgroundPainter.java   Source Code and License 5 votes vote down vote up
@Override
protected void paintToImage(Component c, Graphics g, int w, int h, Object[] args) {
	g.setColor(new ColorUIResource(252, 252, 252));
	g.fillRect(0, 0, w, 3);

	Graphics2D g2 = (Graphics2D) g;
	g2.setPaint(new GradientPaint(0, 3, new ColorUIResource(252, 252, 252), 0, h - 3, new ColorUIResource(232, 232, 232)));
	g2.fillRect(0, 3, w, h - 3);
}
 
Example 34
Project: rapidminer   File: ProcessDrawUtils.java   Source Code and License 5 votes vote down vote up
/**
 * Draws a shadow around the given rectangle.
 *
 * @param rect
 *            the rectangle which should get a shadow
 * @param g2
 *            the graphics context to draw the shadow on
 */
public static void drawShadow(final Rectangle2D rect, final Graphics2D g2) {
	Graphics2D g2S = (Graphics2D) g2.create();

	Rectangle2D shadow = new Rectangle2D.Double(rect.getX() + 5, rect.getY() + ProcessDrawer.HEADER_HEIGHT + 5,
			rect.getWidth(), rect.getHeight() - ProcessDrawer.HEADER_HEIGHT);
	GeneralPath bottom = new GeneralPath();
	bottom.moveTo(shadow.getX(), rect.getMaxY());
	bottom.lineTo(rect.getMaxX(), rect.getMaxY());
	bottom.lineTo(shadow.getMaxX(), shadow.getMaxY());
	bottom.lineTo(shadow.getMinX(), shadow.getMaxY());
	bottom.closePath();
	g2S.setPaint(new GradientPaint((float) rect.getX(), (float) rect.getMaxY(), Color.gray, (float) rect.getX(),
			(float) shadow.getMaxY(), TRANSPARENT_GRAY));
	g2S.fill(bottom);

	GeneralPath right = new GeneralPath();
	right.moveTo(rect.getMaxX(), shadow.getMinY());
	right.lineTo(shadow.getMaxX(), shadow.getMinY());
	right.lineTo(shadow.getMaxX(), shadow.getMaxY());
	right.lineTo(rect.getMaxX(), rect.getMaxY());
	right.closePath();
	g2S.setPaint(new GradientPaint((float) rect.getMaxX(), (float) shadow.getY(), Color.gray, (float) shadow.getMaxX(),
			(float) shadow.getY(), TRANSPARENT_GRAY));
	g2S.fill(right);

	g2S.dispose();
}
 
Example 35
Project: rapidminer   File: AnnotationDrawer.java   Source Code and License 5 votes vote down vote up
/**
 * Draws indicator in case the annotation text overflows on the y axis.
 *
 * @param anno
 *            the annotation
 * @param g
 *            the graphics context to draw upon
 * @param loc
 *            the location of the annotation
 * @param printing
 *            if we are currently printing
 */
private void drawOverflowIndicator(final WorkflowAnnotation anno, final Graphics2D g, final Rectangle2D loc,
		final boolean printing) {
	if (printing) {
		// never draw them for printing
		return;
	}
	Graphics2D g2 = (Graphics2D) g.create();

	int size = 20;
	int xOffset = 10;
	int yOffset = 10;
	int stepSize = size / 4;
	int dotSize = 3;
	int x = (int) loc.getMaxX() - size - xOffset;
	int y = (int) loc.getMaxY() - size - yOffset;
	GradientPaint gp = new GradientPaint(x, y, Color.WHITE, x, y + size * 1.5f, Color.LIGHT_GRAY);
	g2.setPaint(gp);
	g2.fillRect(x, y, size, size);

	g2.setColor(Color.BLACK);
	g2.drawRect(x, y, size, size);

	g2.fillOval(x + stepSize, y + stepSize * 2, dotSize, dotSize);
	g2.fillOval(x + stepSize * 2, y + stepSize * 2, dotSize, dotSize);
	g2.fillOval(x + stepSize * 3, y + stepSize * 2, dotSize, dotSize);

	g2.dispose();
}
 
Example 36
Project: jmt   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawProcessor(Color startC, Color border, boolean gradientFill, Graphics2D g2d) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	processor.setFrame(x, y, 2 * PROC_RAD, 2 * PROC_RAD);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + PROC_RAD * 2), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	g2d.fill(processor);
	g2d.setPaint(border);
	g2d.draw(processor);
}
 
Example 37
Project: jmt   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawProcessor2(Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	processor.setFrame(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, PROC_RAD, PROC_RAD);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + PROC_RAD * 2), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	g2d.fill(processor);
	g2d.setPaint(border);
	g2d.draw(processor);
}
 
Example 38
Project: jmt   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawProcessorMulti(Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	processor.setFrame(x + PROC_RAD / 2 + ELEMS_GAP / 2, y + cpu * (PROC_RAD - ELEMS_GAP) + ELEMS_GAP * cpu * 3 - ELEMS_GAP / 2, PROC_RAD
			- ELEMS_GAP, PROC_RAD - ELEMS_GAP);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + PROC_RAD * 2), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	g2d.fill(processor);
	g2d.setPaint(border);
	g2d.draw(processor);
}
 
Example 39
Project: jmt   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawPoint(Color startC, Color border, boolean gradientFill, Graphics2D g2d, int point) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	processor.setFrame(x + PROC_RAD, y + PROC_RAD - ELEMS_GAP / 2 + ELEMS_GAP * point, 0.5, 0.5);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + PROC_RAD * 2), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	g2d.fill(processor);
	g2d.setPaint(border);
	g2d.draw(processor);
}
 
Example 40
Project: jmt   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawUtilization(double U, Color startC, Color border, boolean gradientFill, Graphics2D g2d) {

		double x = getProcessorXY().x, y = getProcessorXY().y;
		try {
			occupiedRect = new Rectangle2D.Double(x, y, 2 * PROC_RAD, 2 * PROC_RAD * (1 - U));
		} catch (Exception e) {
			occupiedRect = new Rectangle2D.Double(x, y, 2 * PROC_RAD, 0.0);
		}
		occupiedEll = new Ellipse2D.Double(x, y, 2 * PROC_RAD, 2 * PROC_RAD);
		if (gradientFill) {
			GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
					false);
			g2d.setPaint(gp);
		} else {
			g2d.setPaint(startC);
		}
		occupiedArea = new Area(occupiedEll);
		occupiedArea.subtract(new Area(occupiedRect));
		g2d.fill(occupiedArea);
		g2d.setPaint(Color.BLACK);
		g2d.draw(occupiedArea);

		// //draw informations about processes
		// txtBounds = drawCenteredText("job n.:" + donejobs, Color.BLACK, x +
		// PROC_RAD,y + PROC_RAD * 2 + 4 * ELEMS_GAP,g2d, false);
		// //draw orizontal line parallel to occupation
		//			
		// //draw box around text
		// txtBounds.setFrame(
		// x + PROC_RAD - txtBounds.getWidth() / 2,
		// y + 2 * PROC_RAD + 4 * ELEMS_GAP - txtBounds.getHeight() / 2,
		// txtBounds.getWidth(),
		// txtBounds.getHeight());
		//			
		// g2d.draw(txtBounds);
	}
 
Example 41
Project: jmt   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawOccupiedPercentage2(Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {
	//processor.setFrame(x+PROC_RAD/2 , y + cpu*PROC_RAD, 2 * PROC_RAD /2, 2 * PROC_RAD /2);

	//		if (remainingTime[cpu] != 0) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	occupiedRect = new Rectangle2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, 2 * PROC_RAD
			* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2);
	occupiedEll = new Ellipse2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, 2 * PROC_RAD / 2);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	occupiedArea = new Area(occupiedEll);
	occupiedArea.subtract(new Area(occupiedRect));
	g2d.fill(occupiedArea);
	g2d.setPaint(Color.BLACK);
	g2d.draw(occupiedArea);

	// draw orizontal line parallel to occupation
	Line2D.Double l = new Line2D.Double(x + PROC_RAD * 2 + ELEMS_GAP, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2 + 2 * PROC_RAD
			* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2,//y + PROC_RAD * 2 * (1 - (double) remainingTime / (double) totTime) /2 + ELEMS_GAP * cpu -  ELEMS_GAP /2  , 
			x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2 + 2 * PROC_RAD
					* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2);//y + PROC_RAD * 2 * (1 - (double) remainingTime / (double) totTime) /2 + ELEMS_GAP * cpu -  ELEMS_GAP /2 );
	g2d.draw(l);

	// draw vertical line
	l = new Line2D.Double(x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2 + 2 * PROC_RAD
			* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2, x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + PROC_RAD * 2 / 2 + cpu
			* PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2);
	g2d.draw(l);

	//		}
}
 
Example 42
Project: Progetto-C   File: GradientEffect.java   Source Code and License 5 votes vote down vote up
/**
 * @see org.newdawn.slick.font.effects.Effect#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.newdawn.slick.UnicodeFont, org.newdawn.slick.font.Glyph)
 */
public void draw(BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph) {
	int ascent = unicodeFont.getAscent();
	float height = (ascent) * scale;
	float top = -glyph.getYOffset() + unicodeFont.getDescent() + offset + ascent / 2 - height / 2;
	g.setPaint(new GradientPaint(0, top, topColor, 0, top + height, bottomColor, cyclic));
	g.fill(glyph.getShape());
}
 
Example 43
Project: JDigitalSimulator   File: Guitilities.java   Source Code and License 5 votes vote down vote up
public static BufferedImage createGradientImage(int width, int height, Color gradient_a, Color gradient_b) {
	BufferedImage image = createCompatibleImage(width, height);
	GradientPaint gradient = new GradientPaint(0, 0, gradient_a, 0, height, gradient_b, false);
	Graphics2D graphics = (Graphics2D) image.getGraphics();
	graphics.setPaint(gradient);
	graphics.fillRect(0, 0, width, height);
	graphics.dispose();
	return image;
}
 
Example 44
Project: febit   File: GradientBackgroundFilter.java   Source Code and License 5 votes vote down vote up
@Override
public BufferedImage render(final BufferedImage baseImage) {

    int width = baseImage.getWidth();
    int height = baseImage.getHeight();

    // create an opaque image
    RenderingHints hints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_OFF);

    hints.add(new RenderingHints(RenderingHints.KEY_COLOR_RENDERING,
            RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    hints.add(new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION,
            RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));

    hints.add(new RenderingHints(RenderingHints.KEY_RENDERING,
            RenderingHints.VALUE_RENDER_QUALITY));

    BufferedImage imageWithBackground = new BufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB);

    Graphics2D graph = (Graphics2D) imageWithBackground.getGraphics();
    graph.setRenderingHints(hints);
    graph.setPaint(new GradientPaint(0, 0, colorFrom, width, height, colorTo));
    graph.fill(new Rectangle2D.Double(0, 0, width, height));
    graph.drawImage(baseImage, 0, 0, null);
    graph.dispose();

    return imageWithBackground;
}
 
Example 45
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawProcessor(Color startC, Color border, boolean gradientFill, Graphics2D g2d) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	processor.setFrame(x, y, 2 * PROC_RAD, 2 * PROC_RAD);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + PROC_RAD * 2), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	g2d.fill(processor);
	g2d.setPaint(border);
	g2d.draw(processor);
}
 
Example 46
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawProcessorMulti(Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	processor.setFrame(x + PROC_RAD / 2 + ELEMS_GAP / 2, y + cpu * (PROC_RAD - ELEMS_GAP) + ELEMS_GAP * cpu * 3 - ELEMS_GAP / 2, PROC_RAD
			- ELEMS_GAP, PROC_RAD - ELEMS_GAP);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + PROC_RAD * 2), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	g2d.fill(processor);
	g2d.setPaint(border);
	g2d.draw(processor);
}
 
Example 47
Project: brModelo   File: FormaArea.java   Source Code and License 5 votes vote down vote up
protected void PaintGradiente(Graphics2D g) { //, boolean round) {
        Paint bkp = g.getPaint();
        int dist = distSelecao;

        int W = getWidth() - dist;
        int H = 2 * alturaTexto - 1 - dist;
        boolean dv = getGDirecao() == VERTICAL;

        Composite originalComposite = g.getComposite();
        int type = AlphaComposite.SRC_OVER;

        g.setComposite(AlphaComposite.getInstance(type, alfa));

        Stroke bkps = g.getStroke();
        if (isDashed()) {
            g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{1, 2}, 0));
        }

//        GradientPaint GP = new GradientPaint(getLeft(), getTop(), Color.LIGHT_GRAY, dv ? getLeft() : getLeft() + W, dv ? getTop() + H : getTop(), Color.white, true);
//        g.setPaint(GP);
        int w = getWidth() - dist;
        int h = getHeight() - dist;
        int L = getLeft();
        int T = getTop();

        GradientPaint GP = new GradientPaint(L, T, getGradienteStartColor(), dv ? L : L + w, dv ? T + h : T, getGradienteEndColor(), true);
        g.setPaint(GP);

        g.fillRect(getLeft() + 1, getTop() + 1, W, H);
        g.setComposite(originalComposite);
        g.setPaint(bkp);
        g.setStroke(bkps);
    }
 
Example 48
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawUtilization(double U, Color startC, Color border, boolean gradientFill, Graphics2D g2d) {

		double x = getProcessorXY().x, y = getProcessorXY().y;
		try {
			occupiedRect = new Rectangle2D.Double(x, y, 2 * PROC_RAD, 2 * PROC_RAD * (1 - U));
		} catch (Exception e) {
			occupiedRect = new Rectangle2D.Double(x, y, 2 * PROC_RAD, 0.0);
		}
		occupiedEll = new Ellipse2D.Double(x, y, 2 * PROC_RAD, 2 * PROC_RAD);
		if (gradientFill) {
			GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
					false);
			g2d.setPaint(gp);
		} else {
			g2d.setPaint(startC);
		}
		occupiedArea = new Area(occupiedEll);
		occupiedArea.subtract(new Area(occupiedRect));
		g2d.fill(occupiedArea);
		g2d.setPaint(Color.BLACK);
		g2d.draw(occupiedArea);

		// //draw informations about processes
		// txtBounds = drawCenteredText("job n.:" + donejobs, Color.BLACK, x +
		// PROC_RAD,y + PROC_RAD * 2 + 4 * ELEMS_GAP,g2d, false);
		// //draw orizontal line parallel to occupation
		//			
		// //draw box around text
		// txtBounds.setFrame(
		// x + PROC_RAD - txtBounds.getWidth() / 2,
		// y + 2 * PROC_RAD + 4 * ELEMS_GAP - txtBounds.getHeight() / 2,
		// txtBounds.getWidth(),
		// txtBounds.getHeight());
		//			
		// g2d.draw(txtBounds);
	}
 
Example 49
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawUtilization2(double U, Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {

		double x = getProcessorXY().x, y = getProcessorXY().y;
		try {
			occupiedRect = new Rectangle2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, PROC_RAD
					* (1 - U / nCpu));
		} catch (Exception e) {
			occupiedRect = new Rectangle2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, 0.0);
		}
		occupiedEll = new Ellipse2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, 2 * PROC_RAD / 2);
		if (gradientFill) {
			GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
					false);
			g2d.setPaint(gp);
		} else {
			g2d.setPaint(startC);
		}
		occupiedArea = new Area(occupiedEll);
		occupiedArea.subtract(new Area(occupiedRect));
		g2d.fill(occupiedArea);
		g2d.setPaint(Color.BLACK);
		g2d.draw(occupiedArea);

		// //draw informations about processes
		// txtBounds = drawCenteredText("job n.:" + donejobs, Color.BLACK, x +
		// PROC_RAD,y + PROC_RAD * 2 + 4 * ELEMS_GAP,g2d, false);
		// //draw orizontal line parallel to occupation
		//			
		// //draw box around text
		// txtBounds.setFrame(
		// x + PROC_RAD - txtBounds.getWidth() / 2,
		// y + 2 * PROC_RAD + 4 * ELEMS_GAP - txtBounds.getHeight() / 2,
		// txtBounds.getWidth(),
		// txtBounds.getHeight());
		//			
		// g2d.draw(txtBounds);
	}
 
Example 50
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawOccupiedPercentage(Color startC, Color border, boolean gradientFill, Graphics2D g2d) {

		if (remainingTime[0] != 0) {
			double x = getProcessorXY().x, y = getProcessorXY().y;
			occupiedRect = new Rectangle2D.Double(x, y, 2 * PROC_RAD, 2 * PROC_RAD * (1 - (double) remainingTime[0] / (double) totTime[0]));
			occupiedEll = new Ellipse2D.Double(x, y, 2 * PROC_RAD, 2 * PROC_RAD);
			if (gradientFill) {
				GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
						false);
				g2d.setPaint(gp);
			} else {
				g2d.setPaint(startC);
			}
			occupiedArea = new Area(occupiedEll);
			occupiedArea.subtract(new Area(occupiedRect));
			g2d.fill(occupiedArea);
			g2d.setPaint(Color.BLACK);
			g2d.draw(occupiedArea);

			// draw orizontal line parallel to occupation
			Line2D.Double l = new Line2D.Double(x + PROC_RAD * 2 + ELEMS_GAP, y + PROC_RAD * 2
					* (1 - (double) remainingTime[0] / (double) totTime[0]), x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + PROC_RAD * 2
					* (1 - (double) remainingTime[0] / (double) totTime[0]));
			g2d.draw(l);

			// draw vertical line
			l = new Line2D.Double(x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + PROC_RAD * 2 * (1 - (double) remainingTime[0] / (double) totTime[0]), x
					+ PROC_RAD * 2 + 2 * ELEMS_GAP, y + 2 * PROC_RAD + 4 * ELEMS_GAP - txtBounds.getHeight() / 2);
			g2d.draw(l);

			// draw horizontal line under text
			txtBounds.setFrame(x + PROC_RAD - txtBounds.getWidth() / 2, y + 2 * PROC_RAD + 4 * ELEMS_GAP - txtBounds.getHeight() / 2, txtBounds
					.getWidth(), txtBounds.getHeight());

			g2d.draw(txtBounds);
		}
	}
 
Example 51
Project: QN-ACTR-Release   File: QueueDrawer.java   Source Code and License 5 votes vote down vote up
private void drawOccupiedPercentage2(Color startC, Color border, boolean gradientFill, Graphics2D g2d, int cpu) {
	//processor.setFrame(x+PROC_RAD/2 , y + cpu*PROC_RAD, 2 * PROC_RAD /2, 2 * PROC_RAD /2);

	//		if (remainingTime[cpu] != 0) {
	double x = getProcessorXY().x, y = getProcessorXY().y;
	occupiedRect = new Rectangle2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, 2 * PROC_RAD
			* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2);
	occupiedEll = new Ellipse2D.Double(x + PROC_RAD / 2, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2, 2 * PROC_RAD / 2, 2 * PROC_RAD / 2);
	if (gradientFill) {
		GradientPaint gp = new GradientPaint((float) x, (float) y, startC.brighter(), (float) x, (float) (y + 2 * PROC_RAD), startC.darker(),
				false);
		g2d.setPaint(gp);
	} else {
		g2d.setPaint(startC);
	}
	occupiedArea = new Area(occupiedEll);
	occupiedArea.subtract(new Area(occupiedRect));
	g2d.fill(occupiedArea);
	g2d.setPaint(Color.BLACK);
	g2d.draw(occupiedArea);

	// draw orizontal line parallel to occupation
	Line2D.Double l = new Line2D.Double(x + PROC_RAD * 2 + ELEMS_GAP, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2 + 2 * PROC_RAD
			* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2,//y + PROC_RAD * 2 * (1 - (double) remainingTime / (double) totTime) /2 + ELEMS_GAP * cpu -  ELEMS_GAP /2  , 
			x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2 + 2 * PROC_RAD
					* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2);//y + PROC_RAD * 2 * (1 - (double) remainingTime / (double) totTime) /2 + ELEMS_GAP * cpu -  ELEMS_GAP /2 );
	g2d.draw(l);

	// draw vertical line
	l = new Line2D.Double(x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + cpu * PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2 + 2 * PROC_RAD
			* (1 - (double) remainingTime[cpu] / (double) totTime[cpu]) / 2, x + PROC_RAD * 2 + 2 * ELEMS_GAP, y + PROC_RAD * 2 / 2 + cpu
			* PROC_RAD + ELEMS_GAP * cpu - ELEMS_GAP / 2);
	g2d.draw(l);

	//		}
}
 
Example 52
Project: Spark   File: Java2DEngine.java   Source Code and License 5 votes vote down vote up
public final void drawGradientLine(float X1, float Y1, float Red1,
		float Green1, float Blue1, float Alpha1, float X2, float Y2,
		float Red2, float Green2, float Blue2, float Alpha2)
{
	GradientPaint gp = new GradientPaint(X1, Y1, new Color(Red1, Green1,
			Blue1, Alpha1), X2, Y2, new Color(Red2, Green2, Blue2, Alpha2),
			true);
	java2DGame.g.setPaint(gp);
	java2DGame.g.drawLine((int) X1, (int) Y1, (int) X2, (int) Y2);
	java2DGame.g.setPaint(null);
}
 
Example 53
Project: brModelo   File: PreTexto.java   Source Code and License 5 votes vote down vote up
protected void PaintGradiente(Graphics2D g, boolean round) {
    int dist = 0;
    int w = getWidth() - dist;
    int h = getHeight() - dist;
    int L = getLeft();
    int T = getTop();
    boolean dv = getGDirecao() == VERTICAL;

    //Composite originalComposite = g.getComposite();
    //g.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_OVER, alfa));
    GradientPaint GP = new GradientPaint(L, T, getGradienteStartColor(), dv ? L : L + w, dv ? T + h : T, getGradienteEndColor(), true);
    //g.setPaint(GP);

    g.setPaint(getForeColor());
    if (round) {
        g.drawRoundRect(L, T, w - 1, h - 1, roundRectSize, roundRectSize);
        g.setPaint(GP);
        g.fillRoundRect(L + 1, T + 1, w - 2, h - 2, roundRectSize, roundRectSize);
        g.setPaint(isDisablePainted()? disabledColor : Color.WHITE);
        g.drawRoundRect(L + 1, T + 1, w - 3, h - 3, roundRectSize, roundRectSize);
    } else {
        g.drawRect(L, T, w - 1, h - 1);
        g.setPaint(GP);
        g.fillRect(L + 1, T + 1, w - 2, h - 2);
        g.setPaint(isDisablePainted()? disabledColor : Color.WHITE);
        g.drawRect(L + 1, T + 1, w - 3, h - 3);
    }
    if (isGradientePinteDetalhe()) {
        g.setPaint(getGradienteCorDetalhe());
        GeneralPath path = new GeneralPath();
        path.moveTo(L + 2, T + 2);
        path.quadTo(L + w / 2 + 1, T + h / 2 + 1, L + w - 1, T + 2);
        path.closePath();
        g.fill(path);
    }
    //g.setComposite(originalComposite);

}
 
Example 54
Project: BaseClient   File: GradientEffect.java   Source Code and License 5 votes vote down vote up
/**
 * @see org.newdawn.slick.font.effects.Effect#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.newdawn.slick.UnicodeFont, org.newdawn.slick.font.Glyph)
 */
public void draw(BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph) {
	int ascent = unicodeFont.getAscent();
	float height = (ascent) * scale;
	float top = -glyph.getYOffset() + unicodeFont.getDescent() + offset + ascent / 2 - height / 2;
	g.setPaint(new GradientPaint(0, top, topColor, 0, top + height, bottomColor, cyclic));
	g.fill(glyph.getShape());
}
 
Example 55
Project: openjdk-jdk10   File: PngForceStopWritingTest.java   Source Code and License 5 votes vote down vote up
private static BufferedImage createImage(int size) {

        BufferedImage image = new
            BufferedImage(size, size, BufferedImage.TYPE_3BYTE_BGR);
        Graphics2D g = image.createGraphics();
        g.setPaint(new GradientPaint(0, 0, Color.blue, size, size, Color.red));
        g.fillRect(0, 0, size, size);
        g.dispose();
        return image;
    }
 
Example 56
Project: OpenJSharp   File: BufferedPaints.java   Source Code and License 5 votes vote down vote up
static void setPaint(RenderQueue rq, SunGraphics2D sg2d,
                     Paint paint, int ctxflags)
{
    if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
        setColor(rq, sg2d.pixel);
    } else {
        boolean useMask = (ctxflags & BufferedContext.USE_MASK) != 0;
        switch (sg2d.paintState) {
        case SunGraphics2D.PAINT_GRADIENT:
            setGradientPaint(rq, sg2d,
                             (GradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_LIN_GRADIENT:
            setLinearGradientPaint(rq, sg2d,
                                   (LinearGradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_RAD_GRADIENT:
            setRadialGradientPaint(rq, sg2d,
                                   (RadialGradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_TEXTURE:
            setTexturePaint(rq, sg2d,
                            (TexturePaint)paint, useMask);
            break;
        default:
            break;
        }
    }
}
 
Example 57
Project: OpenJSharp   File: BufferedPaints.java   Source Code and License 5 votes vote down vote up
private static void setGradientPaint(RenderQueue rq,
                                     SunGraphics2D sg2d,
                                     GradientPaint paint,
                                     boolean useMask)
{
    setGradientPaint(rq, (AffineTransform)sg2d.transform.clone(),
                     paint.getColor1(), paint.getColor2(),
                     paint.getPoint1(), paint.getPoint2(),
                     paint.isCyclic(), useMask);
}
 
Example 58
Project: OpenJSharp   File: SunGraphics2D.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the Paint in the current graphics state.
 * @param paint The Paint object to be used to generate color in
 * the rendering process.
 * @see java.awt.Graphics#setColor
 * @see GradientPaint
 * @see TexturePaint
 */
public void setPaint(Paint paint) {
    if (paint instanceof Color) {
        setColor((Color) paint);
        return;
    }
    if (paint == null || this.paint == paint) {
        return;
    }
    this.paint = paint;
    if (imageComp == CompositeType.SrcOverNoEa) {
        // special case where compState depends on opacity of paint
        if (paint.getTransparency() == Transparency.OPAQUE) {
            if (compositeState != COMP_ISCOPY) {
                compositeState = COMP_ISCOPY;
            }
        } else {
            if (compositeState == COMP_ISCOPY) {
                compositeState = COMP_ALPHA;
            }
        }
    }
    Class<? extends Paint> paintClass = paint.getClass();
    if (paintClass == GradientPaint.class) {
        paintState = PAINT_GRADIENT;
    } else if (paintClass == LinearGradientPaint.class) {
        paintState = PAINT_LIN_GRADIENT;
    } else if (paintClass == RadialGradientPaint.class) {
        paintState = PAINT_RAD_GRADIENT;
    } else if (paintClass == TexturePaint.class) {
        paintState = PAINT_TEXTURE;
    } else {
        paintState = PAINT_CUSTOM;
    }
    validFontInfo = false;
    invalidatePipe();
}
 
Example 59
Project: DicomViewer   File: SliderComponentForTimeSlider.java   Source Code and License 5 votes vote down vote up
@Override
protected void drawSlider(final Graphics2D g2) {
    GradientPaint gradient = new GradientPaint(0, 0, colorLimitMin, sliderWidth(), 0, colorLimitMax, true);
    g2.setPaint(gradient);
    fillSlider(g2);
    g2.setColor(Color.black);
    super.drawSlider(g2);
}
 
Example 60
Project: JuggleMasterPro   File: AnimationJFrame.java   Source Code and License 5 votes vote down vote up
/**
 * Method description
 * 
 * @see
 * @param objPgraphics2D
 */
final private void doDrawColoredBorder(Graphics2D objPgraphics2D) {

	final Insets objLinsets = this.getInsets();

	final byte bytLthickness = 4;
	final int intLx0 = objLinsets.left;
	final int intLy0 = objLinsets.top;
	final int intLx1 = objLinsets.left + this.intGbackgroundWidth;
	final int intLy1 = objLinsets.top + this.intGbackgroundHeight;

	// North border :
	objPgraphics2D.setStroke(new BasicStroke(0.5F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
	objPgraphics2D.setPaint(new GradientPaint(intLx0, intLy0, Color.WHITE, intLx1, intLy0, Color.ORANGE, false));
	objPgraphics2D.fillRect(intLx0, intLy0, intLx1 - intLx0, bytLthickness);

	// West border :
	objPgraphics2D.setPaint(new GradientPaint(intLx0, intLy0, Color.WHITE, intLx0, intLy1, Color.ORANGE, false));
	objPgraphics2D.fillRect(intLx0, intLy0, bytLthickness, intLy1 - intLy0);

	// East border :
	objPgraphics2D.setPaint(new GradientPaint(intLx1, intLy0, Color.ORANGE, intLx1, intLy1, Color.RED, false));
	objPgraphics2D.fillRect(intLx1 - bytLthickness, intLy0, bytLthickness, intLy1 - intLy0);

	// South border :
	objPgraphics2D.setPaint(new GradientPaint(intLx0, intLy1, Color.ORANGE, intLx1, intLy1, Color.RED, false));
	objPgraphics2D.fillRect(intLx0, intLy1 - bytLthickness, intLx1 - intLx0, bytLthickness);
}