Package java.awt

Examples of java.awt.Shape


        return res;
    }
   
    private GatedComponent getGateComponentAt(Point p){
        GatedComponent res = null;
        Shape shape = _elementContainer.getSelection().getShapeAt(p.x, p.y);
        if (shape != null && shape instanceof GatedComponent){
            res = ((GatedComponent)shape);
        }
        return res;
    }
View Full Code Here


        if(canEdit){
            _selX=(int)((double)e.getX()/_param.scale)-_param.xmargin;
            _selY=(int)((double)e.getY()/_param.scale)-_param.ymargin;

            if(_elementContainer.getSelection().isSelected(_selX, _selY)){
                Shape s2=_elementContainer.getSelection().getSelectedShapeAt(_selX,_selY);
                if(s2 instanceof ContextualDrawingProvider && getContextualDrawing()==null){
                    setContextualDrawing(((ContextualDrawingProvider)s2).getContextualDrawing(_elementContainer.getSelection()));
                    getContextualDrawing().consumeMouseEvent(e);

                    canProccessMouseWheelEvent = true;
View Full Code Here

    renderer.setTree(this.root);
    this.root = null; // We're done with it...

    try {
      // now we are sure that the aoi is the image size
      Shape raoi = new Rectangle2D.Float(0, 0, width, height);
      // Warning: the renderer's AOI must be in user space
      renderer.repaint(curTxf.createInverse()
          .createTransformedShape(raoi));
      BufferedImage rend = renderer.getOffScreen();
      renderer = null; // We're done with it...
View Full Code Here

     * @param ox point coordinate along X axis
     * @param oy point coordinate along Y axis
     * @return selected shape at these coordinates or null if no selection at these coordinates
     */
    public Shape getSelectedShapeAt(int ox, int oy){
        Shape res = null;

        for(int i=0; i<_selectedElements.size() && res==null;i++){
            ElementSelection ss = (ElementSelection)_selectedElements.get(i);
            Shape s=ss.element;
            if(s.contains(ox,oy)){
                res = s;
            }
        }
        return res;
    }
View Full Code Here

     * @param as the shape to add
     */
    protected void replaceShapes(Vector v, AbstractShape as){
        int k=getShapeCount()-1;
        for(int i=k;i>=0;i--){
            Shape s=getShape(i);
            if(v.contains(s)){
                removeShapeAt(i);
            }
        }
        add(createShapeSelection(as));
View Full Code Here

     */
    public void alignSelectionToTop() {

        int topBound = Integer.MAX_VALUE;
        for(int i=0; i<_selectedElements.size(); i++) {
            Shape s = ((ElementSelection)_selectedElements.get(i)).getShape();
            if(s.getBounds().y < topBound) {
                topBound = s.getBounds().y;
            }
        }

        CompoundEdit ce = new CompoundEdit();
        int dy;
View Full Code Here

    public void alignSelectionToBottom() {

        int bottomBound = Integer.MIN_VALUE;

        for(int i=0; i<_selectedElements.size(); i++) {
            Shape s = ((ElementSelection)_selectedElements.get(i)).getShape();

            if(s.getBounds().y + s.getBounds().height > bottomBound) {
                bottomBound = s.getBounds().y + s.getBounds().height;
            }
        }

        CompoundEdit ce = new CompoundEdit();
        int dy;
View Full Code Here

    public void alignSelectionToLeft() {

        int leftBound = Integer.MAX_VALUE;

        for(int i=0; i<_selectedElements.size(); i++) {
            Shape s = ((ElementSelection)_selectedElements.get(i)).getShape();
           
            if(s.getBounds().x < leftBound) {
                leftBound = s.getBounds().x;
            }
        }

        CompoundEdit ce = new CompoundEdit();
        int dx;
View Full Code Here

    public void alignSelectionToRight() {

        int rightBound = Integer.MIN_VALUE;

        for(int i=0; i<_selectedElements.size(); i++) {
            Shape s = ((ElementSelection)_selectedElements.get(i)).getShape();
            if(s.getBounds().x + s.getBounds().width > rightBound) {
                rightBound = s.getBounds().x + s.getBounds().width;
            }
        }

        CompoundEdit ce = new CompoundEdit();
        int dx;
View Full Code Here

        int vCenter = 0;

        Rectangle bounds;
        for(int i=0; i<_selectedElements.size(); i++) {
            Shape s = ((ElementSelection)_selectedElements.get(i)).getShape();
            bounds = s.getBounds();
            vCenter += bounds.y + bounds.height/2;
        }
        vCenter /= _selectedElements.size();

        CompoundEdit ce = new CompoundEdit();
View Full Code Here

TOP

Related Classes of java.awt.Shape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.