mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
refine zero location
This commit is contained in:
@@ -164,6 +164,14 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
scrollPane.setUseHardwareAcceleration((Boolean) value);
|
||||
}
|
||||
});
|
||||
|
||||
ConfigurationManager.getInstance().addConfigListener(IPlugInPort.METRIC_KEY, new IConfigListener() {
|
||||
|
||||
@Override
|
||||
public void valueChanged(String key, Object value) {
|
||||
updateZeroLocation();
|
||||
}
|
||||
});
|
||||
|
||||
ConfigurationManager.getInstance().addConfigListener(IPlugInPort.EXTRA_SPACE_KEY, new IConfigListener() {
|
||||
|
||||
@@ -177,8 +185,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
canvasPanel.scrollRectToVisible(visibleRect);
|
||||
canvasPanel.revalidate();
|
||||
|
||||
double extraSpace = CanvasPlugin.this.plugInPort.getExtraSpace();
|
||||
getScrollPane().setZeroLocation(new Point2D.Double(extraSpace, extraSpace));
|
||||
updateZeroLocation();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -687,8 +694,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
canvasPanel.scrollRectToVisible(visibleRect);
|
||||
canvasPanel.revalidate();
|
||||
|
||||
double extraSpace = CanvasPlugin.this.plugInPort.getExtraSpace();
|
||||
getScrollPane().setZeroLocation(new Point2D.Double(extraSpace, extraSpace));
|
||||
updateZeroLocation();
|
||||
|
||||
zoomLevel = (Double) params[0];
|
||||
break;
|
||||
@@ -736,4 +742,9 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void updateZeroLocation() {
|
||||
double extraSpace = CanvasPlugin.this.plugInPort.getExtraSpace();
|
||||
getScrollPane().setZeroLocation(new Point2D.Double(extraSpace, extraSpace));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +104,7 @@ public class StatusBar extends JPanel implements IPlugIn {
|
||||
private List<String> componentNamesUnderCursor;
|
||||
private List<String> selectedComponentNames;
|
||||
private List<String> stuckComponentNames;
|
||||
private String statusMessage;
|
||||
private Point mousePosition;
|
||||
private String statusMessage;
|
||||
|
||||
private AnnouncementProvider announcementProvider;
|
||||
|
||||
@@ -482,7 +481,7 @@ public class StatusBar extends JPanel implements IPlugIn {
|
||||
if (mousePosition == null)
|
||||
getPositionLabel().setText(null);
|
||||
else
|
||||
getPositionLabel().setText(String.format("@%.2f %.2f " + (metric ? "mm" : "in"), mousePosition.getX(), mousePosition.getY()));
|
||||
getPositionLabel().setText(String.format("x:%.2f y:%.2f " + (metric ? "mm" : "in"), mousePosition.getX(), mousePosition.getY()));
|
||||
}
|
||||
|
||||
private void refreshStatusText() {
|
||||
|
||||
Reference in New Issue
Block a user