Java Code Examples for java.awt.Graphics2D.drawRoundRect()

The following are Jave code examples for showing how to use drawRoundRect() of the java.awt.Graphics2D class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: rapidminer   File: ComboBoxUI.java   View Source Code Vote up 6 votes
/**
 * Draws the border of the combobox.
 */
private void paintBorder(Graphics g, JComponent c) {
	int w = c.getWidth();
	int h = c.getHeight();
	if (w <= 0 || h <= 0) {
		return;
	}

	Graphics2D g2 = (Graphics2D) g;
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
	boolean hasFocus = comboBox.isEditable() ? c.isFocusOwner()
			|| ((JComboBox) c).getEditor().getEditorComponent().isFocusOwner() : c.isFocusOwner();
			if (c.isEnabled()) {
				if (hasFocus) {
					g2.setColor(Colors.COMBOBOX_BORDER_FOCUS);
				} else {
					g2.setColor(Colors.COMBOBOX_BORDER);
				}
			} else {
				g2.setColor(Colors.COMBOBOX_BORDER_DISABLED);
			}

			g2.drawRoundRect(0, 0, w - 1, h - 1, RapidLookAndFeel.CORNER_DEFAULT_RADIUS, RapidLookAndFeel.CORNER_DEFAULT_RADIUS);
}
 
Example 2
Project: rapidminer   File: TextFieldBorder.java   View Source Code Vote up 6 votes
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
	Graphics2D g2 = (Graphics2D) g;
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

	g2.translate(x, y);

	if (c.isEnabled()) {
		if (c.isFocusOwner()) {
			g2.setColor(Colors.TEXTFIELD_BORDER_FOCUS);
		} else {
			g2.setColor(Colors.TEXTFIELD_BORDER);
		}
	} else {
		g2.setColor(Colors.TEXTFIELD_BORDER_DISABLED);
	}

	g2.drawRoundRect(0, 0, w - 1, h - 1, RapidLookAndFeel.CORNER_DEFAULT_RADIUS, RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	g2.translate(-x, -y);
}
 
Example 3
Project: defense-solutions-proofs-of-concept   File: RoundedJPanel.java   View Source Code Vote up 6 votes
@Override
protected void paintComponent(Graphics g) {
    int borderWidth = 3;
    int x = borderWidth;
    int y = borderWidth;
    int w = getWidth() - (2 * borderWidth);
    int h = getHeight() - (2 * borderWidth);
    int arc = 30;

    Graphics2D g2 = (Graphics2D) g.create();
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);

    g2.setColor(Color.WHITE);
    g2.fillRoundRect(x, y, w, h, arc, arc);

    g2.setStroke(new BasicStroke(borderWidth));
    g2.setColor(new Color(40, 40, 40));
    g2.drawRoundRect(x, y, w, h, arc, arc);

    g2.dispose();
}
 
Example 4
Project: rapidminer   File: CompositeButtonPainter.java   View Source Code Vote up 6 votes
/**
 * Draws the component border.
 *
 * @param graphics
 *            the graphics context
 */
void paintBorder(Graphics graphics) {
	Graphics2D g = (Graphics2D) graphics.create();
	g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

	g.setColor(Colors.BUTTON_BORDER);

	int radius = RapidLookAndFeel.CORNER_DEFAULT_RADIUS;
	switch (position) {
		case SwingConstants.LEFT:
			g.drawRoundRect(0, 0, button.getWidth() + radius, button.getHeight() - 1, radius, radius);
			break;
		case SwingConstants.CENTER:
			g.drawRect(0, 0, button.getWidth() + radius, button.getHeight() - 1);
			break;
		default:
			g.drawRoundRect(-radius, 0, button.getWidth() + radius - 1, button.getHeight() - 1, radius, radius);
			g.drawLine(0, 0, 0, button.getHeight());
			break;
	}
}
 
Example 5
Project: monarch   File: LifelineState.java   View Source Code Vote up 5 votes
public void highlight(Graphics2D g) {
  Rectangle bounds = g.getClipBounds();
  if (startY > bounds.getMaxY() || startY + height < bounds.getMinY()) {
    return;
  }

  int x = line.getX();
  int width = line.getWidth();

  g.drawRoundRect(x, startY, width, height, ARC_SIZE, ARC_SIZE);
}
 
