protected void setupMouseControls(){
        // right click to set the color
        addMouseListener(new MouseInputAdapter() {
            public void mouseClicked(MouseEvent e) {
                if( e.getButton() == MouseEvent.BUTTON1 || e.getButton() == MouseEvent.BUTTON3){
                    int xPos = e.getX();
                    if(xPos < 0 || xPos > CHR_PIXEL_WIDTH*tile.getWidth()){
                        // ignore it
                        return;
                    }
                    int yPos = e.getY();
                    if(yPos < 0 || yPos > CHR_PIXEL_HEIGHT*tile.getHeight()){
                        // ignore it
                        return;
                    }
                    int relX = xPos / CHR_PIXEL_WIDTH;
                    int relY = yPos / CHR_PIXEL_HEIGHT;
                    int index = (relY * tile.getWidth()) + relX;
                    if( e.getButton() == MouseEvent.BUTTON1){
                        processLeftClick(index);
                    }
                    if( e.getButton() == MouseEvent.BUTTON3){
                        processRightClick(index);
                    }
                }
            }
        });
        addMouseMotionListener(new MouseMotionAdapter() {
            public void mouseDragged(MouseEvent e) {
                processMouseDragged(e);              
            }
            public void mouseMoved(MouseEvent e) {
                processMouseMoved(e);
            }
        }
        );        
        
    }