JSVGScrollPane patch

2010-06-03 Thread mistercaste

I tried to apply  https://issues.apache.org/bugzilla/show_bug.cgi?id=42533
this patch  on a new JSVGScrollPane (see
attachment:  http://old.nabble.com/file/p28767356/JSVGScrollPane.java
JSVGScrollPane.java ) and Netbeans's 
Matisse recognizes it as a drag-and-drop element.

However although I can take it and place it on my JFrames
and place the JSVGCanvas over it, if I zoom on my canvas
or resize the Swing window containing it the Scrollpanes do
not appear.

Has somebody found a solution for this? Thank you.


-- 
View this message in context: 
http://old.nabble.com/JSVGScrollPane-patch-tp28767356p28767356.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Use Elements Attributes

2010-03-26 Thread mistercaste

Hi
I have a trouble with USE elements and listeners.
I'm writing a swing application which visualizes
a road map and when I get an onMouseOver on a work
sign a window should open and show the user the
info about works.

Everything works good except that I can't set
attributes on the signs that I place on the map
(which are the use elements).

I've attached a file  http://old.nabble.com/file/p28042452/my.svg my.svg  
that is a part of an export
of my map, so that the DOM tree is known (with Inkscape
or else).

Inside the DOM my sign are enclosed in the Symbols
g group and divided into other g subgroups, each
of them should have his own attributes.

How can I do? I tried adding attributes when building
my DOM but I can't get them. I attach also my code.

Thanks




private void registerListeners() {

...

NodeList symbolList =
canvas.getSVGDocument().getElementsByTagName(SVG_USE_TAG);// ???

// For each symbol...
for (int i = 0; i  symbolList.getLength(); i++) {
EventTarget t = (EventTarget) symbolList.item(i);

// onMouseOut listener
   t.addEventListener(mouseout, new OnSymbolMouseOut(), false);

// onMouseOver listener
t.addEventListener(mouseover, new OnSymbolMouseOver(), false);
}
}


private class OnSymbolMouseOver implements EventListener {

@Override
public void handleEvent(Event evt) {
EventTarget evtTarget = evt.getTarget();
//EventTarget evtTarget = evt.getCurrentTarget();
final Element elem = (Element) evtTarget;

myWindow.setValue(elem.getAttribute(AN ATTRIBUTE),
elem.getAttribute(ANOTHER ATTRIBUTE));// ???
myWindow.setVisible(true);
}
}


public class OnSymbolMouseOut implements EventListener {

@Override
public void handleEvent(Event evt) {
myWindow.setVisible(false);
}
}

-- 
View this message in context: 
http://old.nabble.com/Use-Elements-Attributes-tp28042452p28042452.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Zoom In Limit

2010-03-23 Thread mistercaste

Thanks Thomas, it works.
This is my code:

private JSVGCanvas canvas = new JSVGCanvas() {

@Override

public void setRenderingTransform(AffineTransform at) {

if (at.getDeterminant()  ZOOM_IN_LIMIT) {

// Applies the new zoom level

setRenderingTransform(at, true);

} else {

// Redraws the last zoom level

scheduleGVTRendering();

}

}

};
-- 
View this message in context: 
http://old.nabble.com/Zoom-In-Limit-tp27933984p2813.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Stroke size

2010-03-12 Thread mistercaste

Thanks for the answer Thomas.
Could you give me some resources/examples links to study?
I don't know to implement this with Batik.








thomas.deweese wrote:
 
 Hi 
 
 mistercaste misterca...@gmail.com wrote on 03/09/2010 10:30:18 AM:
 
 I'm writing a map system for a GIS and the roads should have always the 
 same
 size, independently by the zoom level applied. Actually when I zoom-in 
 the
 stroke gets bigger proportionally to the zoom level applied, so at a 
 certain
 level the whole screen is occupied by the line on which I zoomed over.
 
You can do this by catching the svg 'onzoom' event and updating the
 stroke-width for your line elements.  Updating the stroke is easiest
 if all the lines with the same width are in the same group.
 
 However the stroke invariant shouldn't be applied to every element in my 
 SVG
 document, because there are also other elements which I need to treat
 differently.
 
Sure you get to pick what elements you update the stroke-width on.
 In later versions of the spec there are easier ways to do this.
 
 

-- 
View this message in context: 
http://old.nabble.com/Stroke-size-tp27837302p27874122.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: JSVGCanvas - Constant text size

2010-03-12 Thread mistercaste

If the text centering is needed here's a useful 
http://old.nabble.com/zooming-problem-to3462572.html#a3467449 link .
-- 
View this message in context: 
http://old.nabble.com/JSVGCanvas---Constant-text-size-tp26262831p27881846.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Stroke size

