Java 8 Rectangle2D.Double - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Rectangle2D.Double class.

This code example shows how to use the following methods:
        arrowPath.lineTo(-.5f, -.1f);
        arrowPath.lineTo(0f, -.1f);
        arrowPath.lineTo(0f, -.5f);
         
        arrow = new ExplicitBoundsShape(arrowPath);
        ((ExplicitBoundsShape)arrow).setBounds(new Rectangle2D.Double(-.5,.5,1.,1.));
 
        GeneralPath hatchPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        hatchPath.moveTo(.55f,.57f);
        hatchPath.lineTo(.52f,.57f);
        hatchPath.lineTo(-.57f,-.52f);
        hatchPath.lineTo(-.57f,-.57f);
        hatchPath.lineTo(-.52f, -.57f);
        hatchPath.lineTo(.57f, .52f);
        hatchPath.lineTo(.57f,.57f);
                 
        hatchPath.moveTo(.57f,-.49f);
        hatchPath.lineTo(.49f, -.57f);
        hatchPath.lineTo(.57f,-.57f);
        hatchPath.lineTo(.57f,-.49f);
5
CodeRank
This code example shows how to use the following methods:
        double x = bounds.getX() - _halo;
        double y = bounds.getY() - _halo;
        double w = bounds.getWidth() + 2 * _halo;
        double h = bounds.getHeight() + 2 * _halo;
  
        g.fill(new Rectangle2D.Double(x,y,w,h));
 
        // Draw the child 
        getChild().paint(g);
    } 
 
    /** Receive repaint notification. This method generates another 
     * repaint() call, with a larger region, in order to ensure 
     * that the highlight is repainted. 
     */ 
    public void repaint (DamageRegion d) {
        repaint(); 
    } 
 
    /** Request a repaint of the figure and highlight. 
4
CodeRank
This code example shows how to use the following methods:
     * same as the child figure, if there is one, or a very small 
     * rectangle if there isn't. 
     */ 
    public Rectangle2D getBounds () {
        if (_child == null) {
            return new Rectangle2D.Double();
        } else { 
            return _child.getBounds();
        } 
    } 
  
    /** Get the child figure, or null if there isn't one. 
     */ 
    public Figure getChild () { 
        return _child;
    } 
  
    /** Get the container, which is defined as the lowest 
     * ancestor that is not a FigureDecorator. 
     */ 
4
CodeRank
This code example shows how to use the following methods:
            return super.getBounds(); 
        } 
        else { 
            Rectangle2D r1 = super.getBounds();
            Rectangle2D r2 = _background.getBounds();
            Rectangle2D rout = new Rectangle2D.Double();
            Rectangle2D.union(r1, r2, rout);
            return rout;
        } 
    } 
 
 
    /** 
     * Paint this composite figure onto a 2D graphics object.  This 
     * implementation pushes the transform context onto the transform 
     * stack, and then paints all children. 
     */ 
    public void paint (Graphics2D g) {
        //        debug("PAINT!"); 
        if(_background != null) {
4
CodeRank
This code example shows how to use the following methods:
 
    /** Get the bounds of the child figure. 
     */ 
    public Rectangle2D getBounds () {
        if (_child == null) {
            return new Rectangle2D.Double();
        } else { 
            return _child.getBounds();
        } 
    } 
  
    /** Get the child figure, or null if there isn't one. 
     */ 
    public Figure getChild () { 
        return _child;
    } 
  
    /** Get the outline shape of the child figure. 
     */ 
    public Shape getShape () {
4
CodeRank
See Code Examples for Java 8 Rectangle2D.Double Methods: