107 }
108 }
109
110 plugins = new LinkedHashMap<ExceptionSafePlugin, SwingWorker<?, ?>>();
111 for (JConsolePlugin p : JConsole.getPlugins()) {
112 p.setContext(proxyClient);
113 plugins.put(new ExceptionSafePlugin(p), null);
114 }
115
116 Utilities.updateTransparency(this);
117
118 ToolTipManager.sharedInstance().registerComponent(this);
119
120 // Start listening to connection state events
121 //
122 proxyClient.addPropertyChangeListener(this);
123
124 addMouseListener(new MouseAdapter() {
125
126 public void mouseClicked(MouseEvent e) {
127 if (connectedIconBounds != null && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && connectedIconBounds.contains(e.getPoint())) {
128
129 if (isConnected()) {
130 userDisconnected = true;
131 disconnect();
132 wasConnected = false;
133 } else {
134 connect();
135 }
136 repaint();
137 }
138 }
139 });
140
141 }
142 private static Icon connectedIcon16 =
143 new ImageIcon(VMPanel.class.getResource("resources/connected16.png"));
144 private static Icon connectedIcon24 =
145 new ImageIcon(VMPanel.class.getResource("resources/connected24.png"));
146 private static Icon disconnectedIcon16 =
147 new ImageIcon(VMPanel.class.getResource("resources/disconnected16.png"));
|
107 }
108 }
109
110 plugins = new LinkedHashMap<ExceptionSafePlugin, SwingWorker<?, ?>>();
111 for (JConsolePlugin p : JConsole.getPlugins()) {
112 p.setContext(proxyClient);
113 plugins.put(new ExceptionSafePlugin(p), null);
114 }
115
116 Utilities.updateTransparency(this);
117
118 ToolTipManager.sharedInstance().registerComponent(this);
119
120 // Start listening to connection state events
121 //
122 proxyClient.addPropertyChangeListener(this);
123
124 addMouseListener(new MouseAdapter() {
125
126 public void mouseClicked(MouseEvent e) {
127 if (connectedIconBounds != null
128 && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0
129 && connectedIconBounds.contains(e.getPoint())) {
130
131 if (isConnected()) {
132 userDisconnected = true;
133 disconnect();
134 wasConnected = false;
135 } else {
136 connect();
137 }
138 repaint();
139 }
140 }
141 });
142
143 }
144 private static Icon connectedIcon16 =
145 new ImageIcon(VMPanel.class.getResource("resources/connected16.png"));
146 private static Icon connectedIcon24 =
147 new ImageIcon(VMPanel.class.getResource("resources/connected24.png"));
148 private static Icon disconnectedIcon16 =
149 new ImageIcon(VMPanel.class.getResource("resources/disconnected16.png"));
|