2010-03-09 Thread mistercaste

Hi
I need a constant stroke size for some elements when I zoom on the
JSVGCanvas.

I'm writing a map system for a GIS and the roads should have always the same
size, independently by the zoom level applied. Actually when I zoom-in the
stroke gets bigger proportionally to the zoom level applied, so at a certain
level the whole screen is occupied by the line on which I zoomed over.

However the stroke invariant shouldn't be applied to every element in my SVG
document, because there are also other elements which I need to treat
differently.

I think this is possible, because instruments which use Batik like the
GeoTools library have this feature, but I don't know how to implement it
(and to determine how GeoTools does it it's quite hard).

I tried with the DOM functionalities, but now I am quite convinced that
right way is to work through the Java2D Graphics2D class. However I don't
have much experience on Java2D.

Any hints? Hope to have explained clearly my problem.


Thanks.




-- 
View this message in context: 
http://old.nabble.com/Stroke-size-tp27837302p27837302.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: SVG Symbol Bbox

2010-02-22 Thread mistercaste

I have solved this trivially using the SVG attributes.
The fields x and y can't be null, so I can always take
them to locate an element. Here is my code:


private void antiTransformSymbols() {
final Element symbolsGroup =
canvas.getSVGDocument().getElementById(ID_SYMBOLS_GROUP);

LinkedList list = new LinkedList();
recurseLeaves((Node) symbolsGroup, list);// Takes all the leaves of
the symbols group

while (!list.isEmpty()) {// For every symbol..
final Node node = (Node) lista.remove();

// Scale factor
final double scale = (1 /
canvas.getSVGDocument().getRootElement().getCurrentScale()) *
ANTI_ZOOM_MULTIPLIER_SYMBOLS;

/*
 * Gets the current element coordinates.
 * The fields x and y can't be null because of SVG definition.
 */
final float cx = Float.valueOf(((Element)
node).getAttribute(x));
final float cy = Float.valueOf(((Element)
node).getAttribute(y));

canvas.getUpdateManager().getUpdateRunnableQueue().
invokeLater(new Runnable() {

@Override
public void run() {
/*
 * DOM actions
 * Translation - Scale - Translation because the
element
 * must be scaled on the center of the reference system.
 */
((Element) node).setAttributeNS(
null,
SVG_TRANSFORM_ATTRIBUTE,
translate( + (cx) + , + (cy) + ) +
scale( + scale + )  +
translate( + (-cx) + , + (-cy) + ));
}
});

}
}




Thanks for support.


-- 
View this message in context: 
http://old.nabble.com/SVG-Symbol-Bbox-tp27622473p27685811.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: PDF Transcoder Zoom

2010-02-22 Thread mistercaste

Well, thanks for the answer.
I used your code and the transform is ok, but
unfortunately it still doesn't work as expected.
After some testing I've located the problem in
the following line:

Rectangle myRect = canvas.getBounds();

It happens that the bounds i get are only a
portion of the image visualized on the canvas.
Any ideas? Thanks






-- 
View this message in context: 
http://old.nabble.com/PDF-Transcoder-Zoom-tp26593852p27685863.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Symbol Bbox

2010-02-17 Thread mistercaste

Hi
I need to get the bounding box of an SVG element which is a Symbol.
I've already tried with

- SVGLocatableSupport.getBbox(element)
- ((SVGGraphicsElement)element).getBBox()

..but it don't seem to work. How can I do to get the bbox? Thanks


-- 
View this message in context: 
http://old.nabble.com/Symbol-Bbox-tp27622473p27622473.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: JavaDoc

2009-12-02 Thread mistercaste

Here it is, I did it!! :-)

You can find it 
http://apache.fastbull.org/xml/commons/xml-commons-external-1.3.04-src.zip
here !

As general information source maybe it could be useful this page about 
http://xml.apache.org/mirrors.cgi Apache XML Projects Downloads .

Good work, coders!






jonathan wood-3 wrote:
 
 I'm not sure where the javadoc is, but the spec will get you far here:
 
 http://www.w3.org/TR/SVG/types.html#BasicDOMInterfaces
 
 good luck!
 
 On Tue, Dec 1, 2009 at 11:42 AM, mistercaste misterca...@gmail.com
 wrote:
 

 Hi
 I'm searching the org.w3c.dom.svg JavaDoc because a lot of Batik features
 are based on this.
 Is this part of the Batik project? Where can I find it?

 Thanks!
 --
 View this message in context:
 http://old.nabble.com/JavaDoc-tp26594246p26594246.html
 Sent from the Batik - Users mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://old.nabble.com/JavaDoc-tp26594246p26605604.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: PDF Transcoder Zoom

