You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Cheffe <ni...@freenet.de> on 2007/01/21 20:51:50 UTC

Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Hi folks,
Finally my first post.
I use the zooming functionality in the AWTViewer a lot!
I realized a notgoodie =) in the AWTViewer with certain PDF-Files with a lot
of lines, less a pixel high.
Not all lines and borders are visible under certain zoom-steps in the panel.
You see it also in the sample borders.fo when you zoom in and out that some
lines are hiding. I think it was page 4.
So not all lines are shown in the panel but the print is all fine!
How can i ensure that lines are visible when the clip is less than pixel
high while zooming in and out.
Its probably a bug in the java2d api i think or the java2drenderer ?
Definitly its a clipping issue where Java will not display a line if the
clip width is smaller 0.99 i think.
Has anyone tips where i can find the line to fix the bug myself.
-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8478339
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jeremias Maerki wrote:
> But what I don't know is whether there was a particular reason that we
> use (and cache) bitmaps to paint the pages instead of painting them
> directly.

I vaguely remember there were PgUp/PgDn buttons in the window,
and using them was blindingly fast...

J.Pietschmann

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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Me again,

I solved the problem not the whole but a piece of it.
I have overwritten drawBorders() in AWTRenderer with this...

protected void drawBorders(Rectangle2D.Float borderRect, BorderProps
bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
	{
		float x1 = borderRect.x;
		float y1 = borderRect.y;
		float x2 = borderRect.x + borderRect.width;
		float y2 = borderRect.y + borderRect.height;
		if (bpsStart != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x1, y1, x1, y2));
			restoreGraphicsState();
		}
		if (bpsBefore != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x1, y1, x2, y1));
			restoreGraphicsState();
		}
		if (bpsEnd != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x2, y1, x2, y2));
			restoreGraphicsState();
		}
		if (bpsAfter != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x1, y2, x2, y2));
			restoreGraphicsState();
		}
	}

Fast and stupid solution but it worked for me =)

And what can I say all borders are painted correct, so i think perhaps in
drawBackAndBorders() or drawBorders()
somewhere there there must be a problem. 
I dont think anymore its a prob with bufferedimages.

Dont know where to go on...


Jeremias Maerki-2 wrote:
> 
> Sure, please start here:
> http://xmlgraphics.apache.org/fop/bugs.html
> 
> Please add all information you have gathered so far, so that when
> someone new looks into it, he doesn't have to start from scratch.
> 
> On 21.03.2007 12:28:53 Cheffe wrote:
>> 
>> Me again.
>> Since i didnt get the problem solved. Is it possible to post it as a bug
>> report?
>> If yes how can i do that?
>> 
>> Cheffe wrote:
>> > 
>> > Thx Jeremias
>> > If anybody is still interested here is the link where the story is
>> going
>> > on:
>> >
>> http://archives.java.sun.com/cgi-bin/wa?A2=ind0701&L=java2d-interest&D=0&T=0&X=06B05B125A8B1CEAF3&Y=nixmail2006-forum@freenet.de&P=5174
>> > 
>> > Jeremias Maerki-2 wrote:
>> >> 
>> >> I would, but I don't have the time at the moment. Sorry. Maybe the
>> >> following list could help you with the Java2D specifics:
>> >> http://archives.java.sun.com/java2d-interest.html
>> >> 
>> >> On 29.01.2007 22:15:32 Cheffe wrote:
>> >>> 
>> >>> Anybody here for helping me out? Or does anyone know an other forum
>> >>> where i
>> >>> might get some help =)
>> >> <snip/>
>> >> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a9839092
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Me again,

I solved the problem not the whole but a piece of it.
I have overwritten drawBorders() in AWTRenderer with this...

