Skip to content

Commit

Permalink
Move main screen and switchmodes to gui package
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostFoxSledgehammer committed Dec 6, 2021
1 parent 88229a6 commit 01a7376
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'jacoco'
apply plugin: 'application'


mainClassName = "PanoViewer.PanoViewer"
mainClassName = "org.panoviewer.PanoViewer"

configurations {
// configuration that holds jars to include in the jar
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/panoviewer/PanoViewer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: GPL. For details, see LICENSE file.
package org.panoviewer;

import org.panoviewer.gui.MainScreen;

/**
*
* @author kshan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
// License: GPL. For details, see LICENSE file.
package org.panoviewer;
package org.panoviewer.gui;

import org.panoviewer.utils.IOUtils;
import org.panoviewer.gui.Menu;
import javax.swing.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.dnd.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.List;

import static java.awt.dnd.DnDConstants.ACTION_COPY;
import java.io.IOException;

public class MainScreen extends JFrame implements DropTargetListener {

private JMenuBar menuBar = Menu.getInstance();
private JPanel jPanel;
private static MainScreen instance = new MainScreen();
private final JMenuBar menuBar;
private final JPanel jPanel;
private static MainScreen instance;

public static MainScreen getInstance() {
if (instance == null) {
instance = new MainScreen();
}
return instance;
}

private MainScreen() {
this.menuBar = Menu.getInstance();
setSize(600, 600);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Expand Down Expand Up @@ -70,8 +75,7 @@ public void drop(DropTargetDropEvent event) {
List<File> files = (List<File>) transferable.getTransferData(df);
displayImage(files.get(0));
}
} catch (Exception e) {
e.printStackTrace();
} catch (UnsupportedFlavorException | IOException e) {
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/panoviewer/gui/Menu.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// License: GPL. For details, see LICENSE file.
package org.panoviewer.gui;

import org.panoviewer.MainScreen;
import org.panoviewer.Mode;
import org.panoviewer.ModeRecorder;
import org.panoviewer.utils.IOUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// License: GPL. For details, see LICENSE file.
package org.panoviewer;
package org.panoviewer.gui;

import org.panoviewer.gui.jogl.FlatPanel;
import org.panoviewer.gui.jogl.PanoramicPanel;
Expand All @@ -8,6 +8,8 @@
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import org.panoviewer.Mode;
import org.panoviewer.ModeRecorder;

import static org.panoviewer.utils.imageutils.isRatio;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/panoviewer/utils/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

import java.awt.image.BufferedImage;
import org.panoviewer.FileChooser;
import org.panoviewer.MainScreen;
import org.panoviewer.SwitchModes;
import org.panoviewer.gui.MainScreen;
import org.panoviewer.gui.SwitchModes;

/**
*
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/org/panoviewer/CameraTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// License: GPL. For details, see LICENSE file.
package org.panoviewer;

import junit.framework.TestCase;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;
import org.junit.Test;

/**
* Tests {@link Camera}
*/
public class CameraTest extends TestCase {
public class CameraTest {

public CameraTest() {
}
Expand Down

0 comments on commit 01a7376

Please sign in to comment.