private void updateGui() { vbEvents.getChildren().clear(); List<StockEvent> events = StockEventManager.instance().getStockEventsForSecurity(security.getTicker()); for (StockEvent event : events) { if (event.getSecurityType() == StockEvent.SecurityType.Stock) { new SecurityEvent(event, vbEvents); } else { new OptionEvent(event, vbEvents); } } }
public void setSecurity(Security security) { this.security = security; tpMainPane.setText(formatSecurityTitle()); security .getQuantityProperty() .addListener( (arg01, arg11, newValue) -> { Platform.runLater(() -> {}); }); security .getCostBasisProperty() .addListener( (arg01, arg11, newValue) -> { Platform.runLater(() -> {}); }); security .getCurrentPriceProperty() .addListener( (arg01, arg11, newValue) -> { Platform.runLater(() -> {}); }); security .getNameProperty() .addListener( (arg01, arg11, newValue) -> { Platform.runLater(() -> tpMainPane.setText(formatSecurityTitle())); }); security .getValueProperty() .addListener( (arg01, arg11, newValue) -> { Platform.runLater(() -> tpMainPane.setText(formatSecurityTitle())); }); StockEventManager.instance() .getStockEvents() .addListener( (ListChangeListener<StockEvent>) c -> { updateGui(); }); updateGui(); }