equal
deleted
inserted
replaced
681 * follow the reference specified by a link. |
681 * follow the reference specified by a link. |
682 * |
682 * |
683 * @param e the mouse event |
683 * @param e the mouse event |
684 * @see MouseListener#mouseClicked |
684 * @see MouseListener#mouseClicked |
685 */ |
685 */ |
|
686 @SuppressWarnings("deprecation") |
686 public void mouseClicked(MouseEvent e) { |
687 public void mouseClicked(MouseEvent e) { |
687 JEditorPane editor = (JEditorPane) e.getSource(); |
688 JEditorPane editor = (JEditorPane) e.getSource(); |
688 |
689 |
689 if (! editor.isEditable() && editor.isEnabled() && |
690 if (! editor.isEditable() && editor.isEnabled() && |
690 SwingUtilities.isLeftMouseButton(e)) { |
691 SwingUtilities.isLeftMouseButton(e)) { |
699 // ignore the drags |
700 // ignore the drags |
700 public void mouseDragged(MouseEvent e) { |
701 public void mouseDragged(MouseEvent e) { |
701 } |
702 } |
702 |
703 |
703 // track the moving of the mouse. |
704 // track the moving of the mouse. |
|
705 @SuppressWarnings("deprecation") |
704 public void mouseMoved(MouseEvent e) { |
706 public void mouseMoved(MouseEvent e) { |
705 JEditorPane editor = (JEditorPane) e.getSource(); |
707 JEditorPane editor = (JEditorPane) e.getSource(); |
706 if (!editor.isEnabled()) { |
708 if (!editor.isEnabled()) { |
707 return; |
709 return; |
708 } |
710 } |
771 |
773 |
772 /** |
774 /** |
773 * Returns a string anchor if the passed in element has a |
775 * Returns a string anchor if the passed in element has a |
774 * USEMAP that contains the passed in location. |
776 * USEMAP that contains the passed in location. |
775 */ |
777 */ |
|
778 @SuppressWarnings("deprecation") |
776 private String getMapHREF(JEditorPane html, HTMLDocument hdoc, |
779 private String getMapHREF(JEditorPane html, HTMLDocument hdoc, |
777 Element elem, AttributeSet attr, int offset, |
780 Element elem, AttributeSet attr, int offset, |
778 int x, int y) { |
781 int x, int y) { |
779 Object useMap = attr.getAttribute(HTML.Attribute.USEMAP); |
782 Object useMap = attr.getAttribute(HTML.Attribute.USEMAP); |
780 if (useMap != null && (useMap instanceof String)) { |
783 if (useMap != null && (useMap instanceof String)) { |
811 /** |
814 /** |
812 * Returns true if the View representing <code>e</code> contains |
815 * Returns true if the View representing <code>e</code> contains |
813 * the location <code>x</code>, <code>y</code>. <code>offset</code> |
816 * the location <code>x</code>, <code>y</code>. <code>offset</code> |
814 * gives the offset into the Document to check for. |
817 * gives the offset into the Document to check for. |
815 */ |
818 */ |
|
819 @SuppressWarnings("deprecation") |
816 private boolean doesElementContainLocation(JEditorPane editor, |
820 private boolean doesElementContainLocation(JEditorPane editor, |
817 Element e, int offset, |
821 Element e, int offset, |
818 int x, int y) { |
822 int x, int y) { |
819 if (e != null && offset > 0 && e.getStartOffset() == offset) { |
823 if (e != null && offset > 0 && e.getStartOffset() == offset) { |
820 try { |
824 try { |