View Javadoc

1   /* $Id: EditorComponentListener.java 8 2008-07-31 18:54:46Z mihlon $ */
2   
3   //////////////////////////////////////////////////////////////////////////////
4   //                                                                          //
5   //   This program is free software: you can redistribute it and/or modify   //
6   //   it under the terms of the GNU General Public License as published by   //
7   //   the Free Software Foundation, either version 3 of the License, or      //
8   //   at your option any later version.                                      //
9   //                                                                          //
10  //   This program is distributed in the hope that it will be useful,        //
11  //   but WITHOUT ANY WARRANTY; without even the implied warranty of         //
12  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          //
13  //   GNU General Public License for more details.                           //
14  //                                                                          //
15  //   You should have received a copy of the GNU General Public License      //
16  //   along with this program.  If not, see <http://www.gnu.org/licenses/>.  //
17  //                                                                          //
18  //////////////////////////////////////////////////////////////////////////////
19  
20  package cs.pancava.caltha;
21  
22  import cs.pancava.caltha.desktop.EditorDesktop;
23  import java.awt.event.ComponentEvent;
24  import java.awt.event.ComponentListener;
25  
26  /**
27   * <p><b>Tato trida reaguje na zmeny hlavniho panelu edotoru (na presun aplikace,
28   *       zmena velikosti, ...).</b></p>
29   *
30   * @author Milan Vaclavik<br />
31   * @version $Revision: 8 $<br />
32   * $LastChangedBy: mihlon $<br />
33   */
34  public class EditorComponentListener implements ComponentListener
35  {
36      /**
37       * Reference na okno, ktere budeme ovlivnovat, kdyz zaznamename prislusnou
38       * udalost.
39       */
40      private EditorDesktop md;
41  
42      /**
43       * Konstruktor - uklada referenci na okno u ktereho se bude aktualizovat
44       * rozmery jednotlivych komponent.
45       * @param aThis MainDesktop : Reference na okno.
46       */
47      public EditorComponentListener(final EditorDesktop aThis)
48      {
49          this.md = aThis;
50      }
51  
52      /**
53       * Reaguje na udalost okna - zmena velikosti okna.
54       * @param e ComponentEvent : Udalost okna.
55       */
56      @Override
57      public final void componentResized(final ComponentEvent e)
58      {
59          // Doslo ke zmene velikosti, je treba znovu prepocitat velikosti
60          // jednotlivych oken.
61          this.md.resizeWin();
62      }
63  
64      /**
65       * Reaguje na udalost okna - pohyb (presun) okna.
66       * @param e ComponentEvent : Udalost okna.
67       */
68      @Override
69      public void componentMoved(final ComponentEvent e)
70      {
71      }
72  
73      /**
74       * Reaguje na udalost okna - okno bylo zobrazeno.
75       * @param e ComponentEvent : Udalost okna.
76       */
77      @Override
78      public final void componentShown(final ComponentEvent e)
79      {
80          // Doslo ke zmene velikosti, je treba znovu prepocitat velikosti
81          // jednotlivych oken.
82          this.md.resizeWin();
83      }
84  
85      /**
86       * Reaguje na udalost okna - okno bylo skryto.
87       * @param e ComponentEvent : Udalost okna.
88       */
89      @Override
90      public void componentHidden(final ComponentEvent e)
91      {
92      }
93  }