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


Java Rectangle.grow方法代码示例

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


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

示例1: DrawImagem

import java.awt.Rectangle; //导入方法依赖的package包/类
public void DrawImagem(Graphics2D g) {
    BufferedImage img = getImagem();
    if (img == null) {
        return;
    }
    int[] pts = ArrayDePontos(getPosiImagem());
    if (pts.length != 4) {
        posiImagem = "L,T,200,200";
        imgres = null;
        pts = ArrayDePontos(getPosiImagem());
    }
    Rectangle rec = new Rectangle(pts[0], pts[1], pts[2], pts[3]);
    rec.grow(-2, -2);
    if (imgres == null) {
        imgres = img.getScaledInstance(rec.width, rec.height, Image.SCALE_SMOOTH);
    }
    g.drawImage(imgres, rec.x, rec.y, null);
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:19,代码来源:baseDrawerItem.java

示例2: paintAfter

import java.awt.Rectangle; //导入方法依赖的package包/类
@Override
public void paintAfter( TabData tab, Graphics g, Rectangle tabRect, boolean isSelected ) {
    if( !isSelected || !Settings.getDefault().isSameProjectSameColor() )
        return;
    Color c = null;
    synchronized( tab2color ) {
        c = tab2color.get( tab );
        if( null == c ) {
            c = getColorForTab( tab );
            if( null == c )
                return;
            tab2color.put( tab, c );
        }
    }
    g.setColor( c );
    Rectangle rect = new Rectangle( tabRect );
    rect.y += rect.height - 3;
    rect.grow( -1, -1 );
    g.fillRect( rect.x, rect.y, rect.width, rect.height );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ProjectColorTabDecorator.java

示例3: LigarA

import java.awt.Rectangle; //导入方法依赖的package包/类
/**
 * Liga uma linha a um objeto manualmente (sem o uso do mouse).
 *
 * @param res
 * @return
 */
public boolean LigarA(Elementar res) {
    boolean sn = false;
    if (res instanceof Forma) {
        setEm((Forma) res);
        if (getEm() != null) {
            getEm().PosicionePonto(this);
            getDono().OrganizeLinha();
            sn = true;
        }
    }
    getDono().reSetBounds();
    ReenquadreLinha();
    Rectangle rec = getBounds();
    rec.grow(5, 5);
    InvalidateArea(rec);
    //ProcessaOverDraw(true);
    return sn;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:25,代码来源:PontoDeLinha.java

示例4: moveRectangle

import java.awt.Rectangle; //导入方法依赖的package包/类
private void moveRectangle(int aDeltaX, int aDeltaY) {
    if (theStartRectangle == null)
        return;

    Insets insets = getInsets();
    Rectangle newRect = new Rectangle(theStartRectangle);
    newRect.x += aDeltaX;
    newRect.y += aDeltaY;
    newRect.x = Math.min(Math.max(newRect.x, insets.left), getWidth()
            - insets.right - newRect.width);
    newRect.y = Math.min(Math.max(newRect.y, insets.right), getHeight()
            - insets.bottom - newRect.height);
    Rectangle clip = new Rectangle();
    Rectangle.union(theRectangle, newRect, clip);
    clip.grow(2, 2);
    theRectangle = newRect;
    paintImmediately(clip);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:19,代码来源:ScrollPanePreview.java

示例5: DrawImagem

import java.awt.Rectangle; //导入方法依赖的package包/类
public void DrawImagem(Graphics2D g) {
    BufferedImage imgB = getImagem();
    if (imgB == null) {
        return;
    }
    Rectangle rec = getBounds();
    rec.grow(-2, -2);
    if (imgres == null) {
        imgres = imgB.getScaledInstance(rec.width, rec.height, Image.SCALE_SMOOTH);
    }

    Composite originalComposite = g.getComposite();
    if (alfa != 1f) {
        int type = AlphaComposite.SRC_OVER;
        g.setComposite(AlphaComposite.getInstance(type, alfa));
    }
    Image img = imgres;
    if (isDisablePainted()) {
        img = util.Utilidades.dye(new ImageIcon(imgres), disabledColor);
    }
    
    g.drawImage(img, rec.x, rec.y, null);
    g.setComposite(originalComposite);
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:25,代码来源:Desenhador.java

示例6: updateFinderBounds

import java.awt.Rectangle; //导入方法依赖的package包/类
/**
 * 
 */
public void updateFinderBounds(Rectangle bounds, boolean repaint)
{
	if (bounds != null && !bounds.equals(finderBounds))
	{
		Rectangle old = new Rectangle(finderBounds);
		finderBounds = bounds;

		// LATER: Fix repaint region to be smaller
		if (repaint)
		{
			old = old.union(finderBounds);
			old.grow(3, 3);
			repaint(old);
		}
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:20,代码来源:mxGraphOutline.java

示例7: mark

import java.awt.Rectangle; //导入方法依赖的package包/类
/**
 * Marks the markedState and fires a mxEvent.MARK event.
 */
public void mark() {
  if (markedState != null) {
    Rectangle bounds = markedState.getRectangle();
    bounds.grow(3, 3);
    bounds.width += 1;
    bounds.height += 1;
    setBounds(bounds);

    if (getParent() == null) {
      setVisible(true);

      if (KEEP_ON_TOP) {
        graphComponent.getGraphControl().add(this, 0);
      } else {
        graphComponent.getGraphControl().add(this);
      }
    }

    repaint();
    eventSource.fireEvent(new mxEventObject(mxEvent.MARK, "state", markedState));
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:26,代码来源:mxCellMarker.java

示例8: updateClusterBounds

import java.awt.Rectangle; //导入方法依赖的package包/类
public void updateClusterBounds(){      
    Rectangle boundRect=null;
    
    for(NodeWidget nw : this.members){
        if(boundRect==null){
            boundRect = nw.convertLocalToScene(nw.getBounds());  
        } else {
            boundRect = boundRect.union(nw.convertLocalToScene(nw.getBounds()));
        }  
    }
    if(boundRect==null) return;
    for(Widget w : this.getChildren()) {
        if(w instanceof LoopClusterWidget) {            
            LoopClusterWidget lc = (LoopClusterWidget)w;
            lc.updateClusterBounds();
            boundRect = boundRect.union(w.convertLocalToScene(w.getBounds()));
        }
    }
   
    boundRect.grow(INSET, INSET);
    this.setPreferredBounds(boundRect);               
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:23,代码来源:LoopClusterWidget.java

示例9: performLayout

import java.awt.Rectangle; //导入方法依赖的package包/类
@Override
protected void performLayout() {
    Rectangle rectangle = null;
    List<? extends Widget> toFit = widgets != null ? widgets : depScene.getChildren();
    if (toFit == null) {
        return;
    }

    for (Widget widget : toFit) {
        Rectangle bounds = widget.getBounds();
        if (bounds == null) {
            continue;
        }
        if (rectangle == null) {
            rectangle = widget.convertLocalToScene(bounds);
        } else {
            rectangle = rectangle.union(widget.convertLocalToScene(bounds));
        }
    }
    // margin around
    if (widgets == null) {
        rectangle.grow(5, 5);
    } else {
        rectangle.grow(25, 25);
    }
    Dimension dim = rectangle.getSize();
    Dimension viewDim = parentScrollPane.getViewportBorderBounds().getSize ();
    double zf = Math.min ((double) viewDim.width / dim.width, (double) viewDim.height / dim.height);
    if (depScene.isAnimated()) {
        if (widgets == null) {
            depScene.getSceneAnimator().animateZoomFactor(zf);
        } else {
            CenteredZoomAnimator cza = new CenteredZoomAnimator(depScene.getSceneAnimator());
            cza.setZoomFactor(zf,
                    new Point((int)rectangle.getCenterX(), (int)rectangle.getCenterY()));
        }
    } else {
        depScene.setMyZoomFactor (zf);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:DependencyGraphScene.java

示例10: InvalidateArea

import java.awt.Rectangle; //导入方法依赖的package包/类
/**
 * Nome da função de repintura em C#. Em Java sera repaint.
 * Repinta apenas a área do componente
 */
public void InvalidateArea() {
    if (master != null) {
        Rectangle r = (Rectangle)clientRectangle.clone();
        r.grow(1, 1);
        master.repaint(r);
    }
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:12,代码来源:Elementar.java

示例11: getSuperArea

import java.awt.Rectangle; //导入方法依赖的package包/类
public Rectangle getSuperArea() {
    int espacoL = distSelecao;
    int mW = getMaster().getPontoWidth() + espacoL;
    int mH = getMaster().getPontoHeigth() + espacoL;
    Rectangle rec = getClientRectangle().getBounds();
    rec.grow(mW, mH);
    return rec;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:9,代码来源:Forma.java

示例12: paintRect

import java.awt.Rectangle; //导入方法依赖的package包/类
private void paintRect(int x, int y, int w, int h, int t) {
    if (w != 0 && h != 0) {
        Rectangle rect = new Rectangle(x, y, w, h);
        rect.grow(t, t);
        paintImmediately(rect);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:XChartSelectionOverlay.java

示例13: mouseReleased

import java.awt.Rectangle; //导入方法依赖的package包/类
@Override
    public void mouseReleased(MouseEvent e) {
        isMouseDown = false;
        dragging = false;

        if (IsTopOrBotton) {
            Elementar res = getMaster().CaptureBaseFromPoint(null, e.getPoint());
            if (res instanceof Forma) {
                res = res.ProcessaComposicao(e.getPoint());
//                if (res.isComposto()) {
//                    res = res.ProcessaComposicao(e.getPoint());
//                }
                setEm((Forma) res);
                if (getEm() != null) {
                    getEm().PosicionePonto(this);
                    getDono().OrganizeLinha();
                }
            } else {
                setEm(null);
            }
        }
        getDono().reSetBounds();
        ReenquadreLinha();
        Rectangle rec = getBounds();
        rec.grow(5, 5);
        InvalidateArea(rec);
        ProcessaOverDraw(true);
        super.mouseReleased(e);
    }
 
开发者ID:chcandido,项目名称:brModelo,代码行数:30,代码来源:PontoDeLinha.java

示例14: getSortingColumnIndex

import java.awt.Rectangle; //导入方法依赖的package包/类
private int getSortingColumnIndex(JTableHeader header, Point p, int column) {
	if (column == -1) {
		return -1;
	}

	Rectangle r = header.getHeaderRect(column);
	r.grow(-4, 0);

	if (!r.contains(p)) {
		return -1;
	} else {
		return column;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:15,代码来源:ExtendedJTableSorterModel.java

示例15: mark

import java.awt.Rectangle; //导入方法依赖的package包/类
/**
 * Marks the markedState and fires a mxEvent.MARK event.
 */
public void mark()
{
	if (markedState != null)
	{
		Rectangle bounds = markedState.getRectangle();
		bounds.grow(3, 3);
		bounds.width += 1;
		bounds.height += 1;
		setBounds(bounds);

		if (getParent() == null)
		{
			setVisible(true);

			if (KEEP_ON_TOP)
			{
				graphComponent.getGraphControl().add(this, 0);
			}
			else
			{
				graphComponent.getGraphControl().add(this);
			}
		}

		repaint();
		eventSource.fireEvent(new mxEventObject(mxEvent.MARK, "state",
				markedState));
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:33,代码来源:mxCellMarker.java


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