Skip to content

Commit

Permalink
Merge pull request #62 from klassenserver7b/Development
Browse files Browse the repository at this point in the history
V3.5.0
  • Loading branch information
klassenserver7b authored Dec 17, 2023
2 parents ea532f3 + b79ce06 commit fa4d1a6
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './mvn-site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v3
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Java CI
on:
push:
release:
types: [published]

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract Maven project version
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
id: project
- name: Show extracted Maven project version
run: echo ${{ steps.project.outputs.version }}
- name: Upload to Release
if: github.event_name == 'release'
uses: JasonEtco/upload-to-release@master
with:
args: target/DanceInterpreter-${{ steps.project.outputs.version }}-full.jar application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>de.klassenserver7b</groupId>
<artifactId>danceinterpreter</artifactId>
<version>3.0.0</version>
<version>3.5.0</version>

<name>DanceInterpreter</name>
<description>Tool to present a playlist for ballroom dancing</description>
Expand Down Expand Up @@ -169,7 +169,7 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.2.3</version>
<version>5.3</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.slf4j.LoggerFactory;

import de.klassenserver7b.danceinterpreter.Main;
import de.klassenserver7b.danceinterpreter.graphics.listener.CustomKeyListener;
import de.klassenserver7b.danceinterpreter.graphics.listener.FileDropListener;
import de.klassenserver7b.danceinterpreter.songprocessing.SongData;
import de.klassenserver7b.danceinterpreter.songprocessing.dataprovider.PlaylistSongDataProvider;
Expand All @@ -36,8 +37,8 @@

