use of org.netxms.ui.eclipse.topology.widgets.helpers.PortCalculatorUpDownLeftRight in project netxms by netxms.
the class SlotView method paintControl.
/* (non-Javadoc)
* @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent)
*/
@Override
public void paintControl(PaintEvent e) {
e.gc.drawText(slotName, HORIZONTAL_MARGIN, (getSize().y - nameSize.y) / 2);
PortCalculator portCalculator = null;
switch(numberingScheme) {
case NDD_PN_DU_LR:
portCalculator = new PortCalculatorDownUpLeftRight(nameSize.x, rowCount);
break;
case NDD_PN_LR_UD:
portCalculator = new PortCalculatorLeftRightUpDown(nameSize.x, ports.size(), rowCount);
break;
case NDD_PN_LR_DU:
portCalculator = new PortCalculatorLeftRightDownUp(nameSize.x, ports.size(), rowCount);
break;
case NDD_PN_CUSTOM:
break;
case NDD_PN_UNKNOWN:
case NDD_PN_UD_LR:
default:
portCalculator = new PortCalculatorUpDownLeftRight(nameSize.x, rowCount);
break;
}
for (PortInfo p : ports) {
drawPort(p, portCalculator.calculateNextPos(), e.gc);
}
}
Aggregations