1 package org.libcsdbg.jtracer;
3 import java.beans.PropertyChangeListener;
5 import java.util.Vector;
8 import java.io.IOException;
10 import java.net.Socket;
12 import java.awt.event.WindowEvent;
13 import java.awt.event.WindowListener;
15 import javax.swing.JFrame;
16 import java.awt.Component;
37 addPropertyChangeListener(
"sessionCount", (PropertyChangeListener)
owner);
38 addPropertyChangeListener(
"currentSession", (PropertyChangeListener) owner);
44 public void register(Socket sock)
throws IOException
47 s.addWindowListener(
this);
55 s.setAlwaysOnTop(owner.isAlwaysOnTop());
62 sessions.get(
current).dispose();
69 Session cur = sessions.remove(0);
70 cur.removeWindowListener(
this);
75 firePropertyChange(
"sessionCount", null, 0);
81 int cnt = sessions.size();
82 if (i >= 0 && i < cnt) {
87 for (i = 0; i < cnt; i++)
104 for (
int i = 0, cnt =
sessions.size(); i < cnt; i++) {
111 catch (Throwable t) {
116 sessions.get(prev).toFront();
120 Thread t =
new Thread(
new Worker());
134 step = (step < 0) ? -1 : 1;
150 if (cur.isIconified())
156 while (!prev.equals(cur));
174 Session cur = sessions.get(sel);
175 cur.setIconified(
false);
182 return sessions.size();
194 for (
int i = 0, sz =
sessions.size(); i < sz; i++)
195 cnt +=
sessions.get(i).getTraceCount();
218 int row = (index + rowsz) / rowsz;
219 int mod = index % rowsz;
220 int x = basex + step * mod;
221 int y = basey + step * (row + mod);
223 sessions.get(index).setLocation(x, y);
229 for (
int i = 0, cnt =
sessions.size(); i < cnt; i++)
242 JFrame f = (JFrame) event.getWindow();
247 for (i = 0, cnt =
sessions.size(); i < cnt; i++)
254 Session cur = sessions.remove(i);
255 cur.removeWindowListener(
this);
262 firePropertyChange(
"sessionCount", null, cnt);
269 firePropertyChange(
"sessionCount", null, cnt);
277 catch (Throwable t) {
291 JFrame f = (JFrame) event.getWindow();
297 int cnt = sessions.size();
300 firePropertyChange(
"sessionCount", null, cnt);
307 firePropertyChange(
"sessionCount", null, cnt);
317 catch (Throwable t) {
331 JFrame f = (JFrame) event.getWindow();
335 firePropertyChange(
"sessionCount", null,
sessions.size());
338 catch (Throwable t) {
352 JFrame f = (JFrame) event.getWindow();
357 catch (Throwable t) {
371 JFrame f = (JFrame) event.getWindow();
376 catch (Throwable t) {
390 JFrame f = (JFrame) event.getWindow();
394 for (
int i = 0, cnt =
sessions.size(); i < cnt; i++) {
399 firePropertyChange(
"currentSession", null,
current);
405 catch (Throwable t) {
void windowDeiconified(WindowEvent event)
Handler for events fired for restored windows.
void windowActivated(WindowEvent event)
Handler for events fired for activated (focused) windows.
void windowClosed(WindowEvent event)
Handler for events fired for closed (disposed) windows.
void windowIconified(WindowEvent event)
Handler for events fired for iconified windows.
void windowDeactivated(WindowEvent event)
Handler for events fired for deactivated (unfocused) windows.
void windowOpened(WindowEvent event)
Handler for events fired for opened windows.
void setAlwaysOnTop(int i, boolean how)
Vector< Session > sessions
void setIconified(final boolean how)
Minimize or restore all client windows.
void shiftSelection(int step)
Select the previous/next not iconified client window.
void setClientPosition(int index)
Position a client frame to its default coordinates.
int current
Currently selected (focused) client.
int getTraceCount()
Get the total number of traces.
Vector< Session > getSessions()
static final long serialVersionUID
Class version.
boolean isIconified()
Check frame state.
void windowClosing(WindowEvent event)
Handler for events fired for closing windows.