xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vyang <vy...@apt-cafm.com>
Subject invokelater thread issue?
Date Thu, 23 Aug 2007 19:47:43 GMT

Hello,

It seems I'm having some issue with invokelater threading.  I have a method
that does multiple invokelater calls.  It seems to work fine when this
method is called once, however when inside a loop it seems the invokelater
are called out of order.  This results in the text element being null when
the tspan tries to grab it.  My coding is as follows:

private void placeCellText() {
final TextBoxElement textBoxElement = new TextBoxElement(textBoxElementID,
elementName, 
                x, y, layer, null, textBoxAttribute);

textBoxElement.addNew(drawingPanel, parent.getConnection());  >> this method
calls invokelater which creates the text element

Vector textContentClone = (Vector)temp.clone();
                
while (textContentClone.size() > 0) {
     TextBoxElementContent firstTextBoxElementContent =
(TextBoxElementContent)textContentClone.remove(0);
     addTexts(textBoxElement, firstTextBoxElementContent); >> this method
calls invokelater which adds tspan element to text element above

     for (int i = 0; i < textContentClone.size(); i++) {

          if (firstTextBoxElementContent.getRow() ==
secondTextBoxElementContent.getRow()) {
          addTexts(textBoxElement, firstTextBoxElementContent); >> this
method calls invokelater which adds tspan element to text element above
          }
     }
}

Is there a way to make sure the first invokelater is done executing before
the next one begins.  Also is this a good way to use invokelater threading?

vyang
-- 
View this message in context: http://www.nabble.com/invokelater-thread-issue--tf4319567.html#a12300668
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message