**This needs to be in java. **Please check the attached images for reference. **
ID: 3576580 • Letter: #
Question
**This needs to be in java.
**Please check the attached images for reference.
**I only need "Client Mode".
Client Mode
There should be a "Client Start" button that prompts for a client connection ("host:port" syntax), with "127.0.0.1:port" as the default, so the user can just hit return to start in the default way. This should try to start a client connection and set the status string to "Client mode". In Client Mode, the operation of the program is quite different. None of the edit operations add/delete, set color, move, resize should work. They should just do nothing. Instead, the client just synchronizes its model to show current model of the server. Selection can still work, but it's pretty meaningless without the ability to make any change to the selected shape.
**This needs to be in java.
**Please check the attached images for reference.
**I only need "Client Mode".
remove case. We want to be fast and specifi updated() for the one-shape-changing case, s TableRow that one that happens continuously during a mouse dra Hints and Suggestions Here are some other general ideas about the Whiteboard code our one design requirement is that the Dshape classes do not store the model data. Instead the Dshape has a pointer to a DshapeModel object, and it stores the data. The canvas and the shapes should be concemed with drawing, selection, and the knobs It's finc to add methods to the canvas, shape. and model classes as your design grows to support all the features. For example, it's fine to addsetters to the model for the convenience of the other classes. such as a and a move By kdx Under the set Bounds (Rectangle dy hood, you can simplify things by having the convenient method m aetBounds Performance is mostly not going to be a problem, so aim for a design that is clean and correct first, without worrying too much about performance. The one exception is that wc do care about performance during move and resize animation. Therefore, canvas paintcomponent hould be as straightforward as possibl avoid cxtranco computation and just draw all the shape Part A represents a little more than half work. Part B the layers on some neat data-handling features that build on the solid MVC design of part A. Part B File Saving and Networking Now we turn to the "advanced" features of the Whiteboard. Before working on these, you want to have core MVC. se-draw part of the code lolal y cleaned up and debugged, since the advanced features build on the basic MVC core. This handout presc s the file saving first, then the nctwork operations, although n reality you could add the fea er order. There is no additional starter code for these features. but feel free to res in C get code from the relevant lecture examples (the Java code for the lecture examples is available in the hw directory File Save/Open Add support for very basic file savciopen support with two buttons Save and Open. This part of the code me earlier parts, Save should prompt the user for a filename and should be relatively easy, as it builds on rite the current model to it. Save should work if the whiteboard is in normal. client, or server mode. The Open button should prompt the user to select file, clear out any existing state, and read in the state from the filc. Op en only needs to work with the Whiteboard in normal mode, not clicnt or server mode. We are not implementing the dirty bit or Save As. To implement save, build a temporary Ds pe Mode J array, and then use Java's bu XML encode machinery to write out. To read a file, use the XML decoder to re-create the array, and then run t ose models through the add-shape bottleneck to populate the canvas. The shapes when read in should appear to have the same back-front order they had when saved out. See the lecture saveopen example, which demonstrates exactly this strat you may nccd to adjust the getters/scttcr public interfacc of DshapeModel a little so the XML machinery can use your model properly. After saving afile, open it up in a text editor to see that the object is being written out the way yo ntend. Finally, add a Save Image button that prompts the user for a filename and saves the current appearance of the canvas to a PNG file (see the lecture exampl Create some sort of drawing in your program and save it as "arl-yourname.png" which i one of the deliverables. Detail: don't draw the knobs in the saved image of the canvas. Optionally Invest a littlc artistic cffort in your picturc to cxprcsscs your foclings about Java, OOP, or somcthing clscExplanation / Answer
Whiteboard.java
========================================================================
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.