public FSUIPCKryonetInterface(String server, int port) { this.server = server; this.port = port; // ~ client = new Client(); client.start(); client.addListener(new Listener() { public void received (Connection connection, Object object) { if(object instanceof String) { String message = (String)object; if(message.startsWith("CHANGED")) { Collection<OffsetItem> offsetItems = toOffsetItems(message); for(OffsetItem offsetItem : offsetItems) { offsetEventListeners.fire().valueChanged(offsetItem); } offsetCollectionEventListeners.fire().valuesChanged(offsetItems); } } } }); // ~ offsetEventListeners = EventListenerSupport.create(OffsetEventListener.class); offsetCollectionEventListeners = EventListenerSupport.create(OffsetCollectionEventListener.class); }
/** * Constructs a new controller for the specified {@code DiagnosticTool} * instance. * * @param frame the {@code DiagnosticTool} instance using this controller */ public Controller(DiagnosticTool frame) { super(); this.frame = frame; listeners = EventListenerSupport.create(ControllerListener.class); accumulators = new HashMap<ResultKey, List<Accumulator>>(); }
/** * Constructs a new progress helper for generating progress reports for * the given executor. * * @param executor the executor that will be reporting progress */ public ProgressHelper(Executor executor) { super(); this.executor = executor; statistics = new DescriptiveStatistics(25); listeners = EventListenerSupport.create(ProgressListener.class); }
public NodeSelection(HierarchyModel<T, U> model) { this.root = model.getRootBranch(); nodes = new SortedNodeCollection<T, U>(root); type = SelectionType.FOLDERS; leafClass = model.leafClass; selectionEvents = new EventListenerSupport<>(NodeSelectionListener.class, NodeSelectionListener.class.getClassLoader()); }
public DTreeSelectionModel(HierarchyModel<T,U> model) { this.selection = model.getSelection(); propertyChanges = new PropertyChangeSupport(this); selectionEvents = new EventListenerSupport<>(TreeSelectionListener.class); leafClass = model.leafClass; selection.addSelectionListener(this); }
public DTreeModel(HierarchyModel<T, U> model) { this.model = model; this.root = model.getRootBranch(); treeListeners = new EventListenerSupport<>(TreeModelListener.class); model.addRepresentation(this); }
public LeafListSelectionModel(HierarchyModel<T,U> model, U folder) { this.selection = model.getSelection(); this.folder = folder; selectionEvents = new EventListenerSupport<>(ListSelectionListener.class); leafClass = model.leafClass; selection.addSelectionListener(this); anchor = -1; lead = -1; }
public MonitorOffsetThread(FSUIPCFlightSimInterface fsuipcFlightSimInterface) { this.fsuipcFlightSimInterface = fsuipcFlightSimInterface; this.monitorOffsetList = new ConcurrentHashMap<>(); this.offsetValues = new HashMap<>(); this.offsetEventListeners = EventListenerSupport.create(OffsetEventListener.class); this.offsetCollectionEventListeners = EventListenerSupport.create(OffsetCollectionEventListener.class); }
public DataListTableWrapper(DataList model) { this.model = Objects.requireNonNull(model); tableListeners = new EventListenerSupport<>(TableModelListener.class); }
public DataListCellEditor(JTable table) { cellListeners = EventListenerSupport.create(CellEditorListener.class); this.table = table; }
@PostConstruct void initializeListeners() { this.listenerList = EventListenerSupport.create(ISlangTestCaseEventListener.class); }
/** * Decorates the specified algorithm with adaptive time continuation. * * @param algorithm the algorithm being decorated * @param windowSize the number of iterations between invocations of * {@code check} * @param maxWindowSize the maximum number of iterations allowed since the * last restart before forcing a restart * @param populationRatio the population-to-archive ratio * @param minimumPopulationSize the minimum size of the population * @param maximumPopulationSize the maximum size of the population * @param selection the selection operator for selecting solutions from the * archive during a restart * @param variation the variation operator for mutating solutions selected * from the archive during a restart */ public AdaptiveTimeContinuation(EvolutionaryAlgorithm algorithm, int windowSize, int maxWindowSize, double populationRatio, int minimumPopulationSize, int maximumPopulationSize, Selection selection, Variation variation) { super(algorithm, windowSize, FrequencyType.STEPS); this.maxWindowSize = maxWindowSize; this.populationRatio = populationRatio; this.minimumPopulationSize = minimumPopulationSize; this.maximumPopulationSize = maximumPopulationSize; this.selection = selection; this.variation = variation; listeners = EventListenerSupport.create(RestartListener.class); }