Example 6
Project: rapidminer   File: AttributeStatisticsPanel.java   View Source Code Vote up 5 votes
@Override
public void paintComponent(final Graphics g) {
	Graphics2D g2 = (Graphics2D) g;
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
	int x = 0;
	int y = 0;
	int width = (int) getSize().getWidth();
	int height = (int) getSize().getHeight();

	// draw background depending special roles and hovering
	g2.setPaint(AttributeGuiTools.getColorForAttributeRole(mapAttributeRoleName(),
			hovered ? ColorScope.HOVER : ColorScope.BACKGROUND));

	g2.fillRoundRect(x, y, width, height, RapidLookAndFeel.CORNER_DEFAULT_RADIUS,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	// draw background depending special roles and hovering
	g2.setPaint(AttributeGuiTools.getColorForAttributeRole(mapAttributeRoleName(), ColorScope.BORDER));
	if (hovered) {
		g2.setStroke(new BasicStroke(1.0f));
	} else {
		g2.setStroke(new BasicStroke(0.5f));
	}
	g2.drawRoundRect(x, y, width - 1, height - 1, RapidLookAndFeel.CORNER_DEFAULT_RADIUS,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	// let Swing draw its components
	super.paintComponent(g2);
}
 
Example 7
Project: scorekeeperfrontend   File: FocusButton.java   View Source Code Vote up 5 votes
@Override
public void paint(Graphics g1) 
{
	Graphics2D g = (Graphics2D) g1;
	if (model.isArmed() && model.isPressed())
		g.setColor(colors.pressed);
	else if (model.isRollover())
		g.setColor(colors.hover);
	else
		g.setColor(colors.background);
	
	g.fillRoundRect(0, 0, getWidth() - 1, getHeight() - 1, 5, 5);
	g.setColor(Color.BLACK);
	g.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 1, 5, 5);
	
	// cheap way to draw icon/text with nice spacing
	if (currentState < 0)
	{
		stamp.setText("");
		stamp.setIcon(null);
	}
	else
	{
	    stamp.setText(getText() + currentState);
		stamp.setIcon(timerOn);
	}
	
	stamp.setForeground(colors.foreground);
	stamp.setFont(getFont());	
	stamp.setBounds(getBounds());
	stamp.paint(g1);
}
 
Example 8
Project: VASSAL-src   File: ADC2Module.java   View Source Code Vote up 5 votes
public void drawFlagImage(Graphics2D g) {
  final int tabHeight = 15;
  final int tabWidth = 10;
  g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  g.setColor(background);
  g.fillRoundRect(-tabWidth, 0, 2*tabWidth, tabHeight, 6, 6);
  g.setColor(foreground);
  g.drawRoundRect(-tabWidth, 0, 2*tabWidth-1, tabHeight-1, 6, 6);
  g.setFont(new Font("Dialog", Font.PLAIN, 9));
  Rectangle2D r = g.getFontMetrics().getStringBounds(name, g);
  g.drawString(name, tabWidth/2 - (int) (r.getWidth()/2.0) - 1, 11);
  g.setBackground(new Color(0,0,0,0));
  g.clearRect(-tabWidth, 0, tabWidth, tabHeight);
}
 
Example 9
Project: EasyDragDrop   File: MainFrame.java   View Source Code Vote up 5 votes
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
    Dimension arcs = new Dimension(40, 40);
    Graphics2D graphics = (Graphics2D) g;
    graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    graphics.setColor(new Color(106, 117, 144));
    graphics.fillRoundRect(0, 0, width - 1, height - 1, arcs.width, arcs.height);//paint background

    graphics.setClip(null);
    graphics.drawRoundRect(0, 0, width - 1, height - 1, arcs.width, arcs.height);//paint border
}
 
Example 10
Project: GIFKR   File: ColorInterpolator.java   View Source Code Vote up 5 votes
@Override
public void paintComponent(Graphics g2) {
	Graphics2D g = (Graphics2D) g2;
	
	g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
	
	int padding = 0;
	int osxBottomFix = System.getProperty("os.name").toLowerCase().contains("mac") ? 3 : 0;
	
	g.setColor(key.getValue());
	g.fillRoundRect(padding, padding, getWidth()-2*padding, getHeight()-2*padding-osxBottomFix, 10, 10);
	g.setColor(key.getValue().darker());
	g.drawRoundRect(padding, padding, getWidth()-2*padding, getHeight()-2*padding-osxBottomFix, 10, 10);
}
 
