Skip to main content

JTextPane

81 replies [Last post]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
stanislavl
Offline
Joined: 2003-06-17

[code]
public void paint(Graphics g, Shape a)
{
double zoomFactor = getZoomFactor();

Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);

AffineTransform old = g2d.getTransform();
g2d.scale(zoomFactor, zoomFactor);

g2d.setTransform(old);
}
[/code]

You don't call super method.

regards,
Stas

freesoft_2001
Offline
Joined: 2006-03-11

Hi everyone,

> You don't call super method.

I changed the paint method as below
[code]
public void paint(Graphics g, Shape a)
{
double zoomFactor = getZoomFactor();

Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);

AffineTransform old = g2d.getTransform();
g2d.scale(zoomFactor, zoomFactor);

super.paint(g2d, a);
g2d.setTransform(old);
}
[/code]

and called super but still it did not work and i still got the same results in which the embedded JTextPane reamined unscaled.

Am i missing something or have i done something wrongly in the MyComponentView class?

On another issue, i remember once asking you about how i can serialize individual pages in the JTextPane which used your paginated EditorKIt as a document object.

This was what your reply was

>>To get content of page you in fact need two offsets: >>start offset on page and end offset on page.

>>All the offets can be got by viewToModel() methods. You >>just have to specify proper coordinates (x=0 , y=page >>start Y ) for start offset and (x=page Width, y=page >>end Y) for end offset.

Could you clarify what you mean by this as i am a bit confused by it.

As far as i know this is in the viewToModel method which uses scaling

[code]
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
{
double zoomFactor = getZoomFactor();

Rectangle alloc = a.getBounds();

x/= zoomFactor;
y/= zoomFactor;
alloc.x/= zoomFactor;
alloc.y/= zoomFactor;
alloc.width/= zoomFactor;
alloc.height/= zoomFactor;

return super.viewToModel(x, y, alloc, bias);
}
[/code]

From what you are saying

The start offset should be x = 0, y = The value of y passed into the viewToModel function

The end offset should be x = alloc.x, y = alloc.y

Is this correct or have i misunderstood you somehow?

Once i get the information, i am not really sure how to use it to get the individual pages as a document object
maybe you can explain a little further if its of no inconvinience to you as i seem to be a liitle confused about getting the individual pages as a document object.

Hoping to hear from you

Yours Sincerely

Richard West

stanislavl
Offline
Joined: 2003-06-17

The MyComponentView seems to be ok. May be there are some anther errors somewhere in your code.

about pages.

You don't have to modify the viewToModel() emthod
just call it with the params i described to obtain pages offsets.

>Once i get the information, i am not really sure how to use it to get the individual pages as a document object
maybe you can explain a little further if its of no inconvinience to you as i seem to be a liitle confused about getting the individual pages as a document object.

You cannot get multiple document from one document. You have to create your own documents (for each page) from content of main document accroding to obtained start and end offsets for each page.

regards,
Stas

freesoft_2001
Offline
Joined: 2006-03-11

Hi everyone,

> The MyComponentView seems to be ok. May be there are
> some anther errors somewhere in your code.

It seems okay if i use in a normal JTextPane with your scaled editorkit but it does not scale when i use it with your paginated editorkit with scaling.

Am i supposed to do something else as well to get the same effect when i use it with your paginated editorkit with scaling?

> about pages.

> just call it with the params i described to obtain
> pages offsets.

Call the method? I really don't understand what you mean
The method seems to return an integer but what do i do with that single integer?

The signature of the function is as follows
[code]
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
[/code]

What do i put in for Shape and bias?
I think i have really confused myself very badly on the pages part.

> You have to create your own documents (for each page)
> from content of main document accroding to obtained
> start and end offsets for each page.

True that's the exact problem i am having, how do i get the content of that document by using the above params that you mentioned, i still don't see the picture.

Hoping to hear from you

Yours Sincerely

Richard West

stanislavl
Offline
Joined: 2003-06-17

>Am i supposed to do something else as well to get the same effect when i use it with your paginated editorkit with scaling?
Obviously there are some bugs in your code but I can't say where. Debug the code to see what happens.