protected void drawBorders(Rectangle2D.Float borderRect, BorderProps
bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
	{
		float x1 = borderRect.x;
		float y1 = borderRect.y;
		float x2 = borderRect.x + borderRect.width;
		float y2 = borderRect.y + borderRect.height;
		if (bpsStart != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x1, y1, x1, y2));
			restoreGraphicsState();
		}
		if (bpsBefore != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x1, y1, x2, y1));
			restoreGraphicsState();
		}
		if (bpsEnd != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x2, y1, x2, y2));
			restoreGraphicsState();
		}
		if (bpsAfter != null)
		{
			saveGraphicsState();
			state.updateColor(Color.BLACK);
			state.updateStroke(0.1f, EN_SOLID);
			state.getGraph().draw(new Line2D.Float(x1, y2, x2, y2));
			restoreGraphicsState();
		}
	}

Fast and stupid solution but it worked for me =)

And what can I say all borders are painted correct, so i think perhaps in
drawBackAndBorders() or drawBorders()
somewhere there there must be a problem. 
I dont think anymore its a prob with bufferedimages.

Dont know where to go on...


Jeremias Maerki-2 wrote:
> 
> Sure, please start here:
> http://xmlgraphics.apache.org/fop/bugs.html
> 
> Please add all information you have gathered so far, so that when
> someone new looks into it, he doesn't have to start from scratch.
> 
> On 21.03.2007 12:28:53 Cheffe wrote:
>> 
>> Me again.
>> Since i didnt get the problem solved. Is it possible to post it as a bug
>> report?
>> If yes how can i do that?
>> 
>> Cheffe wrote:
>> > 
>> > Thx Jeremias
>> > If anybody is still interested here is the link where the story is
>> going
>> > on:
>> >
>> http://archives.java.sun.com/cgi-bin/wa?A2=ind0701&L=java2d-interest&D=0&T=0&X=06B05B125A8B1CEAF3&Y=nixmail2006-forum@freenet.de&P=5174
>> > 
>> > Jeremias Maerki-2 wrote:
>> >> 
>> >> I would, but I don't have the time at the moment. Sorry. Maybe the
>> >> following list could help you with the Java2D specifics:
>> >> http://archives.java.sun.com/java2d-interest.html
>> >> 
>> >> On 29.01.2007 22:15:32 Cheffe wrote:
>> >>> 
>> >>> Anybody here for helping me out? Or does anyone know an other forum
>> >>> where i
>> >>> might get some help =)
>> >> <snip/>
>> >> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a9839090
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Sure, please start here:
http://xmlgraphics.apache.org/fop/bugs.html

Please add all information you have gathered so far, so that when
someone new looks into it, he doesn't have to start from scratch.

On 21.03.2007 12:28:53 Cheffe wrote:
> 
> Me again.
> Since i didnt get the problem solved. Is it possible to post it as a bug
> report?
> If yes how can i do that?
> 
> Cheffe wrote:
> > 
> > Thx Jeremias
> > If anybody is still interested here is the link where the story is going
> > on:
> > http://archives.java.sun.com/cgi-bin/wa?A2=ind0701&L=java2d-interest&D=0&T=0&X=06B05B125A8B1CEAF3&Y=nixmail2006-forum@freenet.de&P=5174
> > 
> > Jeremias Maerki-2 wrote:
> >> 
> >> I would, but I don't have the time at the moment. Sorry. Maybe the
> >> following list could help you with the Java2D specifics:
> >> http://archives.java.sun.com/java2d-interest.html
> >> 
> >> On 29.01.2007 22:15:32 Cheffe wrote:
> >>> 
> >>> Anybody here for helping me out? Or does anyone know an other forum
> >>> where i
> >>> might get some help =)
> >> <snip/>
> >> 


Jeremias Maerki


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Me again.
Since i didnt get the problem solved. Is it possible to post it as a bug
report?
If yes how can i do that?

