Hello Andreas:

On 9/17/07, Andreas Martens  wrote:
> if something changes the document (e.g. insert text, change formatting,
> apply numbering!) automatically the input cursor becomes visible again.
> At the end of such action a method UpdateCrsr() is called which
> calculates the (graphical) position of the input cursor. Afterwards it
> calls a method MakeVisible() to scroll the displayed area if necessary.
> You describe it yourself, if you place the cursor this automatic
> scrolling does not happen.

Yes thats exactly how it behaves... though I am not inserting text,
changing formatting
or applying numbering, i am merely building a hierachy of the document
structure in terms of the numbering level (everything is "read"
activity ) - and storing this hierarchy into a vector that in turn
refreshes a JList list box....... see the brief extract of code below
-  [1]

>Your subject ".. mysterious cursor movement"
> is misleading.
> There is no cursor movement, there is an automatic
> scrolling to make the cursor visible again.

Sorry for the misleading subject.. it was a bit late in the night.. i
thought it was
something to do the view cursor  :-)

> I have to admit that sometimes this could be unwanted, but sometimes it
> is quiet helpful.

Is there anyway i can suppress the automatic scrolling back behaviour... ?

it seems like a usability issue to me..., maybe even a bug, since I am
not really
writing anything into the document.

The  list box refresh code runs in a swing timer class that  runs
every 10 seconds...

At the moment its quite disconcerting for the user when the document
seems to jump and scroll  randomly... when all they are doing is
scrolling through the document using the mouse....(either using the
mouse wheel or by dragging the scroll bar...)

thanks

ashok


[1] - paragraph enumeration code :

while (paraEnum.hasMoreElements()) {
.....
  objNextElement = paraEnum.nextElement();
  //get service info
  xInfo = UnoRuntime.queryInterface(XServiceInfo.class, objNextElement);
  if (xInfo.supportsService("com.sun.star.text.Paragraph")) {
      XPropertySet xSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xInfo);
          nLevel =
AnyConverter.toShort(xSet.getPropertyValue("ParaChapterNumberingLevel"));
          if (nLevel >= 0 ){
                        ....
              XTextContent xContent = ooDocument.getTextContent(objNextElement);
              XTextRange aTextRange =   xContent.getAnchor();
              String strHeading = aTextRange.getString();
              //this is the structure added to the vector which
refreshes the JList box...
              //the object also stores the text range of the heading....
              DocStructureElement element = new
DocStructureElement(strHeading, nLevel, aTextRange );
              vectorDocumentHeadings.addElement(element);       
          }

    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to