ensuring hidden directories are included.
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
import java.awt.*;
|
|
||||||
|
|
||||||
public interface AppTheme {
|
|
||||||
|
|
||||||
public Color lightAccent = Color.decode("#EAF0CE");
|
|
||||||
public Color lightBrown = Color.decode("#EBBE9B");
|
|
||||||
public Color medBrown = Color.decode("#E4A677");
|
|
||||||
|
|
||||||
public Color darkBrown = Color.decode("#502419");
|
|
||||||
|
|
||||||
public Color darkestBrown = Color.decode("#1F0E0A");
|
|
||||||
|
|
||||||
public Color black = Color.BLACK;
|
|
||||||
|
|
||||||
public Color confirmationBlue = Color.decode("#296EB4");
|
|
||||||
|
|
||||||
public Color rejectionRed = Color.decode("#A23E48");
|
|
||||||
|
|
||||||
public Font headerFont = new Font("SanSalvi", Font.BOLD, 45);
|
|
||||||
public Font subHeaderFont = new Font("SanSalvi", Font.PLAIN, 35);
|
|
||||||
|
|
||||||
public Font paragraphFont = new Font("SanSalvi", Font.PLAIN, 20);
|
|
||||||
public Font userTextFont = new Font("SanSalvi", Font.PLAIN, 15);
|
|
||||||
public Font buttonFont = new Font("SanSalvi", Font.PLAIN, 15);
|
|
||||||
|
|
||||||
public String OS = System.getProperty("os.name");
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Background {
|
public class Background {
|
||||||
|
|
||||||
int backgroundIndex;
|
int backgroundIndex;
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.border.LineBorder;
|
import javax.swing.border.LineBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class BasicNavPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class BasicNavPanel extends JPanel {
|
||||||
|
|
||||||
private DefaultButton backButton;
|
private DefaultButton backButton;
|
||||||
private DefaultButton continueButton;
|
private DefaultButton continueButton;
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class BasicPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
import static src.ImageManager.*;
|
||||||
|
|
||||||
|
public class BasicPanel extends JPanel {
|
||||||
|
|
||||||
private DefaultButton[] optionButtons;
|
private DefaultButton[] optionButtons;
|
||||||
private String[] options;
|
private String[] options;
|
||||||
private ImageInfoPanel infoPanel;
|
private InfoPanel infoPanel;
|
||||||
private int choiceIndex;
|
private int choiceIndex;
|
||||||
private String panelTitle;
|
private String panelTitle;
|
||||||
|
private ImageManager images;
|
||||||
|
private int currentPanel;
|
||||||
|
|
||||||
public BasicPanel(JPanel navPanel, String[] options, String[] descriptions, String panelTitle) {
|
public BasicPanel(JPanel navPanel, String[] options, String[] descriptions, String panelTitle) {
|
||||||
|
|
||||||
@@ -24,8 +31,13 @@ public class BasicPanel extends JPanel implements AppTheme {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.infoPanel = new ImageInfoPanel(options, descriptions, basicBounds, Integer.parseInt(Character.toString(panelTitle.charAt(5))));
|
images = new ImageManager();
|
||||||
infoPanel.updateInfo(0); // Default start with 0th element.
|
|
||||||
|
infoPanel = new InfoPanel(options, descriptions, basicBounds, images);
|
||||||
|
|
||||||
|
currentPanel = Integer.parseInt(Character.toString(panelTitle.charAt(5)));
|
||||||
|
|
||||||
|
infoPanel.updateInfo(0, getNextPortrait(0));
|
||||||
|
|
||||||
choiceIndex = 0;
|
choiceIndex = 0;
|
||||||
|
|
||||||
@@ -35,6 +47,28 @@ public class BasicPanel extends JPanel implements AppTheme {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private JLabel getNextPortrait(int index) {
|
||||||
|
|
||||||
|
JLabel nextPortrait;
|
||||||
|
|
||||||
|
if(currentPanel == 1) {
|
||||||
|
|
||||||
|
nextPortrait = images.getRacePortrait(index);
|
||||||
|
|
||||||
|
} else if(currentPanel == 2) {
|
||||||
|
|
||||||
|
nextPortrait = images.getClassPortrait(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
nextPortrait = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nextPortrait;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void panelSetup() {
|
private void panelSetup() {
|
||||||
|
|
||||||
setBackground(lightBrown);
|
setBackground(lightBrown);
|
||||||
@@ -108,7 +142,16 @@ public class BasicPanel extends JPanel implements AppTheme {
|
|||||||
optionButtons[newIndex].select();
|
optionButtons[newIndex].select();
|
||||||
|
|
||||||
choiceIndex = newIndex;
|
choiceIndex = newIndex;
|
||||||
infoPanel.updateInfo(choiceIndex);
|
|
||||||
|
if(currentPanel == 1 || currentPanel == 2) {
|
||||||
|
|
||||||
|
infoPanel.updateInfo(choiceIndex, getNextPortrait(choiceIndex));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
infoPanel.updateInfo(choiceIndex);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class CharacterSheet implements Serializable {
|
public class CharacterSheet implements Serializable {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class CharacterStats implements Serializable {
|
public class CharacterStats implements Serializable {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Charisma extends Stats implements Serializable {
|
public class Charisma extends Stats implements Serializable {
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.LineBorder;
|
import javax.swing.border.LineBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class ChooseAbilityScoresPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class ChooseAbilityScoresPanel extends JPanel {
|
||||||
|
|
||||||
private DefaultButton[] statInfoButtons;
|
private DefaultButton[] statInfoButtons;
|
||||||
private JLabel[] statLabels;
|
private JLabel[] statLabels;
|
||||||
@@ -30,7 +34,7 @@ public class ChooseAbilityScoresPanel extends JPanel implements AppTheme {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
infoPanel = new InfoPanel(statOptions, statDescriptions, abilityScoreBounds, 3);
|
infoPanel = new InfoPanel(statOptions, statDescriptions, abilityScoreBounds);
|
||||||
infoPanel.updateInfo(0); // Default start with 0th element.
|
infoPanel.updateInfo(0); // Default start with 0th element.
|
||||||
|
|
||||||
createMasterPanel(panelTitle);
|
createMasterPanel(panelTitle);
|
||||||
@@ -82,13 +86,13 @@ public class ChooseAbilityScoresPanel extends JPanel implements AppTheme {
|
|||||||
|
|
||||||
private JPanel createAbilityPanel(String ability, int statIndex) {
|
private JPanel createAbilityPanel(String ability, int statIndex) {
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
panel.setFont(paragraphFont);
|
panel.setFont(paragraphText);
|
||||||
panel.setBackground(medBrown);
|
panel.setBackground(medBrown);
|
||||||
panel.setBorder(new LineBorder(darkestBrown, 4, true));
|
panel.setBorder(new LineBorder(darkestBrown, 4, true));
|
||||||
panel.setLayout(new BorderLayout(0, 0));
|
panel.setLayout(new BorderLayout(0, 0));
|
||||||
|
|
||||||
DefaultButton tmpButton = new DefaultButton(ability);
|
DefaultButton tmpButton = new DefaultButton(ability);
|
||||||
tmpButton.setFont(paragraphFont);
|
tmpButton.setFont(paragraphText);
|
||||||
tmpButton.setHorizontalAlignment(SwingConstants.CENTER);
|
tmpButton.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
tmpButton.addActionListener(e -> updateButtons(statIndex));
|
tmpButton.addActionListener(e -> updateButtons(statIndex));
|
||||||
|
|
||||||
@@ -107,7 +111,7 @@ public class ChooseAbilityScoresPanel extends JPanel implements AppTheme {
|
|||||||
JPanel subPanel = new JPanel();
|
JPanel subPanel = new JPanel();
|
||||||
|
|
||||||
JLabel scoreLabel = new JLabel("" + selectedStats[statIndex]);
|
JLabel scoreLabel = new JLabel("" + selectedStats[statIndex]);
|
||||||
scoreLabel.setFont(paragraphFont);
|
scoreLabel.setFont(paragraphText);
|
||||||
scoreLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
scoreLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
|
|
||||||
statLabels[statIndex] = scoreLabel;
|
statLabels[statIndex] = scoreLabel;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public interface ClassTemplate {
|
public interface ClassTemplate {
|
||||||
|
|
||||||
abstract String getDescription();
|
abstract String getDescription();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Cleric implements ClassTemplate {
|
public class Cleric implements ClassTemplate {
|
||||||
|
|
||||||
private int HP;
|
private int HP;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Constitution extends Stats implements Serializable {
|
public class Constitution extends Stats implements Serializable {
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
|
|
||||||
public class DefaultButton extends JButton implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class DefaultButton extends JButton {
|
||||||
|
|
||||||
private boolean selected;
|
private boolean selected;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.border.LineBorder;
|
import javax.swing.border.LineBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class DescriptionPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class DescriptionPanel extends JPanel {
|
||||||
|
|
||||||
private BasicNavPanel nav;
|
private BasicNavPanel nav;
|
||||||
private String[] characteristics;
|
private String[] characteristics;
|
||||||
@@ -137,12 +141,12 @@ public class DescriptionPanel extends JPanel implements AppTheme {
|
|||||||
panel.setOpaque(false);
|
panel.setOpaque(false);
|
||||||
|
|
||||||
JLabel label = new JLabel(characteristicsHolder[index]);
|
JLabel label = new JLabel(characteristicsHolder[index]);
|
||||||
label.setFont(paragraphFont);
|
label.setFont(paragraphText);
|
||||||
label.setOpaque(false);
|
label.setOpaque(false);
|
||||||
label.setForeground(darkestBrown);
|
label.setForeground(darkestBrown);
|
||||||
|
|
||||||
JTextField field = new JTextField(10);
|
JTextField field = new JTextField(10);
|
||||||
field.setFont(paragraphFont);
|
field.setFont(paragraphText);
|
||||||
field.setBackground(lightBrown);
|
field.setBackground(lightBrown);
|
||||||
field.setBorder(null);
|
field.setBorder(null);
|
||||||
|
|
||||||
@@ -219,13 +223,13 @@ public class DescriptionPanel extends JPanel implements AppTheme {
|
|||||||
panel.setOpaque(false);
|
panel.setOpaque(false);
|
||||||
|
|
||||||
JLabel label = new JLabel("Enter a Description");
|
JLabel label = new JLabel("Enter a Description");
|
||||||
label.setFont(paragraphFont);
|
label.setFont(paragraphText);
|
||||||
label.setOpaque(false);
|
label.setOpaque(false);
|
||||||
label.setForeground(darkestBrown);
|
label.setForeground(darkestBrown);
|
||||||
|
|
||||||
JTextArea textArea = new JTextArea();
|
JTextArea textArea = new JTextArea();
|
||||||
textArea.setForeground(darkestBrown);
|
textArea.setForeground(darkestBrown);
|
||||||
textArea.setFont(userTextFont);
|
textArea.setFont(userText);
|
||||||
textArea.setOpaque(false);
|
textArea.setOpaque(false);
|
||||||
textArea.setBorder(new LineBorder(darkestBrown, 3));
|
textArea.setBorder(new LineBorder(darkestBrown, 3));
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Dexterity extends Stats implements Serializable {
|
public class Dexterity extends Stats implements Serializable {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Dragonborn implements Race {
|
public class Dragonborn implements Race {
|
||||||
private final int speed = 30;
|
private final int speed = 30;
|
||||||
private final int maxAge = 80;
|
private final int maxAge = 80;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Dwarf implements Race {
|
public class Dwarf implements Race {
|
||||||
private final int speed = 25;
|
private final int speed = 25;
|
||||||
private final int maxAge = 350;
|
private final int maxAge = 350;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Elf implements Race, Serializable {
|
public class Elf implements Race, Serializable {
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
public class ExportPDF {
|
|
||||||
|
|
||||||
public ExportPDF() {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Fighter implements ClassTemplate, Serializable {
|
public class Fighter implements ClassTemplate, Serializable {
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
public class FileManager {
|
public class FileManager {
|
||||||
|
|
||||||
private String filepath;
|
private String filepath;
|
||||||
@@ -12,8 +16,6 @@ public class FileManager {
|
|||||||
|
|
||||||
public FileManager() {
|
public FileManager() {
|
||||||
|
|
||||||
filepath = System.getProperty("user.dir");
|
|
||||||
|
|
||||||
saveFiles = new ArrayList<>();
|
saveFiles = new ArrayList<>();
|
||||||
|
|
||||||
setSaveFiles();
|
setSaveFiles();
|
||||||
@@ -22,11 +24,11 @@ public class FileManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOSFilepath() {
|
public int getNumSaves() {
|
||||||
|
|
||||||
return filepath;
|
return saveFiles.size();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReturningUser() {
|
public boolean isReturningUser() {
|
||||||
|
|
||||||
@@ -63,11 +65,11 @@ public class FileManager {
|
|||||||
|
|
||||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||||
|
|
||||||
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(filepath + "/.resources/SanSalvi.ttf")));
|
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontFilepath)));
|
||||||
|
|
||||||
} catch(IOException | FontFormatException e) {
|
} catch(IOException | FontFormatException e) {
|
||||||
|
|
||||||
System.out.println("Filepath of font not found: " + filepath + "/.resources/SanSalvi.ttf does not exist.");
|
System.out.println("Filepath of font not found: " + fontFilepath + " does not exist.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +77,7 @@ public class FileManager {
|
|||||||
|
|
||||||
private void setSaveFiles() {
|
private void setSaveFiles() {
|
||||||
|
|
||||||
File[] tmp = new File(filepath + "/.savedSheets/").listFiles();
|
File[] tmp = new File(savesFilepath).listFiles();
|
||||||
|
|
||||||
if(tmp != null) {
|
if(tmp != null) {
|
||||||
|
|
||||||
@@ -107,8 +109,6 @@ public class FileManager {
|
|||||||
|
|
||||||
CharacterSheet sheet = null;
|
CharacterSheet sheet = null;
|
||||||
|
|
||||||
System.out.println("filepath: " + file.getPath());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
FileInputStream fileIn = new FileInputStream(file.getPath());
|
FileInputStream fileIn = new FileInputStream(file.getPath());
|
||||||
@@ -134,20 +134,16 @@ public class FileManager {
|
|||||||
|
|
||||||
try(
|
try(
|
||||||
|
|
||||||
FileOutputStream fileOut = new FileOutputStream(filepath + "/.savedSheets/" + sheet.getName() + ".dnd");
|
FileOutputStream fileOut = new FileOutputStream(savesFilepath + sheet.getName() + ".dnd");
|
||||||
|
|
||||||
ObjectOutputStream objOut = new ObjectOutputStream(fileOut);
|
ObjectOutputStream objOut = new ObjectOutputStream(fileOut);
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
System.out.println("Inside saving char method.");
|
|
||||||
|
|
||||||
objOut.writeObject(sheet);
|
objOut.writeObject(sheet);
|
||||||
|
|
||||||
setSaveFiles();
|
setSaveFiles();
|
||||||
|
|
||||||
System.out.println("Object written to file.");
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
System.out.println("ERROR: ");
|
System.out.println("ERROR: ");
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import src.AppConstants.*;
|
||||||
|
|
||||||
public class GUImanager extends JFrame {
|
public class GUImanager extends JFrame {
|
||||||
|
|
||||||
private FileManager fileManager;
|
private FileManager fileManager;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Gnome implements Race {
|
public class Gnome implements Race {
|
||||||
private final int speed = 25;
|
private final int speed = 25;
|
||||||
private final int maxAge = 500;
|
private final int maxAge = 500;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class HalfElf implements Race {
|
public class HalfElf implements Race {
|
||||||
private final int speed = 30;
|
private final int speed = 30;
|
||||||
private final int maxAge = 180;
|
private final int maxAge = 180;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class HalfOrc implements Race {
|
public class HalfOrc implements Race {
|
||||||
private final int speed = 30;
|
private final int speed = 30;
|
||||||
private final int maxAge = 75;
|
private final int maxAge = 75;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Halfling implements Race {
|
public class Halfling implements Race {
|
||||||
private final int speed = 30;
|
private final int speed = 30;
|
||||||
private final int maxAge = 750;
|
private final int maxAge = 750;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Human implements Race {
|
public class Human implements Race {
|
||||||
|
|
||||||
private final int speed = 30;
|
private final int speed = 30;
|
||||||
|
|||||||
@@ -1,178 +0,0 @@
|
|||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class ImageInfoPanel extends InfoPanel implements AppTheme {
|
|
||||||
|
|
||||||
private JLabel[][] portraits;
|
|
||||||
private int lastIndex;
|
|
||||||
|
|
||||||
//private JLabel[] savesPortraits;
|
|
||||||
|
|
||||||
//private int numSaveCharacters;
|
|
||||||
|
|
||||||
// TODO: Need to implement
|
|
||||||
/*
|
|
||||||
public ImageInfoPanel(int panelIndex, int numSaveCharacters) {
|
|
||||||
|
|
||||||
super(panelIndex);
|
|
||||||
|
|
||||||
this.numSaveCharacters = numSaveCharacters;
|
|
||||||
this.characterName = characterName;
|
|
||||||
|
|
||||||
createSavesPortraits();
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public ImageInfoPanel(String[] categoryHolder, String[] holderDescriptions, Rectangle[] bounds, int panelIndex) {
|
|
||||||
|
|
||||||
super(categoryHolder, holderDescriptions, bounds, panelIndex);
|
|
||||||
createPortraits();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateInfo(int holderIndex) {
|
|
||||||
|
|
||||||
super.updateInfo(holderIndex, portraits[holderIndex][getNextPortrait(holderIndex)]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getNextPortrait(int holderIndex) {
|
|
||||||
|
|
||||||
Random ran = new Random();
|
|
||||||
int bound = portraits[holderIndex].length;
|
|
||||||
int newIndex = ran.nextInt(bound);
|
|
||||||
|
|
||||||
/* while(newIndex == lastIndex) {
|
|
||||||
|
|
||||||
newIndex = ran.nextInt(bound);
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
lastIndex = newIndex;
|
|
||||||
|
|
||||||
return newIndex;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Need to create a separate class/refactor ImageInfoPanel to be multi-purpose.
|
|
||||||
/*
|
|
||||||
private void createSavesPortraits() {
|
|
||||||
|
|
||||||
File imagesDir;
|
|
||||||
|
|
||||||
imagesDir = new File("Img/.savesPortraits").listFiles();
|
|
||||||
|
|
||||||
savesPortraits = new JLabel[imagesDir.length);
|
|
||||||
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
for(File file : imagesDir) {
|
|
||||||
|
|
||||||
savesPortraits[index] = image(file);
|
|
||||||
savesPortraits[index].setOpaque(true);
|
|
||||||
savesPortraits[index].setBackground(lightBrown);
|
|
||||||
savesPortraits[index].setBounds(bounds[3]);
|
|
||||||
|
|
||||||
index++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
private void createPortraits() {
|
|
||||||
|
|
||||||
String category = "";
|
|
||||||
|
|
||||||
if (panelIndex == 1) {
|
|
||||||
|
|
||||||
category = "Races";
|
|
||||||
|
|
||||||
} else if (panelIndex == 2) {
|
|
||||||
|
|
||||||
category = "Classes";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
portraits = new JLabel[categoryHolder.length][];
|
|
||||||
|
|
||||||
for (int i = 0; i < categoryHolder.length; i++) {
|
|
||||||
|
|
||||||
File imagesDir;
|
|
||||||
|
|
||||||
if (OS.startsWith("Windows")) {
|
|
||||||
|
|
||||||
imagesDir = new File("dndBuilder\\src\\Resources\\Img\\" + category + "\\" + categoryHolder[i].toLowerCase() + "\\");
|
|
||||||
|
|
||||||
} else if (OS.startsWith("Mac")) {
|
|
||||||
|
|
||||||
imagesDir = new File("dndBuilder/src/Resources/Img/" + category + "/" + categoryHolder[i].toLowerCase() + "/");
|
|
||||||
|
|
||||||
} else if (OS.startsWith("Linux")) {
|
|
||||||
imagesDir = new File("Img/" + category + "/" + categoryHolder[i].toLowerCase());
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
System.out.println("Unable to detect operating system.");
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
File[] dir = imagesDir.listFiles();
|
|
||||||
portraits[i] = new JLabel[dir.length];
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
for (File file : dir) {
|
|
||||||
portraits[i][index] = image(file);
|
|
||||||
portraits[i][index].setOpaque(true);
|
|
||||||
portraits[i][index].setBackground(lightBrown);
|
|
||||||
portraits[i][index].setBounds(bounds[3]);
|
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private JLabel image(File file) {
|
|
||||||
|
|
||||||
BufferedImage img;
|
|
||||||
Image finalImg;
|
|
||||||
JLabel picture;
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
img = ImageIO.read(file);
|
|
||||||
finalImg = img.getScaledInstance(250, 375, Image.SCALE_SMOOTH);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
System.out.println("Error reading file.");
|
|
||||||
img = null;
|
|
||||||
finalImg = null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Objects.isNull(finalImg)) {
|
|
||||||
|
|
||||||
picture = new JLabel("ERROR: Image not found.");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
picture = new JLabel(new ImageIcon(finalImg));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return picture;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class InfoPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class InfoPanel extends JPanel {
|
||||||
|
|
||||||
protected JTextArea[] descriptions;
|
protected JTextArea[] descriptions;
|
||||||
protected Rectangle[] bounds;
|
protected Rectangle[] bounds;
|
||||||
protected String[] holderDescriptions;
|
protected String[] holderDescriptions;
|
||||||
protected String[] categoryHolder;
|
protected String[] categoryHolder;
|
||||||
protected int panelIndex;
|
protected ImageManager images;
|
||||||
|
|
||||||
public InfoPanel(String[] categoryHolder, String[] holderDescriptions, Rectangle[] bounds, int panelIndex) {
|
public InfoPanel(String[] categoryHolder, String[] holderDescriptions, Rectangle[] bounds) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
this.categoryHolder = categoryHolder;
|
this.categoryHolder = categoryHolder;
|
||||||
this.holderDescriptions = holderDescriptions;
|
this.holderDescriptions = holderDescriptions;
|
||||||
this.bounds = bounds;
|
this.bounds = bounds;
|
||||||
this.panelIndex = panelIndex;
|
|
||||||
|
panelSetup();
|
||||||
|
|
||||||
|
createDescriptions();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public InfoPanel(String[] categoryHolder, String[] holderDescriptions, Rectangle[] bounds, ImageManager images) {
|
||||||
|
|
||||||
|
super();
|
||||||
|
this.categoryHolder = categoryHolder;
|
||||||
|
this.holderDescriptions = holderDescriptions;
|
||||||
|
this.bounds = bounds;
|
||||||
|
|
||||||
panelSetup();
|
panelSetup();
|
||||||
|
|
||||||
@@ -76,7 +92,7 @@ public class InfoPanel extends JPanel implements AppTheme {
|
|||||||
tmpDesc.setOpaque(true);
|
tmpDesc.setOpaque(true);
|
||||||
tmpDesc.setEditable(false);
|
tmpDesc.setEditable(false);
|
||||||
tmpDesc.setFocusable(false);
|
tmpDesc.setFocusable(false);
|
||||||
tmpDesc.setFont(paragraphFont);
|
tmpDesc.setFont(paragraphText);
|
||||||
tmpDesc.setBounds(bounds[2]);
|
tmpDesc.setBounds(bounds[2]);
|
||||||
tmpDesc.setBorder(new EmptyBorder(5, 5, 5, 5));
|
tmpDesc.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||||
tmpDesc.setBackground(medBrown);
|
tmpDesc.setBackground(medBrown);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Intelligence extends Stats implements Serializable {
|
public class Intelligence extends Stats implements Serializable {
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class LoadCharacterPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class LoadCharacterPanel extends JPanel {
|
||||||
|
|
||||||
private ArrayList<DefaultButton> savedCharacters;
|
private ArrayList<DefaultButton> savedCharacters;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.BevelBorder;
|
import javax.swing.border.BevelBorder;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
@@ -5,7 +7,9 @@ import java.awt.*;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
public class MainMenuPanel extends JPanel implements AppTheme {
|
import static src.AppConstants.*;
|
||||||
|
|
||||||
|
public class MainMenuPanel extends JPanel {
|
||||||
|
|
||||||
private DefaultButton newCharacter;
|
private DefaultButton newCharacter;
|
||||||
private DefaultButton randomCharacter;
|
private DefaultButton randomCharacter;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public interface Race {
|
public interface Race {
|
||||||
|
|
||||||
String getRace();
|
String getRace();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object stores information about a character's skills arrays. Firstly, the name of each skill, and secondly the value of each skill. When constructed, a private method is called
|
* Object stores information about a character's skills arrays. Firstly, the name of each skill, and secondly the value of each skill. When constructed, a private method is called
|
||||||
* which adds any proficiency bonus to each skill and then adds the ability score modifier to each skill.
|
* which adds any proficiency bonus to each skill and then adds the ability score modifier to each skill.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public abstract class Stats {
|
public abstract class Stats {
|
||||||
|
|
||||||
public int calcSavingThrow(int abilityScore) {
|
public int calcSavingThrow(int abilityScore) {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Strength extends Stats implements Serializable {
|
public class Strength extends Stats implements Serializable {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Tiefling implements Race {
|
public class Tiefling implements Race {
|
||||||
private final int speed = 30;
|
private final int speed = 30;
|
||||||
private final int maxAge = 85;
|
private final int maxAge = 85;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Wisdom extends Stats implements Serializable {
|
public class Wisdom extends Stats implements Serializable {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package src;
|
||||||
|
|
||||||
public class Wizard implements ClassTemplate {
|
public class Wizard implements ClassTemplate {
|
||||||
|
|
||||||
private int HP;
|
private int HP;
|
||||||
|
|||||||
@@ -1,277 +0,0 @@
|
|||||||
import javax.swing.*;
|
|
||||||
import javax.swing.border.BevelBorder;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
|
|
||||||
public class step4 extends JPanel implements AppTheme {
|
|
||||||
private JTextField nameTxtField;
|
|
||||||
private JTextField ageTextField;
|
|
||||||
private JTextField heightTxtField;
|
|
||||||
private JTextField weightTxtField;
|
|
||||||
private JTextField skinTxtField;
|
|
||||||
private JTextField eyesTxtField;
|
|
||||||
private JTextField hairTxtField;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the panel.
|
|
||||||
*/
|
|
||||||
public step4() {
|
|
||||||
createEntirePanel();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createEntirePanel() {
|
|
||||||
setBackground(new Color(222, 184, 135));
|
|
||||||
setBorder(new BevelBorder(BevelBorder.RAISED, new Color(160, 82, 45), new Color(165, 42, 42), new Color(0, 0, 0), null));
|
|
||||||
setLayout(new BorderLayout(0, 0));
|
|
||||||
|
|
||||||
JLabel lblNewLabel = createLbl();
|
|
||||||
add(lblNewLabel, BorderLayout.NORTH);
|
|
||||||
//Creates back and continue panel
|
|
||||||
JPanel backContPanel = createBackContinuePanel();
|
|
||||||
add(backContPanel, BorderLayout.SOUTH);
|
|
||||||
|
|
||||||
JPanel innerPanel = new JPanel();
|
|
||||||
innerPanel.setToolTipText("");
|
|
||||||
innerPanel.setOpaque(false);
|
|
||||||
add(innerPanel, BorderLayout.CENTER);
|
|
||||||
innerPanel.setLayout(null);
|
|
||||||
|
|
||||||
JPanel nameAndAlignment = new JPanel();
|
|
||||||
nameAndAlignment.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
|
|
||||||
nameAndAlignment.setBackground(new Color(210, 105, 30));
|
|
||||||
nameAndAlignment.setBounds(6, 6, 306, 114);
|
|
||||||
innerPanel.add(nameAndAlignment);
|
|
||||||
nameAndAlignment.setLayout(null);
|
|
||||||
|
|
||||||
JLabel nameLbl = new JLabel("Character Name: ");
|
|
||||||
nameLbl.setBounds(6, 6, 108, 16);
|
|
||||||
nameAndAlignment.add(nameLbl);
|
|
||||||
|
|
||||||
nameTxtField = new JTextField();
|
|
||||||
nameTxtField.setBounds(121, 1, 173, 26);
|
|
||||||
nameAndAlignment.add(nameTxtField);
|
|
||||||
nameTxtField.setColumns(10);
|
|
||||||
|
|
||||||
JLabel ageLbl = new JLabel("Age: ");
|
|
||||||
ageLbl.setBounds(6, 34, 32, 16);
|
|
||||||
nameAndAlignment.add(ageLbl);
|
|
||||||
|
|
||||||
ageTextField = new JTextField();
|
|
||||||
ageTextField.setBounds(61, 34, 64, 21);
|
|
||||||
nameAndAlignment.add(ageTextField);
|
|
||||||
ageTextField.setColumns(10);
|
|
||||||
|
|
||||||
JLabel heightLbl = new JLabel("Height: ");
|
|
||||||
heightLbl.setBounds(6, 62, 55, 16);
|
|
||||||
nameAndAlignment.add(heightLbl);
|
|
||||||
|
|
||||||
heightTxtField = new JTextField();
|
|
||||||
heightTxtField.setBounds(61, 57, 64, 26);
|
|
||||||
nameAndAlignment.add(heightTxtField);
|
|
||||||
heightTxtField.setColumns(10);
|
|
||||||
|
|
||||||
JLabel weightLbl = new JLabel("Weight:");
|
|
||||||
weightLbl.setBounds(6, 90, 61, 16);
|
|
||||||
nameAndAlignment.add(weightLbl);
|
|
||||||
|
|
||||||
weightTxtField = new JTextField();
|
|
||||||
weightTxtField.setBounds(61, 85, 64, 26);
|
|
||||||
nameAndAlignment.add(weightTxtField);
|
|
||||||
weightTxtField.setColumns(10);
|
|
||||||
|
|
||||||
JLabel skinLbl = new JLabel("Skin: ");
|
|
||||||
skinLbl.setBounds(131, 34, 35, 16);
|
|
||||||
nameAndAlignment.add(skinLbl);
|
|
||||||
|
|
||||||
skinTxtField = new JTextField();
|
|
||||||
skinTxtField.setBounds(165, 29, 130, 26);
|
|
||||||
nameAndAlignment.add(skinTxtField);
|
|
||||||
skinTxtField.setColumns(10);
|
|
||||||
|
|
||||||
JLabel eyesLbl = new JLabel("Eyes: ");
|
|
||||||
eyesLbl.setBounds(130, 62, 42, 16);
|
|
||||||
nameAndAlignment.add(eyesLbl);
|
|
||||||
|
|
||||||
eyesTxtField = new JTextField();
|
|
||||||
eyesTxtField.setBounds(164, 57, 130, 26);
|
|
||||||
nameAndAlignment.add(eyesTxtField);
|
|
||||||
eyesTxtField.setColumns(10);
|
|
||||||
|
|
||||||
JLabel hairLbl = new JLabel("Hair: ");
|
|
||||||
hairLbl.setBounds(127, 90, 39, 16);
|
|
||||||
nameAndAlignment.add(hairLbl);
|
|
||||||
|
|
||||||
hairTxtField = new JTextField();
|
|
||||||
hairTxtField.setBounds(164, 85, 130, 26);
|
|
||||||
nameAndAlignment.add(hairTxtField);
|
|
||||||
hairTxtField.setColumns(10);
|
|
||||||
|
|
||||||
JPanel alignmentPanel = new JPanel();
|
|
||||||
alignmentPanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
|
|
||||||
alignmentPanel.setBackground(new Color(205, 133, 63));
|
|
||||||
alignmentPanel.setBounds(324, 6, 396, 114);
|
|
||||||
innerPanel.add(alignmentPanel);
|
|
||||||
alignmentPanel.setLayout(new BorderLayout(0, 0));
|
|
||||||
|
|
||||||
JLabel alignmentLbl = new JLabel("Alignment");
|
|
||||||
alignmentLbl.setFont(new Font("Lucida Grande", Font.PLAIN, 19));
|
|
||||||
alignmentLbl.setHorizontalAlignment(SwingConstants.CENTER);
|
|
||||||
alignmentPanel.add(alignmentLbl, BorderLayout.NORTH);
|
|
||||||
|
|
||||||
JPanel alignmentInnerPanel = new JPanel();
|
|
||||||
alignmentInnerPanel.setOpaque(false);
|
|
||||||
alignmentPanel.add(alignmentInnerPanel, BorderLayout.CENTER);
|
|
||||||
alignmentInnerPanel.setLayout(new GridLayout(3, 3, 0, 0));
|
|
||||||
|
|
||||||
JButton btnLawfulGood = new JButton("Lawful Good");
|
|
||||||
alignmentInnerPanel.add(btnLawfulGood);
|
|
||||||
|
|
||||||
JButton btnNuetralGood = new JButton("Neutral Good");
|
|
||||||
alignmentInnerPanel.add(btnNuetralGood);
|
|
||||||
|
|
||||||
JButton btnChaoticGood = new JButton("Chaotic Good");
|
|
||||||
alignmentInnerPanel.add(btnChaoticGood);
|
|
||||||
|
|
||||||
JButton btnLawfulNeutral = new JButton("Lawful Neutral");
|
|
||||||
alignmentInnerPanel.add(btnLawfulNeutral);
|
|
||||||
|
|
||||||
JButton btnTrueNeutral = new JButton("True Neutral");
|
|
||||||
alignmentInnerPanel.add(btnTrueNeutral);
|
|
||||||
|
|
||||||
JButton btnChaoticNeutral = new JButton("Chaotic Neutral");
|
|
||||||
alignmentInnerPanel.add(btnChaoticNeutral);
|
|
||||||
|
|
||||||
JButton btnLawfulEvil = new JButton("Lawful Evil");
|
|
||||||
alignmentInnerPanel.add(btnLawfulEvil);
|
|
||||||
|
|
||||||
JButton btnNeutralEvil = new JButton("Neutral Evil");
|
|
||||||
alignmentInnerPanel.add(btnNeutralEvil);
|
|
||||||
|
|
||||||
JButton btnChaoticEvil = new JButton("Chaotic Evil");
|
|
||||||
alignmentInnerPanel.add(btnChaoticEvil);
|
|
||||||
|
|
||||||
JPanel backgroundPanel = new JPanel();
|
|
||||||
backgroundPanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
|
|
||||||
backgroundPanel.setBackground(new Color(210, 105, 30));
|
|
||||||
backgroundPanel.setBounds(6, 132, 306, 264);
|
|
||||||
innerPanel.add(backgroundPanel);
|
|
||||||
backgroundPanel.setLayout(new BorderLayout(0, 0));
|
|
||||||
|
|
||||||
JLabel backgroundLbl = new JLabel("Background");
|
|
||||||
backgroundLbl.setFont(new Font("Dialog", Font.PLAIN, 20));
|
|
||||||
backgroundLbl.setHorizontalAlignment(SwingConstants.CENTER);
|
|
||||||
backgroundPanel.add(backgroundLbl, BorderLayout.NORTH);
|
|
||||||
|
|
||||||
JPanel backgroundInnerPanel = new JPanel();
|
|
||||||
backgroundInnerPanel.setOpaque(false);
|
|
||||||
backgroundPanel.add(backgroundInnerPanel, BorderLayout.CENTER);
|
|
||||||
backgroundInnerPanel.setLayout(new GridLayout(9, 2, 0, 0));
|
|
||||||
|
|
||||||
JButton btnAcolyte = new JButton("Acolyte");
|
|
||||||
backgroundInnerPanel.add(btnAcolyte);
|
|
||||||
|
|
||||||
JButton btnCharlatan = new JButton("Charlatan");
|
|
||||||
backgroundInnerPanel.add(btnCharlatan);
|
|
||||||
|
|
||||||
JButton btnCriminal = new JButton("Criminal");
|
|
||||||
backgroundInnerPanel.add(btnCriminal);
|
|
||||||
|
|
||||||
JButton btnEntertainer = new JButton("Entertainer");
|
|
||||||
backgroundInnerPanel.add(btnEntertainer);
|
|
||||||
|
|
||||||
JButton btnFolkHero = new JButton("Folk Hero");
|
|
||||||
backgroundInnerPanel.add(btnFolkHero);
|
|
||||||
|
|
||||||
JButton btnGladiator = new JButton("Gladiator");
|
|
||||||
backgroundInnerPanel.add(btnGladiator);
|
|
||||||
|
|
||||||
JButton btnGuildArtisan = new JButton("Guild Artisan");
|
|
||||||
backgroundInnerPanel.add(btnGuildArtisan);
|
|
||||||
|
|
||||||
JButton btnGuildMerchant = new JButton("Guild Merchant");
|
|
||||||
backgroundInnerPanel.add(btnGuildMerchant);
|
|
||||||
|
|
||||||
JButton btnHermit = new JButton("Hermit");
|
|
||||||
backgroundInnerPanel.add(btnHermit);
|
|
||||||
|
|
||||||
JButton btnKnight = new JButton("Knight");
|
|
||||||
backgroundInnerPanel.add(btnKnight);
|
|
||||||
|
|
||||||
JButton btnNoble = new JButton("Noble");
|
|
||||||
backgroundInnerPanel.add(btnNoble);
|
|
||||||
|
|
||||||
JButton btnOutlander = new JButton("Outlander");
|
|
||||||
backgroundInnerPanel.add(btnOutlander);
|
|
||||||
|
|
||||||
JButton btnPirate = new JButton("Pirate");
|
|
||||||
backgroundInnerPanel.add(btnPirate);
|
|
||||||
|
|
||||||
JButton btnSage = new JButton("Sage");
|
|
||||||
backgroundInnerPanel.add(btnSage);
|
|
||||||
|
|
||||||
JButton btnSailor = new JButton("Sailor");
|
|
||||||
backgroundInnerPanel.add(btnSailor);
|
|
||||||
|
|
||||||
JButton btnSoldier = new JButton("Soldier");
|
|
||||||
backgroundInnerPanel.add(btnSoldier);
|
|
||||||
|
|
||||||
JButton btnSpy = new JButton("Spy");
|
|
||||||
backgroundInnerPanel.add(btnSpy);
|
|
||||||
|
|
||||||
JButton btnUrchin = new JButton("Urchin");
|
|
||||||
backgroundInnerPanel.add(btnUrchin);
|
|
||||||
|
|
||||||
JPanel panel = new JPanel();
|
|
||||||
panel.setBackground(new Color(205, 133, 63));
|
|
||||||
panel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
|
|
||||||
panel.setBounds(324, 132, 396, 264);
|
|
||||||
panel.setLayout(new BorderLayout(0, 0));
|
|
||||||
|
|
||||||
JLabel lblDescription = new JLabel("Description");
|
|
||||||
lblDescription.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
|
|
||||||
lblDescription.setHorizontalAlignment(SwingConstants.CENTER);
|
|
||||||
|
|
||||||
JTextArea textArea = new JTextArea();
|
|
||||||
textArea.setBackground(new Color(238, 232, 170));
|
|
||||||
|
|
||||||
panel.add(lblDescription, BorderLayout.NORTH);
|
|
||||||
panel.add(textArea, BorderLayout.CENTER);
|
|
||||||
|
|
||||||
innerPanel.add(panel);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private JPanel createBackContinuePanel() {
|
|
||||||
JPanel backContPanel = new JPanel();
|
|
||||||
backContPanel.setBackground(new Color(205, 133, 63));
|
|
||||||
|
|
||||||
|
|
||||||
JButton backBtn = new JButton("<--- Back ");
|
|
||||||
backBtn.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
backContPanel.add(backBtn);
|
|
||||||
|
|
||||||
JButton continueBtn = new JButton("Continue --->");
|
|
||||||
continueBtn.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
backContPanel.add(continueBtn);
|
|
||||||
return backContPanel;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private JLabel createLbl() {
|
|
||||||
JLabel titleLbl = new JLabel("Step 4: Description");
|
|
||||||
titleLbl.setHorizontalAlignment(SwingConstants.CENTER);
|
|
||||||
titleLbl.setFont(new Font("Bodoni 72 Oldstyle", Font.PLAIN, 33));
|
|
||||||
return titleLbl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 148 KiB |
|
Before Width: | Height: | Size: 351 KiB |
|
Before Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 238 KiB |
|
Before Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 267 KiB |
|
Before Width: | Height: | Size: 374 KiB |
|
Before Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 305 KiB |
|
Before Width: | Height: | Size: 477 KiB |
|
Before Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 111 KiB |