Cheffe wrote:
> 
> Thx Jeremias
> If anybody is still interested here is the link where the story is going
> on:
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0701&L=java2d-interest&D=0&T=0&X=06B05B125A8B1CEAF3&Y=nixmail2006-forum@freenet.de&P=5174
> 
> Jeremias Maerki-2 wrote:
>> 
>> I would, but I don't have the time at the moment. Sorry. Maybe the
>> following list could help you with the Java2D specifics:
>> http://archives.java.sun.com/java2d-interest.html
>> 
>> On 29.01.2007 22:15:32 Cheffe wrote:
>>> 
>>> Anybody here for helping me out? Or does anyone know an other forum
>>> where i
>>> might get some help =)
>> <snip/>
>> 
>> 
>> 
>> Jeremias Maerki
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a9592005
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Thx Jeremias
If anybody is still interested here is the link where the story is going on:
http://archives.java.sun.com/cgi-bin/wa?A2=ind0701&L=java2d-interest&D=0&T=0&X=06B05B125A8B1CEAF3&Y=nixmail2006-forum@freenet.de&P=5174

Jeremias Maerki-2 wrote:
> 
> I would, but I don't have the time at the moment. Sorry. Maybe the
> following list could help you with the Java2D specifics:
> http://archives.java.sun.com/java2d-interest.html
> 
> On 29.01.2007 22:15:32 Cheffe wrote:
>> 
>> Anybody here for helping me out? Or does anyone know an other forum where
>> i
>> might get some help =)
> <snip/>
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8728801
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I would, but I don't have the time at the moment. Sorry. Maybe the
following list could help you with the Java2D specifics:
http://archives.java.sun.com/java2d-interest.html

On 29.01.2007 22:15:32 Cheffe wrote:
> 
> Anybody here for helping me out? Or does anyone know an other forum where i
> might get some help =)
<snip/>



Jeremias Maerki


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Anybody here for helping me out? Or does anyone know an other forum where i
might get some help =)

