MCPcopy Create free account
hub / github.com/benfry/processing4 / mousePressed

Method mousePressed

app/src/processing/app/ui/EditorHeader.java:97–112  ·  view source on GitHub ↗
(MouseEvent e)

Source from the content-addressed store, hash-verified

95
96 addMouseListener(new MouseAdapter() {
97 public void mousePressed(MouseEvent e) {
98 int x = e.getX();
99 int y = e.getY();
100
101 if ((x > menuLeft) && (x < menuRight)) {
102 popup.show(EditorHeader.this, x, y);
103 } else {
104 Sketch sketch = editor.getSketch();
105 for (Tab tab : tabs) {
106 if (tab.contains(x)) {
107 sketch.setCurrentCode(tab.index);
108 repaint();
109 }
110 }
111 }
112 }
113
114 public void mouseExited(MouseEvent e) {
115 // only clear if it's been set

Callers

nothing calls this directly

Calls 7

setCurrentCodeMethod · 0.95
getXMethod · 0.80
getYMethod · 0.80
getSketchMethod · 0.80
repaintMethod · 0.80
showMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected