Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Added Licence URL and Infos to the About-Window
Browse files Browse the repository at this point in the history
  • Loading branch information
Petschko committed Jan 17, 2017
1 parent b4b0458 commit 511b5a3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/org/petschko/rpgmakermv/decrypt/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Config {
static final String programName = "RPG-Maker MV Decrypter";
static final String projectPageURL = "https://github.com/Petschko/Java-RPG-Maker-MV-Decrypter";
static final String projectBugReportURL = "https://github.com/Petschko/Java-RPG-Maker-MV-Decrypter/issues";
static final String projectLicenceURL = "https://github.com/Petschko/Java-RPG-Maker-MV-Decrypter/blob/master/LICENCE";
static final String authorImage = "/org/petschko/icons/petschko_icon.png";

// File-Path-Settings
Expand Down
66 changes: 62 additions & 4 deletions src/org/petschko/rpgmakermv/decrypt/GUI_About.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import org.petschko.lib.Const;
import org.petschko.lib.gui.JImageLabel;
import org.petschko.lib.gui.JLabelExtra;
import org.petschko.lib.gui.JPanelLine;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;

Expand Down Expand Up @@ -49,26 +56,76 @@ class GUI_About extends org.petschko.lib.gui.GUI_About {
*/
@Override
protected void constructAbout() {
int lineSpace = 4;

// Initial Comps - Panels
JPanel borderFrame = new JPanel();
JPanel descriptionContainer = new JPanel();
JPanel logoPanel = new JPanel();
JPanel okButton = new JPanel();

// Initial Comps - Labels
JPanelLine versionLine = new JPanelLine();
JLabelExtra versionHeading = new JLabelExtra("Version:");
JLabel version = new JLabel(Config.version);

JPanelLine licenceLine = new JPanelLine();
JLabelExtra licenceHeading = new JLabelExtra("Licence:");
JLabelExtra licence = new JLabelExtra("MIT-Licence");
licence.setURL(Config.projectLicenceURL, true);

JPanelLine projectLine = new JPanelLine();
JLabelExtra projectHpHeading = new JLabelExtra("Project-HP:");
JLabelExtra projectHp = new JLabelExtra("Visit the Project-Page on Github");
projectHp.setURL(Config.projectPageURL, true);

JPanelLine creditLine = new JPanelLine();
JLabelExtra creditHeading = new JLabelExtra("Credits:");
JPanelLine creatorLine = new JPanelLine();
JLabel programmedBy = new JLabel(Const.creator + " (Programmer) - ");
JLabelExtra programmedByURL = new JLabelExtra("Website");
programmedByURL.setURL(Const.creatorURL, true);

// Set Layouts
borderFrame.setLayout(new BorderLayout());
descriptionContainer.setLayout(new BorderLayout());
descriptionContainer.setLayout(new BoxLayout(descriptionContainer, BoxLayout.Y_AXIS));

// Set Borders
// Style
versionHeading.setUnderline(true);
licenceHeading.setUnderline(true);
projectHpHeading.setUnderline(true);
creditHeading.setUnderline(true);
borderFrame.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
//todo add info and design
descriptionContainer.setBorder(BorderFactory.createEmptyBorder(20, 0, 20, 0));

// Add stuff
logoPanel.add(this.imagePanel);
okButton.add(this.closeButton);

versionLine.add(versionHeading);
versionLine.addSpaceDimension(10);
versionLine.add(version);
licenceLine.add(licenceHeading);
licenceLine.addSpaceDimension(10);
licenceLine.add(licence);
projectLine.add(projectHpHeading);
projectLine.addSpaceDimension(10);
projectLine.add(projectHp);
creditLine.add(creditHeading);
creatorLine.add(programmedBy);
creatorLine.add(programmedByURL);

descriptionContainer.add(versionLine);
descriptionContainer.add(Box.createRigidArea(new Dimension(0, lineSpace)));
descriptionContainer.add(licenceLine);
descriptionContainer.add(Box.createRigidArea(new Dimension(0, lineSpace)));
descriptionContainer.add(projectLine);
descriptionContainer.add(Box.createRigidArea(new Dimension(0, lineSpace)));
descriptionContainer.add(creditLine);
descriptionContainer.add(creatorLine);

borderFrame.add(logoPanel, BorderLayout.NORTH);
borderFrame.add(descriptionContainer, BorderLayout.CENTER);
borderFrame.add(okButton, BorderLayout.SOUTH);

this.add(borderFrame);
Expand All @@ -95,7 +152,8 @@ protected String closeButtonText() {
protected JImageLabel aboutIcon() {
JImageLabel imagePanel = new JImageLabel(Config.authorImage, true);

imagePanel.setImageSize(333, 250);
// Ensure this size
imagePanel.setImageSize(200, 150);

return imagePanel;
}
Expand Down

0 comments on commit 511b5a3

Please sign in to comment.