brcomponent.java

来自「java调用ie浏览器demo源码,可以用在windows或者linux」· Java 代码 · 共 1,072 行 · 第 1/3 页

JAVA
1,072
字号
        super.processMouseEvent(e);
        if( !e.isConsumed() ){
            checkMouse(e);
        }
    }
    
    @Override
    protected void processMouseMotionEvent(MouseEvent e) {
        super.processMouseMotionEvent(e);
        if( !e.isConsumed() ){
            checkMouse(e);
        }
    }
    protected void processMouseWheelEvent(MouseEvent e) {
        super.processMouseMotionEvent(e);
        if( !e.isConsumed() ){
            checkMouse(e);
        }
    }


    /**
     * Utility field used by bound properties.
     */
    protected java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this);

    /**
     * Adds a PropertyChangeListener to the listener list.
     * @param ls The listener to add.
     */
    @Override
    public void addPropertyChangeListener(java.beans.PropertyChangeListener ls) {
        propertyChangeSupport.addPropertyChangeListener(ls);
    }

    /**
     * Removes a PropertyChangeListener from the listener list.
     * @param ls The listener to remove.
     */
    @Override
    public void removePropertyChangeListener(java.beans.PropertyChangeListener ls) {
        propertyChangeSupport.removePropertyChangeListener(ls);
    }

    /**
     * Holds value of property navigatedURL to show in address bar.
     */
    private String navigatedURL;
    
    /**
     * Getter for property navigatedURL.
     * 
     * @return Value of property navigatedURL.
     */
    public String getNavigatedURL() {
        return this.navigatedURL;
    }

    /**
     * Setter for property navigatedURL.
     * 
     * @param addressURL New value of property navigatedURL.
     */
    protected void setNavigatedURL(String addressURL) {
        String oldAddressURL = this.navigatedURL;
        this.navigatedURL = addressURL;
        propertyChangeSupport.firePropertyChange ("navigatedURL", oldAddressURL, addressURL);
    }

    /**
     * Holds value of property statusText to show in status bar.
     */
    private String statusText;

    /**
     * Getter for property statusText.
     * @return Value of property statusText.
     */
    public String getStatusText() {
        return this.statusText;
    }

    /**
     * Setter for property statusText.
     * @param statusText New value of property statusText.
     */
    protected void setStatusText(String statusText) {
        String oldStatusText = this.statusText;
        this.statusText = statusText;
        propertyChangeSupport.firePropertyChange ("statusText", oldStatusText, statusText);
    }

    /**
     * Holds value of property windowTitle to show in window title.
     */
    private String windowTitle;

    /**
     * Getter for property windowTitle.
     * @return Value of property windowTitle.
     */
    public String getWindowTitle() {
        return this.windowTitle;
    }

    /**
     * Setter for property windowTitle.
     * @param windowTitle New value of property windowTitle.
     */
    protected void setWindowTitle(String windowTitle) {
        String oldWindowTitle = this.windowTitle;
        this.windowTitle = windowTitle;
        propertyChangeSupport.firePropertyChange ("windowTitle", oldWindowTitle, windowTitle);
    }

    /**
     * Holds value of property progressBar.
     */
    private String progressBar;

    /**
     * Getter for property progressBar.
     * @return Value of property progressBar.
     */
    public String getProgressBar() {
        return this.progressBar;
    }

    /**
     * Setter for property progressBar.
     * @param progressBar New value of property progressBar.
     */
    protected void setProgressBar(String progressBar) {
        String oldProgressBar = this.progressBar;
        this.progressBar = progressBar;
        propertyChangeSupport.firePropertyChange ("progressBar", oldProgressBar, progressBar);
    }

    /**
     * Holds value of property debugDrawBorder.
     */
    private boolean debugDrawBorder;

    /**
     * Getter for property debugDrawBorder.
     * @return Value of property debugDrawBorder.
     */
    public boolean isDebugDrawBorder() {
        return this.debugDrawBorder;
    }

    /**
     * Setter for property debugDrawBorder.
     * @param debugDrawBorder New value of property debugDrawBorder.
     */
    public void setDebugDrawBorder(boolean debugDrawBorder) {
        boolean old = this.debugDrawBorder;
        this.debugDrawBorder = debugDrawBorder;
        propertyChangeSupport.firePropertyChange("debugDrawBorder", old, debugDrawBorder);
    }
    
    private boolean editable;    
    /**
     * Indicates whether or not this stURL component is editable.
     * @return     <code>true</code> if this stURL component is
     *                  editable; <code>false</code> otherwise.
     * @see        BrComponent#setEditable
     */
    public boolean isEditable() {
	return editable;
    }

    /**
     * Sets the flag that determines whether or not this
     * stURL component is editable.
     * <p>
     * If the flag is set to <code>true</code>, this stURL component
     * becomes user editable. If the flag is set to <code>false</code>,
     * the user cannot change the stURL of this stURL component.
     * By default, non-editable stURL components have a background color
     * of SystemColor.control.  This default can be overridden by
     * calling setBackground.
     *
     * @param     b   a flag indicating whether this stURL component
     *                is user editable.
     * @see       BrComponent#isEditable
     */
    public void setEditable(boolean b) {
        if (editable == b) {
            return;
        }
        editable = b;
        if( isPeerReady() ) {
            brPeer.setEditable(b);
        }
    }

    /**
     * Holds value of property securityIcon.
     */
    private String securityIcon;

    /**
     * Getter for property securityIcon.
     * @return Value of property securityIcon.
     */
    public String getSecurityIcon() {
        return this.securityIcon;
    }

    /**
     * Setter for property securityIcon.
     * One of secureLockIconXXXX const
     * @param securityIcon New value of property securityIcon.
     */
    protected void setSecurityIcon(String securityIcon) {
        String oldSecurityIcon = this.securityIcon;
        this.securityIcon = securityIcon;
        propertyChangeSupport.firePropertyChange ("securityIcon", oldSecurityIcon, securityIcon);
    }

    /**
     * Holds value of property mandatoryDispose.
     */
    private boolean mandatoryDispose = true;

    /**
     * Getter for property mandatoryDispose.
     * @return Value of property mandatoryDispose.
     */
    public boolean isMandatoryDispose() {
        return mandatoryDispose;
    }

    /**
     * Setter for property mandatoryDispose.
     * @param mandatoryDispose New value of property mandatoryDispose.
     */
    public void setMandatoryDispose(boolean mandatoryDispose) {
        boolean old = this.mandatoryDispose;
        this.mandatoryDispose = mandatoryDispose;
        propertyChangeSupport.firePropertyChange("mandatoryDispose", old, mandatoryDispose);
    }

    /**
     * Holds value of property goBackEnable.
     */
    private boolean goBackEnable;

    /**
     * Getter for property goBackEnable.
     * @return Value of property goBackEnable.
     */
    public boolean isGoBackEnable() {
        return this.goBackEnable;
    }

    /**
     * Setter for property goBackEnable.
     * @param goBackEnable New value of property goBackEnable.
     */
    public void setGoBackEnable(boolean goBackEnable) {
        boolean old = this.goBackEnable;
        this.goBackEnable = goBackEnable;
        propertyChangeSupport.firePropertyChange("goBackEnable", old, goBackEnable);
    }

    /**
     * Holds value of property goForwardEnable.
     */
    private boolean goForwardEnable;

    /**
     * Getter for property goForwardEnable.
     * @return Value of property goForwardEnable.
     */
    public boolean isGoForwardEnable() {
        return this.goForwardEnable;
    }

    /**
     * Setter for property goForwardEnable.
     * @param goForwardEnable New value of property goForwardEnable.
     */
    public void setGoForwardEnable(boolean goForwardEnable) {
        boolean old = this.goForwardEnable;
        this.goForwardEnable = goForwardEnable;
        propertyChangeSupport.firePropertyChange("goForwardEnable", old, goForwardEnable);
    }

    /**
     * Holds value of property toolbarChanged.
     */
    private boolean toolbarChanged;

    /**
     * Getter for property toolbarChanged.
     * @return Value of property toolbarChanged.
     */
    public boolean isToolbarChanged() {
        return this.toolbarChanged;
    }

    /**
     * Setter for property toolbarChanged.
     * @param toolbarChanged New value of property toolbarChanged.
     */
    public void setToolbarChanged(boolean toolbarChanged) {
        boolean old = this.toolbarChanged;
        this.toolbarChanged = toolbarChanged;
        propertyChangeSupport.firePropertyChange("toolbarChanged", old, toolbarChanged);
    }

    /**
     * Holds value of property documentReady.
     */
    private boolean documentReady;

    /**
     * Getter for property documentReady.
     * @return Value of property documentReady.
     */
    public boolean isDocumentReady() {
        return this.documentReady;
    }

    /**
     * Setter for property documentReady.
     * @param documentReady New value of property documentReady.
     */
    protected void setDocumentReady(boolean documentReady) {
        boolean old = this.documentReady;
        this.documentReady = documentReady;
        propertyChangeSupport.firePropertyChange("documentReady", old, documentReady);
    }
    
    public long getNativeHandle() {
        return brPeer.getNativeHandle();
    }
    
    public int  setActionFiler(int flag, boolean busyState)
    {
        return brPeer.setActionFiler(flag, busyState);
    }

    @Override
    public boolean isFocusOwner() {
        return super.isFocusOwner() || ( isPeerReady() && brPeer.hasFocus() );
    }
   
    public BrComponentPeer getBrPeer()
    {
        return brPeer;
    }
}
    

⌨️ 快捷键说明

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