Example 11
Project: brModelo   File: PreTexto.java   View Source Code Vote up 5 votes
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 12
Project: komodoGUI   File: PresentationPanel.java   View Source Code Vote up 5 votes
public void paintComponent(Graphics graphics) 
{
	int h = getHeight();
	int w =  getWidth();
	
	if (h < GRADIENT_EXTENT + 1) 
	{
		super.paintComponent(graphics);
		return;
	}
	
	float percentageOfGradient = (float) GRADIENT_EXTENT / h;
	
	if (percentageOfGradient > 0.49f)
	{
		percentageOfGradient = 0.49f;
	}
	
	Graphics2D graphics2D = (Graphics2D) graphics;
	
	float fractions[] = new float[] 
	{ 
		0, percentageOfGradient, 1 - percentageOfGradient, 1f 
	};
	
	Color colors[] = new Color[] 
	{ 
		colorLow, colorHigh, colorHigh, colorLow 
	};
	
	LinearGradientPaint paint = new LinearGradientPaint(0, 0, 0, h - 1, fractions, colors);
	
	graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
	graphics2D.setPaint(paint);
	graphics2D.fillRoundRect(0, 0, w - 1, h - 1, GRADIENT_EXTENT, GRADIENT_EXTENT);
	graphics2D.setColor(colorBorder);
	graphics2D.setStroke(edgeStroke);
	graphics2D.drawRoundRect(0, 0, w - 1, h - 1, GRADIENT_EXTENT, GRADIENT_EXTENT);
}
 
Example 13
Project: DicomViewer   File: AbstractSliderComponent.java   View Source Code Vote up 5 votes
/** dessine un cursseur dont le centre en X est centerX, et le centre en Y est centerY */
protected void drawCursor(final Graphics2D g2, final Color fillColor, final Color drawColor, final int centerX, final int centerY) {
    g2.setColor(fillColor);
    g2.fillRoundRect(centerX - CURSOR_W / 2, centerY - CURSOR_H / 2, CURSOR_W, CURSOR_H, ARC_SIZE, ARC_SIZE);

    g2.setColor(drawColor);
    g2.drawRoundRect(centerX - CURSOR_W / 2, centerY - CURSOR_H / 2, CURSOR_W, CURSOR_H, ARC_SIZE, ARC_SIZE);
}
 
Example 14
Project: DicomViewer   File: AbstractSliderComponentForTimeSlider.java   View Source Code Vote up 5 votes
/** dessine un cursseur dont le centre en X est centerX, et le centre en Y est centerY */
public static void drawCursor(final Graphics2D g, final Color fillColor, final Color drawColor, final int centerX, final int centerY) {
    Graphics2D g2 = (Graphics2D) g.create();
    g2.setColor(fillColor);
    g2.fillRoundRect(centerX - CURSOR_W / 2, centerY - CURSOR_H / 2, CURSOR_W, CURSOR_H, ARC_SIZE, ARC_SIZE);

    g2.setColor(drawColor);
    g2.drawRoundRect(centerX - CURSOR_W / 2, centerY - CURSOR_H / 2, CURSOR_W, CURSOR_H, ARC_SIZE, ARC_SIZE);
    g2.dispose();
}
 
Example 15
Project: incubator-netbeans   File: RoundBorder.java   View Source Code Vote up 4 votes
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
        Graphics2D g2 = (Graphics2D)g;

        g2.setPaint(fillColor);
        // NOTE: fillRoundRect seems to have poor performance on Linux
