1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.vectomatic.svg.edit.client.command;
19
20 import java.util.Arrays;
21
22 import org.vectomatic.svg.edit.client.command.add.AddCircleCommandFactory;
23 import org.vectomatic.svg.edit.client.command.add.AddEllipseCommandFactory;
24 import org.vectomatic.svg.edit.client.command.add.AddLineCommandFactory;
25 import org.vectomatic.svg.edit.client.command.add.AddPathCommandFactory;
26 import org.vectomatic.svg.edit.client.command.add.AddPolygonCommandFactory;
27 import org.vectomatic.svg.edit.client.command.add.AddPolylineCommandFactory;
28 import org.vectomatic.svg.edit.client.command.add.AddRectCommandFactory;
29
30 import com.extjs.gxt.ui.client.store.ListStore;
31
32
33
34
35
36 public class CommandFactories {
37 public static ListStore<IFactoryInstantiator<?>> getAllFactoriesStore() {
38 ListStore<IFactoryInstantiator<?>> store = new ListStore<IFactoryInstantiator<?>>();
39 store.add(Arrays.asList(new IFactoryInstantiator<?>[] {
40 AddCircleCommandFactory.INSTANTIATOR,
41 AddRectCommandFactory.INSTANTIATOR,
42 AddEllipseCommandFactory.INSTANTIATOR,
43 AddLineCommandFactory.INSTANTIATOR,
44 AddPolylineCommandFactory.INSTANTIATOR,
45 AddPolygonCommandFactory.INSTANTIATOR,
46 AddPathCommandFactory.INSTANTIATOR,
47 EditGeometryCommandFactory.INSTANTIATOR,
48 EditTransformCommandFactory.INSTANTIATOR,
49 RemoveElementsCommandFactory.INSTANTIATOR,
50 EditTitleCommandFactory.INSTANTIATOR,
51 ShowPropertiesCommandFactory.INSTANTIATOR,
52 }));
53 return store;
54 }
55
56 private static DndCommandFactory dndCommandFactory = null;
57 public static DndCommandFactory getDndCommandFactory() {
58 if (dndCommandFactory == null) {
59 dndCommandFactory = DndCommandFactory.INSTANTIATOR.create();
60 }
61 return dndCommandFactory;
62 }
63 }