Get a roll of brown kraft paper from craft store. Cut and tape together as needed to make a template of what your replacing. Its the Best way to make an exact fit for your boat. Use marine grade plywood and a jigsaw to cut. Make sure you use matching thickness to what you already have to minimize any weight change. Be sure to well seal (varnish or paint) the edges and undersides before you screw in place.
I just redid the interior of my J24... Kept the shelf frames, but got new shelves cut from marine plywood. Then I painted and varnished everything. And replaced the nav table and armrest, too. I got plexiglass sliding doors custom cut for the shelves. What do you think?