/** * ************************************************************************* Update server * information ************************************************************************ */ private void updateServer(boolean connectionLost) { if (s_serverInfo != null) { String name = s_serverInfo.getName(); String role = s_serverInfo.getRole().name(); m_connection.setText(" " + name + " "); m_mode.setText(role); m_mode.setBackground(s_okColor); m_connection.setBackground(s_okColor); } else { m_connection.setText(ConnectionStatusConstants.DISCONNECTED); m_mode.setText(ConnectionStatusConstants.UNKNOWN); if (connectionLost) { m_connection.setBackground(s_errorColor); m_mode.setBackground(s_errorColor); } else { m_connection.setBackground(s_warnColor); m_mode.setBackground(s_warnColor); } } m_base.getParent().pack(); }
/** * ************************************************************************* Update context * information ************************************************************************ */ private void updateContext(boolean connectionLost) { if (s_contextInfo != null) { String ctxName = s_contextInfo.getName(); String domain = s_contextInfo.getSC(); m_context.setText(" " + ctxName + " "); m_context.setBackground(s_okColor); m_domain.setText(" " + domain + " "); m_domain.setBackground(s_okColor); m_driver.setText(" " + s_contextInfo.getDriver() + " "); m_driver.setBackground(s_okColor); m_family.setText(" " + s_contextInfo.getFamily() + " "); m_family.setBackground(s_okColor); m_key.setText(s_proxy.getClientKey()); m_key.setBackground(s_okColor); if (s_serverInfo != null) { ServerInfo.ServerRole role = s_serverInfo.getRole(); m_mode.setText(role.equals(ServerInfo.ServerRole.COMMANDING) ? "CMD" : "MON"); m_mode.setBackground(s_okColor); } } else { m_mode.setText(ConnectionStatusConstants.UNKNOWN); m_domain.setText(ConnectionStatusConstants.UNKNOWN); m_driver.setText(ConnectionStatusConstants.UNKNOWN); m_family.setText(ConnectionStatusConstants.UNKNOWN); m_key.setText("?"); if (connectionLost) { m_context.setText(ConnectionStatusConstants.FAILURE); m_context.setBackground(s_errorColor); } else { m_context.setText(ConnectionStatusConstants.UNKNOWN); m_context.setBackground(s_warnColor); } m_mode.setBackground(s_warnColor); m_domain.setBackground(s_warnColor); m_driver.setBackground(s_warnColor); m_family.setBackground(s_warnColor); m_key.setBackground(s_warnColor); } m_base.getParent().pack(); }