⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapmousesupport.java

📁 OpenMap是一个基于JavaBeansTM的开发工具包。利用OpenMap你就能够快速构建用于访问legacy数据库的应用程序与applets。OpenMap提供了允许用户查看和操作地理空间信息的
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
            }        }        boolean ignoreConsumed = !consumed                || (consumed && ((proxyDistributionMask & PROXY_ACK_CONSUMED_MOUSE_RELEASED) == 0));        if (proxy != null && ignoreConsumed && !evt.isShiftDown()) {            proxy.mouseReleased(evt);            consumed = true;        }        return consumed;    }    /**     * Handle a mouseClicked MouseListener event. If the     * priorityListener is set, it automatically gets the clicked     * event. If it is not set, the other listeners get a shot at the     * event according to the consumeEvent mode.     *      * @param evt MouseEvent to be handled.     */    public boolean fireMapMouseClicked(MouseEvent evt) {        if (DEBUG) {            Debug.output("MapMouseSupport: fireMapMouseClicked");        }        clickHappened = true;        boolean consumed = false;        evt = new MapMouseEvent(getParentMode(), evt);        if (priorityListener != null && evt.getClickCount() > 1) {            priorityListener.mouseClicked(evt);            consumed = true;        }        priorityListener = null;        if (proxy == null || evt.isShiftDown()                || (proxyDistributionMask & PROXY_DISTRIB_MOUSE_CLICKED) > 0) {            Iterator it = iterator();            while (it.hasNext() && !consumed) {                MapMouseListener target = (MapMouseListener) it.next();                consumed = target.mouseClicked(evt) && consumeEvents;                if (consumed) {                    priorityListener = target;                }            }        }        boolean ignoreConsumed = !consumed                || (consumed && ((proxyDistributionMask & PROXY_ACK_CONSUMED_MOUSE_CLICKED) == 0));        if (proxy != null && ignoreConsumed && !evt.isShiftDown()) {            proxy.mouseClicked(evt);            consumed = true;        }        return consumed;    }    /**     * Handle a mouseEntered MouseListener event.     *      * @param evt MouseEvent to be handled     * @return true if there was a target to send the event to.     */    public boolean fireMapMouseEntered(MouseEvent evt) {        if (DEBUG) {            Debug.output("MapMouseSupport: fireMapMouseEntered");        }        boolean consumed = false;        if (proxy == null || evt.isShiftDown()                || (proxyDistributionMask & PROXY_DISTRIB_MOUSE_ENTERED) > 0) {            evt = new MapMouseEvent(getParentMode(), evt);            Iterator it = iterator();            while (it.hasNext()) {                ((MapMouseListener) it.next()).mouseEntered(evt);                consumed = true;            }        }        if (proxy != null && !evt.isShiftDown()) {            proxy.mouseEntered(evt);            consumed = true;        }        return consumed;    }    /**     * Handle a mouseExited MouseListener event.     *      * @param evt MouseEvent to be handled     * @return true if there was a target to send the event to.     */    public boolean fireMapMouseExited(MouseEvent evt) {        if (DEBUG) {            Debug.output("MapMouseSupport: fireMapMouseExited");        }        boolean consumed = false;        if (proxy == null || evt.isShiftDown()                || (proxyDistributionMask & PROXY_DISTRIB_MOUSE_EXITED) > 0) {            evt = new MapMouseEvent(getParentMode(), evt);            Iterator it = iterator();            while (it.hasNext()) {                ((MapMouseListener) it.next()).mouseExited(evt);                consumed = true;            }        }        if (proxy != null && !evt.isShiftDown()) {            proxy.mouseExited(evt);            consumed = true;        }        return consumed;    }    /**     * Handle a mouseDragged MouseListener event.     *      * @param evt MouseEvent to be handled     * @return false.     */    public boolean fireMapMouseDragged(MouseEvent evt) {        if (DEBUG_DETAIL) {            Debug.output("MapMouseSupport: fireMapMouseDragged");        }        clickHappened = false;        boolean consumed = false;        if (proxy == null || evt.isShiftDown()                || (proxyDistributionMask & PROXY_DISTRIB_MOUSE_DRAGGED) > 0) {            evt = new MapMouseEvent(getParentMode(), evt);            Iterator it = iterator();            while (it.hasNext() && !consumed) {                consumed = ((MapMouseListener) it.next()).mouseDragged(evt)                        && consumeEvents;            }        }        boolean ignoreConsumed = !consumed                || (consumed && ((proxyDistributionMask & PROXY_ACK_CONSUMED_MOUSE_DRAGGED) == 0));        if (proxy != null && ignoreConsumed && !evt.isShiftDown()) {            proxy.mouseDragged(evt);            consumed = true;        }        return consumed;    }    /**     * Handle a mouseMoved MouseListener event. If the moved event is     * consumed, the rest of the listeners that didn't have a chance     * to respond get called in the mouse moved method without     * arguments.     *      * @param evt MouseEvent to be handled     * @return true if the event was consumed.     */    public boolean fireMapMouseMoved(MouseEvent evt) {        if (DEBUG_DETAIL) {            Debug.output("MapMouseSupport: fireMapMouseMoved");        }        boolean consumed = false;        if (proxy == null || evt.isShiftDown()                || (proxyDistributionMask & PROXY_DISTRIB_MOUSE_MOVED) > 0) {            evt = new MapMouseEvent(getParentMode(), evt);            Iterator it = iterator();            while (it.hasNext()) {                MapMouseListener target = (MapMouseListener) it.next();                if (consumed) {                    target.mouseMoved();                } else {                    consumed = target.mouseMoved(evt);                }            }        }        // consumed was used above to figure out whether to send        // mouseMoved(evt) or mouseMoved(), now we have to set it        // based on whether the MouseMode should be consuming events.        consumed &= consumeEvents;        boolean ignoreConsumed = !consumed                || (consumed && ((proxyDistributionMask & PROXY_ACK_CONSUMED_MOUSE_MOVED) == 0));        if (proxy != null && ignoreConsumed && !evt.isShiftDown()) {            proxy.mouseMoved(evt);            consumed = true;        }        return consumed;    }    /**     * Request to have the parent MapMouseMode act as a proxy for a     * MapMouseMode that wants to remain hidden. Can be useful for     * directing events to one object.     *      * @param mmm the hidden MapMouseMode for this MapMouseMode to     *        send events to.     * @param pdm the proxy distribution mask to use, which lets this     *        support object notify its targets of events if the     *        parent is acting as a proxy.     * @return true if the proxy setup (essentially a lock) is     *         successful, false if the proxy is already set up for     *         another listener.     */    protected synchronized boolean setProxyFor(MapMouseMode mmm, int pdm) {        proxyDistributionMask = pdm;        if (proxy == null || proxy == mmm) {            proxy = mmm;            return true;        }        return false;    }    /**     * Can check if the MapMouseMode is acting as a proxy for another     * MapMouseMode.     */    public synchronized boolean isProxyFor(MapMouseMode mmm) {        return proxy == mmm;    }    /**     * Release the proxy lock on the MapMouseMode. Resets the proxy     * distribution mask.     */    protected synchronized void releaseProxy() {        proxy = null;        proxyDistributionMask = 0;    }    /**     * Set the mask that dictates which events get sent to this     * support object's targets even if the parent mouse mode is     * acting as a proxy.     */    protected void setProxyDistributionMask(int mask) {        proxyDistributionMask = mask;    }    /**     * Get the mask that dictates which events get sent to this     * support object's targets even if the parent mouse mode is     * acting as a proxy.     */    protected int getProxyDistributionMask() {        return proxyDistributionMask;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -