Examples of ImmutablePoint


Examples of com.jcloisterzone.ui.ImmutablePoint

    }

    public ImmutablePoint getMeeplePlacement(Tile tile, Class<? extends Feature> feature, Location location) {
        Location normalizedLoc = location.rotateCCW(tile.getRotation());
        FeatureDescriptor lookups[] = getLookups(tile, feature, normalizedLoc);
        ImmutablePoint point = null;
        for (FeatureDescriptor fd : lookups) {
            point = points.get(fd);
            if (point != null) break;
        }
        if (point == null) return null;
        return point.rotate(tile.getRotation());
    }
View Full Code Here

Examples of com.jcloisterzone.ui.ImmutablePoint

            @Override
            public void processApply(Element node, FeatureDescriptor fd, AffineTransform transform) {
                assert !points.containsKey(fd) : fd + " already defined";
                transform.transform(srcPoint, destPoint);
                //TODO use 1000-pixel standard
                points.put(fd, new ImmutablePoint(destPoint.x/10, destPoint.y/10));
            }

            @Override
            public void processSubstract(Element node, String tileId, AffineTransform transform, boolean isFarm) {
                throw new UnsupportedOperationException("<substract> not allowed for points.xml");
View Full Code Here

Examples of com.jcloisterzone.ui.ImmutablePoint

    @Override
    public ImmutablePoint getMeeplePlacement(Tile tile, Class<? extends Meeple> type, Location loc) {
        if (!containsTile(tile.getId())) return null;
        if (type.equals(Barn.class)) return null;
        Feature piece = tile.getFeature(loc);
        ImmutablePoint point = pluginGeometry.getMeeplePlacement(tile, piece.getClass(), loc);
        if (point == null) {
            point = defaultGeometry.getMeeplePlacement(tile, piece.getClass(), piece.getLocation());
        }
        if (point == null) {
            logger.warn("No point defined for <" + (new FeatureDescriptor(tile, piece.getClass(), loc)) + ">");
            point =  new ImmutablePoint(0, 0);
        }
        return point;
    }
View Full Code Here

Examples of com.jcloisterzone.ui.ImmutablePoint

    /** debug purposes highlight - it always shows basic follower (doesn't important for dbg */
    private void paintFigureHighlight(Graphics2D g2) {
        //ugly copy pasted code from Meeple but uncached here
        g2.setComposite(FIGURE_HIGHLIGHT_AREA_ALPHA_COMPOSITE);
        Tile tile = getGame().getBoard().get(selectedPosition);
        ImmutablePoint point = getClient().getResourceManager().getMeeplePlacement(tile, SmallFollower.class, selectedLocation);
        Player p = getGame().getActivePlayer();
        Image unscaled = getClient().getFigureTheme().getFigureImage(SmallFollower.class, p.getColors().getMeepleColor(), null);
        int size = (int) (getSquareSize() * MeepleLayer.FIGURE_SIZE_RATIO);
        Image scaled = unscaled.getScaledInstance(size, size, Image.SCALE_SMOOTH);
        scaled = new ImageIcon(scaled).getImage();
        ImmutablePoint scaledOffset = point.scale(getSquareSize(), (int)(getSquareSize() * MeepleLayer.FIGURE_SIZE_RATIO));
        g2.drawImage(scaled, getOffsetX(selectedPosition) + scaledOffset.getX(), getOffsetY(selectedPosition) + scaledOffset.getY(), gridPanel);
    }
View Full Code Here

Examples of com.jcloisterzone.ui.ImmutablePoint

        g2.setColor(FILL_COLOR);
        for (Entry<Position, Integer> entry : heights.entrySet()) {
            Area ra = getClient().getResourceManager().getMeepleTileArea(gridPanel.getTile(entry.getKey()), getSquareSize(), Location.TOWER);
            g2.fill(transformArea(ra, entry.getKey()));
            drawAntialiasedTextCenteredNoScale(g2,"" + entry.getValue(), 22, entry.getKey(),
                    new ImmutablePoint((int)ra.getBounds2D().getCenterX(),(int)ra.getBounds2D().getCenterY()), Color.WHITE, null);
        }
    }
View Full Code Here

Examples of com.metamx.collections.spatial.ImmutablePoint

              new Function<ImmutableNode, ImmutablePoint>()
              {
                @Override
                public ImmutablePoint apply(ImmutableNode tNode)
                {
                  return new ImmutablePoint(tNode);
                }
              }
          )
      );
    } else {
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.