From ad823617550389ec45b3d71dd64ac63272e1a2c1 Mon Sep 17 00:00:00 2001 From: flifloo Date: Tue, 19 Jan 2021 16:10:24 +0100 Subject: [PATCH] Fix GUI compilation --- build.gradle | 15 ++- src/main/java/GUI/Agenda/Agenda.java | 38 ++++---- .../GUI/Agenda/Model/AgendaTableModel.java | 6 +- src/main/java/GUI/GUI.java | 97 ++++++++++++++++++- src/main/java/GUI/ProjectionHandler.java | 68 +++++++++++++ src/main/java/GUI/ProjectionSelecter.java | 50 ++++++++++ src/main/resources/META-INF/MANIFEST.MF | 3 + 7 files changed, 253 insertions(+), 24 deletions(-) create mode 100644 src/main/resources/META-INF/MANIFEST.MF diff --git a/build.gradle b/build.gradle index 37d6120..be33483 100644 --- a/build.gradle +++ b/build.gradle @@ -5,19 +5,30 @@ plugins { group 'fr.frt' version '1.0-SNAPSHOT' +jar { + manifest { + attributes 'Main-Class': 'ProjectionPlanning.Main' + } + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } +} + repositories { mavenCentral() } dependencies { - implementation 'org.projectlombok:lombok:1.18.16' + compileOnly 'org.projectlombok:lombok:1.18.16' + annotationProcessor 'org.projectlombok:lombok:1.18.16' implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.1' implementation 'com.googlecode.json-simple:json-simple:1.1.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.1' + implementation 'com.intellij:forms_rt:7.0.3' } test { useJUnitPlatform() -} \ No newline at end of file +} diff --git a/src/main/java/GUI/Agenda/Agenda.java b/src/main/java/GUI/Agenda/Agenda.java index 067b4ee..3037264 100644 --- a/src/main/java/GUI/Agenda/Agenda.java +++ b/src/main/java/GUI/Agenda/Agenda.java @@ -54,7 +54,7 @@ public class Agenda extends JPanel { public void refresh() { this.agendaPanel.removeAll(); int totalPages[] = dayToPage(); - if (this.currentPage >= totalPages.length) { + if (this.currentPage > totalPages.length) { this.currentPage = totalPages.length - 1; } else if (this.currentPage < 0) { this.currentPage = 0; @@ -169,6 +169,7 @@ public class Agenda extends JPanel { ArrayList projections = Projection.getAvailable(competition); for (Projection projection : projections) { addMovie(projection); + } } @@ -189,26 +190,27 @@ public class Agenda extends JPanel { private void addMovie(Projection projection) { Date startDate = projection.getStartDate(); - Time time = projection.getSlot().getStartTime(); - int column = this.table.getColumn(startDate.toString()).getModelIndex(); - int row = 0; - for (int i = 0; i < slots.size(); i++) { - if (slots.get(i).getStartTime().toString().equals(time.toString())) { - row = i; - break; + if (Arrays.asList(((AgendaTableModel) this.table.getModel()).getColumnNames()).contains(startDate.toString())) { + Time time = projection.getSlot().getStartTime(); + int column = this.table.getColumn(startDate.toString()).getModelIndex(); + int row = 0; + for (int i = 0; i < slots.size(); i++) { + if (slots.get(i).getStartTime().toString().equals(time.toString())) { + row = i; + break; + } + } + Object tableValue = table.getValueAt(row, column); + if (tableValue.getClass() == Projection.class) { + Projection[] projections = {(Projection) tableValue, projection}; + table.setValueAt(projections, row, column); + } else if (tableValue.getClass() != String.class) { + ((AgendaTableModel) table.getModel()).addValueAt(projection, row, column); + } else { + table.setValueAt(projection, row, column); } } - Object tableValue = table.getValueAt(row, column); - if (tableValue.getClass() == Projection.class) { - Projection[] projections = {(Projection) tableValue, projection}; - table.setValueAt(projections, row, column); - } else if (tableValue.getClass() != String.class) { - ((AgendaTableModel) table.getModel()).addValueAt(projection, row, column); - } else { - table.setValueAt(projection, row, column); - } } - public int getCurrentPage() { return this.currentPage; } diff --git a/src/main/java/GUI/Agenda/Model/AgendaTableModel.java b/src/main/java/GUI/Agenda/Model/AgendaTableModel.java index 53b1ffb..6439c65 100644 --- a/src/main/java/GUI/Agenda/Model/AgendaTableModel.java +++ b/src/main/java/GUI/Agenda/Model/AgendaTableModel.java @@ -7,6 +7,7 @@ import javax.swing.table.AbstractTableModel; import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; +import java.util.stream.Collectors; public class AgendaTableModel extends AbstractTableModel { private LocalDate[] columnNames; @@ -19,7 +20,6 @@ public class AgendaTableModel extends AbstractTableModel { data = new Object[5][this.day]; LocalDate startDate = Config.getStartDate(); - for (int i = 0; i < this.day; i++) { this.columnNames[i] = startDate.plusDays(i + 5 * (currentPage)); } @@ -47,6 +47,10 @@ public class AgendaTableModel extends AbstractTableModel { return columnNames[column].toString(); } + public String[] getColumnNames() { + return Arrays.stream(columnNames).map(LocalDate::toString).toArray(String[]::new); + } + @Override public Object getValueAt(int rowIndex, int columnIndex) { Object dataObject = data[rowIndex][columnIndex]; diff --git a/src/main/java/GUI/GUI.java b/src/main/java/GUI/GUI.java index 052139b..103e2e2 100644 --- a/src/main/java/GUI/GUI.java +++ b/src/main/java/GUI/GUI.java @@ -6,10 +6,18 @@ import Exceptions.NotFoundInTable; import GUI.Agenda.Agenda; import GUI.Theme.PrimaryContainedButtonUI; import GUI.Types.ProjectionType; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; import javax.swing.*; +import javax.swing.border.TitledBorder; +import javax.swing.plaf.FontUIResource; +import javax.swing.text.StyleContext; +import java.awt.*; import java.util.ArrayList; import java.util.HashMap; +import java.util.Locale; public class GUI extends JFrame { private JPanel mainPanel; @@ -31,10 +39,11 @@ public class GUI extends JFrame { private Competition currentCompetition; private HashMap competitionButtons = new HashMap(); - public GUI() { + public GUI() throws NotFoundInTable { super(); + $$$setupUI$$$(); try { - this.currentCompetition = new Competition("Court Métrage"); + this.currentCompetition = new Competition("Un Certain Regard"); construct(); } catch (Exception e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); @@ -49,7 +58,7 @@ public class GUI extends JFrame { } private void construct() throws NotFoundInTable { - this.currentPage = 1; + this.currentPage = 0; setTitle("Projection Planning"); setContentPane(mainPanel); setSize(1280, 800); @@ -104,4 +113,86 @@ public class GUI extends JFrame { previousButton = new JButton(); previousButton.setUI(new PrimaryContainedButtonUI()); } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + createUIComponents(); + mainPanel = new JPanel(); + mainPanel.setLayout(new GridLayoutManager(4, 5, new Insets(0, 0, 0, 0), -1, -1)); + agendaPanel = new JPanel(); + agendaPanel.setLayout(new BorderLayout(0, 0)); + mainPanel.add(agendaPanel, new GridConstraints(1, 0, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); + agendaPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(0, 50, 0, 0), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null)); + final Spacer spacer1 = new Spacer(); + mainPanel.add(spacer1, new GridConstraints(0, 3, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + arrowPanel = new JPanel(); + arrowPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + mainPanel.add(arrowPanel, new GridConstraints(2, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + Font previousButtonFont = this.$$$getFont$$$("JetBrains Mono", Font.PLAIN, -1, previousButton.getFont()); + if (previousButtonFont != null) previousButton.setFont(previousButtonFont); + previousButton.setText("<--"); + arrowPanel.add(previousButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, 1, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + Font nextButtonFont = this.$$$getFont$$$("JetBrains Mono", Font.PLAIN, -1, nextButton.getFont()); + if (nextButtonFont != null) nextButton.setFont(nextButtonFont); + nextButton.setText("-->"); + arrowPanel.add(nextButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, 1, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + mainPanel.add(spacer2, new GridConstraints(3, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + mainPanel.add(panel1, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final Spacer spacer3 = new Spacer(); + panel1.add(spacer3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel1.add(panel2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + competitionButtonPanel = new JPanel(); + competitionButtonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); + panel2.add(competitionButtonPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(284, 61), null, 0, false)); + final Spacer spacer4 = new Spacer(); + panel2.add(spacer4, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, new Dimension(14, 61), null, 0, false)); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 50, 0, 0), -1, -1)); + panel2.add(panel3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + Font label1Font = this.$$$getFont$$$(null, -1, 22, label1.getFont()); + if (label1Font != null) label1.setFont(label1Font); + label1.setText("Agenda"); + panel3.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + Font font = new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + boolean isMac = System.getProperty("os.name", "").toLowerCase(Locale.ENGLISH).startsWith("mac"); + Font fontWithFallback = isMac ? new Font(font.getFamily(), font.getStyle(), font.getSize()) : new StyleContext().getFont(font.getFamily(), font.getStyle(), font.getSize()); + return fontWithFallback instanceof FontUIResource ? fontWithFallback : new FontUIResource(fontWithFallback); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return mainPanel; + } } diff --git a/src/main/java/GUI/ProjectionHandler.java b/src/main/java/GUI/ProjectionHandler.java index c8dfe9d..e149904 100644 --- a/src/main/java/GUI/ProjectionHandler.java +++ b/src/main/java/GUI/ProjectionHandler.java @@ -8,6 +8,8 @@ import GUI.Theme.DangerContainedButtonUI; import GUI.Theme.PrimaryContainedButtonUI; import GUI.Theme.SecondaryContainedButtonUI; import GUI.Types.ProjectionType; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; import javax.swing.*; import java.awt.*; @@ -48,6 +50,7 @@ public class ProjectionHandler extends JDialog { throw new ProjectionNotSpecified(); this.projectionType = projectionType; this.agenda = agenda; + $$$setupUI$$$(); competitionComboBox.getModel().setSelectedItem(agenda.getCompetition()); createUI(); if (agenda.getDate() != null || agenda.getSlot() != null) { @@ -66,6 +69,7 @@ public class ProjectionHandler extends JDialog { this.projectionType = projectionType; this.agenda = agenda; this.projection = projection; + $$$setupUI$$$(); createUI(); competitionComboBox.getModel().setSelectedItem(projection.getCompetition()); filmComboBox.getModel().setSelectedItem(projection.getMovie()); @@ -211,4 +215,68 @@ public class ProjectionHandler extends JDialog { this.agenda.refresh(); dispose(); } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + createUIComponents(); + contentPane = new JPanel(); + contentPane.setLayout(new GridLayoutManager(4, 2, new Insets(10, 10, 10, 10), -1, -1)); + competitionPanel = new JPanel(); + competitionPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(competitionPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + competitionLabel = new JLabel(); + competitionLabel.setText("Competition"); + competitionPanel.add(competitionLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + competitionComboBox = new JComboBox(); + competitionPanel.add(competitionComboBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + slotPanel = new JPanel(); + slotPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(slotPanel, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + slotLabel = new JLabel(); + slotLabel.setText("Slot"); + slotPanel.add(slotLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + slotComboBox = new JComboBox(); + slotPanel.add(slotComboBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + dayPanel = new JPanel(); + dayPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(dayPanel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + dayLabel = new JLabel(); + dayLabel.setText("Day"); + dayPanel.add(dayLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + dayComboBox = new JComboBox(); + dayPanel.add(dayComboBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + cancelButton.setText("Cancel"); + contentPane.add(cancelButton, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + confirmButton.setText("Button"); + contentPane.add(confirmButton, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + filmPanel = new JPanel(); + filmPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(filmPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + filmLabel = new JLabel(); + filmLabel.setText("Film"); + filmPanel.add(filmLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + filmComboBox = new JComboBox(); + filmPanel.add(filmComboBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + roomPanel = new JPanel(); + roomPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(roomPanel, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + roomLabel = new JLabel(); + roomLabel.setText("Room"); + roomPanel.add(roomLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + roomComboBox = new JComboBox(); + roomPanel.add(roomComboBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } } diff --git a/src/main/java/GUI/ProjectionSelecter.java b/src/main/java/GUI/ProjectionSelecter.java index 53871dc..ff9b46d 100644 --- a/src/main/java/GUI/ProjectionSelecter.java +++ b/src/main/java/GUI/ProjectionSelecter.java @@ -4,6 +4,9 @@ import DB.Projection; import GUI.Agenda.Agenda; import GUI.Agenda.Model.ProjectionTableModel; import GUI.Types.ProjectionType; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; import javax.swing.*; import java.awt.*; @@ -67,4 +70,51 @@ public class ProjectionSelecter extends JDialog { dispose(); } + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + contentPane = new JPanel(); + contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1)); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1, true, false)); + panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + buttonOK = new JButton(); + buttonOK.setText("OK"); + panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + buttonCancel = new JButton(); + buttonCancel.setText("Cancel"); + panel2.add(buttonCancel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + panel3.setBackground(new Color(-14273992)); + contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, new Dimension(-1, 200), null, 0, false)); + scrollPane = new JScrollPane(); + panel3.add(scrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + table1 = new JTable(); + scrollPane.setViewportView(table1); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } } diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..7e60099 --- /dev/null +++ b/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: ProjectionPlanning.Main +