use of bisq.core.arbitration.DisputeResult in project bisq-desktop by bisq-network.
the class DisputeSummaryWindow method addContent.
private void addContent() {
Contract contract = dispute.getContract();
if (dispute.getDisputeResultProperty().get() == null)
disputeResult = new DisputeResult(dispute.getTradeId(), dispute.getTraderId());
else
disputeResult = dispute.getDisputeResultProperty().get();
peersDisputeOptional = disputeManager.getDisputesAsObservableList().stream().filter(d -> dispute.getTradeId().equals(d.getTradeId()) && dispute.getTraderId() != d.getTraderId()).findFirst();
addInfoPane();
if (!dispute.isSupportTicket())
addCheckboxes();
addTradeAmountPayoutControls();
addPayoutAmountTextFields();
addReasonControls();
boolean applyPeersDisputeResult = peersDisputeOptional.isPresent() && peersDisputeOptional.get().isClosed();
if (applyPeersDisputeResult) {
// If the other peers dispute has been closed we apply the result to ourselves
DisputeResult peersDisputeResult = peersDisputeOptional.get().getDisputeResultProperty().get();
disputeResult.setBuyerPayoutAmount(peersDisputeResult.getBuyerPayoutAmount());
disputeResult.setSellerPayoutAmount(peersDisputeResult.getSellerPayoutAmount());
disputeResult.setWinner(peersDisputeResult.getWinner());
disputeResult.setLoserPublisher(peersDisputeResult.isLoserPublisher());
disputeResult.setReason(peersDisputeResult.getReason());
disputeResult.setSummaryNotes(peersDisputeResult.summaryNotesProperty().get());
/* if (disputeResult.getBuyerPayoutAmount() != null) {
log.debug("buyerPayoutAmount " + disputeResult.getBuyerPayoutAmount().toFriendlyString());
log.debug("sellerPayoutAmount " + disputeResult.getSellerPayoutAmount().toFriendlyString());
}*/
buyerGetsTradeAmountRadioButton.setDisable(true);
buyerGetsAllRadioButton.setDisable(true);
sellerGetsTradeAmountRadioButton.setDisable(true);
sellerGetsAllRadioButton.setDisable(true);
customRadioButton.setDisable(true);
buyerPayoutAmountInputTextField.setDisable(true);
sellerPayoutAmountInputTextField.setDisable(true);
buyerPayoutAmountInputTextField.setEditable(false);
sellerPayoutAmountInputTextField.setEditable(false);
reasonWasBugRadioButton.setDisable(true);
reasonWasUsabilityIssueRadioButton.setDisable(true);
reasonProtocolViolationRadioButton.setDisable(true);
reasonNoReplyRadioButton.setDisable(true);
reasonWasScamRadioButton.setDisable(true);
reasonWasOtherRadioButton.setDisable(true);
reasonWasBankRadioButton.setDisable(true);
isLoserPublisherCheckBox.setDisable(true);
isLoserPublisherCheckBox.setSelected(peersDisputeResult.isLoserPublisher());
applyPayoutAmounts(tradeAmountToggleGroup.selectedToggleProperty().get());
applyTradeAmountRadioButtonStates();
} else {
isLoserPublisherCheckBox.setSelected(false);
}
setReasonRadioButtonState();
addSummaryNotes();
addButtons(contract);
}
Aggregations