diff --git a/src/Map.java b/src/Map.java index 56049d0..b53abc2 100644 --- a/src/Map.java +++ b/src/Map.java @@ -26,7 +26,7 @@ public double getLatitude() { return latitude.getValue(); } - public void setAutoUpdateEnabled(boolean enabled) { - presenter.setAutoUpdateEnabled(enabled); + public void setAutoUpdate(boolean autoUpdate) { + presenter.setAutoUpdate(autoUpdate); } } \ No newline at end of file diff --git a/src/Presenter.java b/src/Presenter.java index c376c3f..3b66d78 100644 --- a/src/Presenter.java +++ b/src/Presenter.java @@ -3,32 +3,28 @@ private Longitude longitude; private MapLatitude mapLatitude; private Latitude latitude; - private boolean autoUpdateEnabled; + private boolean autoUpdate; public Presenter(MapLongitude mapLong, Longitude longi, MapLatitude mapLat, Latitude lat) { this.mapLongitude = mapLong; this.longitude = longi; this.mapLatitude = mapLat; this.latitude = lat; - this.autoUpdateEnabled = false; // �f�t�H���g�ł͎����X�V��OFF + this.autoUpdate = true; // �����l�͎����X�VON�Ƃ��܂� } - public void setAutoUpdateEnabled(boolean enabled) { - this.autoUpdateEnabled = enabled; - } - - // GPS�̈ʒu�����X�V���A�K�v�ɉ�����MapLongitude��MapLatitude���X�V���� public void updateGPS(double lat2, double long2) { - // Longitude��Latitude�̏�Ԃ��X�V - longitude.updateGPS(long2, lat2); - latitude.updateGPS(long2, lat2); - - // autoUpdateEnabled��true�Ȃ�Map�̏�Ԃ��X�V - if (autoUpdateEnabled) { - mapLongitude.updateGPS(long2, lat2); - mapLatitude.updateGPS(long2, lat2); + // �ܓx�o�x�I�u�W�F�N�g�̏�Ԃ��X�V + longitude.updateGPS(lat2, long2); + latitude.updateGPS(lat2, long2); + // �����X�V��ON�̏ꍇ�A�}�b�v�̈ܓx�o�x���X�V + if (autoUpdate) { + mapLongitude.updateLongitude(long2); + mapLatitude.updateLatitude(lat2); } } - // ���ɕK�v�ȃ��\�b�h������΂����ɒlj����� + public void setAutoUpdate(boolean autoUpdate) { + this.autoUpdate = autoUpdate; + } } \ No newline at end of file