| 1 |  |  | 
| 2 |  |  | 
| 3 |  |  | 
| 4 |  |  | 
| 5 |  |  | 
| 6 |  |  | 
| 7 |  |  | 
| 8 |  |  | 
| 9 |  |  | 
| 10 |  |  | 
| 11 |  |  | 
| 12 |  |  | 
| 13 |  |  | 
| 14 |  |  | 
| 15 |  |  | 
| 16 |  |  | 
| 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 |  | } |