//            g2.fillRoundRect(x + halfBorderStrokeWidth, y + halfBorderStrokeWidth,
//                             width - borderStrokeWidth, height - borderStrokeWidth,
//                             arcRadius * 2, arcRadius * 2);

        int arcRadius2 = arcRadius * 2;
        int arcRadius2p1 = arcRadius2 + 1;

        g2.fillArc(x, y, arcRadius2, arcRadius2, 90, 90);
        g2.fillArc(x + width - arcRadius2p1, y, arcRadius2, arcRadius2, 0, 90);
        g2.fillArc(x, y + height - arcRadius2p1, arcRadius2, arcRadius2, 180, 90);
        g2.fillArc(x + width - arcRadius2p1, y + height - arcRadius2p1, arcRadius2, arcRadius2, 270, 90);

        g2.fillRect(x + arcRadius, y, width - arcRadius2p1, height);
        g2.fillRect(x, y + arcRadius, arcRadius, height - arcRadius2p1);
        g2.fillRect(x + width - arcRadius - 1, y + arcRadius, arcRadius, height - arcRadius2p1);

        Object aa = null;
        Object sc = null;
        if (!forceSpeed) {
            aa = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
            sc = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
        }

        g2.setStroke(borderStroke);
        g2.setPaint(lineColor);
        g2.drawRoundRect(x + halfBorderStrokeWidth, y + halfBorderStrokeWidth,
                         width - borderStrokeWidth, height - borderStrokeWidth,
                         arcRadius * 2, arcRadius * 2);

        if (!forceSpeed) {
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, aa);
            g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, sc);
        }
    }
 
