Skip to content

Commit

Permalink
fixed distance to fovea bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkb777 committed Dec 3, 2017
1 parent 8797e8e commit bd5cdfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/main/java/com/bwc/ora/Ora.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Ora(String title) throws HeadlessException {
this.setMinimumSize(new Dimension(300, 50));
Image appicon = new ImageIcon(getClass().getResource("/logo.png")).getImage();
setIconImage(appicon);
if (System.getProperty("os.name").contains("OS X")){
if (System.getProperty("os.name").contains("OS X")) {
Application application = Application.getApplication();
application.setDockIconImage(appicon);
}
Expand Down Expand Up @@ -114,7 +114,14 @@ public Ora(String title) throws HeadlessException {
disp.addMouseMotionListener(distanceLabel);
distanceLabel.setMouseMovedEventHandler(e -> {
Point octPoint = disp.convertPanelPointToOctPoint(e.getPoint());
distanceLabel.setText(octPoint == null ? "N/A" : "N/A");
Lrp fovealLrp = Collections.getInstance().getLrpCollection().getFovealLrp();
double xscale = ModelsCollection.getInstance().getOctSettings().getxScale();
if (octPoint != null && fovealLrp != null && xscale > 0D) {
int micronsInX = (int) Math.round(xscale * (octPoint.x - fovealLrp.getLrpCenterXPosition()));
distanceLabel.setText(micronsInX + "\u00B5m");
} else {
distanceLabel.setText("N/A");
}
});
infoPanel.add(distanceToFoveaPanel);
infoPanel.add(Box.createHorizontalStrut(5));
Expand Down Expand Up @@ -170,7 +177,7 @@ public Ora(String title) throws HeadlessException {
add(Box.createVerticalGlue());

//add settings tab pane
JTabbedPane settingsTabPane = new JTabbedPane(JTabbedPane.LEFT);
JTabbedPane settingsTabPane = new JTabbedPane(JTabbedPane.BOTTOM);
settingsTabPane.setFont(settingsTabPane.getFont().deriveFont(13F));

//add tool bars
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bwc/ora/collections/LrpCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public Component getListCellRendererComponent(JList<? extends Lrp> list,
}

//Set the icon and text.
setText(value.getName());
setText(" ["+value.getName()+"] ");
return this;
}

Expand Down

0 comments on commit bd5cdfb

Please sign in to comment.