当前位置: 首页>>代码示例>>Java>>正文


Java Graphics.draw3DRect方法代码示例

本文整理汇总了Java中java.awt.Graphics.draw3DRect方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.draw3DRect方法的具体用法?Java Graphics.draw3DRect怎么用?Java Graphics.draw3DRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Graphics的用法示例。


在下文中一共展示了Graphics.draw3DRect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintComponent

import java.awt.Graphics; //导入方法依赖的package包/类
@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);
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:26,代码来源:LinesRectsOvalsJPanel.java

示例2: paint

import java.awt.Graphics; //导入方法依赖的package包/类
@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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:CLSFractal.java

示例3: paint

import java.awt.Graphics; //导入方法依赖的package包/类
@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);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:DrawTest.java

示例4: paint

import java.awt.Graphics; //导入方法依赖的package包/类
/**
 * 
 */
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);
		}
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:27,代码来源:mxConnectionHandler.java

示例5: drawCurrentLineMark

import java.awt.Graphics; //导入方法依赖的package包/类
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 );
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:AnnotationView.java

示例6: paint

import java.awt.Graphics; //导入方法依赖的package包/类
/**
 * 
 */
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);
    }
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:18,代码来源:mxConnectionHandler.java

示例7: update

import java.awt.Graphics; //导入方法依赖的package包/类
public void update( Graphics p0 )
{
	//TO DO (implementation here) 
	p0.draw3DRect(10, 15, 30, 20, true);
}
 
开发者ID:FJplant,项目名称:AntIDE,代码行数:6,代码来源:Dialog1.java


注:本文中的java.awt.Graphics.draw3DRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。