-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathHelloTool.java
More file actions
59 lines (47 loc) · 1.77 KB
/
HelloTool.java
File metadata and controls
59 lines (47 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* you can put a one sentence description of your tool here.
*
* ##copyright##
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author ##author##
* @modified ##date##
* @version ##tool.prettyVersion##
*/
package template.tool;
import processing.app.Base;
import processing.app.tools.Tool;
import processing.app.ui.Editor;
// when creating a tool, the name of the main class which implements Tool must
// be the same as the value defined for project.name in your build.properties
public class HelloTool implements Tool {
Base base;
public String getMenuTitle() {
return "##tool.name##";
}
public void init(Base base) {
// Store a reference to the Processing application itself
this.base = base;
}
public void run() {
// Get the currently active Editor to run the Tool on it
Editor editor = base.getActiveEditor();
// Fill in author.name, author.url, tool.prettyVersion and
// project.prettyName in build.properties for them to be auto-replaced here.
System.out.println("Hello Tool. ##tool.name## ##tool.prettyVersion## by ##author##");
}
}