Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
- VoteResult to Vote
- LongVoteResult to LongVote
- BooleanVoteResult to BooleanVote
  • Loading branch information
ManfredKarrer committed Apr 8, 2018
1 parent 585478f commit d06b067
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import bisq.core.dao.vote.PeriodService;
import bisq.core.dao.vote.proposal.Proposal;
import bisq.core.dao.vote.proposal.ProposalService;
import bisq.core.dao.vote.voteresult.BooleanVoteResult;
import bisq.core.dao.vote.voteresult.VoteResult;
import bisq.core.dao.vote.voteresult.BooleanVote;
import bisq.core.dao.vote.voteresult.Vote;
import bisq.core.locale.Res;

import org.bitcoinj.core.Transaction;
Expand Down Expand Up @@ -63,7 +63,7 @@ public class ProposalListItem implements BsqBlockChain.Listener {
private final ReadableBsqBlockChain readableBsqBlockChain;
private final BsqFormatter bsqFormatter;
private final ChangeListener<Number> chainHeightListener;
private final ChangeListener<VoteResult> voteResultChangeListener;
private final ChangeListener<Vote> voteResultChangeListener;
@Getter
private TxConfidenceIndicator txConfidenceIndicator;
@Getter
Expand Down Expand Up @@ -111,7 +111,7 @@ public class ProposalListItem implements BsqBlockChain.Listener {
readableBsqBlockChain.addListener(this);

phaseChangeListener = (observable, oldValue, newValue) -> {
applyState(newValue, proposal.getVoteResult());
applyState(newValue, proposal.getVote());
};

voteResultChangeListener = (observable, oldValue, newValue) -> {
Expand All @@ -122,7 +122,7 @@ public class ProposalListItem implements BsqBlockChain.Listener {
proposal.getVoteResultProperty().addListener(voteResultChangeListener);
}

public void applyState(PeriodService.Phase newValue, VoteResult voteResult) {
public void applyState(PeriodService.Phase newValue, Vote vote) {
actionButton.setText("");
actionButton.setVisible(false);
actionButton.setOnAction(null);
Expand Down Expand Up @@ -151,10 +151,10 @@ public void applyState(PeriodService.Phase newValue, VoteResult voteResult) {
if (!isTxInPastCycle) {
actionNode = actionButtonIconView;
actionButton.setVisible(false);
if (proposal.getVoteResult() != null) {
if (proposal.getVote() != null) {
actionButtonIconView.setVisible(true);
if (voteResult instanceof BooleanVoteResult) {
if (((BooleanVoteResult) voteResult).isAccepted()) {
if (vote instanceof BooleanVote) {
if (((BooleanVote) vote).isAccepted()) {
actionButtonIconView.setId("accepted");
} else {
actionButtonIconView.setId("rejected");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import bisq.core.dao.vote.blindvote.BlindVoteService;
import bisq.core.dao.vote.proposal.Proposal;
import bisq.core.dao.vote.proposal.ProposalService;
import bisq.core.dao.vote.voteresult.BooleanVoteResult;
import bisq.core.dao.vote.voteresult.BooleanVote;
import bisq.core.locale.Res;

import bisq.common.util.Tuple2;
Expand Down Expand Up @@ -235,17 +235,17 @@ protected void onSelectProposal(ProposalListItem item) {
}

private void onAccept() {
selectedProposalListItem.getProposal().setVoteResult(new BooleanVoteResult(true));
selectedProposalListItem.getProposal().setVote(new BooleanVote(true));
updateStateAfterVote();
}

private void onReject() {
selectedProposalListItem.getProposal().setVoteResult(new BooleanVoteResult(false));
selectedProposalListItem.getProposal().setVote(new BooleanVote(false));
updateStateAfterVote();
}

private void onCancelVote() {
selectedProposalListItem.getProposal().setVoteResult(null);
selectedProposalListItem.getProposal().setVote(null);
updateStateAfterVote();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import bisq.core.dao.vote.myvote.MyVoteService;
import bisq.core.dao.vote.proposal.ProposalList;
import bisq.core.dao.vote.proposal.ProposalService;
import bisq.core.dao.vote.voteresult.BooleanVoteResult;
import bisq.core.dao.vote.voteresult.VoteResult;
import bisq.core.dao.vote.voteresult.BooleanVote;
import bisq.core.dao.vote.voteresult.Vote;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;

Expand Down Expand Up @@ -375,9 +375,9 @@ public void updateItem(final ProposalListItem item, boolean empty) {

if (item != null && !empty) {
actionButtonIconView = new ImageView();
VoteResult voteResult = item.getProposal().getVoteResult();
if (voteResult instanceof BooleanVoteResult) {
if (((BooleanVoteResult) voteResult).isAccepted()) {
Vote vote = item.getProposal().getVote();
if (vote instanceof BooleanVote) {
if (((BooleanVote) vote).isAccepted()) {
actionButtonIconView.setId("accepted");
} else {
actionButtonIconView.setId("rejected");
Expand Down

0 comments on commit d06b067

Please sign in to comment.