>What do i put in for Shape and bias?
Shape could be a rectangle width=textPane.getWidth()
height=textPane.getHeight();

Bias must be Forward (I suppose you don't have bidirectinal fragments).

>True that's the exact problem i am having, how do i get the content of that document by using the above params that you mentioned, i still don't see the picture.

After calling viewToModel you will have offsets of start and end of pages.

For example:
0, 100,235,357.... doc.getLength();

It mean content of first page starts from 0 and the last letter on the page has 100 offset.
The second page starts from 100 and ends 235 etc.

Then get content for each page from original document.

regards,
Stas

freesoft_2001
Offline
Joined: 2006-03-11

Hi everyone,

>After calling viewToModel you will have offsets of start >and end of pages.

From the signature of the viewToModel function it returns a single integer and not an array of integers.

Do you mean that that i have to keep on calling the viewToModel function and i will automatically get the next offset as below for example

viewToModel() - i call the function and the offset is 0
viewToModel() - i call the function again and the offset is 100

Is the above what you mean or have i misunderstood what you mean somehow?

If it is of no inconvinience to you could you elaborate on the part of this part a bit more so that i may get a clearer picture of what you mean.

> Bias must be Forward (I suppose you don't have
> bidirectinal fragments).

I am using your editorkit scaling code and i am also calling the il8n property so to my knowledge this involves bidirectional text but please correct me if i am wrong.

In this case if bidirecional Text is involved do i still specify the bias as Forward or as BackWard or is there something else i have to put in for bias if bidirectinal text is involved.

One more thing in the signiture of the viewToModel function as shown below is this
[code]
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
[/code]

It seems Position.Bias is an array but if i still don't get what are the values i should pass into this array and how large should the array be or have i misunderstood something.

If it is of no inconvinience to you could you elaborate on the part of the Position.Bias part a bit because the array part has confused me a bit.

Hoping to hear from you

Yours Sincerely

Richard West

freesoft_2001
Offline
Joined: 2006-03-11

Hi everyone,

Stanislav are you there?

Richard West

freesoft_2001
Offline
Joined: 2006-03-11

Hi everyone

Anyone there?

Richard West

sreehari
Offline
Joined: 2003-11-26

hi,

i am harry. i am facing few problems in developing a simple drag n drop application. i need ur assistance . can u please send me the source code for a simple drag n drop application.

Task: 1. create a controller( ex: button ) in a container, so that we have to drag the controller to different locations in that container.

task: 2. create a controller( ex: button ) in a container, so that we have to drag the controller to different [b]containers.[/b]

thanks,

harry

ykamran
Offline
Joined: 2006-08-11

Hello Everyone

Currently I am working on an RTF Text Editor and i am caught i an problem. I want to add Scaling feature with Paging in by Editor but i am stuck there. I have implemented the Stas Code of Paging and found the desired output as i have achieved the Paging problem but when i implement Scaling with Paging everything goes haywire. I searched through the Internet for the problem and only found your conversation with Stas on Java Forum Helpful. I tried to extract code from Stas Help but could not.
After reading the forum i found out that you have successfully implemented the SectionView Class needed to implement Paging and Scaling in JTextPane. Please help me in this regards. If you could send me the source code of SectionView Class i will be grateful to you.

Waiting for your kind and urgent response.

--
Regards.
Yahya Kamran.

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

Stanislav, i have been trying to do this scaling thing for some time and its simply not working.
i have been trying to integrate your scaling code together with the section view of your pagination but still i could not get it to work after some time. The thing is that the cursor alsways seems to be misplaced. I can type the scaled text but the original text appears together with it(it seems strange). I remember that you said that all i had to do was to combine the methods but they don't seem to work.

I am listing the combined version of the section view class. If it is of no inconvinience to you maybe you could see where i had gone wrong

[code]
class SectionView extends BoxView
{
int pageNumber = 0;

public int getPageCount()
{
return pageNumber;
}

public SectionView(Element elem, int axis)
{
super(elem,axis);
}

protected void layout(int width, int height)
{
width = pageWidth-2 * DRAW_PAGE_INSET - pageMargins.left - pageMargins.right;
this.setInsets((short) (DRAW_PAGE_INSET + pageMargins.top),
(short)(DRAW_PAGE_INSET + pageMargins.left), (short)(DRAW_PAGE_INSET + pageMargins.bottom),
(short)(DRAW_PAGE_INSET + pageMargins.right));

//add
//super.layout(new Double(width * getZoomFactor()).intValue(), new Double(height * getZoomFactor()).intValue());
//up
super.layout(width, height);
}

public float getMaximumSpan(int axis)
{
return getPreferredSpan(axis);

//add

//float f = super.getMaximumSpan(axis);
//f *= getZoomFactor( );
//return f;
}

public float getMinimumSpan(int axis)
{
return getPreferredSpan(axis);
//add

//float f = super.getMinimumSpan(axis);
//f *= getZoomFactor( );
//return f;
}

public float getPreferredSpan(int axis)
{
float span = 0;

if (axis == View.X_AXIS)
{
span = pageWidth;
//span = (float)(pageWidth * getZoomFactor( ));
}

else
{
span = pageHeight * getPageCount();
//span = (float)(pageHeight * getPageCount() * getZoomFactor());
}

return span;
}

protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans)
{
super.layoutMajorAxis(targetSpan, axis, offsets, spans);
int totalOffset=0;
int n=offsets.length;
pageNumber=0;

for(int i = 0; i < n; i++)
{
offsets[i] = totalOffset;
View v = getView(i);

if((offsets[i] + spans[i]) >
(pageNumber * pageHeight - DRAW_PAGE_INSET * 2 - pageMargins.top - pageMargins.bottom))
{

if((v instanceof MultiPageView) && (v.getViewCount()>1))
{
MultiPageView multipageView=(MultiPageView)v;
int space = offsets[i] - (pageNumber - 1) * pageHeight;

int breakSpan=(pageNumber * pageHeight-DRAW_PAGE_INSET * 2 -
pageMargins.top - pageMargins.bottom) - offsets[i];

multipageView.setBreakSpan(breakSpan);
multipageView.setPageOffset(space);
multipageView.setStartPageNumber(pageNumber);
int height=(int)getHeight();

int width = ((BoxView)v).getWidth();

if(v instanceof PageableParagraphView)
{
PageableParagraphView parView=(PageableParagraphView)v;
parView.layout(width,height);
}

pageNumber=multipageView.getEndPageNumber();
spans[i]+=multipageView.getAdditionalSpace();
}

else
{
offsets[i]=pageNumber * pageHeight;
pageNumber++;
}

}

totalOffset = (int)Math.min((long) offsets[i] + (long) spans[i], Integer.MAX_VALUE);
}

}

public void paint(Graphics g, Shape a)
{
//This overrided paint function paints the layout of the pages
//add

Graphics2D g2d = (Graphics2D)g;

g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);

double zoomFactor = getZoomFactor();
AffineTransform old=g2d.getTransform( );
g2d.scale(zoomFactor, zoomFactor);
//super.paint(g2d, a);
//g2d.setTransform(old);
//up

Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a : a.getBounds();
Shape baseClip = g.getClip().getBounds();
int pageCount = getPageCount();
Rectangle page = new Rectangle();
page.x = alloc.x;
page.y = alloc.y;
page.height = pageHeight;
page.width = pageWidth;

for(int i = 0; i < pageCount; i++)
{
page.y = alloc.y + pageHeight * i;
paintPageFrame(g, page, (Rectangle) baseClip);
g.setColor(Color.black);
g.drawString("Page: " + Integer.toString(i + 1) + "/" + Integer.toString(pageCount),
page.x + page.width - 100,
page.y + page.height - 3);
}

super.paint(g,a);

g.setColor(Color.gray);

//The below command line fills background of pages

int currentWidth = (int)alloc.getWidth();
int currentHeight = (int)alloc.getHeight();
int x = page.x + DRAW_PAGE_INSET;
int y = 0;
int w = 0;
int h = 0;

if(pageWidth < currentWidth)
{
w = currentWidth;
h = currentHeight ;
g.fillRect(page.x + page.width, alloc.y, w, h);
}

if(pageHeight * pageCount < currentHeight)
{
w = currentWidth;
h = currentHeight ;
g.fillRect(page.x, alloc.y + page.height * pageCount, w, h);
}

}

