1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
public void mouseMoved(MouseEvent e)
{
String handel;
Document doc;
int pos = textzone.viewToModel(e.getPoint());
elem = textzone.getStyledDocument().getCharacterElement(pos);
as = elem.getAttributes();
int posdepart = pos;
for(; StyleConstants.getBidiLevel(as) == 20; as = textzone.getStyledDocument().getCharacterElement(posdepart).getAttributes())
{
posdepart--;
}
handel = null;
doc = textzone.getDocument();
try
{
handel = doc.getText(0, doc.getLength()).substring(posdepart, doc.getText(0, doc.getLength()).indexOf(" ", posdepart + 1));
}
catch(BadLocationException ex) {}
if(handel == null)
{
return;
}
handel = handel.replaceAll(">", "").trim();
textzone.setCursor(new Cursor(12));
if(StyleConstants.getBidiLevel(as) == 21 || StyleConstants.getBidiLevel(as) == 22)
{
textzone.setCursor(new Cursor(12));
} else
{
//hyperlinkReceiver.hidePopupInfos();
textzone.setCursor(new Cursor(0));
}
} |
Partager