优化代码结构
This commit is contained in:
28
src/main/java/com/dayrain/views/ServerContainer.java
Normal file
28
src/main/java/com/dayrain/views/ServerContainer.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.dayrain.views;
|
||||
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* server容器
|
||||
* @author peng
|
||||
* @date 2021/11/11
|
||||
*/
|
||||
public class ServerContainer extends VBox {
|
||||
|
||||
private List<ServerPane> serverPanes;
|
||||
|
||||
public ServerContainer(List<ServerPane> serverPanes) {
|
||||
this.serverPanes = serverPanes;
|
||||
createView();
|
||||
}
|
||||
|
||||
public void createView() {
|
||||
getChildren().addAll(serverPanes);
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
getChildren().removeAll();
|
||||
getChildren().addAll(serverPanes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user