Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.vernon.LICK;
- import java.awt.AWTException;
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Robot;
- import java.awt.datatransfer.Clipboard;
- import java.awt.datatransfer.StringSelection;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.FocusEvent;
- import java.awt.event.FocusListener;
- import java.awt.event.KeyEvent;
- import java.awt.event.KeyListener;
- import java.io.File;
- import java.io.IOException;
- import java.io.PrintWriter;
- import javax.swing.AbstractAction;
- import javax.swing.BorderFactory;
- //import javax.swing.ImageIcon;
- import javax.swing.JButton;
- import javax.swing.JFileChooser;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.JScrollPane;
- import javax.swing.JTextArea;
- import javax.swing.SwingUtilities;
- import javax.swing.border.Border;
- import javax.swing.border.CompoundBorder;
- import javax.swing.border.TitledBorder;
- import javax.swing.filechooser.FileNameExtensionFilter;
- @SuppressWarnings("serial")
- public class LoreItemInterface
- extends JPanel
- implements ActionListener, FocusListener, KeyListener
- {
- /*
- * This defines the start of what defines the areas. It creates the text spaces.
- */
- JTextArea current = null;
- final int maxfinal = 50;
- int max = 50;
- int maxDescriptionLineOne = 50;
- int maxDescriptionLineTwo = 50;
- int maxDescriptionLineThree = 50;
- int maxDescriptionLineFour = 50;
- int maxDescriptionLineFive = 50;
- int maxTitle = 50;
- JTextArea LoreTitle = new JTextArea(1, 50);
- JTextArea LoreDescriptionLineOne = new JTextArea(1, 50);
- JTextArea LoreDescriptionLineTwo = new JTextArea(1, 50);
- JTextArea LoreDescriptionLineThree = new JTextArea(1, 50);
- JTextArea LoreDescriptionLineFour = new JTextArea(1, 50);
- JTextArea LoreDescriptionLineFive = new JTextArea(1, 50);
- /*
- * This sucker RUNS the thing
- */
- public static void main(String[] args)
- {
- new LoreItemInterface();
- }
- public static void main1(String[] args)
- throws Exception
- {
- SwingUtilities.invokeLater(new Runnable()
- {
- public void run() {}
- });
- }
- /*
- * This bad puppy defines all the pretty graphics. She's ugly as sin, isn't she?
- */
- public LoreItemInterface()
- {
- JFrame frame = new JFrame("Lore Item Interface");
- frame.setDefaultCloseOperation(3);
- GridBagLayout gridbag = new GridBagLayout();
- GridBagConstraints c = new GridBagConstraints();
- c.fill = 1;
- /*
- * Normally this defines the icon, but I can't get it working in this new version! ¯\_(ツ)_/¯
- */
- // ImageIcon img = new ImageIcon(getClass().getResource("/icon.png"));
- // frame.setIconImage(img.getImage());
- /*
- * This creates the panel.
- */
- JPanel panOuter = new JPanel(new BorderLayout());
- JPanel panInner = new JPanel(new BorderLayout());
- JPanel panBottom = new JPanel();
- panBottom.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
- panBottom.setLayout(gridbag);
- JPanel panInput = new JPanel(new BorderLayout());
- panInput.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
- JPanel panelTitle = new JPanel(new BorderLayout());
- JPanel panelDescriptionBorder = new JPanel(new BorderLayout());
- panelDescriptionBorder.setLayout(gridbag);
- JPanel panelDescriptionLines = new JPanel(new BorderLayout());
- panelDescriptionLines.setLayout(gridbag);
- /*
- * Borders here! Get ya borders!
- * This one is for the Lore Item Title line.
- */
- Border outsideBorder = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder = BorderFactory.createTitledBorder("Lore Item Title");
- CompoundBorder theTitle = BorderFactory.createCompoundBorder(outsideBorder, insideBorder);
- panelTitle.setBorder(theTitle);
- /*
- * This one here is for the Item Description lines, around all of them. We'll give them their own
- * special one soon.
- */
- Border outsideBorder1 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder1 = BorderFactory.createTitledBorder("Lore Item Description");
- CompoundBorder theDescriptionBorder = BorderFactory.createCompoundBorder(outsideBorder1, insideBorder1);
- panelDescriptionBorder.setBorder(theDescriptionBorder);
- /*
- * This border is just for the buttons.
- */
- Border outsideBorder2 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder2 = BorderFactory.createTitledBorder("Buttons");
- CompoundBorder theButtons = BorderFactory.createCompoundBorder(outsideBorder2, insideBorder2);
- panBottom.setBorder(theButtons);
- /*
- * Let's put these fuckers in line eh?
- */
- panInput.add(panBottom, "North");
- panOuter.add(panInput, "West");
- panInner.add(panelDescriptionBorder, "South");
- panInner.add(panelTitle, "North");
- panOuter.add(panInner, "East");
- /*
- * Wow look, MORE FUCKING BORDERS! These are for the Item Descriptions specifically.
- * Check the second line of each one to see which one it's assigned to.
- */
- Border outsideBorder3 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder3 = BorderFactory.createTitledBorder("Lore Item Description Line 1");
- CompoundBorder theDescriptionLineOne = BorderFactory.createCompoundBorder(outsideBorder3, insideBorder3);
- this.LoreDescriptionLineOne.setBorder(theDescriptionLineOne);
- Border outsideBorder4 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder4 = BorderFactory.createTitledBorder("Lore Item Description Line 2");
- CompoundBorder theDescriptionLineTwo = BorderFactory.createCompoundBorder(outsideBorder4, insideBorder4);
- this.LoreDescriptionLineTwo.setBorder(theDescriptionLineTwo);
- Border outsideBorder5 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder5 = BorderFactory.createTitledBorder("Lore Item Description Line 3");
- CompoundBorder theDescriptionLineThree = BorderFactory.createCompoundBorder(outsideBorder5, insideBorder5);
- this.LoreDescriptionLineThree.setBorder(theDescriptionLineThree);
- Border outsideBorder6 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder6 = BorderFactory.createTitledBorder("Lore Item Description Line 4");
- CompoundBorder theDescriptionLineFour = BorderFactory.createCompoundBorder(outsideBorder6, insideBorder6);
- this.LoreDescriptionLineFour.setBorder(theDescriptionLineFour);
- Border outsideBorder7 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
- TitledBorder insideBorder7 = BorderFactory.createTitledBorder("Lore Item Description Line 5");
- CompoundBorder theDescriptionLineFive = BorderFactory.createCompoundBorder(outsideBorder7, insideBorder7);
- this.LoreDescriptionLineFive.setBorder(theDescriptionLineFive);
- /*
- * Now let's apply some word wrapping and line wrapping huh?
- */
- this.LoreTitle.setLineWrap(true);
- this.LoreDescriptionLineOne.setWrapStyleWord(true);
- this.LoreDescriptionLineTwo.setWrapStyleWord(true);
- this.LoreDescriptionLineThree.setWrapStyleWord(true);
- this.LoreDescriptionLineFour.setWrapStyleWord(true);
- this.LoreDescriptionLineFive.setWrapStyleWord(true);
- /*
- * This checks where and if the program is in terms of lines!
- */
- FocusListener focusListener = new FocusListener()
- {
- public void focusLost(FocusEvent e) {}
- public void focusGained(FocusEvent e)
- {
- LoreItemInterface.this.requestFocusInWindow();
- LoreItemInterface.this.current = ((JTextArea)e.getSource());
- LoreItemInterface.this.current.addKeyListener(new KeyListener()
- {
- public void keyPressed(KeyEvent e1)
- {
- String currenttext = LoreItemInterface.this.current.getText();
- /*
- * This entire block of code determines where things are. The code then goes on to
- * add +2 to the character max length (50 characters) every time a certain button on
- * the program is hit (which are to the left of the GUI), or whenever the symbol followed
- * by a one of the special formatting codes is typed manually.
- */
- char c = e1.getKeyChar();
- char symbol = '&';
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- //String cstring = Character.toString(c);
- int len = currenttext.length();
- if (currenttext.equalsIgnoreCase(LoreDTextOne))
- {
- if (len < LoreItemInterface.this.maxDescriptionLineOne)
- {
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- return;
- }
- if (c == '\b')
- {
- String tester = LoreItemInterface.this.current.getText();
- LoreItemInterface.this.maxDescriptionLineOne = 50;
- for (int i = 0; i < tester.length(); i++) {
- if (symbol == tester.charAt(i))
- {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- return;
- }
- }
- }
- }
- else
- {
- if ((c == '\b') ||
- (c == '') ||
- (c == '\n') ||
- (c == '\t') ||
- (e1.isActionKey())) {
- return;
- }
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- return;
- }
- enforceLimit();
- e1.consume();
- return;
- }
- if (e1.getKeyCode() == 9)
- {
- if (e1.getModifiers() > 0) {
- LoreItemInterface.this.LoreDescriptionLineOne.transferFocusBackward();
- } else {
- LoreItemInterface.this.LoreDescriptionLineOne.transferFocus();
- }
- e1.consume();
- }
- }
- else if (currenttext.equalsIgnoreCase(LoreDTextTwo))
- {
- if (len < LoreItemInterface.this.maxDescriptionLineTwo)
- {
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- return;
- }
- if (c == '\b')
- {
- String tester = LoreItemInterface.this.current.getText();
- LoreItemInterface.this.maxDescriptionLineTwo = 50;
- for (int i = 0; i < tester.length(); i++) {
- if (symbol == tester.charAt(i))
- {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- return;
- }
- }
- }
- }
- else
- {
- if ((c == '\b') ||
- (c == '') ||
- (c == '\n') ||
- (c == '\t') ||
- (e1.isActionKey())) {
- return;
- }
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- return;
- }
- enforceLimit();
- e1.consume();
- return;
- }
- if (e1.getKeyCode() == 9)
- {
- if (e1.getModifiers() > 0) {
- LoreItemInterface.this.LoreDescriptionLineTwo.transferFocusBackward();
- } else {
- LoreItemInterface.this.LoreDescriptionLineTwo.transferFocus();
- }
- e1.consume();
- }
- }
- else if (currenttext.equalsIgnoreCase(LoreDTextThree))
- {
- if (len < LoreItemInterface.this.maxDescriptionLineThree)
- {
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- return;
- }
- if (c == '\b')
- {
- String tester = LoreItemInterface.this.current.getText();
- LoreItemInterface.this.maxDescriptionLineThree = 50;
- for (int i = 0; i < tester.length(); i++) {
- if (symbol == tester.charAt(i))
- {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- return;
- }
- }
- }
- }
- else
- {
- if ((c == '\b') ||
- (c == '') ||
- (c == '\n') ||
- (c == '\t') ||
- (e1.isActionKey())) {
- return;
- }
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- return;
- }
- enforceLimit();
- e1.consume();
- return;
- }
- if (e1.getKeyCode() == 9)
- {
- if (e1.getModifiers() > 0) {
- LoreItemInterface.this.LoreDescriptionLineThree.transferFocusBackward();
- } else {
- LoreItemInterface.this.LoreDescriptionLineThree.transferFocus();
- }
- e1.consume();
- }
- }
- else if (currenttext.equalsIgnoreCase(LoreDTextFour))
- {
- if (len < LoreItemInterface.this.maxDescriptionLineFour)
- {
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- return;
- }
- if (c == '\b')
- {
- String tester = LoreItemInterface.this.current.getText();
- LoreItemInterface.this.maxDescriptionLineFour = 50;
- for (int i = 0; i < tester.length(); i++) {
- if (symbol == tester.charAt(i))
- {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- return;
- }
- }
- }
- }
- else
- {
- if ((c == '\b') ||
- (c == '') ||
- (c == '\n') ||
- (c == '\t') ||
- (e1.isActionKey())) {
- return;
- }
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- return;
- }
- enforceLimit();
- e1.consume();
- return;
- }
- if (e1.getKeyCode() == 9)
- {
- if (e1.getModifiers() > 0) {
- LoreItemInterface.this.LoreDescriptionLineFour.transferFocusBackward();
- } else {
- LoreItemInterface.this.LoreDescriptionLineFour.transferFocus();
- }
- e1.consume();
- }
- }
- else if (currenttext.equalsIgnoreCase(LoreDTextFive))
- {
- if (len < LoreItemInterface.this.maxDescriptionLineFive)
- {
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- return;
- }
- if (c == '\b')
- {
- String tester = LoreItemInterface.this.current.getText();
- LoreItemInterface.this.maxDescriptionLineFive = 50;
- for (int i = 0; i < tester.length(); i++) {
- if (symbol == tester.charAt(i))
- {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- return;
- }
- }
- }
- }
- else
- {
- if ((c == '\b') ||
- (c == '') ||
- (c == '\n') ||
- (c == '\t') ||
- (e1.isActionKey())) {
- return;
- }
- if (symbol == c)
- {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- return;
- }
- enforceLimit();
- e1.consume();
- return;
- }
- if (e1.getKeyCode() == 9)
- {
- if (e1.getModifiers() > 0) {
- LoreItemInterface.this.LoreDescriptionLineFive.transferFocusBackward();
- } else {
- LoreItemInterface.this.LoreDescriptionLineFive.transferFocus();
- }
- e1.consume();
- }
- }
- else if (currenttext.equalsIgnoreCase(LoreTText))
- {
- if (len < LoreItemInterface.this.maxTitle)
- {
- if (symbol == c)
- {
- LoreItemInterface.this.maxTitle += 2;
- return;
- }
- if (c == '\b')
- {
- String tester = LoreItemInterface.this.current.getText();
- LoreItemInterface.this.maxTitle = 50;
- for (int i = 0; i < tester.length(); i++) {
- if (symbol == tester.charAt(i))
- {
- LoreItemInterface.this.maxTitle += 2;
- return;
- }
- }
- }
- }
- else
- {
- if ((c == '\b') ||
- (c == '') ||
- (c == '\n') ||
- (c == '\t') ||
- (e1.isActionKey())) {
- return;
- }
- if (symbol == c)
- {
- LoreItemInterface.this.maxTitle += 2;
- return;
- }
- enforceLimit();
- e1.consume();
- return;
- }
- if (e1.getKeyCode() == 9)
- {
- if (e1.getModifiers() > 0) {
- LoreItemInterface.this.LoreTitle.transferFocusBackward();
- } else {
- LoreItemInterface.this.LoreTitle.transferFocus();
- }
- e1.consume();
- }
- }
- }
- private void enforceLimit()
- {
- try
- {
- LoreItemInterface.this.current.setCaretPosition(LoreItemInterface.this.current.getText().length());
- Robot r = new Robot();
- int bsp = 8;
- r.keyPress(bsp);
- r.keyRelease(bsp);
- }
- catch (AWTException ex)
- {
- ex.printStackTrace(System.err);
- }
- }
- public void keyTyped(KeyEvent e1) {}
- public void keyReleased(KeyEvent e1) {}
- });
- }
- };
- /*
- * And this adds in all the focus listeners so all that previous code /works/!
- */
- this.LoreTitle.addFocusListener(focusListener);
- this.LoreDescriptionLineOne.addFocusListener(focusListener);
- this.LoreDescriptionLineTwo.addFocusListener(focusListener);
- this.LoreDescriptionLineThree.addFocusListener(focusListener);
- this.LoreDescriptionLineFour.addFocusListener(focusListener);
- this.LoreDescriptionLineFive.addFocusListener(focusListener);
- /*String LoreDTextOne = this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = this.LoreDescriptionLineFive.getText();
- String LoreTText = this.LoreTitle.getText();*/
- /*
- * This activates the code for the comment before last, and calls which
- * code is connected to what color and what button. It's also defining the button.
- * It also adds the button to the GUI!
- */
- JButton gold = new JButton(new AbstractAction("Gold")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&6";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 2;
- panBottom.add(gold, c);
- gold.setForeground(new Color(215, 175, 0));
- JButton darkblue = new JButton(new AbstractAction("Dark Blue")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&1";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 0;
- panBottom.add(darkblue, c);
- darkblue.setForeground(new Color(0, 0, 150));
- JButton darkgreen = new JButton(new AbstractAction("Dark Green")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&2";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 0;
- panBottom.add(darkgreen, c);
- darkgreen.setForeground(new Color(0, 150, 0));
- JButton darkaqua = new JButton(new AbstractAction("Dark Aqua")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&3";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 1;
- panBottom.add(darkaqua, c);
- darkaqua.setForeground(new Color(0, 150, 150));
- JButton darkred = new JButton(new AbstractAction("Dark Red")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&4";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 1;
- panBottom.add(darkred, c);
- darkred.setForeground(new Color(150, 0, 0));
- JButton darkpurple = new JButton(new AbstractAction("Dark Purple")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&5";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 2;
- panBottom.add(darkpurple, c);
- darkpurple.setForeground(new Color(128, 0, 128));
- JButton gray = new JButton(new AbstractAction("Gray")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&7";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 3;
- panBottom.add(gray, c);
- gray.setForeground(Color.GRAY);
- JButton darkgray = new JButton(new AbstractAction("Dark Gray")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&8";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 3;
- panBottom.add(darkgray, c);
- darkgray.setForeground(Color.DARK_GRAY);
- JButton blue = new JButton(new AbstractAction("Blue")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&9";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 4;
- panBottom.add(blue, c);
- blue.setForeground(Color.blue);
- JButton black = new JButton(new AbstractAction("Black")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&0";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 4;
- panBottom.add(black, c);
- JButton green = new JButton(new AbstractAction("Green")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&a";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 5;
- panBottom.add(green, c);
- green.setForeground(new Color(0, 200, 0));
- JButton aqua = new JButton(new AbstractAction("Aqua")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&b";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 5;
- panBottom.add(aqua, c);
- aqua.setForeground(new Color(0, 200, 200));
- JButton red = new JButton(new AbstractAction("Red")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&c";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 6;
- panBottom.add(red, c);
- red.setForeground(Color.red);
- JButton lightpurple = new JButton(new AbstractAction("Light Purple")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&d";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 6;
- panBottom.add(lightpurple, c);
- lightpurple.setForeground(new Color(255, 0, 255));
- JButton yellow = new JButton(new AbstractAction("Yellow")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&e";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 7;
- panBottom.add(yellow, c);
- yellow.setForeground(new Color(225, 225, 0));
- JButton white = new JButton(new AbstractAction("White")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&f";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 7;
- panBottom.add(white, c);
- white.setForeground(Color.white);
- JButton corrupted = new JButton(new AbstractAction("Corruption")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&k";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 8;
- panBottom.add(corrupted, c);
- JButton bold = new JButton(new AbstractAction("Bold")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&l";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 8;
- panBottom.add(bold, c);
- JButton underline = new JButton(new AbstractAction("Underline")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&n";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 9;
- panBottom.add(underline, c);
- JButton italic = new JButton(new AbstractAction("Italic")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&o";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 9;
- panBottom.add(italic, c);
- JButton strikethrough = new JButton(new AbstractAction("Strikethrough")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&m";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 10;
- panBottom.add(strikethrough, c);
- JButton reset = new JButton(new AbstractAction("Reset")
- {
- public void actionPerformed(ActionEvent e)
- {
- String Color = "&r";
- String currenttext = LoreItemInterface.this.current.getText();
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- if (LoreItemInterface.this.current != null) {
- if (currenttext.equalsIgnoreCase(LoreDTextOne)) {
- LoreItemInterface.this.maxDescriptionLineOne += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextTwo)) {
- LoreItemInterface.this.maxDescriptionLineTwo += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextThree)) {
- LoreItemInterface.this.maxDescriptionLineThree += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFour)) {
- LoreItemInterface.this.maxDescriptionLineFour += 2;
- } else if (currenttext.equalsIgnoreCase(LoreDTextFive)) {
- LoreItemInterface.this.maxDescriptionLineFive += 2;
- } else if (currenttext.equalsIgnoreCase(LoreTText)) {
- LoreItemInterface.this.maxTitle += 2;
- }
- }
- LoreItemInterface.this.current.insert(Color, LoreItemInterface.this.current.getCaretPosition());
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 10;
- panBottom.add(reset, c);
- JButton copyDescription = new JButton(new AbstractAction("Copy Active Line to Clipboard.")
- {
- public void actionPerformed(ActionEvent e)
- {
- StringSelection selection = new StringSelection(LoreItemInterface.this.current.getText());
- Clipboard clipboard = LoreItemInterface.this.getToolkit().getSystemClipboard();
- clipboard.setContents(selection, selection);
- }
- });
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 11;
- panBottom.add(copyDescription, c);
- JButton copyDescription2 = new JButton(new AbstractAction("Save work to send to a GM.")
- {
- public void actionPerformed(ActionEvent e)
- {
- String LoreDTextOne = LoreItemInterface.this.LoreDescriptionLineOne.getText();
- String LoreDTextTwo = LoreItemInterface.this.LoreDescriptionLineTwo.getText();
- String LoreDTextThree = LoreItemInterface.this.LoreDescriptionLineThree.getText();
- String LoreDTextFour = LoreItemInterface.this.LoreDescriptionLineFour.getText();
- String LoreDTextFive = LoreItemInterface.this.LoreDescriptionLineFive.getText();
- String LoreTText = LoreItemInterface.this.LoreTitle.getText();
- JFileChooser jf = new JFileChooser();
- FileNameExtensionFilter filter = new FileNameExtensionFilter(".txt", new String[] { "txt" });
- jf.addChoosableFileFilter(filter);
- String content = LoreTText + "\n" + "\n" + LoreDTextOne + "\n" + "\n" + LoreDTextTwo + "\n" + "\n" + LoreDTextThree + "\n" + "\n" + LoreDTextFour + "\n" + "\n" + LoreDTextFive;
- jf.setFileFilter(filter);
- int returnVal = jf.showSaveDialog(LoreItemInterface.this);
- if (returnVal == 0) {
- try
- {
- File file = jf.getSelectedFile();
- String filePath = file.getPath();
- if (!filePath.toLowerCase().endsWith(".txt"))
- {
- file = new File(filePath + ".txt");
- PrintWriter os = new PrintWriter(file);
- os.println(content);
- os.flush();
- os.close();
- }
- else
- {
- PrintWriter os = new PrintWriter(file);
- os.println(content);
- os.flush();
- os.close();
- }
- }
- catch (IOException e1)
- {
- e1.printStackTrace();
- }
- }
- }
- });
- c.fill = 2;
- c.gridx = 1;
- c.gridy = 11;
- panBottom.add(copyDescription2, c);
- /*
- * Now to activate the scroll panes for the description. This prevents it from just going off to
- * the left and right, and instead makes it wrap within its boundries and have a scroll bar if
- * needed.
- */
- JScrollPane srcPane = new JScrollPane(this.LoreDescriptionLineOne,
- 20,
- 30);
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 0;
- panelDescriptionBorder.add(srcPane, c);
- JScrollPane srcPane2 = new JScrollPane(this.LoreDescriptionLineTwo,
- 20,
- 30);
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 1;
- panelDescriptionBorder.add(srcPane2, c);
- JScrollPane srcPane3 = new JScrollPane(this.LoreDescriptionLineThree,
- 20,
- 30);
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 2;
- panelDescriptionBorder.add(srcPane3, c);
- JScrollPane srcPane4 = new JScrollPane(this.LoreDescriptionLineFour,
- 20,
- 30);
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 3;
- panelDescriptionBorder.add(srcPane4, c);
- JScrollPane srcPane5 = new JScrollPane(this.LoreDescriptionLineFive,
- 20,
- 30);
- c.fill = 2;
- c.gridx = 0;
- c.gridy = 4;
- panelDescriptionBorder.add(srcPane5, c);
- JScrollPane srcPane1 = new JScrollPane(this.LoreTitle,
- 20,
- 30);
- c.fill = 3;
- panelTitle.add(srcPane1, "North");
- c.fill = 3;
- frame.setContentPane(panOuter);
- frame.pack();
- frame.setVisible(true);
- }
- /*
- * I'll be honest. I don't fucking know.
- */
- public void actionPerformed(ActionEvent e) {}
- public void focusGained(FocusEvent arg0) {}
- public void focusLost(FocusEvent arg0) {}
- public void keyPressed(KeyEvent e) {}
- public void keyReleased(KeyEvent e) {}
- public void keyTyped(KeyEvent e) {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement