-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use mouse to jump to any node(position) in variation window #374
Conversation
@phiming Please help to check the following before the code review:
more detail can refer to the review comment of @OlivierBlanvillain: |
@zsalch |
@@ -808,7 +808,7 @@ public void onClicked(int x, int y) { | |||
// check for board click | |||
int[] boardCoordinates = boardRenderer.convertScreenToCoordinates(x, y); | |||
int moveNumber = winrateGraph.moveNumber(x, y); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the blanks.
@@ -822,6 +822,11 @@ public void onClicked(int x, int y) { | |||
if (Lizzie.config.showSubBoard && subBoardRenderer.isInside(x, y)) { | |||
Lizzie.config.toggleLargeSubBoard(); | |||
} | |||
|
|||
if (Lizzie.config.showVariationGraph) { | |||
Lizzie.frame.variationTree.jumpVariationTree(x,y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a blank after the ','.
@@ -13,12 +13,15 @@ | |||
private int XSPACING; | |||
private int DOT_DIAM = 11; // Should be odd number | |||
|
|||
private ArrayList<Integer> laneUsageList; | |||
private BoardHistoryNode curMove; | |||
private ArrayList<Integer> laneUsageList, laneUsageList1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The laneUsageList1 should be more sense.
private ArrayList<Integer> laneUsageList, laneUsageList1; | ||
private BoardHistoryNode curMove, curMove1; | ||
|
||
private int posx1, posy1, width1, height1; //Reserve a copy of varaition window axis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the indent & variables sense.
@@ -114,6 +117,8 @@ public void draw(Graphics2D g, int posx, int posy, int width, int height) { | |||
YSPACING = (Lizzie.config.showLargeSubBoard() ? 20 : 30); | |||
XSPACING = YSPACING; | |||
|
|||
posx1=posx;posy1=posy;width1=width;height1=height; //backup for mouse click event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please append spaces on both sides of the '=' and split the assignment statement to new lines.
@@ -142,4 +147,102 @@ public void draw(Graphics2D g, int posx, int posy, int width, int height) { | |||
} | |||
drawTree(g, posx + xoffset, curposy, 0, posy + height, node, 0,true); | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate blank line.
|
||
//Clone from drawTree() method but draw nothing, just caculate (x,y)->BoardNode | ||
public BoardHistoryNode inSubtree(int posx, int posy, int mouseX, int mouseY, int startLane, int maxposy, BoardHistoryNode startNode, int variationNumber) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The '{' should be in the end of line.
Thanks for your careful review. I use vscode to write and debug those code. It looks good in vscode, but there are still some blanks and spaces I cant find. Is there any tools to check this automatically? |
I recommend using intellij or eclipse, they have auto formatters intellij: ctrl alt L eclipse: ctrl shift f |
VS code may have its own formatter. I don't know |
I'm actually thinking about setting up this mvn plugin to autoformat the code: https://github.com/google/google-java-format. It needs a tiny bit of work to prevent very large lines from becoming unreadable, but once I'm done with that we shouldn't have to review anything related to code format... |
4fe5f6c
to
10875ca
Compare
@OlivierBlanvillain |
I will try to review it ASAP 😄! |
#373 use mouse click to navigate in branch window just like in Sabaki