Clover coverage report - Maven Clover report
Coverage timestamp: Thu Oct 11 2007 08:41:48 CEST
file stats: LOC: 78   Methods: 11
NCLOC: 46   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ZoomInTool.java 25% 72.7% 36.4% 50%
coverage coverage
 1    /*
 2    * Copyright (C) 2007 Eric MIGNOT - mignots.eric@free.fr
 3    *
 4    * This library is free software; you can redistribute it and/or
 5    * modify it under the terms of the GNU Lesser General Public
 6    * License as published by the Free Software Foundation; either
 7    * version 2.1 of the License, or (at your option) any later version.
 8    *
 9    * This library is distributed in the hope that it will be useful,
 10    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12    * Lesser General Public License for more details.
 13    *
 14    * You should have received a copy of the GNU Lesser General Public
 15    * License along with this library; if not, write to the Free Software
 16    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 17    */
 18   
 19    package org.ericmignot.modeler.gui.palette;
 20   
 21    import java.awt.event.MouseEvent;
 22   
 23    import javax.swing.ImageIcon;
 24    import javax.swing.JToggleButton;
 25   
 26    import org.ericmignot.modeler.gui.StaticValues;
 27    import org.ericmignot.modeler.gui.workarea.Item;
 28    import org.ericmignot.modeler.util.action.NotifyableAction;
 29   
 30    public class ZoomInTool extends PaletteTool
 31    {
 32    protected JToggleButton button;
 33   
 34  1 public JToggleButton getButton()
 35    {
 36  1 if (this.button == null)
 37    {
 38  1 this.button = new JToggleButton(
 39    StaticValues.getInstance().get("Design.Palette.ZoomIn", "Zoom in"),
 40    new ImageIcon(this.getClass().getClassLoader().getResource(
 41    "org/ericmignot/modeler/gui/palette/zoomIn.gif")));
 42  1 this.button.setToolTipText(StaticValues.getInstance().get("Design.Palette.ZoomInTooltip", "Zoom in"));
 43    }
 44  1 return this.button;
 45    }
 46   
 47  1 public boolean shouldItemRegister(Item item) {
 48  1 return false;
 49    }
 50   
 51  1 public boolean shouldWorkAreaRegister() {
 52  1 return true;
 53    }
 54   
 55  0 public void registerItem(Item item) {
 56    }
 57   
 58  0 public void unregisterItem(Item item) {
 59    }
 60   
 61  0 public void mousePressed(MouseEvent e) {}
 62  0 public void itemPressed(Item item, int x, int y) {}
 63   
 64  0 public void mouseDragged(MouseEvent e) {}
 65  0 public void itemDragged(int x, int y) {}
 66   
 67  0 public void mouseReleased(MouseEvent e)
 68    {
 69  0 if (e.isConsumed()) return;
 70  0 this.manageReleased();
 71    }
 72   
 73  1 public NotifyableAction manageReleased() {
 74  1 this.getController().treatZoomIn();
 75  1 return null;
 76    }
 77   
 78    }