當前位置: 首頁>>代碼示例>>Java>>正文


Java Ellipse2D.Float方法代碼示例

本文整理匯總了Java中java.awt.geom.Ellipse2D.Float方法的典型用法代碼示例。如果您正苦於以下問題:Java Ellipse2D.Float方法的具體用法?Java Ellipse2D.Float怎麽用?Java Ellipse2D.Float使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.geom.Ellipse2D的用法示例。


在下文中一共展示了Ellipse2D.Float方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setShape

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
/**
 * Creates the shape of the vertex given its description in a string
 * @param shapeString "square" or "circle"
 */
public void setShape(String shapeString) {
	Shape newShape;
	if (shapeString.startsWith("square")){
		Rectangle2D rectangle = new Rectangle2D.Float();
		rectangle.setFrameFromCenter(0,0,size,size);
		newShape = rectangle;
	}
	else
	{
		Ellipse2D ellipse = new Ellipse2D.Float();
		ellipse.setFrameFromCenter(0,0,size,size);
		newShape = ellipse; 
	}
	this.shape = newShape;
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:20,代碼來源:Vertex.java

示例2: paintBorder

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
	Graphics2D g2d = (Graphics2D) g.create();
	g2d.setRenderingHints(ProcessDrawer.HI_QUALITY_HINTS);
	g2d.setStroke(new BasicStroke(2f));

	// clear edges, otherwise they will be in the color of the component background
	if (drawRoundFrame && !c.getBackground().equals(c.getParent().getBackground())) {
		Shape frame = new Rectangle2D.Float(x + 2, y + 2, width - 4, height - 4);
		g2d.setPaint(c.getParent().getBackground());
		g2d.draw(frame);
	}

	g2d.setPaint(paint);
	g2d.setFont(new Font("Dialog", Font.BOLD, 21));

	if (drawRoundFrame) {
		Shape roundFrame = new RoundRectangle2D.Float(x + 2, y + 2, width - 4, height - 4, 10, 10);
		g2d.draw(roundFrame);
	}

	if (number > 0) {
		Shape circle = new Ellipse2D.Float(20, 20, 34, 34);
		g2d.fill(circle);
		g2d.setPaint(Color.WHITE);
		g2d.drawString(String.valueOf(number), 29, 44);
	}

	if (key != null) {
		g2d.setPaint(paint);
		g2d.drawString(key, 60, 44);
	}

	g2d.dispose();
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:36,代碼來源:RoundTitledBorder.java

示例3: contains

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public boolean contains(int x, int y) {
	// TODO Auto-generated method stub
	if(shape == null || shape.getBounds().equals(getBounds()))
		shape = new Ellipse2D.Float(0,0,getWidth(),getHeight());
	return super.contains(x, y);
}
 
開發者ID:BH2017,項目名稱:snake_classic,代碼行數:8,代碼來源:ButtonBack.java

示例4: contains

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public boolean contains(int x, int y) {
	// TODO Auto-generated method stub
	if(shape == null || shape.getBounds().equals(getBounds()))
		shape = new Ellipse2D.Float(0,0,getWidth(),getHeight());
	return super.contains(x, y);

}
 
開發者ID:BH2017,項目名稱:snake_classic,代碼行數:9,代碼來源:ButtonStart.java

示例5: drawCircleImpl

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
/**
 * The implementation of {@link #drawCircle(Vec, Vec, RGBAColor)}.
 *
 * @param pos
 *            same as in base method
 * @param size
 *            same as in base method
 * @param col
 *            same as in base method
 */
private void drawCircleImpl(Vec pos, Vec size, Color col) {
	this.graphics.setColor(col);
	Ellipse2D.Float circle = new Ellipse2D.Float(//
			(pos.x - size.x / 2f), //
			(pos.y - size.y / 2f), //
			size.x, size.y);

	this.graphics.fill(circle);

}
 
開發者ID:rekit-group,項目名稱:rekit-game,代碼行數:21,代碼來源:GameGridImpl.java

示例6: createShape

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
/**
 * 
 */
public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state)
{
	Rectangle temp = state.getRectangle();

	return new Ellipse2D.Float(temp.x, temp.y, temp.width, temp.height);
}
 
開發者ID:GDSRS,項目名稱:TrabalhoFinalEDA2,代碼行數:10,代碼來源:mxEllipseShape.java

