Examples of IDisplayable


Examples of megamek.client.ui.IDisplayable

                    - 1, 2, 2);
        }

        // draw all the "displayables"
        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            disp.draw(backGraph, new Point(backSize.width, backSize.height), backSize);
        }

        // draw the back buffer onto the screen
        // first clear the entire view if the map has been zoomed
        if (scale < 1.00f) {
View Full Code Here

Examples of megamek.client.ui.IDisplayable

        }
        oldMousePosition = point;

        isTipPossible = false;
        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            Point dispPoint = new Point();
            dispPoint.x = point.x - offset.x;
            dispPoint.y = point.y - offset.y;
            if ((backSize != null) && (disp.isHit(dispPoint, backSize))) {
                return;
            }
        }

        if (me.isPopupTrigger()) {
View Full Code Here

Examples of megamek.client.ui.IDisplayable

        public void run() {
            currentTime = System.currentTimeMillis();
            if (isShowing()) {
                boolean redraw = false;
                for (int i = 0; i < displayables.size(); i++) {
                    IDisplayable disp = displayables.get(i);
                    if (!disp.isSliding()) {
                        disp.setIdleTime(currentTime - lastTime, true);
                    } else {
                        redraw = redraw || disp.slide();
                    }
                }
                redraw = redraw || doMoveUnits(currentTime - lastTime);
                if (redraw) {
                    repaint();
View Full Code Here

Examples of megamek.client.ui.IDisplayable

    public void mouseReleased(MouseEvent me) {
        isTipPossible = true;
        oldMousePosition = mousePos;

        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            if (disp.isReleased()) {
                return;
            }
        }
        isScrolling = false;
View Full Code Here

Examples of megamek.client.ui.IDisplayable

        if (null == point) {
            return;
        }

        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            Point dispPoint = new Point();
            dispPoint.x = point.x - offset.x;
            dispPoint.y = point.y - offset.y;
            if (disp.isDragged(dispPoint, backSize)) {
                repaint();
                return;
            }
        }
        mousePos = point;
View Full Code Here

Examples of megamek.client.ui.IDisplayable

        if (null == point) {
            return;
        }

        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            if (disp.isBeingDragged()) {
                isTipPossible = false;
                return;
            }
            if (backSize != null) {
                disp.isMouseOver(point, backSize);
            }
        }
        mousePos = point;
        if (isTipShowing()) {
            hideTooltip();
View Full Code Here

Examples of megamek.client.ui.IDisplayable

    }

    public void mouseClicked(MouseEvent me) {

        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.elementAt(i);
            if (disp.isHit(me.getPoint(), getSize())) {
                disp.isReleased();
                return;
            }
        }

        Coords c = pickCoords(me);
View Full Code Here

Examples of megamek.client.ui.IDisplayable

        public void run() {
            currentTime = System.currentTimeMillis();
            if (isShowing()) {
                boolean redraw = false;
                for (int i = 0; i < displayables.size(); i++) {
                    IDisplayable disp = displayables.get(i);
                    if (!disp.isSliding()) {
                        disp.setIdleTime(currentTime - lastTime, true);
                    } else {
                        redraw = redraw || disp.slide();
                    }
                }
                if (backSize != null) {
                    redraw = redraw || doMoveUnits(currentTime - lastTime);
                    redraw = redraw || doScroll();
View Full Code Here

Examples of megamek.client.ui.IDisplayable

            g.fillRect(start.x - 1, start.y - 1, 2, 2);
        }

        // draw all the "displayables"
        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            double width = Math.min(boardSize.getWidth(), scrollpane.getViewport().getSize().getWidth());
            double height = Math.min(boardSize.getHeight(), scrollpane.getViewport().getSize().getHeight());
            Dimension drawDimension = new Dimension();
            drawDimension.setSize(width, height);
            disp.draw(g,
                    new Point((int)Math.min(boardSize.getWidth(), -getBounds().getX()),
                            (int)Math.min(boardSize.getHeight(),-getBounds().getY())),
                            drawDimension);
        }
    }
View Full Code Here

Examples of megamek.client.ui.IDisplayable

        if (me.isPopupTrigger()) {
            mouseAction(getCoordsAt(point), BOARD_HEX_POPUP, me.getModifiers());
            return;
        }
        for (int i = 0; i < displayables.size(); i++) {
            IDisplayable disp = displayables.get(i);
            double width = Math.min(boardSize.getWidth(), scrollpane.getViewport().getSize().getWidth());
            double height = Math.min(boardSize.getHeight(), scrollpane.getViewport().getSize().getHeight());
            Dimension dispDimension = new Dimension();
            dispDimension.setSize(width, height);
            // we need to adjust the point, because it should be against the displayable dimension
            Point dispPoint = new Point();
            dispPoint.setLocation(point.x + getBounds().x, point.y + getBounds().y);
            if (disp.isHit(dispPoint, dispDimension)) {
                return;
            }
        }

        // Disable scrolling when ctrl or alt is held down, since this
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.