2009-12-02 Thread mistercaste

I tried the following code (a bit.. uh.. randomly), but it
doesn't seem to work.
I don't know how to relate the bounds with the rendering
transform.

private Rectangle getAOI() {
AffineTransform rt = canvas.getRenderingTransform();
double x = rt.getTranslateX();
double y = rt.getTranslateY();
double scaleX = rt.getScaleX();
double scaleY = rt.getScaleY();

Rectangle myRect = canvas.getBounds();

myRect.setRect(
cb.x * x,// X
cb.y * y,// Y
cb.width * scaleX,// Width
cb.height * scaleY);// Height

return myRect;
}
-- 
View this message in context: 
http://old.nabble.com/PDF-Transcoder-Zoom-tp26593852p26607629.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Fit JSVGCanvas around an Element

2009-12-02 Thread mistercaste

Hi
I need to fit my canvas around an Element of my SVG document.
On the forum I found advice that said to do get the Screen CTM
of the Element and that's what I did.
But actually I don't know how to use this CTM in combination with
the RenderingTransform.

Here follows my code:


void centerOnElement(Element elementToCenter) {
SVGMatrix matrix = ((SVGLocatable) elementToCenter).getScreenCTM();

float[] flatMatrix = {
matrix.getA(),
matrix.getB(),
matrix.getC(),
matrix.getD(),
matrix.getE(),
matrix.getF()};

final AffineTransform elementAT = new AffineTransform(flatMatrix);

UpdateManager um = canvas.getUpdateManager();
um.getUpdateRunnableQueue().invokeLater(new Runnable() {

@Override
public void run() {
at = canvas.getInitialTransform();
/*
 * How do I work the elementAT AffineTransform
 * so that it fits the element in the canvas?
 */
canvas.setRenderingTransform(at);
}
});
}




Thank you.



-- 
View this message in context: 
http://old.nabble.com/Fit-JSVGCanvas-around-an-Element-tp26607989p26607989.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



JavaDoc

2009-12-01 Thread mistercaste

Hi
I'm searching the org.w3c.dom.svg JavaDoc because a lot of Batik features
are based on this.
Is this part of the Batik project? Where can I find it?

Thanks!
-- 
View this message in context: 
http://old.nabble.com/JavaDoc-tp26594246p26594246.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Dynamic Elements on zoom

2009-10-26 Thread mistercaste

I'm working on a GIS road-map visualizer.
Actually I'm interested on the zoom problem and in particular
in having some elements invariant to the affine transformation.

For example zooming will not make bigger the road signals.
Signals should have always the same size on screen, independently
by the zoom factor applied to the rest of the elements.

Same thing for the text on the SVGCanvas. I have some texts
on my map indicating the names of the places, and these texts
shouldn't get bigger when I zoom-in into the canvas.

I tryed the GraphicsNode approach with in my mind to use
the inverse affine transforms. I mean that I wanted to apply the
inverse transform on the GraphicsNodes that I wanted to keep
constant, like the road signals and the texts.


What approach should I follow?


Thanks.



thomas.deweese wrote:
 
 Hi Mistercaste,
 
 mistercaste misterca...@gmail.com wrote on 10/23/2009 10:35:27 AM:
 
 I verified the Element source (actually I'm adjusting a code
 inherited by someone else), and it has a use property as
 predicted. Is it possible to get it's GraphicNode?
 
No, because 'used' elements may have many Graphics Nodes.
 So it comes down to why do you need the GraphicsNode?  As there
 may be another way to achieve the desired effect.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Dynamic-Elements-on-zoom-tp23584458p26059986.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Dynamic Elements on zoom

2009-10-22 Thread mistercaste

I get the Element with the getElementById(String) method. It surely works, I
tried to print the result. Here is the code. I based my work on the Batik
sources. Sorry for it's longness.