public void paintPageFrame(Graphics g, Shape page, Rectangle container)
{
Rectangle alloc = (page instanceof Rectangle) ? (Rectangle) page : page.getBounds();

if(container.intersection(alloc).height <= 0)
{
return;
}

Color oldColor = g.getColor();

//The below six command lines sets the border of the pages

g.setColor(Color.gray);
g.fillRect(alloc.x, alloc.y, alloc.width, DRAW_PAGE_INSET);
g.fillRect(alloc.x, alloc.y, DRAW_PAGE_INSET, alloc.height);
g.fillRect(alloc.x, alloc.y + alloc.height - DRAW_PAGE_INSET, alloc.width, DRAW_PAGE_INSET);
g.fillRect(alloc.x + alloc.width - DRAW_PAGE_INSET, alloc.y, DRAW_PAGE_INSET, alloc.height);

//The below six command lines sets the frame of the pages

g.setColor(Color.black);
g.drawLine(alloc.x + DRAW_PAGE_INSET, alloc.y + DRAW_PAGE_INSET,
alloc.x + alloc.width - DRAW_PAGE_INSET, alloc.y + DRAW_PAGE_INSET);

g.drawLine(alloc.x + DRAW_PAGE_INSET, alloc.y + DRAW_PAGE_INSET,
alloc.x + DRAW_PAGE_INSET, alloc.y + alloc.height - DRAW_PAGE_INSET);

g.drawLine(alloc.x + DRAW_PAGE_INSET, alloc.y + alloc.height - DRAW_PAGE_INSET,
alloc.x + alloc.width - DRAW_PAGE_INSET, alloc.y + alloc.height - DRAW_PAGE_INSET);

g.drawLine(alloc.x + alloc.width - DRAW_PAGE_INSET, alloc.y + DRAW_PAGE_INSET,
alloc.x + alloc.width - DRAW_PAGE_INSET, alloc.y + alloc.height - DRAW_PAGE_INSET);

//The below two command lines sets the shadow border of the pages

g.fillRect(alloc.x + alloc.width - DRAW_PAGE_INSET,
alloc.y + DRAW_PAGE_INSET + 4, 4, alloc.height - 2 * DRAW_PAGE_INSET);

g.fillRect(alloc.x + DRAW_PAGE_INSET + 4,
alloc.y + alloc.height - DRAW_PAGE_INSET, alloc.width - 2 * DRAW_PAGE_INSET, 4);

g.setColor(oldColor);
}

