Examples of Rect


Examples of org.antlr.xjlib.appkit.gview.base.Rect

            Rect r = getFrame();
            return r.r.x+r.r.width;
        }

        public double getBottom() {
            Rect r = getFrame();
            return r.r.y+r.r.height;
        }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

    public Rect getFrame() {
        double x = getPositionX()-getWidth()*0.5;
        double y = getPositionY()-getHeight()*0.5;
        double dx = getWidth();
        double dy = getHeight();
        return new Rect(x, y, dx, dy);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

        return closest_anchor;
    }

    public Rect bounds() {
        Rect r = getFrame();
        synchronized(lock) {
            for (GElement element : elements) {
                if (element == this)
                    continue;

                if (r == null)
                    r = element.bounds();
                else
                    r = r.union(element.bounds());
            }
        }
        return r;
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

        arrow.getAnchor().shift(dx, dy);
    }

    @Override
    public Rect getFrame() {
        return new Rect(getPosition(), target, 2, 2);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

    public Rect getFrame() {
        double x = getPositionX()-radius;
        double y = getPositionY()-radius;
        double dx = radius*2;
        double dy = radius*2;
        return new Rect(x, y, dx, dy);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

    public void setLabelPosition(Vector2D position) {
        this.labelPositionAbs = position;
    }

    public Rect getFrame() {
        return new Rect(x0, y0, x1-x0, y1-y0);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

    }

    public static Rect getFrame(String s, double x, double y, Graphics g) {
        if(s != null && g != null) {
            FontMetrics fm = g.getFontMetrics();
            return new Rect(x-fm.stringWidth(s)*0.5, y-fm.getHeight()*0.5,
                            fm.stringWidth(s), fm.getHeight());
        } else
            return new Rect(0, 0, 0, 0);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

    public boolean isLabelVisible() {
        return label.isVisible();
    }

    public Rect getFrame() {
        return new Rect(start, end);
    }
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

    public void autoAdjustSize() {
        if(rootElement == null || !autoAdjustSize)
            return;

        Rect bounds = rootElement.bounds();
        setRealSize((int) ((bounds.r.x+bounds.r.width)*zoom),
                (int) ((bounds.r.y+bounds.r.height)*zoom));

        if(delegate != null)
            delegate.viewSizeDidChange();
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

        }
    }

    public void scrollElementToVisible(GElement element) {
        Rectangle r;
        Rect frame = element.getFrame();
        if(frame == null)
            r = new Rectangle((int)element.getPositionX(), (int)element.getPositionY(), 1, 1);
        else
            r = frame.r;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.