Cheffe wrote:
> 
> Since i didnt get it working right...
> I tried to produce a small sample with the same behaviour, but i cant
> produce this with my own small sample.
> So i think the prob must be somewhere else in the code of the awt
> rendering.
> Here is my example:
> 
> // Sample should show that thin lines disappear while the bufferedimage is
> scaled,
> // but it doesnt happen, its only happening in the awt-viewer in fop
> // Are the lines in Java2DRenderer painted in a different way to this
> sample?
> 
> package test;
> 
> import java.awt.BorderLayout;
> import java.awt.Color;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.RenderingHints;
> import java.awt.geom.AffineTransform;
> import java.awt.geom.Line2D;
> import java.awt.image.BufferedImage;
> 
> import javax.swing.JFrame;
> import javax.swing.JPanel;
> 
> public class Test
> {
> 
> 	public static void main(String[] args)
> 	{
> 		JFrame f = new JFrame();
> 		f.setSize(200,200);
> 		f.setContentPane(new MyPanel());
> 		f.setVisible(true);
> 		f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
> 		f.setLocationRelativeTo(null);
> 	}
> 
> }
> 
> class MyPanel extends JPanel
> {
> 
> 	private static final long serialVersionUID = 736771368105010125L;
> 
> 	private BufferedImage imageBuffer;
> 	
> 	public MyPanel()
> 	{
> 		setLayout(new BorderLayout());
> 		AffineTransform f = new AffineTransform();
> 		f.scale(0.3453543455f,0.3453543455f);
> 		imageBuffer = new BufferedImage(100, 100, BufferedImage.SCALE_SMOOTH);
> 		Graphics2D graphicsBuffer = imageBuffer.createGraphics();
> 		graphicsBuffer.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
> RenderingHints.VALUE_ANTIALIAS_ON);
> 		graphicsBuffer.setRenderingHint(RenderingHints.KEY_RENDERING,
> RenderingHints.VALUE_RENDER_QUALITY);
> 		graphicsBuffer.setTransform(f);
> 		graphicsBuffer.setColor(Color.WHITE);
> 		graphicsBuffer.draw(new Line2D.Float(30, 10, 0.2f, 10));
> 		graphicsBuffer.draw(new Line2D.Float(40, 10, 0.5f, 20));
> 		graphicsBuffer.draw(new Line2D.Float(50, 10, 0f, 30));
> 	}
> 
> 	public void paintComponent(Graphics g) {
> 		g.drawImage(imageBuffer, 0, 0, null);
> 	}
> 
> }
> 
> 
> 
> 
> Cheffe wrote:
>> 
>> Me again.
>> I tried some changes in the source to find a solution for the prob...
>> I did the follow:
>> 
>> -ImageProxyPanel-
>> paintComponent(Graphics g)
>> {
>> getPageasImage(g);                           // changed the params
>> ...
>> //g.paintImage(...)                             //commented out
>> }
>> 
>> - i think it was Java2DRenderer -
>> getPageasImage(Graphics gg)
>> {
>> //Graphics g = image.create.Graphics(); //commented out
>> Graphics g = gg;                                 //changed the params
>> ...
>> }
>> 
>> So it painted it directly to the panel, but the lines are still hiding
>> when i zoom.
>> Any helpful hints are still welcome.
>> I tried to investigate how the debuglines in the viewer are made, cause
>> the debuglines are painted correctly while scaling but i didnt get it.
>> Difficult to understand =)
>> 
>> 
>> Jeremias Maerki-2 wrote:
>>> 
>>> Oh, I think you hit the nail on the head with that link. It is indeed so
>>> that the page is first painted to a bitmap which is then painted on the
>>> panel. So, it appears as if painting the page directly on the panel
>>> could potentially solve the problem.
>>> 
>>> But what I don't know is whether there was a particular reason that we
>>> use (and cache) bitmaps to paint the pages instead of painting them
>>> directly. At first glance, it appears to be a waste of a lot of memory.
>>> If I were you I'd experiment with changing
>>> ImageProxyPanel.paintComponent().
>>> 
>>> On 22.01.2007 13:47:05 Cheffe wrote:
>>>> 
>>>> I found somethin but dont know exactly how to use the info =(
>>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug
>>>> 4109583 
>>>> Someone says if you us use transed graphics to draw line there is no
>>>> prob
>>>> anymore.
>>>> 
>>>> 
>>>> Jeremias Maerki-2 wrote:
>>>> > 
>>>> > It seems more like a general Java2D issue. Can you please search the
>>>> web
>>>> > for hints? I'm sure someone else has run into a similar problem
>>>> before.
>>>> > From there we can see if we can find a solution. I don't know
>>>> off-hand
>>>> > how to solve this.
>>>> > 
>>>> > On 22.01.2007 10:54:39 Cheffe wrote:
>>>> >> 
>>>> >> Has anyone also realized this issue in the AWTViewer? A hint is
>>>> always
>>>> >> welcome =)
>>> 
>>> 
>>> Jeremias Maerki
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8698026
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Since i didnt get it working right...
I tried to produce a small sample with the same behaviour, but i cant
produce this with my own small sample.
So i think the prob must be somewhere else in the code of the awt rendering.
Here is my example:

// Sample should show that thin lines disappear while the bufferedimage is
scaled,
// but it doesnt happen, its only happening in the awt-viewer in fop
// Are the lines in Java2DRenderer painted in a different way to this
sample?

package test;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class Test
{

	public static void main(String[] args)
	{
		JFrame f = new JFrame();
		f.setSize(200,200);
		f.setContentPane(new MyPanel());
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		f.setLocationRelativeTo(null);
	}

}

class MyPanel extends JPanel
{

	private static final long serialVersionUID = 736771368105010125L;

	private BufferedImage imageBuffer;
	
	public MyPanel()
	{
		setLayout(new BorderLayout());
		AffineTransform f = new AffineTransform();
		f.scale(0.3453543455f,0.3453543455f);
		imageBuffer = new BufferedImage(100, 100, BufferedImage.SCALE_SMOOTH);
		Graphics2D graphicsBuffer = imageBuffer.createGraphics();
		graphicsBuffer.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
		graphicsBuffer.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
		graphicsBuffer.setTransform(f);
		graphicsBuffer.setColor(Color.WHITE);
		graphicsBuffer.draw(new Line2D.Float(30, 10, 0.2f, 10));
		graphicsBuffer.draw(new Line2D.Float(40, 10, 0.5f, 20));
		graphicsBuffer.draw(new Line2D.Float(50, 10, 0f, 30));
	}

