/Users/lyon/j4p/src/bookExamples/ch26Graphics/carl/logPolar/ConcentricRadialButton.java

1    /* 
2     * Created by IntelliJ IDEA. 
3     * User: root 
4     * Date: Feb 8, 2002 
5     * Time: 12:35:04 PM 
6     * To change template for new class use 
7     * Code Style | Class Templates options (Tools | IDE Options). 
8     */ 
9    package bookExamples.ch26Graphics.carl.logPolar; 
10    
11   import bookExamples.ch26Graphics.carl.logPolar.ColorArray; 
12    
13   class ConcentricRadialButton extends ToggleCommandButton { 
14       private Controller main; 
15    
16       public ConcentricRadialButton(Controller main) { 
17           super("Concentric", "Radial"); 
18           this.main = main; 
19       } 
20    
21       public void run() { 
22           if (main.getLogic().isRadially()) 
23               main.getLogic().setRadially(false); 
24           else 
25               main.getLogic().setRadially(true); 
26           ColorArray cArray = new ColorArray(main.getLogic().getRings(), main.getLogic().getRays(), main.getLogic().isRadially()); 
27           main.getLogic().getPanDisplay().repaint(); 
28       } 
29   } 
30