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();
}
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;
}
Aggregations