File Source: DummyFrameManager.java

         /* 
    P/P   *  Method: com.dmdirc.addons.ui_dummy.DummyFrameManager__static_init
          */
     1  /*
     2   * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
     3   *
     4   * Permission is hereby granted, free of charge, to any person obtaining a copy
     5   * of this software and associated documentation files (the "Software"), to deal
     6   * in the Software without restriction, including without limitation the rights
     7   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     8   * copies of the Software, and to permit persons to whom the Software is
     9   * furnished to do so, subject to the following conditions:
    10   *
    11   * The above copyright notice and this permission notice shall be included in
    12   * all copies or substantial portions of the Software.
    13   *
    14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    20   * SOFTWARE.
    21   */
    22  
    23  package com.dmdirc.addons.ui_dummy;
    24  
    25  import com.dmdirc.FrameContainer;
    26  import com.dmdirc.Main;
    27  import com.dmdirc.ui.interfaces.FrameManager;
    28  
    29  import java.awt.Color;
    30  
    31  import javax.swing.JComponent;
    32  
    33  /**
    34   * A dummy frame manager. Does nothing.
    35   * @author chris
    36   */
    37  public class DummyFrameManager implements FrameManager {
    38      
    39      /** Creates a new instance of DummyFrameManager. */
             /* 
    P/P       *  Method: void com.dmdirc.addons.ui_dummy.DummyFrameManager()
              */
    40      public DummyFrameManager() {
    41          //Do nothing.
    42      }
    43      
    44      /** {@inheritDoc} */
    45      @Override
    46      public void setParent(final JComponent parent) {
                 /* 
    P/P           *  Method: void setParent(JComponent)
                  * 
                  *  Preconditions:
                  *    parent != null
                  * 
                  *  Presumptions:
                  *    init'ed(java.awt.Color.RED)
                  */
    47          parent.setBackground(Color.RED);
    48      }
    49      
    50      /** {@inheritDoc} */
    51      @Override
    52      public void addWindow(final FrameContainer window) {
                 /* 
    P/P           *  Method: void addWindow(FrameContainer)
                  * 
                  *  Presumptions:
                  *    com.dmdirc.Main:getUI(...)@53 != null
                  *    com.dmdirc.ui.interfaces.UIController:getStatusBar(...)@53 != null
                  */
    53          Main.getUI().getStatusBar()
    54                  .setMessage("DummyFrameManager: addServer: " + window);
    55      }
    56      
    57      /** {@inheritDoc} */
    58      @Override
    59      public void delWindow(final FrameContainer window) {
                 /* 
    P/P           *  Method: void delWindow(FrameContainer)
                  * 
                  *  Presumptions:
                  *    com.dmdirc.Main:getUI(...)@60 != null
                  *    com.dmdirc.ui.interfaces.UIController:getStatusBar(...)@60 != null
                  */
    60          Main.getUI().getStatusBar()
    61                  .setMessage("DummyFrameManager: delServer: " + window);
    62      }
    63      
    64      /** {@inheritDoc} */
    65      @Override
    66      public void addWindow(final FrameContainer parent, final FrameContainer window) {
                 /* 
    P/P           *  Method: void addWindow(FrameContainer, FrameContainer)
                  * 
                  *  Presumptions:
                  *    com.dmdirc.Main:getUI(...)@67 != null
                  *    com.dmdirc.ui.interfaces.UIController:getStatusBar(...)@67 != null
                  */
    67          Main.getUI().getStatusBar()
    68                  .setMessage("DummyFrameManager: addCustom: " + window + "@" + parent);
    69      }
    70      
    71      /** {@inheritDoc} */
    72      @Override
    73      public void delWindow(final FrameContainer parent, final FrameContainer window) {
                 /* 
    P/P           *  Method: void delWindow(FrameContainer, FrameContainer)
                  * 
                  *  Presumptions:
                  *    com.dmdirc.Main:getUI(...)@74 != null
                  *    com.dmdirc.ui.interfaces.UIController:getStatusBar(...)@74 != null
                  */
    74          Main.getUI().getStatusBar()
    75                  .setMessage("DummyFrameManager: delCustom: " + window + "@" + parent);
    76      }
    77      
    78      /** {@inheritDoc} */
    79      @Override
    80      public boolean canPositionVertically() {
                 /* 
    P/P           *  Method: bool canPositionVertically()
                  * 
                  *  Postconditions:
                  *    return_value == 1
                  */
    81          return true;
    82      }
    83      
    84      /** {@inheritDoc} */
    85      @Override
    86      public boolean canPositionHorizontally() {
                 /* 
    P/P           *  Method: bool canPositionHorizontally()
                  * 
                  *  Postconditions:
                  *    return_value == 1
                  */
    87          return true;
    88      }
    89  
    90  }








SofCheck Inspector Build Version : 2.17854
DummyFrameManager.java 2009-Jun-25 01:54:24
DummyFrameManager.class 2009-Sep-02 17:04:15