[英]Change mouse cursor in jgraphx
如何在jgraphx的mxGraphComponent中更改鼠標光標?
我設法通過覆蓋mxGraphHandler.getCursor來更改默認光標(當它不在任何頂點或邊上時):
new mxGraphHandler(graphComponent) {
@Override
protected Cursor getCursor(MouseEvent e) {
return mxGraphHandler.FOLD_CURSOR;
}
};
但是,當光標位於頂點或邊上時,它仍然會改變。 我在封閉的論壇上找到了一些提示: http : //forum.jgraph.com/questions/3883/change-mouse-cursor-based-on-vertex-mouse-is-over ,但是在其中沒有getCursor(MouseEvent)方法mxGraphHandler,所以我想它已經過時或僅與JS版本有關。
非常感謝您的幫助。
在您的鼠標替代方法中嘗試以下操作-
graphComponent.getGraphControl().setCursor(FOLD_CURSOR);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.