You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by th...@kodak.com on 2005/11/01 02:40:49 UTC

RE: Fw: Non-editable Text Element

Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on 
10/31/2005 12:18:24 PM:

> What if you don't want to highlight/edit text, but you want to be able
> to drag it around the canvas? :)

   Typically you create a rect of the same size and make it transparent
then move a group (text then rect).  You can use getBBox to get the 
size of the text element (to make creating the rect easier).

> -----Original Message-----
> From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
> Sent: Monday, October 31, 2005 12:08 PM
> To: batik-users@xmlgraphics.apache.org
> Cc: batik-users@xmlgraphics.apache.org
> Subject: Re: Fw: Non-editable Text Element
> 
> Hi Ted,
> 
>         Try setting, pointer-events="none" on the text element.  That
> will
> turn text selection off.
> 
> Ted.Clement@apcc.com wrote on 10/31/2005 11:31:40 AM:
> 
> > By the way ....I have tried using the    editable="false"   tag.  It 
> seems
> > to have no effect.
> > 
> > ----- Forwarded by Ted Clement/CORP/NAM/APCC on 10/31/2005 11:30 AM 
> -----
> > 
> >              Ted.Clement@apcc. 
> >              com 
> > To 
> >              10/28/2005 03:14 batik-users@xmlgraphics.apache.org 
> >              PM cc 
> > 
> > Subject 
> >              Please respond to         Non-editable Text Element 
> >              batik-users@xmlgr 
> >              aphics.apache.org 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Hello,
> > 
> > I have an element composed of rectangles and a text field. I want the 
> text
> > to be read-only. When this element is rendered on the canvas
> > and the mouse crosses the text field, the cursor changes into "text
> edit
> > mode".  If the mouse button is clicked at this point, I get an
> exception
> > (see below).
> > 
> > How can I specify the text element  as non-editable?   Is it necessary
> 
> to
> > override the TextSelectionManager MouseListener?
> > 
> > 
> >      <g id="GENERIC_DEVICE" transform="translate(50,30)"
> > apcTag="canvasElement">
> >       <g apcTag="normal" display="none" style="font-size:11;
> > fill:rgb(230,230,245); font-family:&apos;Arial&apos;;
> > stroke:rgb(230,230,245); stroke-width:1.5;">
> >         <rect x="0" y="0" width="35.2494" style="stroke:none;" 
> height="45"
> > />
> >         <rect x="0" y="0" width="35.2494" style="fill:none;
> > stroke:rgb(0,130,16);" height="45" />
> >         <text id="userLabel" x="2.1247000694274902" y="9"
> > style="font-size:9; fill:black; stroke:none;" 
> xml:space="preserve">Device
> >         </text>
> >       </g>
> >      </g>
> > 
> > java.lang.NullPointerException
> >       at
> > 
> org.apache.batik.gvt.text.ConcreteTextSelector.checkSelectGesture(Unknow
> n
> > Source)
> >       at
> > org.apache.batik.gvt.text.ConcreteTextSelector.mousePressed(Unknown 
> Source)
> >       at
> > 
> org.apache.batik.swing.gvt.TextSelectionManager$MouseListener.mousePress
> ed(Unknown
> > 
> >  Source)
> >       at
> >
> org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(Unknown
> > Source)
> >       at
> >
> org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(Unknown
> > Source)
> >       at
> > org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown 
> Source)
> >       at 
> org.apache.batik.gvt.event.AWTEventDispatcher.mousePressed(Unknown
> > Source)
> >       at org.apache.batik.swing.svg.JSVGComponent$18.run(Unknown
> Source)
> >       at org.apache.batik.util.RunnableQueue.run(Unknown Source)
> >       at java.lang.Thread.run(Unknown Source)
> > 
> > Thanks,
> > Ted
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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