0

So in the beginner coding classes I teach, they've (the district) moved us away from the Graphics library with java.awt.* and java.swing.* to the simplified standard graphics library, StdDraw -- not necessarily a bad thing as it has most of the bells and whistles that my students need and we only really use it for one chapter and then its an option for a later project if they feel more artsy that analytical. It also more closely mirrors the coordinate system they're using in math classes and logically makes more sense to them defining center pionts to draw instead of corners.

One of the things I really wish it had was the ability to draw sectors/wedges/slices of circles. It does arcs (the portions of a circumference), but especially for the graphical [pie] charts, it's quite essential. For the moment they're just coloring the arcs and we're going on with the lessons. But for NEXT year, I'm hoping I can edit something into the library ahead of time and let them use it traditionally without going against the other teachers across the (large) district and utilizing two graphical libraries "StdDraw" and "g" or being the lone one who uses g entirely.

Most results online suggest migrating to the g-library, my only hesitation was the explicit move away from that for the younger students. More advanced, older may still use it, but I don't teach them. A decent Google, reddit and stackoverflow search didn't return anything that I could just plug into the StdDraw library so wondering if you have any suggestions or work-arounds?

Skelefish
  • 1
  • 2
  • Answering the question in your title, you can use the decorator pattern and create a parent class to expand the functionality of `StdDraw`. I have no idea what the "g-library" refers to. – Gilbert Le Blanc Jan 25 '23 at 20:18
  • the g-library (idk if it has another name) was the old library we used everything was g.setFont(), g.drawPolygon(), etc. Sorry for my shorthand. – Skelefish Jan 25 '23 at 21:20
  • The "g-library" is actually the `Graphics` and `Graphics2D` classes in Java. Yes, using native Swing components removes your dependency on an educational class or library. – Gilbert Le Blanc Jan 25 '23 at 22:09

0 Answers0