11package painttools .tools ;
22
3- import java .awt .Cursor ;
4- import java .awt .Image ;
5- import java .awt .Point ;
6- import java .awt .Toolkit ;
73import java .awt .event .ActionEvent ;
84import java .awt .event .MouseEvent ;
95
10- import javax .swing .ImageIcon ;
11-
126import actions .AddDataInputBoxAction ;
137import buttons .ToolButton ;
148import ui .PaintPanel ;
159import ui .cursor .CustomCursors ;
10+ import ui .icons .CustomIcons ;
1611
1712public class AddInputBoxTool implements ActionToolsInterface {
1813
@@ -30,17 +25,13 @@ public AddInputBoxTool(PaintPanel panel) {
3025 public void start (PaintPanel panel ) {
3126 }
3227
28+
3329 @ Override
3430 public void createButton () {
3531 // TODO Auto-generated method stub
3632 button = new ToolButton ();
37-
38- ImageIcon icon = new ImageIcon ("./images/dot.png" );
39- button .setOriginalImage (icon );
40-
41- ImageIcon icon2 = new ImageIcon ("./images/dotselected.png" );
42- button .setSelectedImage (icon2 );
43-
33+ button .setOriginalImage (CustomIcons .arrow ());
34+ button .setSelectedImage (CustomIcons .selectedArrow ());
4435 button .addActionListener (this );
4536 }
4637
@@ -57,13 +48,14 @@ public void reset() {
5748
5849 @ Override
5950 public void mouseClicked (MouseEvent e ) {
60- // TODO Auto-generated method stub
51+
6152 AddDataInputBoxAction action = new AddDataInputBoxAction (panel );
6253 if (action .canPerformAction ()){
6354 action .setXY (e .getX (), e .getY ());
6455 action .performAction ();
6556 action .setDefaultXY ();
6657 }
58+ panel .setDefaultSelectTool ();
6759
6860 }
6961
0 commit comments