Search in sources :

Example 1 with DatabaseMonitorFigure

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

the class DatabaseMonitorPart 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() {
    DatabaseMonitorFigure dmfg = (DatabaseMonitorFigure) this.getFigure();
    DatabaseNode dn = (DatabaseNode) this.getModel();
    dmfg.setTitle(dn.getName());
    HADatabaseStatusInfo haDatabaseStatus = dn.getHaDatabaseStatus();
    String dbStatus = "";
    if (haDatabaseStatus != null) {
        dmfg.setCpuUsage(haDatabaseStatus.getCpuUsage());
        dmfg.setMemUsage(haDatabaseStatus.getMemUsage());
        dmfg.setDelay(haDatabaseStatus.getDelay());
        dbStatus = DBStatusType.getShowText(haDatabaseStatus.getStatusType());
    }
    dmfg.setStatus(true, dn.getParent().isConnected(), dn.isConnected(), dbStatus, dn.getErrorMsg(), dn.hasNewErrorMsg());
    super.refreshVisuals();
}
Also used : DatabaseNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.DatabaseNode) DatabaseMonitorFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.DatabaseMonitorFigure) HADatabaseStatusInfo(com.cubrid.cubridmanager.core.mondashboard.model.HADatabaseStatusInfo)

Example 2 with DatabaseMonitorFigure

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

the class DatabaseMonitorPart method createFigure.

/**
	 * get a database monitor figure.
	 * 
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 * @return a database figure
	 */
protected IFigure createFigure() {
    DatabaseMonitorFigure dbMonitorFigure = new DatabaseMonitorFigure();
    DatabaseNode databaseNode = (DatabaseNode) getModel();
    HostNode hostNode = databaseNode.getParent();
    dbMonitorFigure.setTitle(databaseNode.getName());
    dbMonitorFigure.setHostName(hostNode.getName());
    String statusText = DBStatusType.getShowText(databaseNode.getDbStatusType());
    dbMonitorFigure.setStatus(true, hostNode.isConnected(), databaseNode.isConnected(), statusText, databaseNode.getErrorMsg(), databaseNode.hasNewErrorMsg());
    dbMonitorFigure.setHint(new StringBuffer(" ").append(databaseNode.getDbName()).append("@").append(hostNode.getIp()).append(":").append(hostNode.getPort()).append(" ").toString());
    return dbMonitorFigure;
}
Also used : DatabaseNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.DatabaseNode) DatabaseMonitorFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.DatabaseMonitorFigure) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Aggregations

DatabaseMonitorFigure (com.cubrid.cubridmanager.ui.mondashboard.editor.figure.DatabaseMonitorFigure)2 DatabaseNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.DatabaseNode)2 HADatabaseStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HADatabaseStatusInfo)1 HostNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)1