コード例 #1
0
 public int imageToViewY(int y) {
   switch (panel.getFitMode()) {
     case FIT_BOTH:
     case FIT_VERTICAL:
       return y * panel.getHeight() / stmt.getHeight();
     case FIT_HORIZONTAL:
       return y * panel.getWidth() / stmt.getWidth();
     default:
       return y;
   }
 }
コード例 #2
0
 public int viewToImageX(int x) {
   switch (panel.getFitMode()) {
     case FIT_BOTH:
     case FIT_HORIZONTAL:
       return x * stmt.getWidth() / panel.getWidth();
     case FIT_VERTICAL:
       return x * stmt.getHeight() / panel.getHeight();
     default:
       return x;
   }
 }