コード例 #1
0
 public IPMInstanceYYLBItemCYDKLBRowDataItem(Plus plus, BusinessNode businessNode) {
   super();
   this.businessNode = businessNode;
   this.p0.set(dataExtractMethodList.get(0).apply(businessNode));
   this.p1.set(dataExtractMethodList.get(1).apply(businessNode));
   this.p2.set(dataExtractMethodList.get(2).apply(businessNode));
   this.p3.set(dataExtractMethodList.get(3).apply(businessNode));
   dataChangeCallbackList.addAll(
       Arrays.asList(
           (node, data) -> {
             node.safeSetFirstAttributeBackFromChildren(this, data, "Name");
             plus.fireEvent(PlusEventListenerType.IPMInstance_Change, node);
           },
           (node, data) -> {
             node.safeSetFirstAttributeBackFromChildren(this, data, "Direction");
             plus.fireEvent(PlusEventListenerType.IPMInstance_Change, node);
           },
           (node, data) -> {
             node.safeSetFirstAttributeBackFromChildren(this, data, "MessageSize");
             plus.fireEvent(PlusEventListenerType.IPMInstance_Change, node);
           },
           (node, data) -> {
             node.safeSetFirstAttributeBackFromChildren(this, data, "RefreshRate");
             plus.fireEvent(PlusEventListenerType.IPMInstance_Change, node);
           }));
 }
コード例 #2
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
  public void scheduleOptimization(ActionEvent actionEvent) {
    log.info("Click 资源调度优化");
    final UINode uiProject = plus.getService(TreeViewService.class).getCurrentUIProject();

    if (uiProject == null) {
      plus.getService(DialogService.class).alert("工作空间内没有项目");
      return;
    }

    final UINode uiPlan = plus.getService(DialogService.class).selectAPlan(uiProject);
    if (uiPlan != null) {
      plus.fireEvent(PlusEventListenerType.ResourceScheduleOptimization, uiPlan);
    }
  }
コード例 #3
0
 public SwitchInstanceVLLBItemMDDKRowDataItem(Plus plus, BusinessNode businessNode) {
   super();
   this.businessNode = businessNode;
   this.p0.set(dataExtractMethodList.get(0).apply(businessNode));
   this.p1.set(dataExtractMethodList.get(1).apply(businessNode));
   this.p2.set(dataExtractMethodList.get(2).apply(businessNode));
   dataChangeCallbackList.addAll(
       Arrays.asList(
           (node, data) -> {
             node.safeSetFirstTextBackFromChildren(this, data, "dest_data_port", "port_name");
             plus.fireEvent(PlusEventListenerType.SwitchInstance_Change, node);
           },
           (node, data) -> {
             node.safeSetFirstTextBackFromChildren(
                 this, data, "dest_data_port", "rx_window", "start");
             plus.fireEvent(PlusEventListenerType.SwitchInstance_Change, node);
           },
           (node, data) -> {
             node.safeSetFirstTextBackFromChildren(
                 this, data, "dest_data_port", "rx_window", "end");
             plus.fireEvent(PlusEventListenerType.SwitchInstance_Change, node);
           }));
 }
コード例 #4
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
  public void deploy(ActionEvent actionEvent) {
    log.info("Click 资源自动分配");
    final UINode uiProject = plus.getService(TreeViewService.class).getCurrentUIProject();

    if (uiProject == null) {
      plus.getService(DialogService.class).alert("工作空间内没有项目");
      return;
    }

    final UINode uiPlan = plus.getService(DialogService.class).selectAPlan(uiProject);
    if (uiPlan != null) {
      plus.fireEvent(PlusEventListenerType.Deployment, uiPlan);
    }
  }
コード例 #5
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
 public void showConsoleAction(ActionEvent actionEvent) {
   plus.fireEvent(PlusEventListenerType.Show_Console);
 }
コード例 #6
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
 public void showChartsIPMAction(ActionEvent actionEvent) {
   plus.fireEvent(PlusEventListenerType.Show_Charts_IPM);
 }
コード例 #7
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
 public void showChartsLLDKAction(ActionEvent actionEvent) {
   plus.fireEvent(PlusEventListenerType.Show_Charts_LLDK);
 }
コード例 #8
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
 public void fireDeleteRowAction(ActionEvent actionEvent) {
   log.info("Click 删除行");
   plus.fireEvent(PlusEventListenerType.Delete_Row);
 }
コード例 #9
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
 public void fireNewRowAction(ActionEvent actionEvent) {
   log.info("Click 增加行");
   plus.fireEvent(PlusEventListenerType.New_Row);
 }
