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 Selva <se...@yahoo.co.in> on 2006/05/03 12:57:42 UTC

Re: updating TransformHistory problem

Hi Thomas,

> Do you want to 'undo/redo' moves of your group with lines? 

> Do you want to 'undo/redo' moves of the canvas (whole canvas pan)? 

My requirement is that i should be able to  'undo/redo' moves of the whole
canvas.

> Can you give a complete example of user interaction and what you want 
> the canvas to show? 

Actually my SVGCanvas will have SVG image elements with text elements. text
element will be used to display the name of the image. my image elements are
connected with lines. If user moves the image element, it should move along
with connected lines.

Thanks,
Selva


--
View this message in context: http://www.nabble.com/updating-TransformHistory-problem-t1523168.html#a4208054
Sent from the Batik - Users forum at Nabble.com.


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


Re: updating TransformHistory problem

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

On Mon, 2006-05-15 at 04:54 +0000, Selva wrote:
> svgCanvas.transformHistory.update(_svgCanvas.getRenderingTransform());
> _svgCanvas.previousTransformAction.update();
> _svgCanvas.nextTransformAction.update();
> 
> but when i perform previousTransformAction and nextTransformAction, it's not 
> updating the positions.

Rather than called update(), call actionPerformed(evt) instead.
If you look at the source code, update() is only setting whether the
action will be enabled or not. The real action in on actionPerformed,
since it is a subclass of standard Java Action.

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


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


Re: updating TransformHistory problem

Posted by Selva <se...@yahoo.co.in>.
Hi Thomas,

> > 1. want 'undo/redo' moves of your group with lines? 
> 
>     This requires a totally separate system to track this.  You
> will need to track this yourself.  Probably recording the original
> group transform on mouse down (or what ever starts the move
> operation).

Can you give bit more details on how to undo/redo the moves. because i have 
tried with "mouseup" action. But it's not updating the positions. whenever 
mouse released, i updated the transformHistory using following code.

svgCanvas.transformHistory.update(_svgCanvas.getRenderingTransform());
_svgCanvas.previousTransformAction.update();
_svgCanvas.nextTransformAction.update();

but when i perform previousTransformAction and nextTransformAction, it's not 
updating the positions.

Thanks,
Selva


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


Re: updating TransformHistory problem

Posted by th...@kodak.com.
Hi Selva,

news <ne...@sea.gmane.org> wrote on 05/04/2006 06:19:58 AM:

> Sorry for the mistake i have done in earlier mail thomas. Actually i 
want 
> both 'undo/redo' cases. 
> 
> 1. want 'undo/redo' moves of your group with lines? 

    This requires a totally separate system to track this.  You
will need to track this yourself.  Probably recording the original
group transform on mouse down (or what ever starts the move
operation).

> 2. want 'undo/redo' moves of the canvas (whole canvas pan)? 

    This should work fine with the code below.  However you will
need to come up with your own system for managing the group moves
and canvas moves together so they are undone and redone in the
correct order.

> To achieve this, i have added GVTTreeRendererListener for my SVGCanvas. 
While 
> doing zoom in,zoom out and moving group elements , it's not executing 
> RenderingTransform's gvtRenderingCompleted(). Why it's not executing 
> RenderingCompleted even GVTTreeRendererListener added??

    This works fine for me, so without a stand-alone example that shows 
your
problem I can't help you.


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


Re: updating TransformHistory problem

Posted by Selva <se...@yahoo.co.in>.
Hi Thomas,

Sorry for the mistake i have done in earlier mail thomas. Actually i want 
both 'undo/redo' cases. 

1. want 'undo/redo' moves of your group with lines? 
2. want 'undo/redo' moves of the canvas (whole canvas pan)? 

To achieve this, i have added GVTTreeRendererListener for my SVGCanvas. While 
doing zoom in,zoom out and moving group elements , it's not executing  
RenderingTransform's gvtRenderingCompleted(). Why it's not executing 
RenderingCompleted even GVTTreeRendererListener added??

svgCanvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {

    public void gvtRenderingPrepare(GVTTreeRendererEvent e) {
       System.out.println("Renderer Started...");
    }
    public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
       System.out.println("Renderer Completed...");

       transformHistory.update(svgCanvas.getRenderingTransform());
       previousTransformAction.update();
       nextTransformAction.update();
    }
});

Thanks,
Selva




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


Re: updating TransformHistory problem

Posted by th...@kodak.com.
Hi Selva,

    Please let me explain.
   Moves of the whole canvas are done using the Rendering Transform. 
Whenever the 
rendering transform changes a new gvt rendering is performed (not an 
update), so eventually
gvtRenderingCompleted will be called.

   So I don't know how to make sense of your statements.  It sounded like 
you wanted the
transform history updated during 'updates' i.e. when you modify the 
contents of the document
(like dragging a group) yet you are looking to only undo/redo moves of the 
canvas.

Selva <se...@yahoo.co.in> wrote on 05/03/2006 06:57:42 AM:

> 
> Hi Thomas,
> 
> > Do you want to 'undo/redo' moves of your group with lines? 
> 
> > Do you want to 'undo/redo' moves of the canvas (whole canvas pan)? 
> 
> My requirement is that i should be able to  'undo/redo' moves of the 
whole
> canvas.
> 
> > Can you give a complete example of user interaction and what you want 
> > the canvas to show? 
> 
> Actually my SVGCanvas will have SVG image elements with text elements. 
text
> element will be used to display the name of the image. my image elements 
are
> connected with lines. If user moves the image element, it should move 
along
> with connected lines.
> 
> Thanks,
> Selva
> 
> 
> --
> View this message in context: 
http://www.nabble.com/updating-TransformHistory-
> problem-t1523168.html#a4208054
> Sent from the Batik - Users forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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


Re: updating TransformHistory problem

Posted by Selva <se...@yahoo.co.in>.
Hi Thomas,

>
Actually i have added GVTTreeRendererListener for my SVGCanvas. While doing 
zoom in,zoom out etc, it's not executing  RenderingTransform's 
gvtRenderingCompleted(). Why it's not executing RenderingCompleted even 
GVTTreeRendererListener added ??


svgCanvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
    
    public void gvtRenderingPrepare(GVTTreeRendererEvent e) {
       System.out.println("Renderer Started...");
    }
    public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
       System.out.println("Renderer Completed...");

       transformHistory.update(svgCanvas.getRenderingTransform());
       previousTransformAction.update();
       nextTransformAction.update();
    }
});

> > Do you want to 'undo/redo' moves of the canvas (whole canvas pan)? 
> 
My requirement is that i should be able to  'undo/redo' moves of the whole
canvas.
> 
> > Can you give a complete example of user interaction and what you want 
> > the canvas to show? 
> 
Actually my SVGCanvas will have SVG image elements with text elements. text
element will be used to display the name of the image. my image elements are
connected with lines. If user moves the image element, it should move along
with connected lines.

Thanks,
Selva





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