Property
objects on a map.
.zip
file
containing all of the code necessary to build your
application. Gradescope will only be checking to ensure that your code
complies with the course style guide. Hence, you may only submit
to Gradescope five times. If you can't get your code to comply with
the course style guide within five submissions, you will receive a
grade of 0 on the assignment.
.jar
file named
StaticMapApplication.jar
(that must NOT contain
any of the classes in multimedia2.jar
).
Gradescope will assign a maximum grade of 25 (based solely on style). Points will then be awarded manually based on the criteria discussed in the previous paragraph.
LogoApplication
class:
package homebase; //Java libraries import java.io.*; import javax.swing.*; //Multimedia libraries import app.*; // Application libraries import gui.*; import realestate.*; /** * An application that displays a logo. * * @author Prof. David Bernstein, James Madison University * @version 1.0 */ public class LogoApplication extends HomeBaseApplication { private LogoPanel logoPanel; /** * Explicit value constructor. * * @param args The command line arguments */ public LogoApplication(final String[] args) throws IOException { super(args); logoPanel = new LogoPanel(WIDTH, HEIGHT-60); } /** * Get the GUI component that will be used to display the logo. * * @return The LogoPanel */ @Override protected JComponent getGUIComponent() { return logoPanel.getView(); } /** * Get the PropertyObserver to inform of changes. * * @return null */ @Override protected PropertyObserver getPropertyObserver() { return null; } /** * Construct and invoke (in the event dispatch thread) * an instance of this JApplication. * * @param args The command line arguments */ public static void main(final String[] args) throws IOException { JApplication app = new LogoApplication(args); invokeInEventDispatchThread(app); } }
It makes use of the following LogoBoard
class that is
a Visualization
that adds a single piece of
visual.statik.sampled.Content
(containing the logo) to
itself.
package gui; // Java libraries import java.io.*; // Multimedia libraries import io.*; import visual.*; import visual.statik.sampled.*; // Application libraries import resources.Marker; /** * A Visualization that can be used to display a logo. * * @author Prof. David Bernstein, James Madison University * @version 1.0 */ public class LogoPanel extends Visualization { private ResourceFinder jarFinder; /** * Explicit Value Constructor. * * @param width The width of this component (in pixels) * @param height The height of this component (in pixels) * @throws IOException if something goes wrong */ public LogoPanel(final int width, final int height) throws IOException { super(); jarFinder = ResourceFinder.createInstance(new Marker()); VisualizationView view = getView(); view.setBounds(0, 0, width, height); view.setSize(width, height); ContentFactory contentFactory = new ContentFactory(jarFinder); Content logo = contentFactory.createContent("logoHomeBase.png", 4); logo.setLocation(0, 0); add(logo); } }
.jar
file must
contain the HomeBase logo in "color", it must not contain a gray-version.
You can gray-out the "color" version using a BufferedImageOp
.
Shape
object from
geographic boundary files is to use a Path2D.Float
or Path2D.Double
object.
visual.statik.sampled.ImageFactory
object.
Copyright 2024