Skip to content

Commit

Permalink
Add License, refactor class and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostFoxSledgehammer committed Dec 5, 2021
1 parent d647b3e commit 0e92241
Show file tree
Hide file tree
Showing 24 changed files with 62 additions and 289 deletions.
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/Camera.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import org.joml.Matrix4f;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/FileChooser.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import javax.imageio.ImageIO;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/LookFeel.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import java.awt.Window;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/MainScreen.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import PanoViewer.Utils.IOUtils;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/Mode.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

/*
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/ModeRecorder.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import java.beans.PropertyChangeListener;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/PanoViewer/PanoViewer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
*
*/
// License: GPL. For details, see LICENSE file.
package PanoViewer;

/**
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/PanoViewer/Settings.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
*
*/
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import com.jogamp.opengl.GLProfile;
Expand All @@ -13,7 +11,7 @@ public class Settings {

private static float dragSensitivity = 1f;
private static int wheelSensitivity = 5;
private static int precision = 180;
private static int precision = 360;//No of slices in spherical mesh.
private static GLProfile gl;
/* Whether or not to flip the image when creating texture data. */
private static boolean invertImage;
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/PanoViewer/SwitchModes.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer;

import PanoViewer.ImagePanels.FlatPanel;
import PanoViewer.ImagePanels.PanoramicPanel;
import PanoViewer.gui.jogl.FlatPanel;
import PanoViewer.gui.jogl.PanoramicPanel;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
Expand All @@ -11,18 +12,17 @@
import static PanoViewer.Utils.imageutils.isRatio;

/**
@author - Rohan Babbar
Switching Modes between Flat and Panoramic Images
* JPanel to switch modes between Flat and Panoramic.
* @author - Rohan Babbar
*/

public class SwitchModes extends JPanel implements PropertyChangeListener {

CardLayout cardLayout;
private FlatPanel flatPanel = FlatPanel.getInstance();
private PanoramicPanel panoramicPanel = PanoramicPanel.getInstance();
private final CardLayout cardLayout;
private final FlatPanel flatPanel;
private final PanoramicPanel panoramicPanel;

private static SwitchModes instance;
private BufferedImage cache;
public static SwitchModes getInstance() {
if (instance == null) {
instance = new SwitchModes();
Expand All @@ -31,11 +31,11 @@ public static SwitchModes getInstance() {
}

private SwitchModes() {
this.panoramicPanel = PanoramicPanel.getInstance();
this.flatPanel = FlatPanel.getInstance();
ModeRecorder.getInstance().addPropertyChangeListener(this);
setBounds(50,50,400,400);
setLayout(new CardLayout());
FlatPanel flatPanel = FlatPanel.getInstance();
PanoramicPanel panoramicPanel = PanoramicPanel.getInstance();
add(Mode.Flat.toString(),flatPanel);
add(Mode.Panoramic.toString(),panoramicPanel);
cardLayout = (CardLayout)getLayout();
Expand All @@ -48,7 +48,6 @@ private SwitchModes() {
* @param image the image to be set.
*/
public void setImage(BufferedImage image) {
cache=image;
flatPanel.setImage(image);
panoramicPanel.setImage(image);
if(isRatio(image))
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/PanoViewer/Utils/IOUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
*
*/
// License: GPL. For details, see LICENSE file.
package PanoViewer.Utils;

import java.io.File;
Expand All @@ -22,6 +20,9 @@
*/
public class IOUtils {

private IOUtils() {
// private constructor to prevent instantiation
}
/*
* Gets the image selected by the user and sets it on the SwitchMode panel.
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/Utils/imageutils.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer.Utils;

import javax.swing.*;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/PanoViewer/Utils/joglUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
*
*/
// License: GPL. For details, see LICENSE file.
package PanoViewer.Utils;

import static PanoViewer.Settings.invertImage;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/PanoViewer/gui/AboutDialog.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer.gui;

import static PanoViewer.Utils.IOUtils.getFileFromResourceAsStream;
Expand Down Expand Up @@ -35,7 +36,7 @@ private AboutDialog() {
e.printStackTrace();
}
try {
String repoLink = "https://github.com/opencodeiiita/PanoViewer";
String repoLink = "https://github.com/GhostFoxSledgehammer/PanoViewer";
url = new URI(repoLink);
} catch (URISyntaxException e) {
e.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/PanoViewer/gui/ImageViewer.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer.gui;

import java.awt.image.BufferedImage;
Expand Down
21 changes: 12 additions & 9 deletions src/main/java/PanoViewer/gui/Menu.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// License: GPL. For details, see LICENSE file.
package PanoViewer.gui;

import PanoViewer.MainScreen;
Expand All @@ -11,15 +12,17 @@

public class Menu extends JMenuBar implements PropertyChangeListener {

private JMenu File;// creating menu objects
private JMenu Help;// creating menu objects
private JMenu options;// creating menu objects
private JMenuItem open, exit , settings;// creating menuitem objects
private JMenuItem About;// creating menu objects
private JMenu mode;
private JCheckBoxMenuItem flat;
private JCheckBoxMenuItem panoramic;
private ButtonGroup group = new ButtonGroup();
private final JMenu File;// creating menu objects
private final JMenu Help;// creating menu objects
private final JMenu options;// creating menu objects
private final JMenuItem open;
private final JMenuItem exit;// creating menuitem objects
private final JMenuItem settings;// creating menuitem objects
private final JMenuItem About;// creating menu objects
private final JMenu mode;
private final JCheckBoxMenuItem flat;
private final JCheckBoxMenuItem panoramic;
private final ButtonGroup group = new ButtonGroup();
private static Menu instance;// creating a menu instance

// private constructor for implementing singleton design principle
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/PanoViewer/gui/Pannable.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
*
*/
// License: GPL. For details, see LICENSE file.
package PanoViewer.gui;

/**
Expand Down
Loading

0 comments on commit 0e92241

Please sign in to comment.