示例7: getRegiaoCirculo

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public Shape getRegiaoCirculo() {
    if (Regiao == null) {
        Regiao = new Ellipse2D.Float(getLeft(), getTop(), getWidth(), getHeight());
    }
    return Regiao;
}
 
開發者ID:chcandido,項目名稱:brModelo,代碼行數:8,代碼來源:LivreJuncao.java

示例8: DoPaintDoks

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
protected void DoPaintDoks(Graphics2D g) {
    super.DoPaintDoks(g);
    Stroke bkp = g.getStroke();
    g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{1, 2}, 0));
    Shape t = new Ellipse2D.Float(getLeft(), getTop(), getWidth(), getHeight());
    g.draw(t);
    g.setStroke(bkp);
}
 
開發者ID:chcandido,項目名稱:brModelo,代碼行數:10,代碼來源:LivreJuncao.java

示例9: getRegiao

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public Shape getRegiao() {
    if (Regiao == null) {
        Regiao = new Ellipse2D.Float(getLeft(), getTop(), getWidth(), getHeight());
    }
    return Regiao;
}
 
開發者ID:chcandido,項目名稱:brModelo,代碼行數:8,代碼來源:FluxConector.java

示例10: DoPaint

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public void DoPaint(Graphics2D g) {
    if (isAutosize()) {
        int largura = g.getFontMetrics(getFont()).stringWidth(getTextoToDraw()) + getHeight() + 4 + 4;
        if (getWidth() != largura) {
            setStopRaize(true);
            setWidth(largura);
            setStopRaize(false);
            needRecalPts = true;
            calculePontos();
            SendNotificacao(Constantes.Operacao.opResize);
            setRegiao(null);
            if (isSelecionado()) {
                Reposicione();
            }
            ReSizedByAutoSize();
        }
    }
    super.DoPaint(g);
    Shape reg;
    if (getDirecaoLigacao() == Direcao.Left) {
        reg = new Ellipse2D.Float(getLeft(), getTop(), getHeight() - 1, getHeight() - 1);
    } else {
        reg = new Ellipse2D.Float(getLeft() + getWidth() - getHeight(), getTop(), getHeight() - 1, getHeight() - 1);
    }
    Stroke bkps = g.getStroke();
    if (isOpcional()) {
        g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{4, 2}, 0));
    }
    if (isIdentificador()) {
        g.fill(reg);
    } else {
        g.draw(reg);
    }
    if (isOpcional()) {
        g.setStroke(bkps);
    }
}
 
開發者ID:chcandido,項目名稱:brModelo,代碼行數:39,代碼來源:PreAtributo.java

示例11: Vertex

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
/**
 * General constructor for a vertex
 * @param id
 */
public Vertex(int id){
	this.id = generateID(id);
	Ellipse2D ellipse = new Ellipse2D.Float();
	ellipse.setFrameFromCenter(0,0,size,size);
	shape = ellipse;
	position = null;
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:12,代碼來源:Vertex.java

示例12: createCircle

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
public static Shape createCircle() {
	final float s = SHAPE_SIZE;
	float s_d2 = Math.round(s / 2.0);
	float s_dm2 = s_d2 * 2;
	return new Ellipse2D.Float(-s_d2, -s_d2, s_dm2, s_dm2);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:7,代碼來源:SeriesFormat.java

示例13: getShape

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
@Override
public Shape getShape() {
    Ellipse2D p = new Ellipse2D.Float(-40, -20, 80, 40);
    return p;
}
 
開發者ID:CLARIN-PL,項目名稱:WordnetLoom,代碼行數:6,代碼來源:ViwnNodeWord.java

示例14: createShape

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
/**
 * 
 */
public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) {
  Rectangle temp = state.getRectangle();

  return new Ellipse2D.Float(temp.x, temp.y, temp.width, temp.height);
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:9,代碼來源:mxEllipseShape.java

示例15: getRegiaoCirculo

import java.awt.geom.Ellipse2D; //導入方法依賴的package包/類
public Shape getRegiaoCirculo() {
    if (Regiao == null) {
        Regiao = new Ellipse2D.Float(getLeft(), getTop(), getWidth(), getHeight());
    }
    return Regiao;
}
 
開發者ID:chcandido,項目名稱:brModelo,代碼行數:7,代碼來源:LivreBase.java


注:本文中的java.awt.geom.Ellipse2D.Float方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。