Mapping piece position in draw()

I’m building a custom component and would like to draw on the map “above” a selected game piece. I’ve implemented the Drawable interface and have everything wired up so I know what piece is selected and I can draw to the map, but I’m struggling to figure out how to map the piece’s location to the Graphics context. I’ll need to account for zooming, etc.

So what should Center be in the following code…

GamePiece[] gamePieces = map.getPieces();
Point center;
        for (int i = 0; i < gamePieces.length; ++i) {
            if (gamePieces[i] instanceof Stack) {
                for (Iterator<GamePiece> it = ((Stack) gamePieces[i]).getPiecesIterator();it.hasNext();) {
                    GamePiece child = it.next();
                    if(child.getProperty(Properties.SELECTED).equals(Boolean.TRUE)) {
                        center = ???;
                    }
                }
            }
            else  {
                if(gamePieces[i].getProperty(Properties.SELECTED).equals(Boolean.TRUE)) {
                    center = ???;
                }
            }
        }

… so when I draw my component “Center” is the center of the selected piece in the graphics context.

    public void draw(Graphics g, Map map) {

        if (center != null) {

            // draw a circle around the selected piece
            Graphics2D gg = (Graphics2D) g;
            g.setColor(Color.RED);
            gg.setStroke(new BasicStroke(3));
            gg.drawOval(center.x,center.y,100,100);
        }
    }

Thanks, David

Never mind - I figured it out. -David