コード例 #10
0
ファイル: MainFrame.java プロジェクト: yunluchentom/dimaApp
  public void popupAboutDialog(ActionEvent actionEvent) {
    final Alert aboutDialog = new Alert(Alert.AlertType.INFORMATION);
    aboutDialog.setTitle("关于 - Dima");
    aboutDialog.setHeaderText(null);
    aboutDialog.setContentText("本软件制作权属于 @Yunlu");

    aboutDialog.initStyle(StageStyle.DECORATED);
    aboutDialog.showAndWait();

    /** Hooked, For temporary use */
    if (plus.getService(TreeViewService.class).getCurrentUIProject() == null) {
      return;
    }

    final UINode uiPlan =
        plus.getService(TreeViewService.class)
            .getCurrentUIProject()
            .getFirstChildByName(UIPlan_NAME);

    final File ipmDir = PlusFileUtil.newDir(plus, uiPlan, "ipm", "1", "ES_1");
    final File switchDir = PlusFileUtil.newDir(plus, uiPlan, "switch", "1", "SW_1");
    final File rdcDir = PlusFileUtil.newDir(plus, uiPlan, "rdc", "1", "Rdc429ToDis");

    final BusinessNode businessNode653 =
        plus.getService(XMLService.class).parseRootBusinessNode("config/653.xml");
    final BusinessNode businessNodeBSP =
        plus.getService(XMLService.class).parseRootBusinessNode("config/BSP.xml");
    final BusinessNode businessNodeWL =
        plus.getService(XMLService.class).parseRootBusinessNode("config/网络配置表.xml");
    final BusinessNode businessNodeYY =
        plus.getService(XMLService.class).parseRootBusinessNode("config/应用配置表.xml");
    final BusinessNode businessNodeSwitch =
        plus.getService(XMLService.class).parseRootBusinessNode("config/switch.xml");
    final BusinessNode businessNodeIPMInternalData =
        plus.getService(XMLService.class).parseRootBusinessNode("config/IPMInternalData.xml");
    final BusinessNode businessNodeRDCInstance =
        plus.getService(XMLService.class).parseRootBusinessNode("config/RDCInstance.xml");
    final BusinessNode businessNodeTopoData =
        plus.getService(XMLService.class).parseRootBusinessNode("config/TopoData.xml");

    /** IPM */
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNode653, new File(ipmDir, Names.FILE_653));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeWL, new File(ipmDir, Names.FILE_WL("1", "ES_1")));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeYY, new File(ipmDir, Names.FILE_YY("1", "app_sync")));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeYY, new File(ipmDir, Names.FILE_YY("1", "app_part1")));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(
            businessNodeIPMInternalData, new File(ipmDir, Names.FILE_IPM_INTERNAL_DATA));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeBSP, new File(ipmDir, Names.FILE_BSP));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeTopoData, new File(ipmDir, Names.FILE_TOPO_DATA));

    /** Switch */
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeSwitch, new File(switchDir, Names.FILE_SWITCH));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeTopoData, new File(switchDir, Names.FILE_TOPO_DATA));

    /** RDC */
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeRDCInstance, new File(rdcDir, Names.FILE_RDCInstance));
    plus.getService(XMLService.class)
        .outputBusinessNodeToXML(businessNodeTopoData, new File(rdcDir, Names.FILE_TOPO_DATA));

    plus.fireEvent(PlusEventListenerType.RequirePlanUpdate, uiPlan);

    plus.fireEvent(PlusEventListenerType.RequirePlanStatisticsUpdate, uiPlan);

    /** Mock Chart */
    final ObservableList<PieChart.Data> pieChartData1 =
        FXCollections.observableArrayList(
            new PieChart.Data("空闲", 12),
            new PieChart.Data("CPU-1", 18),
            new PieChart.Data("CPU-2", 53),
            new PieChart.Data("CPU-3", 24),
            new PieChart.Data("CPU-4", 11));

    final ObservableList<PieChart.Data> pieChartData2 =
        FXCollections.observableArrayList(
            new PieChart.Data("空闲", 12),
            new PieChart.Data("内存-1", 18),
            new PieChart.Data("内存-2", 53),
            new PieChart.Data("内存-3", 24),
            new PieChart.Data("内存-4", 11));
    plus.fireEvent(Input_CPU_Memory_Data, pieChartData1, pieChartData2);

    final ObservableList<PieChart.Data> pieChartData3 =
        FXCollections.observableArrayList(
            new PieChart.Data("空闲", 12),
            new PieChart.Data("带宽-1", 18),
            new PieChart.Data("带宽-2", 53),
            new PieChart.Data("带宽-3", 24),
            new PieChart.Data("带宽-4", 11));
    final ObservableList<PieChart.Data> pieChartData4 =
        FXCollections.observableArrayList(
            new PieChart.Data("空闲", 12),
            new PieChart.Data("带宽-1", 18),
            new PieChart.Data("带宽-2", 53),
            new PieChart.Data("带宽-3", 24),
            new PieChart.Data("带宽-4", 11));
    plus.fireEvent(Input_LLDK_Data, pieChartData3, pieChartData4);

    /** Mock line chart */
    Random random = new Random();
    final XYChart.Series<Number, Number> series1 = new XYChart.Series<>();
    series1.getData().add(new XYChart.Data<>(1, Math.abs(random.nextInt(20)) + 1900));
    series1.getData().add(new XYChart.Data<>(2, Math.abs(random.nextInt(20)) + 1900));
    series1.getData().add(new XYChart.Data<>(3, Math.abs(random.nextInt(20)) + 1900));
    series1.getData().add(new XYChart.Data<>(6, Math.abs(random.nextInt(20)) + 1900));
    series1.getData().add(new XYChart.Data<>(7, Math.abs(random.nextInt(20)) + 1900));
    series1.getData().add(new XYChart.Data<>(8, Math.abs(random.nextInt(20)) + 1900));
    series1.setName("消息1");

    final XYChart.Series<Number, Number> series2 = new XYChart.Series<>();
    series2.getData().add(new XYChart.Data<>(1, Math.abs(random.nextInt(20)) + 1900));
    series2.getData().add(new XYChart.Data<>(2, Math.abs(random.nextInt(20)) + 1900));
    series2.getData().add(new XYChart.Data<>(3, Math.abs(random.nextInt(20)) + 1900));
    series2.getData().add(new XYChart.Data<>(6, Math.abs(random.nextInt(20)) + 1900));
    series2.getData().add(new XYChart.Data<>(7, Math.abs(random.nextInt(20)) + 1900));
    series2.getData().add(new XYChart.Data<>(8, Math.abs(random.nextInt(20)) + 1900));
    series2.setName("消息2");

    final XYChart.Series<Number, Number> series3 = new XYChart.Series<>();
    series3.getData().add(new XYChart.Data<>(2, Math.abs(random.nextInt(20)) + 1900));
    series3.getData().add(new XYChart.Data<>(4, Math.abs(random.nextInt(20)) + 1900));
    series3.getData().add(new XYChart.Data<>(5, Math.abs(random.nextInt(20)) + 1900));
    series3.getData().add(new XYChart.Data<>(6, Math.abs(random.nextInt(20)) + 1900));
    series3.getData().add(new XYChart.Data<>(8, Math.abs(random.nextInt(20)) + 1900));
    series3.getData().add(new XYChart.Data<>(10, Math.abs(random.nextInt(20)) + 1900));
    series3.setName("消息3");

    final XYChart.Series<Number, Number> series4 = new XYChart.Series<>();
    series4.getData().add(new XYChart.Data<>(2, Math.abs(random.nextInt(20)) + 1900));
    series4.getData().add(new XYChart.Data<>(4, Math.abs(random.nextInt(20)) + 1900));
    series4.getData().add(new XYChart.Data<>(5, Math.abs(random.nextInt(20)) + 1900));
    series4.getData().add(new XYChart.Data<>(6, Math.abs(random.nextInt(20)) + 1900));
    series4.getData().add(new XYChart.Data<>(8, Math.abs(random.nextInt(20)) + 1900));
    series4.getData().add(new XYChart.Data<>(10, Math.abs(random.nextInt(20)) + 1900));
    series4.setName("消息4");

    final List<XYChart.Series<Number, Number>> delaySeriesList = Lists.newArrayList();
    final List<XYChart.Series<Number, Number>> jitterSeriesList = Lists.newArrayList();
    delaySeriesList.add(series1);
    delaySeriesList.add(series2);
    jitterSeriesList.add(series3);
    jitterSeriesList.add(series4);
    plus.fireEvent(Input_Message_Data, delaySeriesList, jitterSeriesList);

    /** Mock console */
    final TreeItem<ConsoleBoxItem> r1 =
        new TreeItem<>(
            new ConsoleBoxItem("结果1", "XXXX1"),
            new ImageView(
                new Image(
                    MainFrame.class
                        .getClassLoader()
                        .getResourceAsStream("dima/view/res/console_24.png"))));
    final TreeItem<ConsoleBoxItem> r2 =
        new TreeItem<>(
            new ConsoleBoxItem("结果1 - 1", "XXXX2"),
            new ImageView(
                new Image(
                    MainFrame.class
                        .getClassLoader()
                        .getResourceAsStream("dima/view/res/console_24.png"))));
    final TreeItem<ConsoleBoxItem> r3 =
        new TreeItem<>(
            new ConsoleBoxItem("结果1 - 2", "XXXX3"),
            new ImageView(
                new Image(
                    MainFrame.class
                        .getClassLoader()
                        .getResourceAsStream("dima/view/res/console_24.png"))));
    r1.getChildren().addAll(r2, r3);
    plus.fireEvent(Add_Console_Message, r1);

    //        log.info("Confirm = {}",
    // plus.getService(DialogService.class).confirmDialog("这条消息确定吗"));

    plus.fireEvent(
        PlusEventListenerType.IPMInstance_Refresh,
        UINode.findFromChildren(
            plus.getService(TreeViewService.class).getCurrentUIProject(), UIPlan_NAME),
        0);
    plus.fireEvent(
        PlusEventListenerType.SwitchInstance_Refresh,
        UINode.findFromChildren(
            plus.getService(TreeViewService.class).getCurrentUIProject(), UIPlan_NAME),
        0);
  }