canvas.getInteractors().add(new AbstractZoomInteractor() {

...

@Override
public void mouseReleased(MouseEvent e) {

finished = true;
JGVTComponent c = (JGVTComponent) e.getSource(); - HERE
I GET THE COMPONENT
c.getOverlays().remove(overlay);
overlay.paint(c.getGraphics());
xCurrent = e.getX();
yCurrent = e.getY();

if ((xCurrent - xStart) != 0  (yCurrent - yStart) != 0) {
int dx = xCurrent - xStart;
int dy = yCurrent - yStart;

if (dx  0) {
dx = -dx;
xStart = xCurrent;
}

if (dy  0) {
dy = -dy;
yStart = yCurrent;
}

Dimension size = c.getSize();
float scaleX = size.width / (float) dx;
float scaleY = size.height / (float) dy;
float scale = (scaleX  scaleY) ? scaleX : scaleY;
AffineTransform at = new AffineTransform();
at.scale(scale, scale);
at.translate(-xStart, -yStart);
at.concatenate(c.getRenderingTransform());
c.setRenderingTransform(at);

SVGDocument docum = canvas.getSVGDocument();
Element element = docum.getElementById(MySvgElement);  - HERE
I GET THE SVG ELEMENT
UpdateManager um = ((JSVGCanvas) c).getUpdateManager();  -
JGVTComponent to JSVGCanvas
BridgeContext bc = um.getBridgeContext();
System.out.println(BC:  + bc.toString()); -- THIS
RETURNS SOMETHING
GraphicsNode gn = (GraphicsNode) bc.getGraphicsNode(element);
System.out.println(GN:  + gn); - THIS
RETURNS NULL
}
}
});



thx



-- 
View this message in context: 
http://www.nabble.com/Dynamic-Elements-on-zoom-tp23584458p26008288.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Dynamic Elements on zoom

2009-10-21 Thread mistercaste

I realized that in the BridgeContext class when i get a GraphicsNode like in
the following code i get a null return value.


BridgeContext bc = ((JSVGCanvas)c).getUpdateManager().getBridgeContext();
GraphicsNode gn = (GraphicsNode)bc.getGraphicsNode(element);
System.out.println(gn);


What can I do? The c element is an element i get by clicking on the
canvas, so it shouldn't give any problem, but when i get it's BridgeContext
(which is not null) I can't get the corresponding element.

Any help/suggestion appreciated. Thx



-- 
View this message in context: 
http://www.nabble.com/Dynamic-Elements-on-zoom-tp23584458p25998554.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



CompositeGraphicsNode to ShapeNode

2009-07-17 Thread mistercaste

Hi, I'm trying to change the GraphicsNode color of a relative DOM element via
the BridgeContext but I get as casting error CompositeGraphicsNode cannot
be cast to ShapeNode. Here is my code:

BridgeContext bc = ((JSVGCanvas) c).getUpdateManager().getBridgeContext();
bc.setDynamic(true);
bc.setInteractive(true);

// This is a CompositeGraphicsNode (implements GraphicsNode)
GraphicsNode gn = (GraphicsNode) bc.getGraphicsNode(element);

ShapeNode sn = (ShapeNode)gn;  -- THIS CAST DOESN'T WORK
ShapePainter sp = sn.getShapePainter();
StrokeShapePainter painter = new StrokeShapePainter(sn.getShape());
painter.setPaint(Color.YELLOW);
painter.setStroke(new BasicStroke(10.0f));
sn.setShapePainter(painter);


On the ShapeNode casting I get the following error:

Exception in thread AWT-EventQueue-0 java.lang.ClassCastException:
org.apache.batik.gvt.CompositeGraphicsNode cannot be cast to
org.apache.batik.gvt.ShapeNode

Any ideas or suggestion on what to do? Thanks



-- 
View this message in context: 
http://www.nabble.com/CompositeGraphicsNode-to-ShapeNode-tp24531759p24531759.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Dynamic Elements on zoom

2009-05-17 Thread mistercaste

I need to build a map system for a GIS with some elements' size independent
by the zoom level applied.

I've found a lot of questions about this issue but nobody looks like to have
an idea on what to do, so I hope the Batik's designers could give an idea on
what to do, or take this topic as an idea for improving a new functionality
to this really useful library (this would give Batik even more value,
because this kind of applications erally need these features).

Such zoom-invariant elements are for example the stroke size of the streets,
the size of text, some drawings size (like the car accident), ecc.. I
understand it's a large problem.

The approach about stroke sizes could be to modify the DOM element's
property with:


element.setAttributeNS(stroke-size, ..whatever..);


This works, but this approach modifies the DOM elements properties and is
not really elegant.
So another solution could be to bind DOM with GVT using the rendered objects
of the GVT by the BridgeContext and modifying the affinetransform of them,
like:


GraphicsNode graphicsNode =
bridgeContext.getGraphicsNode(element);
AffineTransform at = graphicsNode.getTransform();


..and then applying it the inverse CTM of the root node. But this even
doesn't work, because the transformation gives back an element which doesn't
fit on the previous Bounding Box.
I was thinking to try to apply also the previous bounding box to the
element, but how?

Another approach could be to modify the stroke rendering size with the
StrokeShapePainter, like:


StrokeShapePainter ssp = new StrokeShapePainter();
ssp.setShape(elementShape);
ssp.setStroke(new Stroke(..whatever..));


