use of com.exalttech.trex.ui.PortState in project trex-stateless-gui by cisco-system-traffic-generator.
the class MainViewController method updateHeaderBtnStat.
/**
* Update header stream buttons state
*/
private void updateHeaderBtnStat() {
int portIndex = getSelectedPortIndex();
resetBtnState();
if (portIndex != -1) {
Port port = portManager.getPortList().get(portIndex);
PortState state = PortState.getPortStatus(port.getStatus());
// enable state btn btn according to owner
boolean isOwner = portManager.isCurrentUserOwner(portIndex);
switch(state) {
case STREAMS:
startStream.setDisable(!isOwner || !portManager.getPortModel(portIndex).isStreamLoaded());
break;
case TX:
pauseStream.setDisable(!isOwner);
stopStream.setDisable(!isOwner);
break;
case PAUSE:
startStream.setDisable(!isOwner);
pauseStream.setDisable(!isOwner);
stopStream.setDisable(!isOwner);
pauseStream.getStyleClass().add("pauseIconPressed");
break;
case IDLE:
AssignedProfile portProfile = assignedPortProfileMap.get(portIndex);
if (portProfile != null) {
startStream.setDisable(!(isOwner && portProfile.isProfileAssigned()));
}
break;
default:
break;
}
}
}
use of com.exalttech.trex.ui.PortState in project trex-stateless-gui by cisco-system-traffic-generator.
the class MainViewController method stopAllTransitBtnCLicked.
/**
* stop all transit btn clicked
*
* @param event
*/
@FXML
public void stopAllTransitBtnCLicked(MouseEvent event) {
LOG.trace("Clicked on the Stop All Transit Button ");
portManager.getPortList().stream().forEach(port -> {
PortState portState = PortState.getPortStatus(port.getStatus());
if (portManager.isCurrentUserOwner(port.getIndex()) && portState == PortState.TX) {
serverRPCMethods.stopPortTraffic(port.getIndex());
portManager.updatedPorts(Arrays.asList(port.getIndex()));
}
});
enableUpdateBtn(false, false);
}
use of com.exalttech.trex.ui.PortState in project trex-stateless-gui by cisco-system-traffic-generator.
the class StatisticLabelCell method updateStatusCell.
/**
* Update status cell value
*
* @param newValue
*/
private void updateStatusCell(String newValue) {
PortState portState = PortState.getPortStatus(newValue);
getStyleClass().add(portState.getTextColor());
}
Aggregations