Search in sources :

Example 1 with HostMonitorFigure

use of com.cubrid.cubridmanager.ui.mondashboard.editor.figure.HostMonitorFigure in project cubrid-manager by CUBRID.

the class HostMonitorPart method createFigure.

/**
	 * create a host figure
	 * 
	 * @return a host figure
	 */
protected IFigure createFigure() {
    HostMonitorFigure hostMonFigure = new HostMonitorFigure();
    HostNode hn = (HostNode) getModel();
    hostMonFigure.setStatus(true, hn.isConnected(), hn.getErrorMsg(), hn.hasNewErrorMsg());
    hostMonFigure.setTitle(hn.getName());
    hostMonFigure.setHint(new StringBuffer(" ").append(hn.getUserName()).append("@").append(hn.getIp()).append(":").append(hn.getPort()).append(" ").toString());
    return hostMonFigure;
}
Also used : HostMonitorFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.HostMonitorFigure) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Example 2 with HostMonitorFigure

use of com.cubrid.cubridmanager.ui.mondashboard.editor.figure.HostMonitorFigure in project cubrid-manager by CUBRID.

the class HostMonitorPart method refreshVisuals.

/**
	 * Refreshes this EditPart's <i>visuals</i>. This method is called by
	 * {@link #refresh()}, and may also be called in response to notifications
	 * from the model.
	 */
protected void refreshVisuals() {
    HostMonitorFigure fg = (HostMonitorFigure) this.getFigure();
    HostNode model = (HostNode) getModel();
    HAHostStatusInfo hostStatusInfo = model.getHostStatusInfo();
    fg.setTitle(model.getName());
    fg.setStatus(true, model.isConnected(), model.getErrorMsg(), model.hasNewErrorMsg());
    if (hostStatusInfo != null) {
        fg.setHostCpuUsage(hostStatusInfo.getCpuUsage());
        fg.setHostMemUsage(hostStatusInfo.getMemUsage());
        fg.setHostIO(hostStatusInfo.getIoWait());
    }
    super.refreshVisuals();
}
Also used : HAHostStatusInfo(com.cubrid.cubridmanager.core.mondashboard.model.HAHostStatusInfo) HostMonitorFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.HostMonitorFigure) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Aggregations

HostMonitorFigure (com.cubrid.cubridmanager.ui.mondashboard.editor.figure.HostMonitorFigure)2 HostNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)2 HAHostStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HAHostStatusInfo)1