Package java.awt

Examples of java.awt.Point.translate()


                // JW: what we are after
                // is the offset into the hierarchical column
                // then intersect this with the pathbounds  
                Point mousePoint = event.getPoint();
                // translate to coordinates relative to cell
                mousePoint.translate(-cellRect.x, -cellRect.y);
                // translate horizontally to
                mousePoint.translate(-pathBounds.x, 0);
                // show tooltip only if over renderer?
//                if (mousePoint.x < 0) return null;
//                p.translate(-pathBounds.x, -pathBounds.y);
View Full Code Here


                // then intersect this with the pathbounds  
                Point mousePoint = event.getPoint();
                // translate to coordinates relative to cell
                mousePoint.translate(-cellRect.x, -cellRect.y);
                // translate horizontally to
                mousePoint.translate(-pathBounds.x, 0);
                // show tooltip only if over renderer?
//                if (mousePoint.x < 0) return null;
//                p.translate(-pathBounds.x, -pathBounds.y);
                MouseEvent newEvent = new MouseEvent(rComponent, event.getID(),
                      event.getWhen(),
View Full Code Here

            graph.setColor(new Color(TRANSPARENT));
            graph.fillRect(0, 0, bounds.width, bounds.height);

            // setup some variables
            final Point stepPos = getHexLocation(step.getPosition());
            stepPos.translate(-bounds.x, -bounds.y);
            final Polygon facingPoly = facingPolys[step.getFacing()];
            final Polygon movePoly = movementPolys[step.getFacing()];
            Point offsetCostPos;
            Polygon myPoly;
            Color col;
View Full Code Here

            graph.setColor(new Color(TRANSPARENT));
            graph.fillRect(0, 0, bounds.width, bounds.height);

            // setup some variables
            final Point stepPos = getHexLocation(step.getPosition());
            stepPos.translate(-bounds.x, -bounds.y);
            final Polygon facingPoly = facingPolys[step.getFacing()];
            final Polygon movePoly = movementPolys[step.getFacing()];
            Point offsetCostPos;
            Polygon myPoly;
            Color col;
View Full Code Here

        // loop through the hexes
        for (int i = 0; i < drawHeight; i++) {
            for (int j = 0; j < drawWidth; j++) {
                Coords c = new Coords(j + drawX, i + drawY);
                Point p = getHexLocation(c);
                p.translate(-(view.x), -(view.y));
                if (board.isLegalDeployment(c, m_plDeployer)) {
                    backGraph.setColor(Color.yellow);
                    int[] xcoords = { p.x + (int) (21 * scale),
                            p.x + (int) (62 * scale), p.x + (int) (83 * scale),
                            p.x + (int) (83 * scale), p.x + (int) (62 * scale),
 
View Full Code Here

        // loop through the hexes
        for (int i = 0; i < drawHeight; i++) {
            for (int j = 0; j < drawWidth; j++) {
                Coords c = new Coords(j + drawX, i + drawY);
                Point p = getHexLocation(c);
                p.translate(-(view.x), -(view.y));

                if (!board.contains(c)) {
                    continue;
                }
                if (!game.containsMinefield(c)) {
View Full Code Here

            // update tip text
            tipWindow.removeAll();
            tipWindow.add(new TooltipCanvas(tipText));
            tipWindow.pack();

            tipLoc.translate(mousePos.x, mousePos.y + 20);

            // adjust horizontal location for the tipWindow if it goes off the
            // frame
            if (getLocationOnScreen().x + this.getSize().width < tipLoc.x
                    + tipWindow.getSize().width + 10) {
View Full Code Here

        int xOffset = UIManager.getInt(prefix + "X");
        int yOffset = UIManager.getInt(prefix + "Y");
        if (!leftToRight) {
            xOffset = -xOffset;
        }
        result.translate(xOffset - getX(), yOffset - getY());
        return result;
    }

    public boolean isPopupMenuVisible() {
        return popup != null ? popup.isVisible() : false;
View Full Code Here

        int margin = spacing + itemHeight/4;

        Point location = s.getLocation();
        Point result = new Point(location);
        result.translate(s.getWidth() - margin, y - spacing);
        // TODO: ajust position according to sumbenu size
        return result;
    }

}
View Full Code Here

    System.out.println("[ECSTATE] processMouseReleased");
    if(isBeingRightClickDragged){
      isBeingRightClickDragged = false;
     
      Point p = evt.getPoint();
      p.translate(this.getX(), this.getY());
      Component c = getParent().getComponentAt(p);
      if(c != null && c instanceof ECState && c != this){
        ECState other = (ECState)c;
        ECCDialog eccdialog = new ECCDialog((Element)elem.getParentNode(), evt);
        eccdialog.setSourceStateName(getName());
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.