// add

public Shape modelToView(int pos, Shape a, Position.Bias b)
throws BadLocationException {
double zoomFactor = getZoomFactor( );
Rectangle alloc;
alloc = a.getBounds( );
Shape s = super.modelToView(pos, alloc, b);
alloc = s.getBounds( );
alloc.x*=zoomFactor;
alloc.y*=zoomFactor;
alloc.width*=zoomFactor;
alloc.height*=zoomFactor;

return alloc;
}

public int viewToModel(float x, float y, Shape a,
Position.Bias[ ] bias) {
double zoomFactor = getZoomFactor( );
Rectangle alloc = a.getBounds( );
x/=zoomFactor;
y/=zoomFactor;
alloc.x/=zoomFactor;
alloc.y/=zoomFactor;
alloc.width/=zoomFactor;
alloc.height/=zoomFactor;

return super.viewToModel(x, y, alloc, bias);
}

public double getZoomFactor( ) {
Double scale=(Double)getDocument( ).getProperty("ZOOM_FACTOR");
if (scale!=null) {
return scale.doubleValue( );
}

return 1;
}

}
[/code]

The thing i don't understand is that why is thgere a copy of text inserted into the document each time i type something?

I know you are pressed for time and sincerely apologize for bothering you on this topic.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

Anonymous

Richard, why do you comment the scaling related code?
You do layout without scaling. That's one of possible reasons.

Another one you commented restoring of transformation in paint(). Why?

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