Example 16
Project: rapidminer   File: ProgressBarUI.java   View Source Code Vote up 4 votes
@Override
protected void paintDeterminate(Graphics g, JComponent c) {
	boolean compressed = Boolean.parseBoolean(String.valueOf(progressBar
			.getClientProperty(RapidLookTools.PROPERTY_PROGRESSBAR_COMPRESSED)));

	int y = 0;
	int x = 0;
	int w;
	int h;
	if (compressed) {
		x = (int) (c.getWidth() * 0.67);
		w = (int) (c.getWidth() * 0.33);
		y = 3;
		h = c.getHeight() - 6;
	} else {
		w = c.getWidth();
		h = c.getHeight() / 2;
	}

	int amountFull = getAmountFull(progressBar.getInsets(), w, h);

	Graphics2D g2 = (Graphics2D) g;
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

	if (c.isOpaque()) {
		if (c.getParent() != null) {
			g2.setColor(c.getParent().getBackground());
		} else {
			g2.setColor(c.getBackground());
		}
		g2.fillRect(x, y, c.getWidth(), c.getHeight());
	}

	g2.setColor(Colors.PROGRESSBAR_BACKGROUND);
	g2.fillRoundRect(x + 1, y + 1, w - 2, h - 2, RapidLookAndFeel.CORNER_DEFAULT_RADIUS,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	g2.setColor(Colors.PROGRESSBAR_BORDER);
	g2.drawRoundRect(x + 1, y + 1, w - 2, h - 2, RapidLookAndFeel.CORNER_DEFAULT_RADIUS,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	Paint gp = new GradientPaint(x, y + 3, Colors.PROGRESSBAR_DETERMINATE_FOREGROUND_GRADIENT_START, x, h - 5,
			Colors.PROGRESSBAR_DETERMINATE_FOREGROUND_GRADIENT_END);
	g2.setPaint(gp);
	g2.fillRoundRect(x + 3, y + 3, amountFull - 5, h - 5, RapidLookAndFeel.CORNER_DEFAULT_RADIUS / 2,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS / 2);

	drawString(g2, w, h, compressed);
}
 
Example 17
Project: rapidminer   File: ProgressBarUI.java   View Source Code Vote up 4 votes
@Override
protected void paintIndeterminate(Graphics g, JComponent c) {
	boolean compressed = Boolean.parseBoolean(String.valueOf(progressBar
			.getClientProperty(RapidLookTools.PROPERTY_PROGRESSBAR_COMPRESSED)));

	int y = 0;
	int x = 0;
	int w;
	int h;
	if (compressed) {
		x = (int) (c.getWidth() * 0.67);
		w = (int) (c.getWidth() * 0.33);
		y = 3;
		h = c.getHeight() - 6;
	} else {
		w = c.getWidth();
		h = c.getHeight() / 2;
	}

	Graphics2D g2 = (Graphics2D) g;
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

	if (c.isOpaque()) {
		if (c.getParent() != null) {
			g2.setColor(c.getParent().getBackground());
		} else {
			g2.setColor(c.getBackground());
		}
		g2.fillRect(x, y, c.getWidth(), c.getHeight());
	}

	g2.setColor(Colors.PROGRESSBAR_BACKGROUND);
	g2.fillRoundRect(x + 1, y + 1, w - 2, h - 2, RapidLookAndFeel.CORNER_DEFAULT_RADIUS,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	g2.setColor(Colors.PROGRESSBAR_BORDER);
	g2.drawRoundRect(x + 1, y + 1, w - 2, h - 2, RapidLookAndFeel.CORNER_DEFAULT_RADIUS,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS);

	// make sure we don't draw over the boundaries
	RoundRectangle2D clipRect = new RoundRectangle2D.Double(x + 3, y + 3, w - 5, h - 5,
			RapidLookAndFeel.CORNER_DEFAULT_RADIUS / 2, RapidLookAndFeel.CORNER_DEFAULT_RADIUS / 2);
	g2.setClip(clipRect);

	for (double xCoord = x + -4 * ANIMATION_BAR_LENGTH + System.currentTimeMillis() * ANIMATION_SPEED
			% (2 * ANIMATION_BAR_LENGTH); xCoord < x + w + 2 * ANIMATION_BAR_LENGTH;) {
		g2.setColor(Colors.PROGRESSBAR_INDETERMINATE_FOREGROUND_1);
		g2.fill(createIntermediateShape(xCoord, ANIMATION_BAR_LENGTH, h));
		xCoord += ANIMATION_BAR_LENGTH;
		g2.setColor(Colors.PROGRESSBAR_INDETERMINATE_FOREGROUND_2);
		g2.fill(createIntermediateShape(xCoord, ANIMATION_BAR_LENGTH, h));
		xCoord += ANIMATION_BAR_LENGTH;
	}
	g2.setClip(null);

	drawString(g2, w, h, compressed);
}
 
Example 18
Project: DicomViewer   File: AbstractSliderComponent.java   View Source Code Vote up 4 votes
protected void drawSlider(final Graphics2D g2) {
    g2.drawRoundRect(SLIDER_X, sliderY(), sliderWidth(), SLIDER_H, ARC_SIZE, ARC_SIZE);
}
 
Example 19
Project: DicomViewer   File: AbstractSliderComponent_1.java   View Source Code Vote up 4 votes
protected void drawSlider(final Graphics2D g2) {
    g2.drawRoundRect(borderLeftRight, sliderY(), sliderWidth(), SLIDER_H, ARC_SIZE, ARC_SIZE);
}
 
Example 20
Project: JGraphix   File: JGraphix_Example_1.java   View Source Code Vote up 4 votes
public static void main(String[] args) {
	DrawFrame df = DrawFrame.create("MyDrawing", 200, 300);
	Graphics2D g = df.getGraphics2D();
	
	float linewidth = 5.0f;	// line width = 5 pixels
	g.setStroke(new BasicStroke(linewidth));
	
	g.setColor(Color.BLUE);
	g.drawLine(40, 10, 10, 40);
	g.draw(new Line2D.Double(70.2, 10.3, 100.4, 40.5));

	g.fillOval(10, 60, 30, 30);
	g.drawOval(60, 60, 30, 30);
	g.fillRoundRect(110, 60, 30, 30, 10, 10);
	g.drawRoundRect(160, 60, 30, 30, 10, 10);

	g.setColor(Color.GREEN.darker());
	g.fillArc(10, 110, 30, 30, 45, 240);
	g.fillArc(60, 110, 30, 30, 45 + 240, 360 - 240);
	g.fillArc(110, 110, 30, 30, 90, 270);
	g.fillArc(160, 110, 30, 30, 270, 270);

	g.setColor(Color.MAGENTA);
	g.drawArc(10, 160, 30, 30, 45, 240);
	g.drawArc(60, 160, 30, 30, 45 + 240, 360 - 240);
	g.drawArc(110, 160, 30, 30, 90, 270);
	g.drawArc(160, 160, 30, 30, 270, 270);

	g.setColor(Color.ORANGE);
	g.fillPolygon(new int[] { 10, 40, 10, 40 }, new int[] { 210, 210, 240, 240 }, 4);
	g.drawPolygon(new int[] { 60, 90, 60, 90 }, new int[] { 210, 210, 240, 240 }, 4);
	g.drawPolyline(new int[] { 110, 140, 110, 140 }, new int[] { 210, 210, 240, 240 }, 4);
	g.drawPolyline(new int[] { 160, 160, 190, 190 }, new int[] {240, 210, 240, 210 }, 4);

	// Printing texts
	g.setColor(Color.BLACK);
	g.setFont(new Font("Monospaced", Font.PLAIN, 14));
	g.drawString("Drawn with JGraphix", 10, 275);

	df.refresh();

	System.out.println("done.");
}