Ignore:
Timestamp:
2009-01-01T18:28:53+01:00 (16 years ago)
Author:
stoecker
Message:

removed tab stop usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/slippy_map_chooser/src/SizeButton.java

    r7199 r12778  
    1515 */
    1616public class SizeButton{
    17        
    18         private int x = 0;
    19         private int y = 0;
    20        
    21         private ImageIcon enlargeImage;
    22         private ImageIcon shrinkImage;
    23         private boolean isEnlarged = false;
    24        
    25        
    26         public SizeButton(){
    27                 enlargeImage = ImageProvider.get("", "view-fullscreen.png");
    28                 shrinkImage = ImageProvider.get("", "view-fullscreen-revert.png");             
    29         }
    30        
    31         public void paint(Graphics g){
    32                 if(isEnlarged){
    33                         if(shrinkImage != null)
    34                                 g.drawImage(shrinkImage.getImage(),x,y, null);
    35                 }else{
    36                         if(enlargeImage != null)
    37                                 g.drawImage(enlargeImage.getImage(),x,y, null);
    38                 }
    39         }
    40        
    41         public void toggle(){
    42                 isEnlarged = !isEnlarged;
    43         }
    44        
    45         public boolean hit(Point point){
    46                 if(x < point.x && point.x < x + enlargeImage.getIconWidth()){
    47                         if(y < point.y && point.y < y + enlargeImage.getIconHeight() ){                         
    48                                 return true;
    49                         }
    50                 }
    51                 return false;
    52         }
     17   
     18    private int x = 0;
     19    private int y = 0;
     20   
     21    private ImageIcon enlargeImage;
     22    private ImageIcon shrinkImage;
     23    private boolean isEnlarged = false;
     24   
     25   
     26    public SizeButton(){
     27        enlargeImage = ImageProvider.get("", "view-fullscreen.png");
     28        shrinkImage = ImageProvider.get("", "view-fullscreen-revert.png");     
     29    }
     30   
     31    public void paint(Graphics g){
     32        if(isEnlarged){
     33            if(shrinkImage != null)
     34                g.drawImage(shrinkImage.getImage(),x,y, null);
     35        }else{
     36            if(enlargeImage != null)
     37                g.drawImage(enlargeImage.getImage(),x,y, null);
     38        }
     39    }
     40   
     41    public void toggle(){
     42        isEnlarged = !isEnlarged;
     43    }
     44   
     45    public boolean hit(Point point){
     46        if(x < point.x && point.x < x + enlargeImage.getIconWidth()){
     47            if(y < point.y && point.y < y + enlargeImage.getIconHeight() ){             
     48                return true;
     49            }
     50        }
     51        return false;
     52    }
    5353
    5454}
Note: See TracChangeset for help on using the changeset viewer.