On your first question, i tried both codes doing layout without scaling and vice-versa but still got the same esult in which the cursor seems displaced.

On your second question, i commented the transform because with the transform the scaled text i type appears together with the original text in the document

I have tried almost all possible avenues to integrate your scaling code but of no avail.

Am i missing something??

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

Stanislav are you there??

Richard West

Anonymous

I'm here.
I read the forum 2-3 times a week. The problem is I can't implement that myselft because of lack of time as I mentioned before.

I told you possible reasons of not working code and don't have any more suggestions.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

> I told you possible reasons of not working code and
> don't have any more suggestions.

Please stas don't be angry.

It seems you are the only guy around that knows how to do the scaling for a paginated jeditorpane.

This problem has been plaguing my soul for much too long
and that's why i need to know what to do to achieve scaling for a paginated jeditorpane and would really appreciate any help from you stas.

Yours Sincerely

Richard West

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

Stanislav are you there?

I really need your help on this scaling issue as i am really out of answers myself

Richard West

Anonymous

Richard, I will not implement it for you. At least not for free. You have all the codes of scaling and pagination to implement what you need. You don't ask questions but code.

If you don't understand some code in the both examples just ask you questions or guesses here and someone (may be me) will answer.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

>You don't ask questions but code.

Sorry if it sounded that way as i would cetainly not ask you to do this as i know its being unfair to you.
I do apologize if i sounded that way

> If you don't understand some code in the both
> examples just ask you questions or guesses here and
> someone (may be me) will answer.

Actually i do have some questions but i will ask them one by one so bear with me.

You see in your scaling code you overrided the section view. Now what i did was to add your scaling code to that same section view in the pagination code.

The question is do i have to add that scaling code to other view(ie. the PageableParagraphView) as well or is that not required or are there any other views that i need to override to get the desired scaling effect i require.

Another thing i notice is that if i manage to scale the page the rest of the layout on the bottom remains white even after repainting. Could this be because that when i scale the layout, the surrounding page layout must actually be scaled up or am i wrong about this

Another thing i also realize is that if scaling is actually successful the cursor is actually displaced(i am not talking about the glyph). You see if the page is unscaled the cursor appears exactly where it is supposed to be within the page but if it is scaled the cursor always appears at the extreme left outside the page. What do you think in your opinion is causing this?

Hoping to hear from you stas

Yours Sincerely

Richard West

Anonymous

All the scaling must be done in section view. All the rest views should remain as is.

You incorrectly scale and don't restore transform in the end. That's the problem.

Displacement of cursor means you incorrectly wrote modelToView method.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

> You incorrectly scale and don't restore transform in
> the end. That's the problem.

The pages now scale as they are supposed to

> Displacement of cursor means you incorrectly wrote
> modelToView method.

The cursor is now at the right position

I have however only one error left.

You see if the page is at 100% size the surrounding border around the page(the gray frame painted around the page) on the bottom of the page is correct.

If the page is at 50% the surrounding border around the page is is also correct execept at the bottom area of the page where its all white instead of gray as its supposed to be.

What do you think is causing this?

Do i have to do any scaling in the paintPageFrame method and the layoutMajorAxis method in the section view?

How do i correct this?

Hoping to hear from you stas

Richard West

Anonymous

You have to fill content with the same color. You can do that in the paint() method of section view.

All you need is to get available width (it's passed in the layout() method) and page width (that's your constant multiply scale factor).

Just fill rectangle if availableWidth > pageWidth.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

> You have to fill content with the same color. You can
> do that in the paint() method of section view.

I already set the color for that but i doubt that is the problem at all

> All you need is to get available width (it's passed
> in the layout() method) and page width (that's your
> constant multiply scale factor).
>
> Just fill rectangle if availableWidth > pageWidth.

What you are saying is that i have to add that condition in the section paint and not the paintPageFrame method right?

Now the thing is that the rectangle is drawn correctly only for letter sized paper but when it goes horribly wrong when i use other size papers(i.e. A3, A2, etc)

I find it puzzling why it would work for one size and not another.

Would like to see the paint method(the scaling part) for the section view that i did?