..but how to determine the elementStroke Shape object? I can't understand
which Java interfaces and object to call. Maybe the
org.apache.batik.gvt.ShapeNode class, but how?

And what about text size? How could I change it dinamically depending on
zoom size if I neither can get a zoom factor?

There are no examples for these issues and following the abstract
dependencies of the library is really hard. It would be nice to have some
generic example code to insert inside mine, like the great examples that
are actually on the site.

Please help, I'm not an experienced Java programmer and my work actually
depends on this.
Waiting for an answer of yours I congratulate for the work you've done for
supporting the SVG format on Java with such a big open project.




Thank you.




-- 
View this message in context: 
http://www.nabble.com/Dynamic-Elements-on-zoom-tp23584458p23584458.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Dynamic Elements on zoom

2009-05-17 Thread mistercaste

This is what I call a speedy answer :-)
I will try immediately. Thank you!




Helder Magalhães wrote:
 
 Hi mistercase,
 
 
 I need to build a map system for a GIS with some elements' size
 independent
 by the zoom level applied.
 
 Humm... This sounds like another 'déjà vu' from a similar, recent
 thread [1]. ;-)  (Weirdly, the message didn't seem to show up in
 Nabble, so I'm not sure if that was why it was issued again.) Note
 that mailing list messages can get lost sometimes so feel free to
 ping after a while just to make sure that it wasn't the case, but
 please try to do it within the same thread whenever possible. In this
 particular case, for example, I still had the previous one in my list
 for processing whenever possible (time is a finite resource,
 unfortunately!).
 
 
 I've found a lot of questions about this issue but nobody looks like to
 have
 an idea on what to do [...]
 
 Well, I wouldn't put things that way. There's at least a related
 thread [2] and, given that it was found in a few seconds, I'm
 convinced the proper keywords will find a lot more. Also, I recall
 somehow recent (deep!) debates on affine transforms, which would be
 pretty useful for getting this sort of effects! ;-)
 
 
 Such zoom-invariant elements are for example the stroke size of the
 streets,
 the size of text, some drawings size (like the car accident), ecc.. I
 understand it's a large problem.
 
 In terms of invariable stroke width, SVG Tiny 1.2 specifically defines
 that in the non-scaling-stroke value for the vector-effect
 property [3]. Unfortunately, as far as I know, Batik doesn't implement
 this yet (anyone feels like contributing this simple and yet
 interesting/valuable feature?).
 
 
 ..and then applying it the inverse CTM of the root node. But this even
 doesn't work, because the transformation gives back an element which
 doesn't
 fit on the previous Bounding Box.
 
 Well, I'm convinced an approach like this will work. Samuel Dagan's
 Zoom and Pan [4] proof-of-concept employs this in a scripted
 environment. By using Batik's infrastructure performance will
 certainly improve. The sample makes the control element the same size
 relative to document size; if one would want that but relative to an
 absolute size, just needs to apply a similar transform during the
 document load event. ;-)
 
 
 Waiting for an answer of yours [...]
 
 Hope this helps,
  Helder
 
 
 [1]
 http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200904.mbox/%3c23138230.p...@talk.nabble.com%3e
 [2] http://www.nabble.com/Custom-Scaling-tt13513744.html
 [3] http://www.w3.org/TR/SVGTiny12/painting.html#VectorEffectProperty
 [4] http://alzt.tau.ac.il/~dagan/tools/#zoom
 
 -
 To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Dynamic-Elements-on-zoom-tp23584458p23588057.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



Re: Preserve scale size of certain elements

2009-04-20 Thread mistercaste

I have the same problem with a svg map system.

I have some strokes which define the edges of a
path.

The stroke should be zoom-invariant, but only for
some elements on the map (e.g. a highway must
be zoom-invariant, but not the minor roads or
street names which have to be visible only on high
zoom levels).

The feature requested isn't a level of detail (LOD).

In the code below I define the properties of the
Element highway:

highway.setAttributeNS(null, stroke, green);
highway.setAttributeNS(null, stroke-width, 5);// THIS MUST BE INVARIANT
highway.setAttributeNS(null, marker-end, url(# + KINDOFROAD + 1) );

How could I do to implement this feature?
I searched everywhere, please help.









Javid Alimohideen-2 wrote:
 
 Hi,
 Can someone tell me if it possible to restrict the scale of some g or path
 elements? For example, If I zoom in/out, I want to preserve the scale size
 of certain elements.
 
 Thanks,
 Javid
 
 
 -
 To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Preserve-scale-size-of-certain-elements-tp3171259p23138230.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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