Class: WorldMap

Inherits:
WorldMapDlg show all
Defined in:
lib/WorldMap.rb

Instance Attribute Summary

Attributes inherited from WorldMapDlg

#closeBtn, #lastMinutes, #mapFrame, #showCitiesCB, #showHostNamesCB, #showIPsCB, #showLastCB, #showRoutersCB, #showRoutesCB, #textLabel2

Instance Method Summary collapse

Constructor Details

#initialize(masterWindow) ⇒ WorldMap

Returns a new instance of WorldMap.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/WorldMap.rb', line 16

def initialize(masterWindow)
  super(nil)

  @masterWindow = masterWindow
  @gdv = GeoDistView.new(mapFrame, nil, nil, true)

  if $globals.getSetting('LargeMapW') > 0 &&
     $globals.getSetting('LargeMapH') > 0
    resize($globals.getSetting('LargeMapW'),
           $globals.getSetting('LargeMapH'))
  end

  @showIPsCB.checked = $globals.getSetting("WMShowIPs")
  @showCitiesCB.checked = $globals.getSetting("WMShowCityNames")
  @showHostNamesCB.checked = $globals.getSetting("WMShowHostNames")
  @showRoutersCB.checked = $globals.getSetting("WMShowRouters")
  @showRoutesCB.checked = $globals.getSetting("WMShowRoutes")
  @showLastCB.checked = $globals.getSetting("WMShowLast")
  @lastMinutes.value = $globals.getSetting("WMLastMinutes")

  show
end

Instance Method Details

#close(dummy) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/WorldMap.rb', line 43

def close(dummy)
  $globals.setSetting('LargeMapW', width)
  $globals.setSetting('LargeMapH', height)
  $globals.setSetting('WMShowIPs', @showIPsCB.isChecked)
  $globals.setSetting('WMShowHostNames', @showHostNamesCB.isChecked)
  $globals.setSetting('WMShowCityNames', @showCitiesCB.isChecked)
  $globals.setSetting('WMShowRouters', @showRoutersCB.isChecked)
  $globals.setSetting('WMShowRoutes', @showRoutesCB.isChecked)
  $globals.setSetting('WMShowLast', @showLastCB.isChecked)
  $globals.setSetting('WMLastMinutes', @lastMinutes.value)
  # Enabling showRoutes can pump a whole lot of requests into these queues.
  # So we flush them. All still needed requests will quickly be done again.
  $traceRouter.flushQueue
  $geoLocator.flushQueue

  @masterWindow.worldMapClosed

  super(true)
end

#lastMinutesValueChanged(val) ⇒ Object



88
89
90
# File 'lib/WorldMap.rb', line 88

def lastMinutesValueChanged(val)
  @gdv.lastMinutes = val
end

#showCitiesCBToggled(newVal) ⇒ Object



79
80
81
# File 'lib/WorldMap.rb', line 79

def showCitiesCBToggled(newVal)
  @gdv.showCities = newVal
end

#showHostNamesCBToggled(newVal) ⇒ Object



75
76
77
# File 'lib/WorldMap.rb', line 75

def showHostNamesCBToggled(newVal)
  @gdv.showHostNames = newVal
end

#showIPsCBToggled(newVal) ⇒ Object



71
72
73
# File 'lib/WorldMap.rb', line 71

def showIPsCBToggled(newVal)
  @gdv.showIPs = newVal
end

#showLastCBToggled(newVal) ⇒ Object



83
84
85
86
# File 'lib/WorldMap.rb', line 83

def showLastCBToggled(newVal)
  @gdv.showLast = newVal
  @lastMinutes.enabled = newVal
end

#showRoutersCBToggled(newVal) ⇒ Object



63
64
65
# File 'lib/WorldMap.rb', line 63

def showRoutersCBToggled(newVal)
  @gdv.showRouters = newVal
end

#showRoutesCBToggled(newVal) ⇒ Object



67
68
69
# File 'lib/WorldMap.rb', line 67

def showRoutesCBToggled(newVal)
  @gdv.showRoutes = newVal
end

#update(visitors) ⇒ Object



39
40
41
# File 'lib/WorldMap.rb', line 39

def update(visitors)
  @gdv.update(visitors)
end