第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

有沒(méi)有辦法從mxgraph更改頂點(diǎn)或邊緣樣式?

有沒(méi)有辦法從mxgraph更改頂點(diǎn)或邊緣樣式?

慕沐林林 2022-09-22 15:43:28
我用java做了一個(gè)圖表,我想自定義它的風(fēng)格。有什么簡(jiǎn)單的方法嗎?通過(guò)為它們添加樣式?以下是我使用的代碼的一部分:它從json文件中獲取一些數(shù)據(jù),這些數(shù)據(jù)被填充到一些哈希圖中。public mxGraphComponent createGlobalOverview(String Filename) {            mxGraph graph = new mxGraph();            Object parent = graph.getDefaultParent();            graph.getModel().beginUpdate();            try {                  Object vRoot = graph.insertVertex(parent, null, Filename, 0, 0, 100, 50);                  int fmsCounter = 0;                  for (Object i : blueprint.keySet()) {                      getDependencies(i.toString());                      if (blueprint.get(i).equals("FMS")) {                          if (dependsList.get(fmsCounter).equals("null")) {                              Object rootFMS = graph.insertVertex(parent, null, getTitle(i.toString()), 0, 0, 200, 50);                              graph.insertEdge(parent, null, "rootFMS", vRoot, rootFMS);                              System.out.println(blueprint.size());                              createGraph(graph, parent, rootFMS, i, blueprint.size());                            }                        }                    }                    graph.setCellsEditable(false);                    graph.setCellsMovable(false);                    graph.setCellsResizable(false);                    graph.setCellsSelectable(false);                    graph.setEnabled(false);                    mxIGraphLayout layout = new mxHierarchicalLayout(graph);                    layout.execute(parent);              } finally {                    graph.getModel().endUpdate();                }                graph.getView().setScale(0.9);                mxGraphComponent graphComponent = new mxGraphComponent(graph);                graphComponent.setConnectable(false);                return graphComponent; }
查看完整描述

1 回答

?
搖曳的薔薇

TA貢獻(xiàn)1793條經(jīng)驗(yàn) 獲得超6個(gè)贊

您可以使用 API 文檔mxStyleChange()

mxStyleChange(mxGraphModel graph, java.lang.Object cell, java.lang.String style)

要了解有關(guān)布局的更多信息,請(qǐng)?jiān)诖颂幉榭?/a>,這將幫助您定義樣式。這些形狀也可能很有用:

API文檔很廣泛,您應(yīng)該始終查看那里。希望這對(duì)您有所幫助


查看完整回答
反對(duì) 回復(fù) 2022-09-22
  • 1 回答
  • 0 關(guān)注
  • 192 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)