Java Code Examples for java.awt.Graphics.draw3DRect()

The following are Jave code examples for showing how to use draw3DRect() of the java.awt.Graphics 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: LivroJavaComoProgramar10Edicao   File: LinesRectsOvalsJPanel.java   View Source Code Vote up 6 votes
@Override
public void paintComponent(Graphics g)
{
   super.paintComponent(g); 
   this.setBackground(Color.WHITE);

   g.setColor(Color.RED);
   g.drawLine(5, 30, 380, 30);

   g.setColor(Color.BLUE);
   g.drawRect(5, 40, 90, 55);
   g.fillRect(100, 40, 90, 55);

   g.setColor(Color.BLACK);
   g.fillRoundRect(195, 40, 90, 55, 50, 50);
   g.drawRoundRect(290, 40, 90, 55, 20, 20);

   g.setColor(Color.GREEN);   
   g.draw3DRect(5, 100, 90, 55, true);
   g.fill3DRect(100, 100, 90, 55, false);

   g.setColor(Color.MAGENTA);
   g.drawOval(195, 100, 90, 55);
   g.fillOval(290, 100, 90, 55);
}
 
Example 2
Project: OpenJSharp   File: CLSFractal.java   View Source Code Vote up 6 votes
@Override
public void paint(Graphics g) {
    String fractalPath = cls.getPath();
    if (fractalPath == null) {
        super.paint(g);
        return;
    }
    if (savedPath == null || !savedPath.equals(fractalPath)) {
        savedPath = fractalPath;
        render(null, fractalPath);
    }

    for (int i = 0; i < border; i++) {
        g.draw3DRect(i, i, getSize().width - i * 2, getSize().height - i * 2,
                false);
    }
    render(g, fractalPath);
}
 
Example 3
Project: OpenJSharp   File: DrawTest.java   View Source Code Vote up 6 votes
@Override
public void paint(Graphics g) {
    Rectangle r = getBounds();
    g.setColor(Color.lightGray);
    g.draw3DRect(0, 0, r.width, r.height, false);

    int n = getComponentCount();
    for (int i = 0; i < n; i++) {
        Component comp = getComponent(i);
        if (comp instanceof Checkbox) {
            Point loc = comp.getLocation();
            Dimension d = comp.getSize();
            g.setColor(comp.getForeground());
            g.drawRect(loc.x - 1, loc.y - 1, d.width + 1, d.height + 1);
        }
    }
}
 
Example 4
Project: TrabalhoFinalEDA2   File: mxConnectionHandler.java   View Source Code Vote up 6 votes
/**
 * 
 */
public void paint(Graphics g)
{
	if (bounds != null)
	{
		if (connectIcon != null)
		{
			g.drawImage(connectIcon.getImage(), bounds.x, bounds.y,
					bounds.width, bounds.height, null);
		}
		else if (handleEnabled)
		{
			g.setColor(Color.BLACK);
			g.draw3DRect(bounds.x, bounds.y, bounds.width - 1,
					bounds.height - 1, true);
			g.setColor(Color.GREEN);
			g.fill3DRect(bounds.x + 1, bounds.y + 1, bounds.width - 2,
					bounds.height - 2, true);
			g.setColor(Color.BLUE);
			g.drawRect(bounds.x + bounds.width / 2 - 1, bounds.y
					+ bounds.height / 2 - 1, 1, 1);
		}
	}
}
 
Example 5
Project: jdk8u-jdk   File: CLSFractal.java   View Source Code Vote up 6 votes
@Override
public void paint(Graphics g) {
    String fractalPath = cls.getPath();
    if (fractalPath == null) {
        super.paint(g);
        return;
    }
    if (savedPath == null || !savedPath.equals(fractalPath)) {
        savedPath = fractalPath;
        render(null, fractalPath);
    }

    for (int i = 0; i < border; i++) {
        g.draw3DRect(i, i, getSize().width - i * 2, getSize().height - i * 2,
                false);
    }
    render(g, fractalPath);
}
 
Example 6
Project: jdk8u-jdk   File: DrawTest.java   View Source Code Vote up 6 votes
@Override
public void paint(Graphics g) {
    Rectangle r = getBounds();
    g.setColor(Color.lightGray);
    g.draw3DRect(0, 0, r.width, r.height, false);

    int n = getComponentCount();
    for (int i = 0; i < n; i++) {
        Component comp = getComponent(i);
        if (comp instanceof Checkbox) {
            Point loc = comp.getLocation();
            Dimension d = comp.getSize();
            g.setColor(comp.getForeground());
            g.drawRect(loc.x - 1, loc.y - 1, d.width + 1, d.height + 1);
        }
    }
}
 
Example 7
Project: openjdk-jdk10   File: CLSFractal.java   View Source Code Vote up 6 votes
@Override
public void paint(Graphics g) {
    String fractalPath = cls.getPath();
    if (fractalPath == null) {
        super.paint(g);
        return;
    }
    if (savedPath == null || !savedPath.equals(fractalPath)) {
        savedPath = fractalPath;
        render(null, fractalPath);
    }

    for (int i = 0; i < border; i++) {
        g.draw3DRect(i, i, getSize().width - i * 2, getSize().height - i * 2,
                false);
    }
    render(g, fractalPath);
}
 
Example 8
Project: openjdk-jdk10   File: DrawTest.java   View Source Code Vote up 6 votes
@Override
public void paint(Graphics g) {
    Rectangle r = getBounds();
    g.setColor(Color.lightGray);
    g.draw3DRect(0, 0, r.width, r.height, false);

    int n = getComponentCount();
    for (int i = 0; i < n; i++) {
        Component comp = getComponent(i);
        if (comp instanceof Checkbox) {
            Point loc = comp.getLocation();
            Dimension d = comp.getSize();
            g.setColor(comp.getForeground());
            g.drawRect(loc.x - 1, loc.y - 1, d.width + 1, d.height + 1);
        }
    }
}
 
Example 9
Project: incubator-netbeans   File: AnnotationView.java   View Source Code Vote up 5 votes
private void drawCurrentLineMark(Graphics g, int start) {
    g.setColor( CaretMark.getCaretMarkColor());
    g.drawLine(2, start + PIXELS_FOR_LINE / 2, THICKNESS - 3, start + PIXELS_FOR_LINE / 2 );        
    g.fillRect( THICKNESS / 2 - PIXELS_FOR_LINE / 2, start, PIXELS_FOR_LINE, PIXELS_FOR_LINE );
    g.draw3DRect( THICKNESS / 2 - PIXELS_FOR_LINE / 2, start, PIXELS_FOR_LINE - 1, PIXELS_FOR_LINE - 1, true );
    
}
 
Example 10
Project: Tarski   File: mxConnectionHandler.java   View Source Code Vote up 5 votes
/**
 * 
 */
public void paint(Graphics g) {
  if (bounds != null) {
    if (connectIcon != null) {
      g.drawImage(connectIcon.getImage(), bounds.x, bounds.y, bounds.width, bounds.height, null);
    } else if (handleEnabled) {
      g.setColor(Color.BLACK);
      g.draw3DRect(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1, true);
      g.setColor(Color.GREEN);
      g.fill3DRect(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2, true);
      g.setColor(Color.BLUE);
      g.drawRect(bounds.x + bounds.width / 2 - 1, bounds.y + bounds.height / 2 - 1, 1, 1);
    }
  }
}
 
Example 11
Project: AntIDE   File: Dialog1.java   View Source Code Vote up 5 votes
public void update( Graphics p0 )
{
	//TO DO (implementation here) 
	p0.draw3DRect(10, 15, 30, 20, true);
}