	public void paintComponent(Graphics g) {
		g.drawImage(imageBuffer, 0, 0, null);
	}

}




Cheffe wrote:
> 
> Me again.
> I tried some changes in the source to find a solution for the prob...
> I did the follow:
> 
> -ImageProxyPanel-
> paintComponent(Graphics g)
> {
> getPageasImage(g);                           // changed the params
> ...
> //g.paintImage(...)                             //commented out
> }
> 
> - i think it was Java2DRenderer -
> getPageasImage(Graphics gg)
> {
> //Graphics g = image.create.Graphics(); //commented out
> Graphics g = gg;                                 //changed the params
> ...
> }
> 
> So it painted it directly to the panel, but the lines are still hiding
> when i zoom.
> Any helpful hints are still welcome.
> I tried to investigate how the debuglines in the viewer are made, cause
> the debuglines are painted correctly while scaling but i didnt get it.
> Difficult to understand =)
> 
> 
> Jeremias Maerki-2 wrote:
>> 
>> Oh, I think you hit the nail on the head with that link. It is indeed so
>> that the page is first painted to a bitmap which is then painted on the
>> panel. So, it appears as if painting the page directly on the panel
>> could potentially solve the problem.
>> 
>> But what I don't know is whether there was a particular reason that we
>> use (and cache) bitmaps to paint the pages instead of painting them
>> directly. At first glance, it appears to be a waste of a lot of memory.
>> If I were you I'd experiment with changing
>> ImageProxyPanel.paintComponent().
>> 
>> On 22.01.2007 13:47:05 Cheffe wrote:
>>> 
>>> I found somethin but dont know exactly how to use the info =(
>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug
>>> 4109583 
>>> Someone says if you us use transed graphics to draw line there is no
>>> prob
>>> anymore.
>>> 
>>> 
>>> Jeremias Maerki-2 wrote:
>>> > 
>>> > It seems more like a general Java2D issue. Can you please search the
>>> web
>>> > for hints? I'm sure someone else has run into a similar problem
>>> before.
>>> > From there we can see if we can find a solution. I don't know off-hand
>>> > how to solve this.
>>> > 
>>> > On 22.01.2007 10:54:39 Cheffe wrote:
>>> >> 
>>> >> Has anyone also realized this issue in the AWTViewer? A hint is
>>> always
>>> >> welcome =)
>> 
>> 
>> Jeremias Maerki
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8653116
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Me again.
I tried some changes in the source to find a solution for the prob...
I did the follow:

-ImageProxyPanel-
paintComponent(Graphics g)
{
getPageasImage(g);                           // changed the params
...
//g.paintImage(...)                             //commented out
}

- i think it was Java2DRenderer -
getPageasImage(Graphics gg)
{
//Graphics g = image.create.Graphics(); //commented out
Graphics g = gg;                                 //changed the params
...
}

So it painted it directly to the panel, but the lines are still hiding when
i zoom.
Any helpful hints are still welcome.
I tried to investigate how the debuglines in the viewer are made, cause the
debuglines are painted correctly while scaling but i didnt get it.
Difficult to understand =)


Jeremias Maerki-2 wrote:
> 
> Oh, I think you hit the nail on the head with that link. It is indeed so
> that the page is first painted to a bitmap which is then painted on the
> panel. So, it appears as if painting the page directly on the panel
> could potentially solve the problem.
> 
> But what I don't know is whether there was a particular reason that we
> use (and cache) bitmaps to paint the pages instead of painting them
> directly. At first glance, it appears to be a waste of a lot of memory.
> If I were you I'd experiment with changing
> ImageProxyPanel.paintComponent().
> 
> On 22.01.2007 13:47:05 Cheffe wrote:
>> 
>> I found somethin but dont know exactly how to use the info =(
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug
>> 4109583 
>> Someone says if you us use transed graphics to draw line there is no prob
>> anymore.
>> 
>> 
>> Jeremias Maerki-2 wrote:
>> > 
>> > It seems more like a general Java2D issue. Can you please search the
>> web
>> > for hints? I'm sure someone else has run into a similar problem before.
>> > From there we can see if we can find a solution. I don't know off-hand
>> > how to solve this.
>> > 
>> > On 22.01.2007 10:54:39 Cheffe wrote:
>> >> 
>> >> Has anyone also realized this issue in the AWTViewer? A hint is always
>> >> welcome =)
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8563797
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
-UPDATE-
I realized that the debug view in the AWT-viewer can handle the scaleing
thing right.
All debuging lines are shown in every zoomsteps correct.
Perhaps i see a possible solution in this.
I'm still searching and trying...