Richard West

Anonymous

Yes, please post whole SectionView class' code.

In your paint() should be added code like this.
[code]
g.setColor(fillColor);
// Fills background of pages */
if (pageWidth * scale < currentWidth) {
w = new Double(currentWidth / scale - pageWidth).intValue();
h = new Double(currentHeight / scale).intValue();
g.fillRect(page.x + page.width, alloc.y, w, h);
}
if (pageHeight * pageCount * scale < currentHeight) {
w = new Double(currentWidth / scale).intValue();
h = new Double(currentHeight / scale - pageHeight).intValue();
g.fillRect(page.x, alloc.y + page.height * pageCount, w, h);
}
[/code]

please check what are page.x and page.width and actual width (set from layout()).
regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

I finally have gotten the scaling working thanks to you stas. I still have some questions on why you do certain things so maybe you can explain them to me

What is actually the purpose of the viewToModel method you have in your original code?

You see in the viewToModel method in your original aticle you did this(please assume a scaling factor of 50%)

[code]
public int viewToModel(float x, float y, Shape a,
Position.Bias[] bias) {
Rectangle alloc = a.getBounds();

x/= 0.5;
y/= 0.5;
alloc.x/= 0.5;
alloc.y/= 0.5;
alloc.width/= 0.5;
alloc.height/= 0.5;

return super.viewToModel(x, y, alloc, bias);
}
[/code]

why is it not like this instead

[code]
public int viewToModel(float x, float y, Shape a,
Position.Bias[] bias) {

Rectangle alloc = a.getBounds();

x*= 0.5;
y*= 0.5;
alloc.x*= 0.5;
alloc.y*= 0.5;
alloc.width*= 0.5;
alloc.height*= 0.5;

return super.viewToModel(x, y, alloc, bias);
}
[/code]

Yours Sincerely

Richard west

Anonymous

The method calculates where caret should be placed when you click in the JEditorPane.

1. You click on the pane.
x and y coordinates are passed to the method.

2. If your scale=0.5 and you click on 100, 100 point that would mean 200, 200 in unscaled content, right?

3. So you have to divide your coordinates and allocation rect.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

> The method calculates where caret should be placed
> when you click in the JEditorPane.

Isn't that the purpose of the modelToView method as well.
Correct me if i am wrong.

On another issue which has nothing to do with scaling let's say if i have three pages in my paginated JTextPane and the cursor is on page 2 how do i get the current page number the cursor is on. A rough explanation would help

Another thing is that i have already implemented my own table views to add tables into the styled document but here is the kicker when i use the below glyph property
the table simply becomes corrupted

[code]
StyledDocument.putProperty("i18n", Boolean.TRUE);
[/code]

but if i omit the above property all is alright. My question is do you know of any other properties that has the same effect as the above glyph property but will not distrupt any table views.

Yours Sincerely

Richard West

Anonymous

The property is used to provide fractionla metrics in views.

You can write your own GlyphPainter (see sun's GlyphPainter1 and GlyphPainter2 classes. They are not public though so you can't extend them) and set the painter to LabelView.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

Thanks stas, but stas i read your other article on scaling but i can't seem to get it right to work. Do you know how i can incorporte both the scaling and pagination into a single class extending from the styled editor kit.

I hope this is of no inconvience to you

Thank You

Yours Sincerely

Richard West

Anonymous

You can get the code of pagination and add all the scaling required methods.
They both have the same root view (for section element) all you need is to combine the methods.

Unfortunately I have lack of time right now and can't provide the integrated code.

regards,
Stas

freesoft_2000
Offline
Joined: 2005-09-06

Hi everyone,

Stanislavl, i realize that you code for pagination(on java sun forum)works well for rtf documents but does not seem to work at all for html documents.

I tried extending from the html editor kit instead of the rtf editor kit like you did in your original code. Do i have to change something in the PageableViewFactory class. What are the neccessary changes do i have to do to your existing pagination code for rtf documents for me to have pagination on html documents. Any example codings would be helpful

Sorry again to bother and for any inconvinience caused to you again on this topic

Thank You

Your Sincerely

Richard West