Package org.antlr.xjlib.appkit.gview.base

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


        public double getTop() {
            return getFrame().r.y;
        }

        public double getRight() {
            Rect r = getFrame();
            return r.r.x+r.r.width;
        }
View Full Code Here


            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

    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

        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

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

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

    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

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

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

    }

    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

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

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

    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

TOP

Related Classes of org.antlr.xjlib.appkit.gview.base.Rect

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.