Jeremias Maerki-2 wrote:
> 
> Oh, I think you hit the nail on the head with that link. It is indeed so
> that the page is first painted to a bitmap which is then painted on the
> panel. So, it appears as if painting the page directly on the panel
> could potentially solve the problem.
> 
> But what I don't know is whether there was a particular reason that we
> use (and cache) bitmaps to paint the pages instead of painting them
> directly. At first glance, it appears to be a waste of a lot of memory.
> If I were you I'd experiment with changing
> ImageProxyPanel.paintComponent().
> 
> On 22.01.2007 13:47:05 Cheffe wrote:
>> 
>> I found somethin but dont know exactly how to use the info =(
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug
>> 4109583 
>> Someone says if you us use transed graphics to draw line there is no prob
>> anymore.
>> 
>> 
>> Jeremias Maerki-2 wrote:
>> > 
>> > It seems more like a general Java2D issue. Can you please search the
>> web
>> > for hints? I'm sure someone else has run into a similar problem before.
>> > From there we can see if we can find a solution. I don't know off-hand
>> > how to solve this.
>> > 
>> > On 22.01.2007 10:54:39 Cheffe wrote:
>> >> 
>> >> Has anyone also realized this issue in the AWTViewer? A hint is always
>> >> welcome =)
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8510721
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Nice nice. I'll take a look at ImageProxyPanel.
Thank you for the tip.
I'll do a reply if I have found a solution but that can take a time cause im
not that deep enough to the source-code =) but i give it a try.
Thx

Jeremias Maerki-2 wrote:
> 
> Oh, I think you hit the nail on the head with that link. It is indeed so
> that the page is first painted to a bitmap which is then painted on the
> panel. So, it appears as if painting the page directly on the panel
> could potentially solve the problem.
> 
> But what I don't know is whether there was a particular reason that we
> use (and cache) bitmaps to paint the pages instead of painting them
> directly. At first glance, it appears to be a waste of a lot of memory.
> If I were you I'd experiment with changing
> ImageProxyPanel.paintComponent().
> 
> On 22.01.2007 13:47:05 Cheffe wrote:
>> 
>> I found somethin but dont know exactly how to use the info =(
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug
>> 4109583 
>> Someone says if you us use transed graphics to draw line there is no prob
>> anymore.
>> 
>> 
>> Jeremias Maerki-2 wrote:
>> > 
>> > It seems more like a general Java2D issue. Can you please search the
>> web
>> > for hints? I'm sure someone else has run into a similar problem before.
>> > From there we can see if we can find a solution. I don't know off-hand
>> > how to solve this.
>> > 
>> > On 22.01.2007 10:54:39 Cheffe wrote:
>> >> 
>> >> Has anyone also realized this issue in the AWTViewer? A hint is always
>> >> welcome =)
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8488596
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Oh, I think you hit the nail on the head with that link. It is indeed so
that the page is first painted to a bitmap which is then painted on the
panel. So, it appears as if painting the page directly on the panel
could potentially solve the problem.

But what I don't know is whether there was a particular reason that we
use (and cache) bitmaps to paint the pages instead of painting them
directly. At first glance, it appears to be a waste of a lot of memory.
If I were you I'd experiment with changing
ImageProxyPanel.paintComponent().

