Watch address is now clickable which starts inspector for that address

This commit is contained in:
Brendan Robert 2015-09-05 12:26:35 -05:00
parent baa79b26c2
commit c5167901b8

View File

@ -54,16 +54,11 @@ class Watch extends VBox {
redraw = outer.animationTimer.scheduleAtFixedRate(this::redraw, MetacheatUI.FRAME_RATE, MetacheatUI.FRAME_RATE, TimeUnit.MILLISECONDS); redraw = outer.animationTimer.scheduleAtFixedRate(this::redraw, MetacheatUI.FRAME_RATE, MetacheatUI.FRAME_RATE, TimeUnit.MILLISECONDS);
setBackground(new Background(new BackgroundFill(Color.NAVY, CornerRadii.EMPTY, Insets.EMPTY))); setBackground(new Background(new BackgroundFill(Color.NAVY, CornerRadii.EMPTY, Insets.EMPTY)));
Label addrLabel = new Label("$" + Integer.toHexString(address)); Label addrLabel = new Label("$" + Integer.toHexString(address));
addrLabel.setOnMouseClicked((evt)-> outer.inspectAddress(address));
addrLabel.setTextAlignment(TextAlignment.CENTER); addrLabel.setTextAlignment(TextAlignment.CENTER);
addrLabel.setMinWidth(GRAPH_WIDTH); addrLabel.setMinWidth(GRAPH_WIDTH);
addrLabel.setFont(new Font(Font.getDefault().getFamily(), 14)); addrLabel.setFont(new Font(Font.getDefault().getFamily(), 14));
addrLabel.setTextFill(Color.WHITE); addrLabel.setTextFill(Color.WHITE);
addrLabel.setMouseTransparent(false);
addrLabel.setOnMouseClicked((MouseEvent evt)-> {
if (evt.isPrimaryButtonDown()) {
outer.inspectAddress(address);
}
});
graph = new Canvas(GRAPH_WIDTH, GRAPH_HEIGHT); graph = new Canvas(GRAPH_WIDTH, GRAPH_HEIGHT);
getChildren().add(addrLabel); getChildren().add(addrLabel);
getChildren().add(graph); getChildren().add(graph);