Re: Cloned 'use' subtrees ids

2005-03-05 Thread Thomas DeWeese
Marcel Ruff wrote:
   
  
  your number
   

One more question arose:
The  is only a reference pointing to the symbol
in my library, it is not a deep copy (clone),
if i understand this correctly.
   Correct.
If i now switch on the light in one of the boeing747
just landed but want another airborne boeing747 to remain dark,
how can i achieve this?
  One option is to use airplanes.svg#boeing747_on and
airplanes.svg#boeing747_off.  This might work well if there are
only a few states (and has the advantage that the rendering of
the states can be quite different if wanted).  This will not work
well if you want to have 53 different colors or something.
Is there a  variant which forces a copy instead of
a reference?
   No, but you can either use Java or 'getURL' to fetch the
airplanes.svg document and use 'cloneNode(true)' to get a deep
clone of the airplane symbol.  Then you do need to be careful
of Id's etc.  In this case get the reference (can't really be
a 'symbol' element since that inhibits rendering) clone the tree
and append the clone under the group instead of the 'use' element.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cloned 'use' subtrees ids

2005-03-05 Thread Marcel Ruff
Hi again,

   
  
  your number
   
One more question arose:
The  is only a reference pointing to the symbol
in my library, it is not a deep copy (clone),
if i understand this correctly.
If i now switch on the light in one of the boeing747
just landed but want another airborne boeing747 to remain dark,
how can i achieve this?
Is there a  variant which forces a copy instead of
a reference?
thanks for an idea,
Marcel
--
http://www.xmlBlaster.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: xml-batik/sources/org/apache/batik/swing/gvt JGVTComponent.java TextSelectionManager.java

2005-03-05 Thread deweese
deweese 2005/03/05 11:31:09

  Modified:sources/org/apache/batik/gvt/renderer
StrokingTextPainter.java
   sources/org/apache/batik/gvt/text ConcreteTextSelector.java
   sources/org/apache/batik/swing/gvt JGVTComponent.java
TextSelectionManager.java
  Log:
  1) Rationalized Text Selection code.  Copy to clipboard is now done
 by JGVTComponent only if 'unix style' text selection is requested
 (default).
  
  Revision  ChangesPath
  1.55  +4 -4  
xml-batik/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java
  
  Index: StrokingTextPainter.java
  ===
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- StrokingTextPainter.java  15 Dec 2004 10:50:30 -  1.54
  +++ StrokingTextPainter.java  5 Mar 2005 19:31:09 -   1.55
  @@ -1446,7 +1446,7 @@
   public Mark selectLast(TextNode node) {
   AttributedCharacterIterator aci;
   aci = node.getAttributedCharacterIterator();
  -TextHit textHit = new TextHit(aci.getEndIndex(), false);
  +TextHit textHit = new TextHit(aci.getEndIndex()-1, false);
   return  new BasicTextPainter.BasicMark(node, textHit);
   }
   
  @@ -1469,8 +1469,8 @@
   start = (BasicTextPainter.BasicMark) startMark;
   finish = (BasicTextPainter.BasicMark) finishMark;
   } catch (ClassCastException cce) {
  -throw new
  -Error("This Mark was not instantiated by this TextPainter 
class!");
  +throw new Error
  +("This Mark was not instantiated by this TextPainter 
class!");
   }
   
   TextNode textNode = start.getTextNode();
  
  
  
  1.21  +1 -44 
xml-batik/sources/org/apache/batik/gvt/text/ConcreteTextSelector.java
  
  Index: ConcreteTextSelector.java
  ===
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/gvt/text/ConcreteTextSelector.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ConcreteTextSelector.java 18 Aug 2004 07:14:40 -  1.20
  +++ ConcreteTextSelector.java 5 Mar 2005 19:31:09 -   1.21
  @@ -121,7 +121,6 @@
   Shape  shape = node.getHighlightShape();
   dispatchSelectionEvent(new SelectionEvent
   (selection, SelectionEvent.SELECTION_DONE, shape));
  -copyToClipboard(selection);
   }
   
   public void clearSelection() {
  @@ -129,7 +128,6 @@
   return;
   dispatchSelectionEvent(new SelectionEvent
   (null, SelectionEvent.SELECTION_CLEARED, null));
  -// copyToClipboard(null);
   selectionNode = null;
   }
   
  @@ -207,7 +205,6 @@
   new SelectionEvent(oldSelection,
   SelectionEvent.SELECTION_DONE,
   newShape));
  -copyToClipboard(oldSelection);
   } else
   
   if (isSelectContinueGesture(evt)) {
  @@ -235,7 +232,6 @@
   .addTreeGraphicsNodeChangeListener(this);
   }
   selectionNode = source;
  -
   ((Selectable) source).selectAll(p.getX(), p.getY());
   Object oldSelection = getSelection();
   Shape newShape =
  @@ -244,7 +240,6 @@
   new SelectionEvent(oldSelection,
   SelectionEvent.SELECTION_DONE,
   newShape));
  -copyToClipboard(oldSelection);
   }
   }
   }
  @@ -341,44 +336,6 @@
   }
   }
   
  -private void copyToClipboard(final Object o) {
  - //
  - // HACK: getSystemClipboard sometimes deadlocks on linux when called
  - // from the AWT Thread. The Thread creation prevents that.
  - //
  - new Thread() {
  - public void run() {
  - // first see if we can access the clipboard
  - SecurityManager securityManager = System.getSecurityManager();
  - boolean canAccessClipboard = true;
  - if (securityManager != null) {
  - try {
  - securityManager.checkSystemClipboardAccess();
  - } catch (SecurityException e) {
  - canAccessClipboard = false;
  - }
  - }
  - if (canAccessClipboard) {
  - String label = "";
  - if (o instanceof CharacterIterator) {
  - CharacterIterator iter = (CharacterIterator) o;
  - char[] cbuff = new 
char[iter.getEndIn