boolean (int x, int y, int id, Object component, Object part) { if ((part == "up") || (part == "down") || (part == "left") || (part == "right")) { if ((id == MouseEvent.MOUSE_ENTERED) || (id == MouseEvent.MOUSE_EXITED) || (id == MouseEvent.MOUSE_PRESSED) || (id == MouseEvent.MOUSE_RELEASED)) { if (id == MouseEvent.MOUSE_PRESSED) { if (processScroll(component, part)) { setTimer(300L); return true; } } else { if (id == MouseEvent.MOUSE_RELEASED) { setTimer(0L); } repaint(component, null, part); } } } else if ((part == "uptrack") || (part == "downtrack") || (part == "lefttrack") || (part == "righttrack")) { if (id == MouseEvent.MOUSE_PRESSED) { if (processScroll(component, part)) { setTimer(300L); } } else if (id == MouseEvent.MOUSE_RELEASED) { setTimer(0L); } } else if ((part == "vknob") || (part == "hknob")) { if (id == MouseEvent.MOUSE_PRESSED) { Rectangle port = getRectangle(component, ":port"); Rectangle view = getRectangle(component, ":view"); if (part == "hknob") { referencex = x - view.x * (port.width - 2 * block) / view.width; } else { referencey = y - view.y * (port.height - 2 * block) / view.height; } } else if (id == MouseEvent.MOUSE_DRAGGED) { Rectangle port = getRectangle(component, ":port"); Rectangle view = getRectangle(component, ":view"); if (part == "hknob") { int viewx = (x - referencex) * view.width / (port.width - 2 * block); viewx = Math.max(0, Math.min(viewx, view.width - port.width + 2)); if (view.x != viewx) { view.x = viewx; repaint(component, null, "horizontal"); } } else { int viewy = (y - referencey) * view.height / (port.height - 2 * block); viewy = Math.max(0, Math.min(viewy, view.height - port.height + 2)); if (view.y != viewy) { view.y = viewy; repaint(component, null, "vertical"); } } } } else if (part == "corner") { part = "corner"; // compiler bug } else { if (id == MouseEvent.MOUSE_PRESSED) { Rectangle port = getRectangle(component, ":port"); setReference(component, port.x + 1, port.y + 1); } return false; } return true; }