Add some docs
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import app.AppModule;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import presenters.MainPresenter;
|
||||
import presenters.NavPresenter;
|
||||
import ui.implementation.components.nav.NavBar;
|
||||
import ui.implementation.views.MainView;
|
||||
import ui.interfaces.IMainView;
|
||||
|
||||
@@ -17,6 +17,7 @@ import ui.interfaces.IMainView;
|
||||
import ui.interfaces.INavBar;
|
||||
|
||||
/**
|
||||
* Gathers some configurations in order to set the dependency injection container up
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class AppModule extends AbstractModule {
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package app;
|
||||
|
||||
/**
|
||||
* Provides some endpoints to browse between views
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public interface INavigator {
|
||||
|
||||
/**
|
||||
* Displays Fourier view
|
||||
*/
|
||||
void showFourier();
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import ui.implementation.views.DoubleMatrix;
|
||||
|
||||
/**
|
||||
* Concrete implement of the INavigator interface.
|
||||
* Implements abstract endpoints to displays views in a Swing way
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class SwingNavigator implements INavigator {
|
||||
|
||||
private final Provider<DoubleMatrix> doubleMatrixProvider;
|
||||
|
||||
@@ -8,6 +8,9 @@ import domain.events.ImageChangedEvent;
|
||||
import domain.events.ModeChangedEvent;
|
||||
import domain.image.Image;
|
||||
|
||||
/**
|
||||
* Represents the global state of the app
|
||||
*/
|
||||
@Singleton
|
||||
public class AppState extends State {
|
||||
|
||||
|
||||
@@ -2,6 +2,12 @@ package app.state;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Represents any states that could ever exist.
|
||||
* In order to notify the caller about any change made to internal properties of a children state, the caller
|
||||
* must register itself
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public abstract class State {
|
||||
|
||||
protected EventBus eventBus;
|
||||
@@ -10,6 +16,10 @@ public abstract class State {
|
||||
this.eventBus = eventBus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the caller so it can be notifed from changes within the state
|
||||
* @param obj the caller itself
|
||||
*/
|
||||
public void register(Object obj) {
|
||||
eventBus.register(obj);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package domain.common;
|
||||
|
||||
/**
|
||||
* Provides some pseudo-types to identify a drawing mode
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public enum Mode {
|
||||
DISABLED,
|
||||
DRAW_PIXEL,
|
||||
|
||||
@@ -5,6 +5,7 @@ import infrastructure.image.io.ImageSaver;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Represents a matrix of gray-scaled pixels
|
||||
* @author Jean-Marc Wagner, Laurent Crema
|
||||
*/
|
||||
public class GrayScaleMatrix {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package domain.image.processing.complex;
|
||||
|
||||
/**
|
||||
* @author Jean-Marc Wagner
|
||||
*/
|
||||
public class ComplexMatrix
|
||||
{
|
||||
private Complexe m[][];
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package domain.image.processing.complex;
|
||||
|
||||
/**
|
||||
* @author Jean-Marc Wagner
|
||||
*/
|
||||
public class Complexe
|
||||
{
|
||||
private double partieReelle;
|
||||
|
||||
@@ -2,6 +2,9 @@ package domain.image.processing.fourier;
|
||||
|
||||
import domain.image.processing.complex.ComplexMatrix;
|
||||
|
||||
/**
|
||||
* @author Jean-Marc Wagner
|
||||
*/
|
||||
public class Fourier
|
||||
{
|
||||
public static ComplexMatrix Fourier2D(double f[][])
|
||||
|
||||
@@ -3,6 +3,9 @@ package domain.image.processing.histogram;
|
||||
import domain.image.GrayScaleMatrix;
|
||||
import domain.image.Image;
|
||||
|
||||
/**
|
||||
* @author Jean-Marc Wagner
|
||||
*/
|
||||
public class Histogramme {
|
||||
public static int[] Histogramme256(GrayScaleMatrix mat) {
|
||||
int M = mat.getHeight();
|
||||
|
||||
@@ -8,6 +8,9 @@ import java.io.IOException;
|
||||
import domain.image.Image;
|
||||
import domain.image.Pixel;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class ImageLoader {
|
||||
|
||||
public static Image loadImage(File f) throws IOException {
|
||||
|
||||
@@ -4,6 +4,9 @@ import domain.image.Image;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class ImageSaver {
|
||||
|
||||
public static void saveImage(Image image) throws IOException {
|
||||
|
||||
@@ -5,6 +5,9 @@ import domain.image.Pixel;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public final class ImageMapper {
|
||||
|
||||
public static BufferedImage toBufferedImage(Image image) {
|
||||
|
||||
@@ -12,6 +12,9 @@ import infrastructure.image.io.ImageSaver;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class ImageService {
|
||||
|
||||
private final AppState appState;
|
||||
|
||||
@@ -4,6 +4,9 @@ import app.state.AppState;
|
||||
import com.google.inject.Inject;
|
||||
import domain.common.Mode;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class ModeService {
|
||||
|
||||
private final AppState appState;
|
||||
|
||||
@@ -8,7 +8,9 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class ImagePanel extends JPanel {
|
||||
private BufferedImage image;
|
||||
private double scale;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package ui.implementation.components.intent;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema
|
||||
*/
|
||||
public class FileChooser extends JFileChooser {
|
||||
|
||||
public FileChooser(String initialLocation) {
|
||||
|
||||
@@ -3,6 +3,9 @@ package ui.implementation.components.nav;
|
||||
import javax.swing.*;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema, Jean-Marc Wagner
|
||||
*/
|
||||
public class Menu extends JMenu {
|
||||
|
||||
public Menu(String title, JMenuItem... items)
|
||||
|
||||
@@ -4,6 +4,9 @@ import javax.swing.*;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema, Jean-Marc Wagner
|
||||
*/
|
||||
public class MenuItem extends JMenuItem {
|
||||
|
||||
public MenuItem(String title, ActionListener listener) {
|
||||
|
||||
@@ -3,6 +3,9 @@ package ui.implementation.dialogs;
|
||||
import java.awt.Color;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema, Jean-Marc Wagner
|
||||
*/
|
||||
public class GreyScaleImageCreatorDialog extends ImageCreatorDialog
|
||||
{
|
||||
private JSlider slider;
|
||||
|
||||
@@ -2,6 +2,9 @@ package ui.implementation.dialogs;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema, Jean-Marc Wagner
|
||||
*/
|
||||
public class GreyScalePicker extends javax.swing.JDialog
|
||||
{
|
||||
private int couleur;
|
||||
|
||||
@@ -4,6 +4,9 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema, Jean-Marc Wagner
|
||||
*/
|
||||
public abstract class ImageCreatorDialog extends JDialog
|
||||
{
|
||||
protected Color color;
|
||||
|
||||
@@ -3,6 +3,9 @@ package ui.implementation.dialogs;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author Laurent Crema, Jean-Marc Wagner
|
||||
*/
|
||||
public class RGBImageCreatorDialog extends ImageCreatorDialog
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user