How can I set the hotspot (double) of the class mxCellMarker for a specific cell without changing the default value.

asked 11 Oct '11, 12:27

dave's gravatar image

dave
75
accept rate: 0%


Try overriding mxCellMarker.intersects.

link

answered 12 Oct '11, 23:27

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

Thank you, it works fine now:

\n
mxCellMarker cm = new mxCellMarker(graphComponent){\n\n    protected boolean intersects(mxCellState state, MouseEvent e)\n        {\n            if (isHotspotEnabled())\n            {\n                mxCell cell = (mxCell) state.getCell();\n\n                // different hotspot example\n                if(cell.getStyle() != null && cell.getStyle().contains("hotspot=1.0")){\n                  return mxUtils.intersectsHotspot(state, e.getX(), e.getY(),\n                        1.0, mxConstants.MIN_HOTSPOT_SIZE,\n                        mxConstants.MAX_HOTSPOT_SIZE);                        \n                }\n\n                return mxUtils.intersectsHotspot(state, e.getX(), e.getY(),\n                        hotspot, mxConstants.MIN_HOTSPOT_SIZE,\n                        mxConstants.MAX_HOTSPOT_SIZE);\n            }\n\n            return true;\n        }\n    };\n    cm.setHotspotEnabled(true);         \n    graphComponent.getConnectionHandler().setMarker(cm);\n
link

answered 13 Oct '11, 12:36

dave's gravatar image

dave
75
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×194
×6

Asked: 11 Oct '11, 12:27

Seen: 1,176 times

Last updated: 13 Oct '11, 12:36