Skip to content
Connor Elsea edited this page May 19, 2015 · 15 revisions

Introduction

Reading through the list of classes below and their descriptions should familiarize you with the software design of the XShot application. The list is good for keeping up with ideas and letting contributors easily learn or critique the design patterns used.

Classes

Driver and Startup

PROGRAM STARTUP, INITIALIZATION

Driver

Both Driver and Program are contained in the com.elsealabs.xshot.program package. The Driver class is not a representation of anything and exists solely to hold the main method, which then launches the Program representation defined by the Program class. The Driver exists so that, even if the Program class or its implementation changes dramatically in the future, the entry point to the entire program can be easily found.

Program

The Program class is a representation of the program as a whole. it holds all relevant objects and handles program startup.

Views and View Management

MVC, VIEWS, ORGANIZATION, AND COMPONENT SYSTEMS

View Manager

The View Manager is a singleton object that contains all of the views. If needed in the future, Views will be able to easily access information about each other.

View Abstract

A View, which is represented in its purest form by the View Abstract class, is a parent-level display. It can be implemented in many different ways and is most commonly implemented in XShot using a JFrame, such as in View Capture.

An implementation of View Abstract, such as View Capture, contains a JFrame object and severely other Swing objects that allow it to build a view. This view just happens to be a JFrame, but for example, if it were to contain equivalent JavaFX classes, that would be okay.

View implementations are stored in com.elsealabs.xshot.graphics.views.

Component

A component is any child part of a view that is complicated enough to be brought into its own class. There is no regulation as to what these are implemented as and there is no abstract class or interface defining what standards these must meet because they can be very different. This is more of a way to group relevant information than completely abstract out this facet of the program.

View Capture

VIEWING CAPTURE, SCALING, ANNOTATIONS, AND MORE

Scale

In order to allow zooming, multiple parts of the system must be affected by the same scale variable. For example, the coordinates of a mouse click have to be scaled, as well