On 22.01.2007 13:47:05 Cheffe wrote:
> 
> I found somethin but dont know exactly how to use the info =(
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug 4109583 
> Someone says if you us use transed graphics to draw line there is no prob
> anymore.
> 
> 
> Jeremias Maerki-2 wrote:
> > 
> > It seems more like a general Java2D issue. Can you please search the web
> > for hints? I'm sure someone else has run into a similar problem before.
> > From there we can see if we can find a solution. I don't know off-hand
> > how to solve this.
> > 
> > On 22.01.2007 10:54:39 Cheffe wrote:
> >> 
> >> Has anyone also realized this issue in the AWTViewer? A hint is always
> >> welcome =)


Jeremias Maerki


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
So here the workaround that did it to me:

protected void drawBorders(Rectangle2D.Float borderRect, BorderProps
bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
	{
		float x1 = borderRect.x;
		float y1 = borderRect.y;
		float x2 = borderRect.x + borderRect.width;
		float y2 = borderRect.y + borderRect.height;
		if (bpsStart != null)
		{
			saveGraphicsState();
			state.updateColor(bpsStart.color);
			state.updateStroke(bpsStart.width / 1000f, bpsStart.style);
			state.getGraph().draw(new Line2D.Float(x1, y1, x1, y2));
			restoreGraphicsState();
		}
		if (bpsBefore != null)
		{
			saveGraphicsState();
			state.updateColor(bpsBefore.color);
			state.updateStroke(bpsBefore.width / 1000f, bpsBefore.style);
			state.getGraph().draw(new Line2D.Float(x1, y1, x2, y1));
			restoreGraphicsState();
		}
		if (bpsEnd != null)
		{
			saveGraphicsState();
			state.updateColor(bpsEnd.color);
			state.updateStroke(bpsEnd.width / 1000f, bpsEnd.style);
			state.getGraph().draw(new Line2D.Float(x2, y1, x2, y2));
			restoreGraphicsState();
		}
		if (bpsAfter != null)
		{
			saveGraphicsState();
			state.updateColor(bpsAfter.color);
			state.updateStroke(bpsAfter.width / 1000f, bpsAfter.style);
			state.getGraph().draw(new Line2D.Float(x1, y2, x2, y2));
			restoreGraphicsState();
		}
	}

Dont know why a lot of calculating is done in the original drawBorderLine()
cause the workaround above is doin it pretty well and all borders are shown
thats the most important thing to me.
-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a9882370
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Ok i give it a try

Jeremias Maerki-2 wrote:
> 
> It seems more like a general Java2D issue. Can you please search the web
> for hints? I'm sure someone else has run into a similar problem before.
> From there we can see if we can find a solution. I don't know off-hand
> how to solve this.
> 
> On 22.01.2007 10:54:39 Cheffe wrote:
>> 
>> Has anyone also realized this issue in the AWTViewer? A hint is always
>> welcome =)
>> -- 
>> View this message in context:
>> http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8486126
>> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8486283
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
I found somethin but dont know exactly how to use the info =(
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug 4109583 
Someone says if you us use transed graphics to draw line there is no prob
anymore.


Jeremias Maerki-2 wrote:
> 
> It seems more like a general Java2D issue. Can you please search the web
> for hints? I'm sure someone else has run into a similar problem before.
> From there we can see if we can find a solution. I don't know off-hand
> how to solve this.
> 
> On 22.01.2007 10:54:39 Cheffe wrote:
>> 
>> Has anyone also realized this issue in the AWTViewer? A hint is always
>> welcome =)
>> -- 
>> View this message in context:
>> http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8486126
>> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8488307
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
It seems more like a general Java2D issue. Can you please search the web
for hints? I'm sure someone else has run into a similar problem before.
From there we can see if we can find a solution. I don't know off-hand
how to solve this.

On 22.01.2007 10:54:39 Cheffe wrote:
> 
> Has anyone also realized this issue in the AWTViewer? A hint is always
> welcome =)
> -- 
> View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8486126
> Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


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


Re: Lines are hiding in AWTViewer perhaps Bug in Java2DRenderer or Java2D itsself

Posted by Cheffe <ni...@freenet.de>.
Has anyone also realized this issue in the AWTViewer? A hint is always
welcome =)
-- 
View this message in context: http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8486126
Sent from the FOP - Users mailing list archive at Nabble.com.


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