1 18 19 package org.objectweb.jac.ide.diagrams; 20 21 import CH.ifa.draw.framework.Tool; 22 import CH.ifa.draw.util.PaletteListener; 23 import org.objectweb.jac.aspects.gui.ResourceManager; 24 import java.awt.Point ; 25 import javax.swing.JPanel ; 26 27 28 public class ToolPalette extends JPanel { 29 30 public ToolPalette() { 31 setLayout(new PaletteLayout(2,new Point (2,2))); 32 } 33 34 35 42 public ToolButton addToolButton(PaletteListener paletteListener, 43 String iconName, String toolName, 44 Tool tool) { 45 ToolButton button = 46 new ToolButton(paletteListener, 47 ResourceManager.getIconResource(iconName), 48 toolName, 49 tool); 50 add(button); 51 return button; 52 } 53 54 ToolButton defaultToolButton; 55 public void setDefaultToolButton(ToolButton defaultToolButton) { 56 this.defaultToolButton = defaultToolButton; 57 } 58 public ToolButton getDefaultToolButton() { 59 return defaultToolButton; 60 } 61 } 62 | Popular Tags |