The objects need to be able to be dragged outside of the layeredPane and back in again. A temporary fix being not allowing the objects to move completely outside of the jLayeredPane.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What we have now, I don't understand (as user) how does it work.
I think follows should be done:
1. Add combo of percentage at the top, so user will be able to select exact zoom he wants. Changing value of this combo will change value of zoomSlider and vice-versa.
2. All graphic objects will be redrawn to the new size after changing value of percentage (it may be reached by using scale() function of Graphics class).
3. During save/print, the coordinates of objects should be recalculated to zoom = 100% before actual save/print.
4. During load, all objects should be drawn according to the currently selected zoom.
What do you think ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree with all of the above. The difficulties lie in resizing text though. Also line size will be tricky to get right, especially if it is only 1 px wide.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am looking at the current implementation more carefully, and see that the implementation is correct from mathematic point of view:
All objects are drawn inside buffered image, which has the fixed size. After it, the buffered image is drawn on the slide itself in the way it will take the whole area of the slide. Size of area of the slide is depend on the selected zoom.
==========================================================
I will try following:
Buffered image will always have the same size as slide itself and use bufferGraphics.scale(....) before drawing objects.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The other detail I see: during increase zoom, the figures moves into right-down direction, which may mislead the user. If user, for example, drew rectancle in the middle, he may suppose the rectangle will stay at the middle (with changed size of course).
This happens because the left-top point of slide is fixed corresponding to the slides frame. We should try to make central point fixed. Is it possible to set left-top point to have negative coordinates ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well the code to resize when the slider is moved should be the same as the code that resizes the slide for slideShow. However with all that is going on with the slide in MainFrame (layout manager, different listeners etc.) it might be easier to get the code working for resizing to the slideshow first then implementing it to the slider action event.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The objects need to be able to be dragged outside of the layeredPane and back in again. A temporary fix being not allowing the objects to move completely outside of the jLayeredPane.
I will work on it.
What we have now, I don't understand (as user) how does it work.
I think follows should be done:
1. Add combo of percentage at the top, so user will be able to select exact zoom he wants. Changing value of this combo will change value of zoomSlider and vice-versa.
2. All graphic objects will be redrawn to the new size after changing value of percentage (it may be reached by using scale() function of Graphics class).
3. During save/print, the coordinates of objects should be recalculated to zoom = 100% before actual save/print.
4. During load, all objects should be drawn according to the currently selected zoom.
What do you think ?
I agree with all of the above. The difficulties lie in resizing text though. Also line size will be tricky to get right, especially if it is only 1 px wide.
I am looking at the current implementation more carefully, and see that the implementation is correct from mathematic point of view:
All objects are drawn inside buffered image, which has the fixed size. After it, the buffered image is drawn on the slide itself in the way it will take the whole area of the slide. Size of area of the slide is depend on the selected zoom.
==========================================================
I will try following:
Buffered image will always have the same size as slide itself and use bufferGraphics.scale(....) before drawing objects.
The idea to replace size of BufferedImage was not successful. I got out-of-memory excetion during continues movig value of zoomSlider.
I used following code in Slide.applyZoom():
AffineTransform tx = AffineTransform.getScaleInstance(this.getZoom(), this.getZoom());
AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
this.buffer = op.filter( this.buffer, null);
this.bufferGraphics = this.buffer.createGraphics();
I also tried to used the commented piece of code (which actually makes the same) and got the same result: out-of-memory exception.
Do you have other ideas ?
The other detail I see: during increase zoom, the figures moves into right-down direction, which may mislead the user. If user, for example, drew rectancle in the middle, he may suppose the rectangle will stay at the middle (with changed size of course).
This happens because the left-top point of slide is fixed corresponding to the slides frame. We should try to make central point fixed. Is it possible to set left-top point to have negative coordinates ?
really this doesn't need to be done in the main program. Just one time before the slideshow is run.
I think you didn't understand me or I didn't understand you. I am talking about user moves slides resizer (at the right bottom to change zoom.
How it is connected to slideshow ?
Well the code to resize when the slider is moved should be the same as the code that resizes the slide for slideShow. However with all that is going on with the slide in MainFrame (layout manager, different listeners etc.) it might be easier to get the code working for resizing to the slideshow first then implementing it to the slider action event.