Revision 2326
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/SimpleServerManager.java | ||
---|---|---|
1 |
package org.gvsig.simplehttpservice; |
|
2 |
|
|
3 |
/** |
|
4 |
* |
|
5 |
* @author gvSIG Team |
|
6 |
*/ |
|
7 |
public interface SimpleServerManager { |
|
8 |
|
|
9 |
public SimpleServerConfig createSimpleServerConfig(); |
|
10 |
|
|
11 |
public SimpleServer createSimpleServer(SimpleServerConfig config); |
|
12 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/SimpleServer.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.simplehttpservice; |
|
3 |
|
|
4 |
import java.net.URL; |
|
5 |
import java.util.Map; |
|
6 |
import org.gvsig.simplehttpservice.commands.Command; |
|
7 |
|
|
8 |
|
|
9 |
public interface SimpleServer { |
|
10 |
|
|
11 |
public static int INFO = 0; |
|
12 |
public static int WARN = 1; |
|
13 |
public static int DEBUG = 2; |
|
14 |
|
|
15 |
public interface LoggerListener { |
|
16 |
public void log(int level, String message); |
|
17 |
} |
|
18 |
|
|
19 |
public SimpleServerConfig getConfig(); |
|
20 |
|
|
21 |
public void start(); |
|
22 |
|
|
23 |
public void stop(); |
|
24 |
|
|
25 |
public void reload(); |
|
26 |
|
|
27 |
public boolean isStarted(); |
|
28 |
|
|
29 |
public void addLogListener(LoggerListener logger); |
|
30 |
|
|
31 |
public void removeLogListener(LoggerListener logger); |
|
32 |
|
|
33 |
public URL getURL(String path); |
|
34 |
|
|
35 |
public String getHost(); |
|
36 |
|
|
37 |
public void log(int level, String message); |
|
38 |
|
|
39 |
public Map<String, Command> getCommands(); |
|
40 |
|
|
41 |
public Command getCommand(String arg); |
|
42 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/commands/CommandFactory.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.simplehttpservice.commands; |
|
3 |
|
|
4 |
import org.apache.commons.lang3.Range; |
|
5 |
import org.gvsig.simplehttpservice.SimpleServer; |
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
* @author jjdelcerro |
|
10 |
*/ |
|
11 |
public interface CommandFactory { |
|
12 |
|
|
13 |
String getMimeType(); |
|
14 |
|
|
15 |
String getName(); |
|
16 |
|
|
17 |
Range getNumArgs(); |
|
18 |
|
|
19 |
String getDescription(); |
|
20 |
|
|
21 |
public Command create(SimpleServer server); |
|
22 |
|
|
23 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/commands/Help.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.simplehttpservice.commands; |
|
3 |
|
|
4 |
import java.util.Map; |
|
5 |
import javax.json.Json; |
|
6 |
import javax.json.JsonArrayBuilder; |
|
7 |
import javax.json.JsonObject; |
|
8 |
import javax.json.JsonObjectBuilder; |
|
9 |
import org.apache.commons.lang3.StringUtils; |
|
10 |
import org.gvsig.htmlbuilder.HTMLBuilder; |
|
11 |
import org.gvsig.htmlbuilder.HTMLBuilder.HTMLComplexElement; |
|
12 |
import org.gvsig.simplehttpservice.SimpleServer; |
|
13 |
import org.gvsig.tools.util.ToolsUtilLocator; |
|
14 |
|
|
15 |
/** |
|
16 |
* |
|
17 |
* @author gvSIG Team |
|
18 |
*/ |
|
19 |
public class Help extends AbstractCommand { |
|
20 |
|
|
21 |
public Help(CommandFactory factory, SimpleServer server) { |
|
22 |
super(factory,server); |
|
23 |
} |
|
24 |
|
|
25 |
|
|
26 |
@Override |
|
27 |
public Object call(int argc, String[] args) { |
|
28 |
Map<String, Command> commands = this.getServer().getCommands(); |
|
29 |
if( argc>0 && StringUtils.equalsIgnoreCase("asjson", args[1]) ) { |
|
30 |
JsonArrayBuilder builder = Json.createArrayBuilder(); |
|
31 |
for (Command command : commands.values()) { |
|
32 |
builder.add(this.getCommandDescription(command)); |
|
33 |
} |
|
34 |
return builder.toString(); |
|
35 |
} else { |
|
36 |
HTMLBuilder builder = ToolsUtilLocator.getToolsUtilManager().createHTMLBuilder(); |
|
37 |
HTMLComplexElement table = builder.table( |
|
38 |
0,1,4, |
|
39 |
builder.thead( |
|
40 |
builder.tr( |
|
41 |
builder.th("Return type"), |
|
42 |
builder.th("Name"), |
|
43 |
builder.th("Description") |
|
44 |
) |
|
45 |
) |
|
46 |
); |
|
47 |
|
|
48 |
for (Command command : commands.values()) { |
|
49 |
HTMLComplexElement tr = builder.tr(HTMLBuilder.valign_top).contents( |
|
50 |
builder.td(command.getMimeType()), |
|
51 |
builder.td(command.getName()), |
|
52 |
builder.td( |
|
53 |
builder.plainWithNl(command.getDescription()+"\n\n") |
|
54 |
) |
|
55 |
); |
|
56 |
table.contents(tr); |
|
57 |
} |
|
58 |
return table.toHTML(); |
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
public JsonObject getCommandDescription(Command command) { |
|
63 |
JsonObjectBuilder builder = Json.createObjectBuilder(); |
|
64 |
builder.add("Name", command.getName()); |
|
65 |
builder.add("NumArgs", command.getNumArgs().toString()); |
|
66 |
builder.add("MimeType", StringUtils.defaultString(command.getMimeType())); |
|
67 |
builder.add("Description", StringUtils.defaultString(command.getDescription())); |
|
68 |
return builder.build(); |
|
69 |
} |
|
70 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/commands/AbstractCommandFactory.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.simplehttpservice.commands; |
|
3 |
|
|
4 |
import org.apache.commons.lang3.Range; |
|
5 |
|
|
6 |
/** |
|
7 |
* |
|
8 |
* @author jjdelcerro |
|
9 |
*/ |
|
10 |
public abstract class AbstractCommandFactory implements CommandFactory { |
|
11 |
|
|
12 |
private final String name; |
|
13 |
private final Range nargs; |
|
14 |
private final String mimetype; |
|
15 |
private final String description; |
|
16 |
|
|
17 |
protected AbstractCommandFactory(String name, Range nargs, String mimetype, String description) { |
|
18 |
this.name = name; |
|
19 |
this.nargs = nargs; |
|
20 |
this.mimetype = mimetype; |
|
21 |
this.description = description; |
|
22 |
} |
|
23 |
|
|
24 |
@Override |
|
25 |
public String getDescription() { |
|
26 |
return this.description; |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
public String getName() { |
|
31 |
return this.name; |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public Range getNumArgs() { |
|
36 |
return this.nargs; |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
|
40 |
public String getMimeType() { |
|
41 |
return this.mimetype; |
|
42 |
} |
|
43 |
|
|
44 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/commands/Command.java | ||
---|---|---|
1 |
package org.gvsig.simplehttpservice.commands; |
|
2 |
|
|
3 |
import org.apache.commons.lang3.Range; |
|
4 |
import org.gvsig.simplehttpservice.SimpleServer; |
|
5 |
|
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
* @author jjdelcerro |
|
10 |
*/ |
|
11 |
public interface Command { |
|
12 |
|
|
13 |
Object call(int argc, String[] args) throws Exception; |
|
14 |
|
|
15 |
String getMimeType(); |
|
16 |
|
|
17 |
String getName(); |
|
18 |
|
|
19 |
Range getNumArgs(); |
|
20 |
|
|
21 |
String getDescription(); |
|
22 |
|
|
23 |
SimpleServer getServer(); |
|
24 |
|
|
25 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/commands/HelpFactory.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.simplehttpservice.commands; |
|
3 |
|
|
4 |
import org.apache.commons.lang3.Range; |
|
5 |
import org.gvsig.simplehttpservice.SimpleServer; |
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
* @author gvSIG Team |
|
10 |
*/ |
|
11 |
public class HelpFactory extends AbstractCommandFactory { |
|
12 |
|
|
13 |
public HelpFactory() { |
|
14 |
super( |
|
15 |
"help", |
|
16 |
Range.between(0,1), |
|
17 |
"text/html", |
|
18 |
"help\n\n" + |
|
19 |
"Retrieve a short help of supported commands.\n" + |
|
20 |
"Use help/asjson to retrieve this help as json." |
|
21 |
); |
|
22 |
} |
|
23 |
|
|
24 |
@Override |
|
25 |
public Command create(SimpleServer server) { |
|
26 |
return new Help(this, server); |
|
27 |
} |
|
28 |
|
|
29 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/commands/AbstractCommand.java | ||
---|---|---|
1 |
package org.gvsig.simplehttpservice.commands; |
|
2 |
|
|
3 |
import org.apache.commons.lang3.Range; |
|
4 |
import org.gvsig.simplehttpservice.SimpleServer; |
|
5 |
import org.gvsig.simplehttpservice.SimpleServerConfig; |
|
6 |
import org.slf4j.Logger; |
|
7 |
import org.slf4j.LoggerFactory; |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @author gvSIG Team |
|
12 |
*/ |
|
13 |
public abstract class AbstractCommand implements Command { |
|
14 |
|
|
15 |
protected static final Logger LOG = LoggerFactory.getLogger(AbstractCommand.class); |
|
16 |
|
|
17 |
private final SimpleServer server; |
|
18 |
private final CommandFactory factory; |
|
19 |
|
|
20 |
public AbstractCommand(CommandFactory factory, SimpleServer server) { |
|
21 |
this.server = server; |
|
22 |
this.factory = factory; |
|
23 |
} |
|
24 |
|
|
25 |
protected SimpleServerConfig getConfig() { |
|
26 |
return this.server.getConfig(); |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
public SimpleServer getServer() { |
|
31 |
return this.server; |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public String getDescription() { |
|
36 |
return this.factory.getDescription().replace("${host}", this.server.getHost()); |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
|
40 |
public String getName() { |
|
41 |
return this.factory.getName(); |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
public Range getNumArgs() { |
|
46 |
return this.factory.getNumArgs(); |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
public String getMimeType() { |
|
51 |
return this.factory.getMimeType(); |
|
52 |
} |
|
53 |
|
|
54 |
|
|
55 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/simplehttpservice/SimpleServerConfig.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.simplehttpservice; |
|
3 |
|
|
4 |
import java.beans.PropertyChangeListener; |
|
5 |
import java.util.Collection; |
|
6 |
import java.util.List; |
|
7 |
import org.gvsig.simplehttpservice.commands.CommandFactory; |
|
8 |
import org.gvsig.simplehttpservice.commands.CommandFactory; |
|
9 |
|
|
10 |
/** |
|
11 |
* |
|
12 |
* @author gvSIG Team |
|
13 |
*/ |
|
14 |
public interface SimpleServerConfig { |
|
15 |
|
|
16 |
public int getPort(); |
|
17 |
|
|
18 |
public int getTimeout(); |
|
19 |
|
|
20 |
public String getServerInfo(); |
|
21 |
|
|
22 |
public SimpleServerConfig setPort(int port); |
|
23 |
|
|
24 |
public SimpleServerConfig setTimeout(int timeout); |
|
25 |
|
|
26 |
public SimpleServerConfig setServerInfo(String serverInfo); |
|
27 |
|
|
28 |
public SimpleServerConfig addCommandFactory(CommandFactory factory); |
|
29 |
|
|
30 |
public void removeCommandFactory(String name); |
|
31 |
|
|
32 |
public void removeCommandFactory(CommandFactory factory); |
|
33 |
|
|
34 |
public Collection<CommandFactory> getCommandFactories(); |
|
35 |
|
|
36 |
public void addPropertyChangeListener(PropertyChangeListener listener); |
|
37 |
|
|
38 |
public void removePropertyChangeListener(PropertyChangeListener listener); |
|
39 |
|
|
40 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/desktopopen/DesktopOpen.java | ||
---|---|---|
1 |
package org.gvsig.desktopopen; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.net.URI; |
|
5 |
|
|
6 |
public interface DesktopOpen { |
|
7 |
|
|
8 |
public boolean browse(URI uri); |
|
9 |
|
|
10 |
public boolean edit(File file); |
|
11 |
|
|
12 |
public boolean open(File file); |
|
13 |
|
|
14 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/htmlbuilder/HTMLBuilder.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.htmlbuilder; |
|
3 |
|
|
4 |
import java.awt.Color; |
|
5 |
import java.util.Date; |
|
6 |
import java.util.List; |
|
7 |
import java.util.Map; |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @author jjdelcerro |
|
12 |
*/ |
|
13 |
public interface HTMLBuilder { |
|
14 |
|
|
15 |
|
|
16 |
public static final String accesskey = "accesskey"; |
|
17 |
public static final String class_ = "class"; |
|
18 |
public static final String contenteditable = "contenteditable"; |
|
19 |
public static final String content = "content"; |
|
20 |
public static final String dir = "dir"; |
|
21 |
public static final String draggable = "draggable"; |
|
22 |
public static final String dropzone = "dropzone"; |
|
23 |
public static final String hidden = "hidden"; |
|
24 |
public static final String id = "id"; |
|
25 |
public static final String lang = "lang"; |
|
26 |
public static final String spellcheck = "spellcheck"; |
|
27 |
public static final String style = "style"; |
|
28 |
public static final String tabindex = "tabindex"; |
|
29 |
public static final String title = "title"; |
|
30 |
public static final String translate = "translate"; |
|
31 |
|
|
32 |
public static final String alt = "alt"; |
|
33 |
public static final String coords = "coords"; |
|
34 |
public static final String download = "download"; |
|
35 |
public static final String href = "href"; |
|
36 |
public static final String hreflang = "hreflang"; |
|
37 |
public static final String media = "media"; |
|
38 |
public static final String nohref = "nohref"; |
|
39 |
public static final String rel = "rel"; |
|
40 |
public static final String shape = "shape"; |
|
41 |
public static final String target = "target"; |
|
42 |
public static final String type = "type"; |
|
43 |
|
|
44 |
public static final String autofocus = "autofocus"; |
|
45 |
public static final String disabled = "disabled"; |
|
46 |
public static final String form = "form"; |
|
47 |
public static final String formaction = "formaction"; |
|
48 |
public static final String formenctype = "formenctype"; |
|
49 |
public static final String formmethod = "formmethod"; |
|
50 |
public static final String formnovalidate = "formnovalidate"; |
|
51 |
public static final String formtarget = "formtarget"; |
|
52 |
public static final String framename = "framename"; |
|
53 |
public static final String name = "name"; |
|
54 |
public static final String value = "value"; |
|
55 |
public static final String height = "height"; |
|
56 |
public static final String width = "width"; |
|
57 |
public static final String align = "align"; |
|
58 |
public static final String open = "open"; |
|
59 |
public static final String size = "size"; |
|
60 |
public static final String color = "color"; |
|
61 |
public static final String face = "face"; |
|
62 |
public static final String noshade = "noshade"; |
|
63 |
public static final String xmlns = "xmlns"; |
|
64 |
public static final String for_ = "for"; |
|
65 |
public static final String charset = "charset"; |
|
66 |
|
|
67 |
public static final String max = "max"; |
|
68 |
public static final String min = "min"; |
|
69 |
public static final String low = "low"; |
|
70 |
public static final String hight = "hight"; |
|
71 |
public static final String optimun = "optimun"; |
|
72 |
|
|
73 |
public static final String compact = "compact"; |
|
74 |
public static final String reversed = "reversed"; |
|
75 |
public static final String start = "start"; |
|
76 |
|
|
77 |
public static final String multiple = "multiple"; |
|
78 |
public static final String required = "required"; |
|
79 |
|
|
80 |
public static final String bgcolor = "bgcolor"; |
|
81 |
public static final String border = "border"; |
|
82 |
public static final String cellpadding = "cellpadding"; |
|
83 |
public static final String cellspacing = "cellspacing"; |
|
84 |
|
|
85 |
public static final String colspan = "colspan"; |
|
86 |
public static final String nowrap = "nowrap"; |
|
87 |
public static final String valign = "valign"; |
|
88 |
|
|
89 |
public static final String cols = "cols"; |
|
90 |
public static final String dirname = "dirname"; |
|
91 |
public static final String maxlength = "maxlength"; |
|
92 |
public static final String placeholder = "placeholder"; |
|
93 |
public static final String readonly = "readonly"; |
|
94 |
public static final String rows = "rows"; |
|
95 |
public static final String wrap = "wrap"; |
|
96 |
|
|
97 |
public static final String datetime = "datetime"; |
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
public static final String target_blank = "_blank"; |
|
105 |
public static final String target_self = "_self"; |
|
106 |
public static final String target_parent = "_parent"; |
|
107 |
public static final String target_top = "_top"; |
|
108 |
|
|
109 |
public static final String method_get = "get"; |
|
110 |
public static final String method_post = "post"; |
|
111 |
|
|
112 |
public static final String type_button = "button"; |
|
113 |
public static final String type_reset = "reset"; |
|
114 |
public static final String type_submit = "submit"; |
|
115 |
|
|
116 |
public static final String valign_top = "top"; |
|
117 |
public static final String valign_middle = "middle"; |
|
118 |
public static final String valign_bottom = "bottom"; |
|
119 |
public static final String valign_baseline = "baseline"; |
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
public interface HTMLElement { |
|
124 |
public boolean allowContents(); |
|
125 |
|
|
126 |
public boolean allowAttributes(); |
|
127 |
|
|
128 |
public String toHTML(); |
|
129 |
} |
|
130 |
|
|
131 |
public interface HTMLElementWithAttributes extends HTMLElement { |
|
132 |
public Map<String,String> getAttributes(); |
|
133 |
|
|
134 |
public Map<String,String> getStyle(); |
|
135 |
|
|
136 |
public HTMLElementWithAttributes set(String name, String value); |
|
137 |
|
|
138 |
public HTMLElementWithAttributes set(String name, int value); |
|
139 |
|
|
140 |
public HTMLElementWithAttributes set(String name, double value); |
|
141 |
|
|
142 |
public HTMLElementWithAttributes set(String name, HTMLColor color); |
|
143 |
|
|
144 |
public HTMLElementWithAttributes set(String name); |
|
145 |
|
|
146 |
public HTMLElementWithAttributes style(String name, String value); |
|
147 |
|
|
148 |
public HTMLElementWithAttributes style(String name, int value); |
|
149 |
|
|
150 |
public HTMLElementWithAttributes style(String name, double value); |
|
151 |
|
|
152 |
public HTMLElementWithAttributes style(String name, HTMLColor color); |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
public interface HTMLElementWithContents extends HTMLElement { |
|
157 |
|
|
158 |
public HTMLElementWithContents contents(Object... values); |
|
159 |
|
|
160 |
public List<HTMLElement> getContents(); |
|
161 |
} |
|
162 |
|
|
163 |
public interface HTMLComplexElement |
|
164 |
extends HTMLElementWithContents, HTMLElementWithAttributes |
|
165 |
{ |
|
166 |
@Override |
|
167 |
public HTMLComplexElement contents(Object... values); |
|
168 |
|
|
169 |
@Override |
|
170 |
public HTMLComplexElement set(String name, String value); |
|
171 |
|
|
172 |
@Override |
|
173 |
public HTMLComplexElement set(String name, int value); |
|
174 |
|
|
175 |
@Override |
|
176 |
public HTMLComplexElement set(String name, double value); |
|
177 |
|
|
178 |
@Override |
|
179 |
public HTMLComplexElement set(String name, HTMLColor color); |
|
180 |
|
|
181 |
@Override |
|
182 |
public HTMLComplexElement set(String name); |
|
183 |
|
|
184 |
@Override |
|
185 |
public HTMLComplexElement style(String name, String value); |
|
186 |
|
|
187 |
@Override |
|
188 |
public HTMLComplexElement style(String name, int value); |
|
189 |
|
|
190 |
@Override |
|
191 |
public HTMLComplexElement style(String name, double value); |
|
192 |
|
|
193 |
@Override |
|
194 |
public HTMLComplexElement style(String name, HTMLColor color); |
|
195 |
|
|
196 |
} |
|
197 |
|
|
198 |
public interface HTMLColor extends HTMLElement { |
|
199 |
|
|
200 |
} |
|
201 |
|
|
202 |
HTMLColor color(Color color); |
|
203 |
|
|
204 |
HTMLColor color(String color); |
|
205 |
|
|
206 |
HTMLColor color(int r, int g, int b); |
|
207 |
|
|
208 |
HTMLElement contents(HTMLElement... values); |
|
209 |
|
|
210 |
HTMLElement custom(String value); |
|
211 |
|
|
212 |
HTMLElement plain(String value); |
|
213 |
|
|
214 |
HTMLElement plainWithNl(String value); |
|
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
219 |
HTMLComplexElement a(Object... contents); |
|
220 |
|
|
221 |
HTMLComplexElement a(String link, Object... contents); |
|
222 |
|
|
223 |
HTMLComplexElement abbr(Object... contents); |
|
224 |
|
|
225 |
HTMLComplexElement acronym(Object... contents); |
|
226 |
|
|
227 |
HTMLComplexElement address(Object... contents); |
|
228 |
|
|
229 |
HTMLComplexElement area(Object... contents); |
|
230 |
|
|
231 |
HTMLComplexElement article(Object... contents); |
|
232 |
|
|
233 |
HTMLComplexElement aside(Object... contents); |
|
234 |
|
|
235 |
HTMLComplexElement b(Object... contents); |
|
236 |
|
|
237 |
HTMLElementWithAttributes base(); |
|
238 |
|
|
239 |
HTMLElementWithAttributes basefont(); |
|
240 |
|
|
241 |
HTMLComplexElement bdi(Object... contents); |
|
242 |
|
|
243 |
HTMLComplexElement bdo(Object... contents); |
|
244 |
|
|
245 |
HTMLElementWithContents big(Object... contents); |
|
246 |
|
|
247 |
HTMLComplexElement blockquote(Object... contents); |
|
248 |
|
|
249 |
HTMLComplexElement body(Object... contents); |
|
250 |
|
|
251 |
HTMLElement br(); |
|
252 |
|
|
253 |
HTMLComplexElement button(Object... contents); |
|
254 |
|
|
255 |
HTMLComplexElement canvas(Object... contents); |
|
256 |
|
|
257 |
HTMLComplexElement caption(Object... contents); |
|
258 |
|
|
259 |
HTMLElementWithContents center(Object... contents); |
|
260 |
|
|
261 |
HTMLComplexElement cite(Object... contents); |
|
262 |
|
|
263 |
HTMLComplexElement code(Object... contents); |
|
264 |
|
|
265 |
HTMLElementWithAttributes col(); |
|
266 |
|
|
267 |
HTMLComplexElement colgroup(Object... contents); |
|
268 |
|
|
269 |
HTMLComplexElement data(Object... contents); |
|
270 |
|
|
271 |
HTMLComplexElement datalist(Object... contents); |
|
272 |
|
|
273 |
HTMLComplexElement dd(Object... contents); |
|
274 |
|
|
275 |
HTMLComplexElement del(Object... contents); |
|
276 |
|
|
277 |
HTMLComplexElement details(Object... contents); |
|
278 |
|
|
279 |
HTMLComplexElement dfn(Object... contents); |
|
280 |
|
|
281 |
HTMLComplexElement dialog(Object... contents); |
|
282 |
|
|
283 |
HTMLElementWithContents dir(Object... contents); |
|
284 |
|
|
285 |
HTMLComplexElement div(Object... contents); |
|
286 |
|
|
287 |
HTMLComplexElement dl(Object... contents); |
|
288 |
|
|
289 |
HTMLComplexElement dt(Object... contents); |
|
290 |
|
|
291 |
HTMLComplexElement em(Object... contents); |
|
292 |
|
|
293 |
HTMLElementWithAttributes embed(); |
|
294 |
|
|
295 |
HTMLComplexElement fieldset(Object... contents); |
|
296 |
|
|
297 |
HTMLComplexElement figcaption(Object... contents); |
|
298 |
|
|
299 |
HTMLComplexElement figure(Object... contents); |
|
300 |
|
|
301 |
HTMLComplexElement font(Object... contents); |
|
302 |
|
|
303 |
HTMLComplexElement font(int size, HTMLColor color); |
|
304 |
|
|
305 |
HTMLComplexElement font(int size, HTMLColor color, String face, Object... contents); |
|
306 |
|
|
307 |
HTMLComplexElement footer(Object... contents); |
|
308 |
|
|
309 |
HTMLComplexElement form(Object... contents); |
|
310 |
|
|
311 |
HTMLComplexElement frame(Object... contents); |
|
312 |
|
|
313 |
HTMLComplexElement frameset(Object... contents); |
|
314 |
|
|
315 |
HTMLComplexElement h1(Object... contents); |
|
316 |
|
|
317 |
HTMLComplexElement h2(Object... contents); |
|
318 |
|
|
319 |
HTMLComplexElement h3(Object... contents); |
|
320 |
|
|
321 |
HTMLComplexElement h4(Object... contents); |
|
322 |
|
|
323 |
HTMLComplexElement h5(Object... contents); |
|
324 |
|
|
325 |
HTMLComplexElement h6(Object... contents); |
|
326 |
|
|
327 |
HTMLComplexElement head(Object... contents); |
|
328 |
|
|
329 |
HTMLComplexElement header(Object... contents); |
|
330 |
|
|
331 |
HTMLComplexElement hr(Object... contents); |
|
332 |
|
|
333 |
HTMLComplexElement html(Object... contents); |
|
334 |
|
|
335 |
HTMLComplexElement i(Object... contents); |
|
336 |
|
|
337 |
HTMLComplexElement iframe(Object... contents); |
|
338 |
|
|
339 |
HTMLElementWithAttributes img(); |
|
340 |
|
|
341 |
HTMLElementWithAttributes input(Object... contents); |
|
342 |
|
|
343 |
HTMLComplexElement ins(Object... contents); |
|
344 |
|
|
345 |
HTMLComplexElement kbd(Object... contents); |
|
346 |
|
|
347 |
HTMLComplexElement label(Object... contents); |
|
348 |
|
|
349 |
HTMLComplexElement legend(Object... contents); |
|
350 |
|
|
351 |
HTMLComplexElement li(Object... contents); |
|
352 |
|
|
353 |
HTMLElementWithAttributes link(); |
|
354 |
|
|
355 |
HTMLElementWithAttributes link(String rel, String type, String href); |
|
356 |
|
|
357 |
HTMLComplexElement main(Object... contents); |
|
358 |
|
|
359 |
HTMLComplexElement map(Object... contents); |
|
360 |
|
|
361 |
HTMLComplexElement mark(Object... contents); |
|
362 |
|
|
363 |
HTMLElementWithAttributes meta(); |
|
364 |
|
|
365 |
HTMLElementWithAttributes meta(String charset); |
|
366 |
|
|
367 |
HTMLElementWithAttributes meta(String name, String content); |
|
368 |
|
|
369 |
HTMLComplexElement meter(Object... contents); |
|
370 |
|
|
371 |
HTMLComplexElement nav(Object... contents); |
|
372 |
|
|
373 |
HTMLElementWithContents noframes(Object... contents); |
|
374 |
|
|
375 |
HTMLElementWithContents noscript(Object... contents); |
|
376 |
|
|
377 |
HTMLComplexElement object(Object... contents); |
|
378 |
|
|
379 |
HTMLComplexElement ol(Object... contents); |
|
380 |
|
|
381 |
HTMLComplexElement optgroup(Object... contents); |
|
382 |
|
|
383 |
HTMLComplexElement option(Object... contents); |
|
384 |
|
|
385 |
HTMLComplexElement output(Object... contents); |
|
386 |
|
|
387 |
HTMLComplexElement p(Object... contents); |
|
388 |
|
|
389 |
HTMLElementWithAttributes param(); |
|
390 |
|
|
391 |
HTMLComplexElement pre(Object... contents); |
|
392 |
|
|
393 |
HTMLComplexElement progress(Object... contents); |
|
394 |
|
|
395 |
HTMLComplexElement q(Object... contents); |
|
396 |
|
|
397 |
HTMLComplexElement rp(Object... contents); |
|
398 |
|
|
399 |
HTMLComplexElement rt(Object... contents); |
|
400 |
|
|
401 |
HTMLComplexElement ruby(Object... contents); |
|
402 |
|
|
403 |
HTMLComplexElement s(Object... contents); |
|
404 |
|
|
405 |
HTMLComplexElement samp(Object... contents); |
|
406 |
|
|
407 |
HTMLComplexElement script(Object... contents); |
|
408 |
|
|
409 |
HTMLComplexElement section(Object... contents); |
|
410 |
|
|
411 |
HTMLComplexElement select(Object... contents); |
|
412 |
|
|
413 |
HTMLComplexElement small(Object... contents); |
|
414 |
|
|
415 |
HTMLComplexElement source(Object... contents); |
|
416 |
|
|
417 |
HTMLComplexElement span(Object... contents); |
|
418 |
|
|
419 |
HTMLElementWithContents strike(Object... contents); |
|
420 |
|
|
421 |
HTMLComplexElement strong(Object... contents); |
|
422 |
|
|
423 |
HTMLComplexElement style(Object... contents); |
|
424 |
|
|
425 |
HTMLComplexElement sub(Object... contents); |
|
426 |
|
|
427 |
HTMLComplexElement summary(Object... contents); |
|
428 |
|
|
429 |
HTMLComplexElement sup(Object... contents); |
|
430 |
|
|
431 |
HTMLComplexElement svg(Object... contents); |
|
432 |
|
|
433 |
HTMLComplexElement table(Object... contents); |
|
434 |
|
|
435 |
HTMLComplexElement table(int border, int cellpadding, int cellspacing); |
|
436 |
|
|
437 |
HTMLComplexElement table(int border, int cellpadding, int cellspacing, int widthpercent); |
|
438 |
|
|
439 |
HTMLComplexElement tbody(Object... contents); |
|
440 |
|
|
441 |
HTMLComplexElement td(Object... contents); |
|
442 |
|
|
443 |
HTMLComplexElement td(boolean wrap, int colspan); |
|
444 |
|
|
445 |
HTMLComplexElement td(boolean wrap, int colspan, String valign); |
|
446 |
|
|
447 |
HTMLComplexElement template(Object... contents); |
|
448 |
|
|
449 |
HTMLComplexElement textarea(Object... contents); |
|
450 |
|
|
451 |
HTMLComplexElement textarea(int rows, int cols); |
|
452 |
|
|
453 |
HTMLComplexElement textarea(int rows, int cols, int maxlength); |
|
454 |
|
|
455 |
HTMLComplexElement tfoot(Object... contents); |
|
456 |
|
|
457 |
HTMLComplexElement th(Object... contents); |
|
458 |
|
|
459 |
HTMLComplexElement thead(Object... contents); |
|
460 |
|
|
461 |
HTMLComplexElement time(Object... contents); |
|
462 |
|
|
463 |
HTMLComplexElement time(Date datetime); |
|
464 |
|
|
465 |
HTMLComplexElement time(String datetime); |
|
466 |
|
|
467 |
HTMLComplexElement title(Object... contents); |
|
468 |
|
|
469 |
HTMLComplexElement tr(Object... contents); |
|
470 |
|
|
471 |
HTMLComplexElement tr(HTMLColor color); |
|
472 |
|
|
473 |
HTMLComplexElement tr(String valign); |
|
474 |
|
|
475 |
HTMLComplexElement tr(String valign, HTMLColor color); |
|
476 |
|
|
477 |
HTMLComplexElement track(Object... contents); |
|
478 |
|
|
479 |
HTMLElementWithContents tt(Object... contents); |
|
480 |
|
|
481 |
HTMLComplexElement u(Object... contents); |
|
482 |
|
|
483 |
HTMLComplexElement ul(Object... contents); |
|
484 |
|
|
485 |
HTMLComplexElement var(Object... contents); |
|
486 |
|
|
487 |
HTMLComplexElement video(Object... contents); |
|
488 |
|
|
489 |
HTMLComplexElement wbr(Object... contents); |
|
490 |
|
|
491 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/texteditor/JTextEditor.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.texteditor; |
|
25 |
|
|
26 |
import java.awt.event.ActionListener; |
|
27 |
import javax.swing.text.JTextComponent; |
|
28 |
import org.gvsig.tools.swing.api.ChangeListenerSupport; |
|
29 |
import org.gvsig.tools.swing.api.Component; |
|
30 |
|
|
31 |
/** |
|
32 |
* @author gvSIG Team |
|
33 |
* |
|
34 |
*/ |
|
35 |
public interface JTextEditor extends Component, ChangeListenerSupport { |
|
36 |
|
|
37 |
public interface UpdateCaretPositionActionEvent { |
|
38 |
|
|
39 |
public int getLine(); |
|
40 |
|
|
41 |
public int getColumn(); |
|
42 |
|
|
43 |
public boolean hasLineAndColumn(); |
|
44 |
} |
|
45 |
|
|
46 |
public void setMimetype(String mimeType); |
|
47 |
|
|
48 |
public String getMimetype(); |
|
49 |
|
|
50 |
public void setText(String text); |
|
51 |
|
|
52 |
public String getText(); |
|
53 |
|
|
54 |
public JTextComponent getJTextComponent(); |
|
55 |
|
|
56 |
public void selectLine(int line); |
|
57 |
|
|
58 |
public void gotoline(int line); |
|
59 |
|
|
60 |
public int getLineCount(); |
|
61 |
|
|
62 |
public void clean(); |
|
63 |
|
|
64 |
public void addUpdateCaretPositionActionListener(ActionListener actionlistener); |
|
65 |
|
|
66 |
public boolean isModified(); |
|
67 |
|
|
68 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/texteditor/TextEditorManager.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.texteditor; |
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* @author gvSIG Team |
|
31 |
* |
|
32 |
*/ |
|
33 |
|
|
34 |
public interface TextEditorManager { |
|
35 |
|
|
36 |
public JTextEditor createTextEditor(); |
|
37 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/svgsupport/SVGRenderer.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or modify it under |
|
7 |
* the terms of the GNU General Public License as published by the Free Software |
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later |
|
9 |
* version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
14 |
* details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License along with |
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us at info AT |
|
21 |
* gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.svgsupport; |
|
24 |
|
|
25 |
import java.awt.Graphics2D; |
|
26 |
import java.awt.geom.Rectangle2D; |
|
27 |
import java.io.File; |
|
28 |
import java.io.IOException; |
|
29 |
import java.net.URL; |
|
30 |
|
|
31 |
public interface SVGRenderer { |
|
32 |
|
|
33 |
public Rectangle2D getBounds(); |
|
34 |
|
|
35 |
public void drawInsideRectangle( |
|
36 |
Graphics2D g, |
|
37 |
Rectangle2D rect, |
|
38 |
boolean keepAspectRatio |
|
39 |
); |
|
40 |
|
|
41 |
public void setSource(URL url) throws IOException; |
|
42 |
public void setSource(File f) throws IOException; |
|
43 |
|
|
44 |
|
|
45 |
public URL getSource(); |
|
46 |
|
|
47 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/svgsupport/SVGSupportManager.java | ||
---|---|---|
1 |
package org.gvsig.svgsupport; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.IOException; |
|
5 |
import java.net.URL; |
|
6 |
|
|
7 |
public interface SVGSupportManager { |
|
8 |
|
|
9 |
public SVGRenderer createRenderer(); |
|
10 |
public SVGRenderer createRenderer(URL source) throws IOException ; |
|
11 |
public SVGRenderer createRenderer(File source) throws IOException ; |
|
12 |
|
|
13 |
|
|
14 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/ToolsUtilLocator.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
/** |
|
4 |
* gvSIG. Desktop Geographic Information System. |
|
5 |
* |
|
6 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or modify it under |
|
9 |
* the terms of the GNU General Public License as published by the Free Software |
|
10 |
* Foundation; either version 3 of the License, or (at your option) any later |
|
11 |
* version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
14 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
15 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
16 |
* details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License along with |
|
19 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
20 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
21 |
* |
|
22 |
* For any additional information, do not hesitate to contact us at info AT |
|
23 |
* gvsig.com, or visit our website www.gvsig.com. |
|
24 |
*/ |
|
25 |
|
|
26 |
import org.gvsig.configurableactions.ConfigurableActionsMamager; |
|
27 |
import org.gvsig.euclidean.EuclideanManager; |
|
28 |
import org.gvsig.filedialogchooser.FileDialogChooserManager; |
|
29 |
import org.gvsig.imageviewer.ImageViewerManager; |
|
30 |
import org.gvsig.propertypage.PropertiesPageManager; |
|
31 |
import org.gvsig.svgsupport.SVGSupportManager; |
|
32 |
import org.gvsig.texteditor.TextEditorManager; |
|
33 |
import org.gvsig.tools.locator.AbstractLocator; |
|
34 |
import org.gvsig.tools.locator.Locator; |
|
35 |
import org.gvsig.tools.locator.LocatorException; |
|
36 |
import org.gvsig.webbrowser2.WebBrowserManager; |
|
37 |
|
|
38 |
/** |
|
39 |
* @author gvSIG Team |
|
40 |
* |
|
41 |
*/ |
|
42 |
@SuppressWarnings("rawtypes") |
|
43 |
public class ToolsUtilLocator extends AbstractLocator { |
|
44 |
|
|
45 |
private static final String LOCATOR_NAME = "ToolsUtilLocator"; |
|
46 |
|
|
47 |
public static final String TOOLS_UTIL_MANAGER_NAME = "org.gvsig.tools.util.manager"; |
|
48 |
private static final String TOOLS_UTIL_MANAGER_DESCRIPTION = "Tools utilities."; |
|
49 |
|
|
50 |
public static final String PROPERTIES_PAGE_MANAGER_NAME = "org.gvsig.tools.properties.page.manager"; |
|
51 |
private static final String PROPERTIES_PAGE_MANAGER_DESCRIPTION = "Properties page manager"; |
|
52 |
|
|
53 |
public static final String FILE_DIALOG_CHOOSER_MANAGER_NAME = "org.gvsig.filedialogchooser.manager"; |
|
54 |
private static final String FILE_DIALOG_CHOOSER_MANAGER_DESCRIPTION = "File dialog chooser."; |
|
55 |
|
|
56 |
public static final String PLUGINS_SVGSUPPORT_MANAGER_NAME = "SVGSupportManager"; |
|
57 |
private static final String PLUGINS_SVGSUPPORT_MANAGER_DESCRIPTION = "SVGSupportManager"; |
|
58 |
|
|
59 |
public static final String PLUGINS_IMAGEVIEWER_MANAGER_NAME = "ImageViewerManager"; |
|
60 |
private static final String PLUGINS_IMAGEVIEWER_MANAGER_DESCRIPTION = "ImageViewerManager"; |
|
61 |
|
|
62 |
public static final String CONFIGURABLE_ACTIONS_MANAGER_NAME = "ConfigurableActionsMamager"; |
|
63 |
private static final String CONFIGURABLE_ACTIONS_MANAGER_DESCRIPTION = "ConfigurableActionsMamager"; |
|
64 |
|
|
65 |
public static final String TEXTEDITOR_MANAGER_NAME = "TextEditorMamager"; |
|
66 |
private static final String TEXTEDITOR_MANAGER_DESCRIPTION = "TextEditorMamager"; |
|
67 |
|
|
68 |
public static final String WEBBROWSER_MANAGER_NAME = "WebBrowserMamager"; |
|
69 |
private static final String WEBBROWSER_MANAGER_DESCRIPTION = "WebBrowserMamager"; |
|
70 |
|
|
71 |
public static final String EUCLIDEAN_MANAGER_NAME = "EuclideanManager"; |
|
72 |
private static final String EUCLIDEAN_MANAGER_DESCRIPTION = "EuclideanManager"; |
|
73 |
|
|
74 |
private static final ToolsUtilLocator INSTANCE = new ToolsUtilLocator(); |
|
75 |
|
|
76 |
private ToolsUtilLocator() { |
|
77 |
|
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Return the singleton instance. |
|
82 |
* |
|
83 |
* @return the singleton instance |
|
84 |
*/ |
|
85 |
public static ToolsUtilLocator getInstance() { |
|
86 |
return INSTANCE; |
|
87 |
} |
|
88 |
|
|
89 |
@Override |
|
90 |
public String getLocatorName() { |
|
91 |
return LOCATOR_NAME; |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* Return a reference to ToolsUtilManager. |
|
96 |
* |
|
97 |
* @return a reference to ToolsUtilManager |
|
98 |
* @throws LocatorException if there is no access to the class or the class |
|
99 |
* cannot be instantiated |
|
100 |
* @see Locator#get(String) |
|
101 |
*/ |
|
102 |
public static ToolsUtilManager getToolsUtilManager() |
|
103 |
throws LocatorException { |
|
104 |
return (ToolsUtilManager) getInstance().get(TOOLS_UTIL_MANAGER_NAME); |
|
105 |
} |
|
106 |
|
|
107 |
/** |
|
108 |
* Registers the Class implementing the ToolsUtilManager interface. |
|
109 |
* |
|
110 |
* @param clazz implementing the ToolsUtilManager interface |
|
111 |
*/ |
|
112 |
public static void registerToolsUtilManager(Class clazz) { |
|
113 |
getInstance().register(TOOLS_UTIL_MANAGER_NAME, |
|
114 |
TOOLS_UTIL_MANAGER_DESCRIPTION, clazz); |
|
115 |
} |
|
116 |
|
|
117 |
public static void registerDefaultToolsUtilManager(Class clazz) { |
|
118 |
getInstance().registerDefault(TOOLS_UTIL_MANAGER_NAME, |
|
119 |
TOOLS_UTIL_MANAGER_DESCRIPTION, clazz); |
|
120 |
} |
|
121 |
|
|
122 |
public static FileDialogChooserManager getFileDialogChooserManager() |
|
123 |
throws LocatorException { |
|
124 |
return (FileDialogChooserManager) getInstance().get(FILE_DIALOG_CHOOSER_MANAGER_NAME); |
|
125 |
} |
|
126 |
|
|
127 |
public static void registerFileDialogChooserManager(Class clazz) { |
|
128 |
getInstance().register(FILE_DIALOG_CHOOSER_MANAGER_NAME, |
|
129 |
FILE_DIALOG_CHOOSER_MANAGER_DESCRIPTION, clazz); |
|
130 |
} |
|
131 |
|
|
132 |
public static void registerDefaultFileDialogChooserManager(Class clazz) { |
|
133 |
getInstance().registerDefault(FILE_DIALOG_CHOOSER_MANAGER_NAME, |
|
134 |
FILE_DIALOG_CHOOSER_MANAGER_DESCRIPTION, clazz); |
|
135 |
} |
|
136 |
|
|
137 |
//SVG support |
|
138 |
public static SVGSupportManager getSVGSupportManager() throws LocatorException { |
|
139 |
return (SVGSupportManager) getInstance().get(PLUGINS_SVGSUPPORT_MANAGER_NAME); |
|
140 |
} |
|
141 |
|
|
142 |
public static void registerSVGSupportManager(Class clazz) { |
|
143 |
getInstance().register(PLUGINS_SVGSUPPORT_MANAGER_NAME, PLUGINS_SVGSUPPORT_MANAGER_DESCRIPTION, |
|
144 |
clazz); |
|
145 |
} |
|
146 |
|
|
147 |
public static void registerDefaultSVGSupportManager(Class clazz) { |
|
148 |
getInstance().registerDefault(PLUGINS_SVGSUPPORT_MANAGER_NAME, |
|
149 |
PLUGINS_SVGSUPPORT_MANAGER_DESCRIPTION, clazz); |
|
150 |
} |
|
151 |
|
|
152 |
public static ImageViewerManager getImageViewerManager() throws LocatorException { |
|
153 |
return (ImageViewerManager) getInstance().get(PLUGINS_IMAGEVIEWER_MANAGER_NAME); |
|
154 |
} |
|
155 |
|
|
156 |
public static void registerImageViewertManager(Class clazz) { |
|
157 |
getInstance().register(PLUGINS_IMAGEVIEWER_MANAGER_NAME, PLUGINS_IMAGEVIEWER_MANAGER_DESCRIPTION, |
|
158 |
clazz); |
|
159 |
} |
|
160 |
|
|
161 |
public static void registerDefaultImageViewerManager(Class clazz) { |
|
162 |
getInstance().registerDefault(PLUGINS_IMAGEVIEWER_MANAGER_NAME, |
|
163 |
PLUGINS_IMAGEVIEWER_MANAGER_DESCRIPTION, clazz); |
|
164 |
} |
|
165 |
|
|
166 |
|
|
167 |
public static ConfigurableActionsMamager getConfigurableActionsMamager() throws LocatorException { |
|
168 |
return (ConfigurableActionsMamager) getInstance().get(CONFIGURABLE_ACTIONS_MANAGER_NAME); |
|
169 |
} |
|
170 |
|
|
171 |
public static void registerConfigurableActionsMamager(Class clazz) { |
|
172 |
getInstance().register(CONFIGURABLE_ACTIONS_MANAGER_NAME, CONFIGURABLE_ACTIONS_MANAGER_DESCRIPTION, |
|
173 |
clazz); |
|
174 |
} |
|
175 |
|
|
176 |
public static void registerDefaultConfigurableActionsMamager(Class clazz) { |
|
177 |
getInstance().registerDefault(CONFIGURABLE_ACTIONS_MANAGER_NAME, |
|
178 |
CONFIGURABLE_ACTIONS_MANAGER_DESCRIPTION, clazz); |
|
179 |
} |
|
180 |
|
|
181 |
|
|
182 |
public static PropertiesPageManager getPropertiesPageManager() throws LocatorException { |
|
183 |
return (PropertiesPageManager) getInstance().get(PROPERTIES_PAGE_MANAGER_NAME); |
|
184 |
} |
|
185 |
|
|
186 |
public static void registerPropertiesPageManager(Class clazz) { |
|
187 |
getInstance().register(PROPERTIES_PAGE_MANAGER_NAME, |
|
188 |
PROPERTIES_PAGE_MANAGER_DESCRIPTION, |
|
189 |
clazz); |
|
190 |
} |
|
191 |
|
|
192 |
public static void registerDefaultPropertiesPageManager(Class clazz) { |
|
193 |
getInstance().registerDefault( |
|
194 |
PROPERTIES_PAGE_MANAGER_NAME, |
|
195 |
PROPERTIES_PAGE_MANAGER_DESCRIPTION, clazz); |
|
196 |
} |
|
197 |
|
|
198 |
public static TextEditorManager getTextEditorManager() throws LocatorException { |
|
199 |
return (TextEditorManager) getInstance().get(TEXTEDITOR_MANAGER_NAME); |
|
200 |
} |
|
201 |
|
|
202 |
public static void registerTextEditorManager(Class clazz) { |
|
203 |
getInstance().register(TEXTEDITOR_MANAGER_NAME, |
|
204 |
TEXTEDITOR_MANAGER_DESCRIPTION, |
|
205 |
clazz); |
|
206 |
} |
|
207 |
|
|
208 |
public static void registerDefaultTextEditorManager(Class clazz) { |
|
209 |
getInstance().registerDefault( |
|
210 |
TEXTEDITOR_MANAGER_NAME, |
|
211 |
TEXTEDITOR_MANAGER_DESCRIPTION, clazz); |
|
212 |
} |
|
213 |
|
|
214 |
|
|
215 |
public static WebBrowserManager getWebBrowserManager() throws LocatorException { |
|
216 |
return (WebBrowserManager) getInstance().get(WEBBROWSER_MANAGER_NAME); |
|
217 |
} |
|
218 |
|
|
219 |
public static void registerWebBrowserManager(Class clazz) { |
|
220 |
getInstance().register(WEBBROWSER_MANAGER_NAME, |
|
221 |
WEBBROWSER_MANAGER_DESCRIPTION, |
|
222 |
clazz); |
|
223 |
} |
|
224 |
|
|
225 |
public static void registerDefaultWebBrowserManager(Class clazz) { |
|
226 |
getInstance().registerDefault( |
|
227 |
WEBBROWSER_MANAGER_NAME, |
|
228 |
WEBBROWSER_MANAGER_DESCRIPTION, clazz); |
|
229 |
} |
|
230 |
|
|
231 |
public static EuclideanManager getEuclideanManager() throws LocatorException { |
|
232 |
return (EuclideanManager) getInstance().get(EUCLIDEAN_MANAGER_NAME); |
|
233 |
} |
|
234 |
|
|
235 |
public static void registerEuclideanManager(Class clazz) { |
|
236 |
getInstance().register(EUCLIDEAN_MANAGER_NAME, |
|
237 |
EUCLIDEAN_MANAGER_DESCRIPTION, |
|
238 |
clazz); |
|
239 |
} |
|
240 |
|
|
241 |
public static void registerDefaultEuclideanManager(Class clazz) { |
|
242 |
getInstance().registerDefault( |
|
243 |
EUCLIDEAN_MANAGER_NAME, |
|
244 |
EUCLIDEAN_MANAGER_DESCRIPTION, clazz); |
|
245 |
} |
|
246 |
|
|
247 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/ToolsUtilLibrary.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
import org.gvsig.tools.ToolsLibrary; |
|
4 |
import org.gvsig.tools.library.AbstractLibrary; |
|
5 |
import org.gvsig.tools.library.LibraryException; |
|
6 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
7 |
|
|
8 |
/** |
|
9 |
* gvSIG. Desktop Geographic Information System. |
|
10 |
* |
|
11 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or |
|
14 |
* modify it under the terms of the GNU General Public License |
|
15 |
* as published by the Free Software Foundation; either version 3 |
|
16 |
* of the License, or (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
26 |
* MA 02110-1301, USA. |
|
27 |
* |
|
28 |
* For any additional information, do not hesitate to contact us |
|
29 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
30 |
*/ |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
@SuppressWarnings("unchecked") |
|
35 |
public class ToolsUtilLibrary extends AbstractLibrary { |
|
36 |
|
|
37 |
public void doRegistration() { |
|
38 |
super.doRegistration(); |
|
39 |
registerAsAPI(ToolsUtilLibrary.class); |
|
40 |
this.require(ToolsLibrary.class); |
|
41 |
} |
|
42 |
|
|
43 |
protected void doInitialize() throws LibraryException { |
|
44 |
|
|
45 |
} |
|
46 |
|
|
47 |
protected void doPostInitialize() throws LibraryException { |
|
48 |
// Validate there is any implementation registered. |
|
49 |
ToolsUtilManager manager = ToolsUtilLocator.getToolsUtilManager(); |
|
50 |
if (manager == null) { |
|
51 |
throw new ReferenceNotRegisteredException( |
|
52 |
ToolsUtilLocator.TOOLS_UTIL_MANAGER_NAME, ToolsUtilLocator |
|
53 |
.getInstance()); |
|
54 |
} |
|
55 |
|
|
56 |
} |
|
57 |
|
|
58 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/ToolsUtilManager.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
import org.gvsig.desktopopen.DesktopOpen; |
|
4 |
import org.gvsig.htmlbuilder.HTMLBuilder; |
|
5 |
|
|
6 |
/** |
|
7 |
* gvSIG. Desktop Geographic Information System. |
|
8 |
* |
|
9 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
10 |
* |
|
11 |
* This program is free software; you can redistribute it and/or modify it under |
|
12 |
* the terms of the GNU General Public License as published by the Free Software |
|
13 |
* Foundation; either version 3 of the License, or (at your option) any later |
|
14 |
* version. |
|
15 |
* |
|
16 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
17 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
18 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
19 |
* details. |
|
20 |
* |
|
21 |
* You should have received a copy of the GNU General Public License along with |
|
22 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
23 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
24 |
* |
|
25 |
* For any additional information, do not hesitate to contact us at info AT |
|
26 |
* gvsig.com, or visit our website www.gvsig.com. |
|
27 |
*/ |
|
28 |
/** |
|
29 |
* @author fdiaz |
|
30 |
* |
|
31 |
*/ |
|
32 |
public interface ToolsUtilManager { |
|
33 |
|
|
34 |
/** |
|
35 |
* @return |
|
36 |
*/ |
|
37 |
public InformationBuilder createInformationBuilder(); |
|
38 |
|
|
39 |
public DesktopOpen createDesktopOpen(); |
|
40 |
|
|
41 |
public HTMLBuilder createHTMLBuilder(); |
|
42 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.249/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/InformationBuilder.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
public interface InformationBuilder { |
|
4 |
|
|
5 |
public interface Element { |
|
6 |
|
|
7 |
public Element value(String format, Object... args); |
|
8 |
public String build(); |
|
9 |
} |
|
10 |
|
|
11 |
public interface TitleElement extends Element { |
|
12 |
|
|
13 |
@Override |
|
14 |
public TitleElement value(String format, Object... args); |
|
15 |
public TitleElement label(String label); |
|
16 |
public TitleElement labelkey(String labelkey); |
|
17 |
} |
|
18 |
|
|
19 |
public interface RawElement extends Element { |
|
20 |
|
|
21 |
@Override |
|
22 |
public RawElement value(String format, Object... args); |
|
23 |
} |
|
24 |
|
|
25 |
public interface TextElement extends RawElement { |
|
26 |
|
|
27 |
@Override |
|
28 |
public TextElement value(String format, Object... args); |
|
29 |
|
|
30 |
} |
|
31 |
|
|
32 |
public interface PropertyElement extends TextElement { |
|
33 |
|
|
34 |
public PropertyElement monospace(); |
|
35 |
|
|
36 |
public PropertyElement label(String label); |
|
37 |
|
|
38 |
public PropertyElement labelkey(String labelkey); |
|
39 |
|
|
40 |
@Override |
|
41 |
public PropertyElement value(String format, Object... args); |
|
42 |
|
|
43 |
} |
|
44 |
|
|
45 |
public InformationBuilder backgroundColor(String color); |
|
46 |
|
|
47 |
public InformationBuilder backgroundColorTitle(String color); |
|
48 |
|
Also available in: Unified diff