mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[mage.rating.plugin] Added executable folder with built jar. Added maven assembly. Added manifest. Added saving option before exiting from app.
This commit is contained in:
parent
6f653d3ce7
commit
4c3035fa06
6 changed files with 48 additions and 6 deletions
7
Mage.Plugins/Mage.Rating.Plugin/MANIFEST.MF
Normal file
7
Mage.Plugins/Mage.Rating.Plugin/MANIFEST.MF
Normal file
|
@ -0,0 +1,7 @@
|
|||
Manifest-Version: 1.0
|
||||
Archiver-Version: Plexus Archiver
|
||||
Created-By: Apache Maven
|
||||
Built-By: natfullina
|
||||
Build-Jdk: 1.6.0_16
|
||||
Main-Class: org.mage.plugins.rating.RateFrame
|
||||
Class-Path: lib/mage-sets.jar
|
BIN
Mage.Plugins/Mage.Rating.Plugin/executable/lib/mage-sets.jar
Normal file
BIN
Mage.Plugins/Mage.Rating.Plugin/executable/lib/mage-sets.jar
Normal file
Binary file not shown.
Binary file not shown.
|
@ -65,6 +65,20 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>org.mage.plugins.rating.RateFrame</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<finalName>mage-card-plugin</finalName>
|
||||
|
|
|
@ -3,6 +3,8 @@ package org.mage.plugins.rating;
|
|||
import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
|
@ -30,9 +32,19 @@ public class RateFrame extends JFrame {
|
|||
log.error(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
if (JOptionPane.showConfirmDialog(null, "Do you want to save recent compares?", "Save before exit", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) {
|
||||
RateThread.getInstance().forceSave();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
int width = 621;
|
||||
int height = 384;
|
||||
setSize(width, height);
|
||||
setResizable(false);
|
||||
int w = getGraphicsConfiguration().getBounds().width;
|
||||
int h = getGraphicsConfiguration().getBounds().height;
|
||||
setLocation((w - width) / 2, (h - height) / 2);
|
||||
|
@ -63,6 +75,8 @@ public class RateFrame extends JFrame {
|
|||
}
|
||||
});
|
||||
add(rate);
|
||||
|
||||
System.out.println("test");
|
||||
}
|
||||
|
||||
public void startRating() {
|
||||
|
|
|
@ -96,6 +96,13 @@ public class RateThread extends Thread {
|
|||
generateNext();
|
||||
}
|
||||
|
||||
public void forceSave() {
|
||||
if (results.size() > 0) {
|
||||
ResultHandler.getInstance().save(results);
|
||||
results.clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeCard(Component component) {
|
||||
if (component != null) {
|
||||
frame.remove(component);
|
||||
|
|
Loading…
Reference in a new issue