1 2 23 24 package net.fenyo.gnetwatch.data; 25 26 import net.fenyo.gnetwatch.*; 27 import net.fenyo.gnetwatch.GUI.*; 28 import net.fenyo.gnetwatch.targets.*; 29 30 import java.util.*; 31 32 import org.apache.commons.logging.Log; 33 import org.apache.commons.logging.LogFactory; 34 35 40 41 public class Views { 42 private static Log log = LogFactory.getLog(Views.class); 43 44 private final GUI gui; 45 46 50 public Views(final GUI gui) { 52 this.gui = gui; 53 } 54 55 60 public void refreshDataViews(final Target target) { 63 synchronized (gui.sync_tree) { 64 for (final Class event_type : target.getEventTypesInUse()) { 65 if (event_type == EventGeneric.class) { 66 } 68 69 if (event_type == EventReachable.class ) { 71 ReachableView reachable_view = null; 72 for (final VisualElement child : target.getChildren()) 74 if (child instanceof ReachableView) { 75 reachable_view = (ReachableView) child; 76 break; 77 } 78 if (reachable_view == null) new ReachableView(gui, target); 79 } 80 81 if (event_type == EventFlood.class) { 83 FloodView flood_view = null; 84 for (final VisualElement child : target.getChildren()) 86 if (child instanceof FloodView) { 87 flood_view = (FloodView) child; 88 break; 89 } 90 if (flood_view == null) new FloodView(gui, target); 91 } 92 93 if (event_type == EventHTTP.class) { 95 HTTPView http_view = null; 96 for (final VisualElement child : target.getChildren()) 98 if (child instanceof HTTPView) { 99 http_view = (HTTPView) child; 100 break; 101 } 102 if (http_view == null) new HTTPView(gui, target); 103 } 104 105 if (event_type == EventHTTPPages.class) { 107 HTTPPagesView http_pages_view = null; 108 for (final VisualElement child : target.getChildren()) 110 if (child instanceof HTTPPagesView) { 111 http_pages_view = (HTTPPagesView) child; 112 break; 113 } 114 if (http_pages_view == null) new HTTPPagesView(gui, target); 115 } 116 117 if (event_type == EventNmap.class) { 119 NmapView nmap_view = null; 120 for (final VisualElement child : target.getChildren()) 122 if (child instanceof NmapView) { 123 nmap_view = (NmapView) child; 124 break; 125 } 126 if (nmap_view == null) new NmapView(gui, target); 127 } 128 129 if (event_type == EventBytesReceived.class) { 131 BytesReceivedView bytes_received_view = null; 132 for (final VisualElement child : target.getChildren()) 134 if (child instanceof BytesReceivedView) { 135 bytes_received_view = (BytesReceivedView) child; 136 break; 137 } 138 if (bytes_received_view == null) new BytesReceivedView(gui, target); 139 } 140 141 if (event_type == EventBytesSent.class) { 143 BytesSentView bytes_sent_view = null; 144 for (final VisualElement child : target.getChildren()) 146 if (child instanceof BytesSentView) { 147 bytes_sent_view = (BytesSentView) child; 148 break; 149 } 150 if (bytes_sent_view == null) new BytesSentView(gui, target); 151 } 152 } 153 } 154 } 155 156 161 public boolean canManageThisChild(final VisualElement visual_element) { 162 return false; 163 } 164 } 165 | Popular Tags |