本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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 );
}
示例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);
}
}
}
示例7: update
import java.awt.Graphics; //导入方法依赖的package包/类
public void update( Graphics p0 )
{
//TO DO (implementation here)
p0.draw3DRect(10, 15, 30, 20, true);
}