public class ConfigWindow {

private JFrame mainframe;
private JPanel mainpanel;
private JFrame mainFrame;
private JPanel mainPanel;
private Long time;
private boolean playlistview;
private boolean imgenabled;
Expand All @@ -57,43 +58,43 @@ public ConfigWindow() {
this.log = LoggerFactory.getLogger(this.getClass());

this.time = 0L;
this.mainframe = new JFrame();
this.mainpanel = new JPanel();
this.mainFrame = new JFrame();
this.mainPanel = new JPanel();
this.playlistview = false;
this.imgenabled = false;

this.dropTarget = new DropTarget(this.mainframe, new FileDropListener());
this.dropTarget = new DropTarget(this.mainFrame, new FileDropListener());

this.mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
File file = new File("./icon.png");

try {
BufferedImage bufferedImage = ImageIO.read(file);
this.mainframe.setIconImage(bufferedImage);
this.mainFrame.setIconImage(bufferedImage);
} catch (IOException e) {
this.log.error("No Icon Found!");
}
this.mainframe.setTitle("DI - Config");
this.mainFrame.setTitle("DI - Config");

this.mainframe.setBounds(10, 10, 500, 281);
this.mainFrame.setBounds(10, 10, 1280, 720);

MenuGenerator mgen = new MenuGenerator(this);

this.mainframe.setJMenuBar(mgen.getMenuBar());
this.mainFrame.setJMenuBar(mgen.getMenuBar());

JLabel img = new JLabel();

// Image image;

// image = ImageIO.read(new File(imgpath));
// ImageIcon icon = new ImageIcon(image.getScaledInstance(mainframe.getWidth(),
// mainframe.getHeight(), 0));
// ImageIcon icon = new ImageIcon(image.getScaledInstance(mainFrame.getWidth(),
// mainFrame.getHeight(), 0));
img = new JLabel(new ImageIcon(this.imgpath));

// img.setIcon(icon);

this.mainpanel.add(img);
this.mainframe.addComponentListener(new ComponentAdapter() {
this.mainPanel.add(img);
this.mainFrame.addComponentListener(new ComponentAdapter() {

@Override
public void componentResized(ComponentEvent componentEvent) {
Expand All @@ -113,31 +114,32 @@ public void componentResized(ComponentEvent componentEvent) {
}

});
this.mainframe.add(this.mainpanel);
this.mainframe.setVisible(true);
this.mainFrame.add(this.mainPanel);
this.mainFrame.setVisible(true);

}

public void updateWindow() {

this.mainpanel.removeAll();
this.mainpanel.paintImmediately(0, 0, this.mainframe.getWidth(), this.mainframe.getHeight());
this.mainPanel.removeAll();
this.mainPanel.paintImmediately(0, 0, this.mainFrame.getWidth(), this.mainFrame.getHeight());

if (!this.playlistview && this.imgenabled) {
JLabel img = new JLabel();
img = new JLabel(new ImageIcon(this.imgpath));

this.mainpanel.add(img);
this.mainPanel.add(img);
}

this.mainpanel.paintComponents(this.mainframe.getGraphics());
this.mainframe.setVisible(true);
this.mainPanel.paintComponents(this.mainFrame.getGraphics());
this.mainFrame.setVisible(true);
}

public void updateWindow(List<JLabel> l) {

this.mainpanel.removeAll();
//mainpanel.paintImmediately(0, 0, mainframe.getWidth(), mainframe.getHeight());
this.mainPanel.removeAll();
// mainPanel.paintImmediately(0, 0, mainFrame.getWidth(),
// mainFrame.getHeight());

if (!this.playlistview) {
JLabel img = new JLabel();
Expand All @@ -146,24 +148,29 @@ public void updateWindow(List<JLabel> l) {

try {
image = ImageIO.read(new File("./pics/splash_small.jpg"));
ImageIcon icon = new ImageIcon(image.getScaledInstance(this.mainframe.getWidth(), this.mainframe.getHeight(), 0));
ImageIcon icon = new ImageIcon(
image.getScaledInstance(this.mainFrame.getWidth(), this.mainFrame.getHeight(), 0));

img.setIcon(icon);

} catch (IOException e) {
e.printStackTrace();
}

this.mainpanel.add(img);
this.mainPanel.add(img);
} else {
for (JLabel label : l) {
this.mainpanel.add(label);
this.mainPanel.add(label);
}
}

this.mainpanel.paintComponents(this.mainframe.getGraphics());
this.mainframe.repaint();
this.mainframe.setVisible(true);
this.mainPanel.paintComponents(this.mainFrame.getGraphics());
this.mainFrame.repaint();
this.mainFrame.setVisible(true);
}

public void initKeyListeners(CustomKeyListener keylis) {
this.mainFrame.addKeyListener(keylis);
}

public List<JLabel> loadPlaylistView() {
Expand Down Expand Up @@ -210,13 +217,13 @@ public List<JLabel> loadPlaylistView() {
}

public void close() {
this.mainframe.removeAll();
this.mainframe.setEnabled(false);
this.mainframe.setVisible(false);
this.mainFrame.removeAll();
this.mainFrame.setEnabled(false);
this.mainFrame.setVisible(false);

this.mainframe.dispose();
this.mainFrame.dispose();

this.mainframe = null;
this.mainFrame = null;
}

public boolean isPlaylistview() {
Expand All @@ -236,11 +243,11 @@ public void setImgenabled(boolean imgenabled) {
}

public JFrame getMainframe() {
return this.mainframe;
return this.mainFrame;
}

public JPanel getMainpanel() {
return this.mainpanel;
return this.mainPanel;
}

class ClickListener implements MouseListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.klassenserver7b.danceinterpreter.Main;
import de.klassenserver7b.danceinterpreter.graphics.listener.ArrowSpaceKeyListener;
import de.klassenserver7b.danceinterpreter.graphics.listener.CustomKeyListener;
import de.klassenserver7b.danceinterpreter.graphics.listener.FullscreenListener;
Expand Down Expand Up @@ -83,6 +84,8 @@ protected void initFrame() {
this.mainFrame.setBounds(screenBounds);
this.mainFrame.setLayout(null);

this.mainFrame.setAutoRequestFocus(true);

this.mainFrame.getContentPane().setBackground(Color.BLACK);

CustomKeyListener keylis = new CustomKeyListener();
Expand All @@ -103,6 +106,8 @@ public void componentResized(ComponentEvent e) {
SongWindowServer.this.registeredWindows.get(SongWindowServer.this.selectedWindow).refresh();
}
});

Main.Instance.getConfigWindow().initKeyListeners(keylis);
}

/**
Expand Down Expand Up @@ -218,4 +223,11 @@ public void setSettingsOverride(SongWindowSpecs settingsOverride) {
provideData(this.currentData);
}

/**
* @return the mainFrame
*/
public JFrame getMainFrame() {
return this.mainFrame;
}

}

0 comments on commit fa4d1a6

Please sign in to comment.