Search in sources :

Example 1 with BrokerDBListFigure

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

the class BrokerDBListMonitorPart method createFigure.

/**
	 * get a database monitor figure.
	 * 
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 * @return a database figure
	 */
protected IFigure createFigure() {
    BrokerDBListFigure figure = new BrokerDBListFigure();
    BrokerDBListNode modelNode = (BrokerDBListNode) getModel();
    figure.setName(modelNode.getName());
    return figure;
}
Also used : BrokerDBListFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerDBListFigure) BrokerDBListNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerDBListNode)

Example 2 with BrokerDBListFigure

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

the class BrokerDBListMonitorPart 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() {
    BrokerDBListFigure figure = (BrokerDBListFigure) this.getFigure();
    BrokerDBListNode dn = (BrokerDBListNode) this.getModel();
    figure.setName(dn.getName());
    //Remove defined dabatases.
    List<String> dbList = new ArrayList<String>();
    dbList.addAll(dn.getDbList());
    Dashboard dashboard = (Dashboard) getParent().getModel();
    for (DatabaseNode dbNode : dashboard.getAllDatabaseNode()) {
        String dbName = dbNode.getDbName() + "@" + dbNode.getParent().getIp();
        if (dn.getDbList().contains(dbName)) {
            dbList.remove(dbName);
        }
    }
    figure.setDBList(dbList);
    BrokerNode broker = dn.getBrokerNode();
    figure.setHostConnected(broker.getParent().isConnected());
    super.refreshVisuals();
}
Also used : BrokerDBListFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerDBListFigure) BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) DatabaseNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.DatabaseNode) BrokerDBListNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerDBListNode) ArrayList(java.util.ArrayList) Dashboard(com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard)

Aggregations

BrokerDBListFigure (com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerDBListFigure)2 BrokerDBListNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerDBListNode)2 BrokerNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode)1 Dashboard (com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard)1 DatabaseNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.DatabaseNode)1 ArrayList (java.util.ArrayList)1