Updated NetLogClient to disable all UI elements when disconnected
This commit is contained in:
parent
bfcab133de
commit
b298aadd68
7 changed files with 35 additions and 27 deletions
|
|
@ -162,7 +162,7 @@ public class DBQueue<E> implements Queue<E>{
|
|||
}
|
||||
|
||||
public Iterator<E> iterator() {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO: Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
</Label>
|
||||
<Region HBox.Hgrow="ALWAYS" />
|
||||
<Separator orientation="VERTICAL" prefHeight="200.0" valignment="CENTER" />
|
||||
<Label fx:id="logCountLable" text="80">
|
||||
<Label fx:id="logCountLabel" text="0">
|
||||
<graphic>
|
||||
<Label text="Log Count:" />
|
||||
</graphic>
|
||||
|
|
@ -69,8 +69,8 @@
|
|||
<Region HBox.Hgrow="ALWAYS" />
|
||||
<Group id="Group">
|
||||
<children>
|
||||
<Label layoutX="0.0" layoutY="-7.0" text="Log Level: " />
|
||||
<ComboBox layoutX="60.0" layoutY="-9.0" onAction="#handleLevelChanged">
|
||||
<Label fx:id="levelLabel" layoutX="0.0" layoutY="-7.0" text="Log Level: " />
|
||||
<ComboBox fx:id="levelComboBox" layoutX="60.0" layoutY="-9.0" onAction="#handleLevelChanged">
|
||||
<items>
|
||||
<FXCollections fx:factory="observableArrayList">
|
||||
<String fx:value="01 - ERROR" />
|
||||
|
|
@ -86,8 +86,8 @@
|
|||
</Group>
|
||||
<Group id="Group">
|
||||
<children>
|
||||
<Label alignment="CENTER_RIGHT" layoutX="0.0" layoutY="-7.0" prefWidth="60.0" text="Interval: " />
|
||||
<ComboBox layoutX="65.0" layoutY="-9.0" onAction="#handleIntervalChanged">
|
||||
<Label fx:id="intervalLabel" alignment="CENTER_RIGHT" layoutX="0.0" layoutY="-7.0" prefWidth="60.0" text="Interval: " />
|
||||
<ComboBox fx:id="intervalComboBox" layoutX="65.0" layoutY="-9.0" onAction="#handleIntervalChanged">
|
||||
<items>
|
||||
<FXCollections fx:factory="observableArrayList">
|
||||
<String fx:value="Instant" />
|
||||
|
|
@ -48,7 +48,7 @@ public class NetLogGuiClient extends Application{
|
|||
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
Parent root = FXMLLoader.load(getClass().getResource("NetLoggerClient.fxml"));
|
||||
Parent root = FXMLLoader.load(getClass().getResource("NetLogClient.fxml"));
|
||||
|
||||
stage.setTitle("NetLoggerClient ("+VERSION+")");
|
||||
stage.setScene(new Scene(root));
|
||||
|
|
@ -79,7 +79,7 @@ public class NetLogGuiClient extends Application{
|
|||
public NetLoggerClientTab(String host, int port) throws IOException{
|
||||
this.setText( host+":"+port );
|
||||
|
||||
Parent tabRoot = FXMLLoader.load(getClass().getResource("NetLoggerClientInstance.fxml"));
|
||||
Parent tabRoot = FXMLLoader.load(getClass().getResource("NetLogClientInstance.fxml"));
|
||||
this.setContent(tabRoot);
|
||||
AnchorPane.setRightAnchor(tabRoot, 0.0);
|
||||
//this.setOnClosed(new EventHandler<Event>() {
|
||||
|
|
|
|||
|
|
@ -26,19 +26,13 @@ import java.util.ResourceBundle;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javafx.scene.control.*;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.Event;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.ProgressBar;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableRow;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.util.Callback;
|
||||
|
||||
|
|
@ -52,9 +46,13 @@ public class NetLogGuiClientInstance implements Initializable, NetLogListener {
|
|||
|
||||
// UI elements
|
||||
@FXML private ToggleButton pauseButton;
|
||||
@FXML private Label logCountLabel;
|
||||
@FXML private ProgressBar progressBar;
|
||||
@FXML private Label errorLabel;
|
||||
@FXML private Label levelLabel;
|
||||
@FXML private ComboBox levelComboBox;
|
||||
@FXML private Label intervalLabel;
|
||||
@FXML private ComboBox intervalComboBox;
|
||||
@FXML private ProgressBar progressBar;
|
||||
@FXML private Label errorLabel;
|
||||
@FXML private Label logCountLabel;
|
||||
|
||||
@FXML private TableView<NetLogMessage> logTable;
|
||||
@FXML private TableColumn<NetLogMessage, Long> logTimestampColumn;
|
||||
|
|
@ -100,7 +98,8 @@ public class NetLogGuiClientInstance implements Initializable, NetLogListener {
|
|||
/************* NETWORK *****************/
|
||||
public void handleLogMessage(NetLogMessage msg) {
|
||||
if(status == Status.RUNNING){
|
||||
logTable.getItems().add(msg);
|
||||
logTable.getItems().add(msg);
|
||||
logCountLabel.setText(""+Integer.parseInt(logCountLabel.getText())+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -163,8 +162,17 @@ public class NetLogGuiClientInstance implements Initializable, NetLogListener {
|
|||
pauseButton.setText("Unpause");
|
||||
}
|
||||
else if(status == Status.DISCONNECTED){
|
||||
progressBar.setProgress(0);
|
||||
pauseButton.disableProperty();
|
||||
pauseButton.setDisable(true);
|
||||
levelLabel.setDisable(true);
|
||||
levelComboBox.setDisable(true);
|
||||
intervalLabel.setDisable(true);
|
||||
intervalComboBox.setDisable(true);
|
||||
|
||||
logTable.setDisable(true);
|
||||
exceptionTable.setDisable(true);
|
||||
|
||||
progressBar.setProgress(0);
|
||||
logCountLabel.setDisable(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ public class Tick {
|
|||
*/
|
||||
public static char increment(char c){
|
||||
switch(Character.toLowerCase(c)){
|
||||
case 'z': return 'å';
|
||||
case 'å': return 'ä';
|
||||
case 'ä': return 'ö';
|
||||
case 'z': return 'å';
|
||||
case 'å': return 'ä';
|
||||
case 'ä': return 'ö';
|
||||
}
|
||||
c = (char)(Character.toLowerCase(c) + 1);
|
||||
if(isAlfa(c)){
|
||||
|
|
@ -122,9 +122,9 @@ public class Tick {
|
|||
case 'x':
|
||||
case 'y':
|
||||
case 'z':
|
||||
case 'å':
|
||||
case 'ä':
|
||||
case 'ö': return true;
|
||||
case 'å':
|
||||
case 'ä':
|
||||
case 'ö': return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue