public void centerOnPointRel(double xrel,double yrel){
  xrel=Math.max(0,xrel);
  xrel=Math.min(1,xrel);
  yrel=Math.max(0,yrel);
  yrel=Math.min(1,yrel);
  Point p=new Point((int)((double)boardSize.getWidth() * xrel) + HEX_W,(int)((double)boardSize.getHeight() * yrel) + HEX_H);
  JScrollBar vscroll=scrollpane.getVerticalScrollBar();
  vscroll.setValue(p.y - (vscroll.getVisibleAmount() / 2));
  JScrollBar hscroll=scrollpane.getHorizontalScrollBar();
  hscroll.setValue(p.x - (hscroll.getVisibleAmount() / 2));
  repaint();
}

public void centerOnPointRel ( double xrel , double yrel ) { xrel = Math . max ( 0 , xrel ) ; xrel = Math . min ( 1 , xrel ) ; yrel = Math . max ( 0 , yrel ) ; yrel = Math . min ( 1 , yrel ) ; Point p = new Point ( ( int ) ( ( double ) boardSize . getWidth ( ) * xrel ) + HEX_W , ( int ) ( ( double ) boardSize . getHeight ( ) * yrel ) + HEX_H ) ; JScrollBar vscroll = scrollpane . getVerticalScrollBar ( ) ; vscroll . setValue ( p . y - ( vscroll . getVisibleAmount ( ) / 2 ) ) ; JScrollBar hscroll = scrollpane . getHorizontalScrollBar ( ) ; hscroll . setValue ( p . x - ( hscroll . getVisibleAmount ( ) / 2 ) ) ; repaint ( ) ; }
centers the board to a point
