Version 4 (modified by tanya, 16 years ago) (diff) |
---|
Analysis
Overview
Z-order of frames is an ordering of overlapping frames, so that one frame can hide part or all of the another. When two frames overlap, their Z-order determines which one appears on top of the other. The frame with higher z-order appears on the top. When a frame is created its z-order is the highest among the frames in the page. Two frames can't have the same z-order. When focus is requested to a frame, the frame appears on the top of the others but its z-order in the model doesn't change. When the same frame lose focus, it appears on the appropriate layer. The way to change the z-order is with the appropriate halo buttons (at least this is for now). So in this task a halo for increasing and a halo for decreasing the z-order of a frame should be created. If a frame has z-order equal to 4 and its z-order is increased to 5, then the frame which had z-order 5 before that will become with z-order 4.
Task requirements
- The frame should have z-order and to be displayed according to it.
- The frame should provide halo buttons to increase and decrease the z-order of the frame.
- The z-order of the frame should follow the concept given in the overview of the task.
Task result
- The result of the task should be source code.
Implementation idea
- Create z-order property in the model of the frame where the frame will keep its z-order.
- Use JLayerPane and the setLayer() method to visualize the different z-orders of the frames.
Related
How to demo
- Create two frame.
- Assert that the second frame has higher z-order.
- Increase the z-order of the first created frame.
- Assert that the first created frame has higher z-order than the second one.
- Decrease the z-order of the first created frame.
- Assert that the second created frame has higher z-order than the first one.
- Create some more frame.
- Assert that the given rules are valid for more that two frames.
Design
Implementation
(Implementation results should be described and linked here (from the wiki or the repository))
Testing
Comments
(Write comments for this or later revisions here.)