public static ControlInterface[] getControlMultiCommand( App app, String name, List<Integer> repeat, List<Set<Integer>> keys, Integer row, Integer position) { Control c = new Control(name.toLowerCase()); int i = 0; for (Set<Integer> k : keys) { KeysEvent keysEvent = new KeysEvent(k, repeat.get(i++)); c.addKeysEvent(keysEvent); } c.validate(); VisualControl vc = new VisualControl(c, row, position); vc.validate(); if (app != null) { app.getControlsManager().addControl(c); app.getVisualControlsManager().addControl(vc); } return new ControlInterface[] {c, vc}; }
public void addControl() { Control c = new Control("name"); c.addKeysEvent(new KeysEvent(65)); data.add(c); fireTableRowsInserted(data.size() - 1, data.size() - 1); }