Skip to content

Commit

Permalink
New *98* theme
Browse files Browse the repository at this point in the history
  • Loading branch information
AndusDEV committed Oct 29, 2021
1 parent 878a6b9 commit cd0b5ff
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/pl/andus/skeditor/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ public Main() throws IOException {
JMenuItem nSkyTheme = new JMenuItem("Night Sky");
JMenuItem metalicTheme = new JMenuItem("Metalic");
JMenuItem laserLTheme = new JMenuItem("Laser Lemon");
JMenuItem nineEightTheme = new JMenuItem("98");

themesMenu.add(lightTheme);
themesMenu.add(darkTheme);
themesMenu.add(nSkyTheme);
themesMenu.add(metalicTheme);
themesMenu.add(laserLTheme);
themesMenu.add(nineEightTheme);

JMenuItem about = new JMenuItem("About");

Expand Down Expand Up @@ -223,6 +225,8 @@ public Main() throws IOException {

laserLTheme.addActionListener(e -> LimeToYellow());

nineEightTheme.addActionListener(e -> NineEight());

about.addActionListener(e -> new About());
}

Expand Down
28 changes: 27 additions & 1 deletion src/main/java/pl/andus/skeditor/Themes.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
import org.fife.ui.rsyntaxtextarea.Token;

import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.plaf.metal.MetalLookAndFeel;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;

import static pl.andus.skeditor.Main.*;

public class Themes {

static BufferedImage nightSkyImg = null;
static BufferedImage metalImg = null;
static BufferedImage laserLemonImg = null;
static BufferedImage neImg = null;

public static void Light() {
// menu
Expand Down Expand Up @@ -56,7 +60,7 @@ public static void NightSky() {
}

// menu
menuBar.setBackground(Color.white);
menuBar.setBackground(new Color(0, 77, 168));
// textarea
textArea.setBackgroundImage(nightSkyImg);
textArea.setCurrentLineHighlightColor(new Color(0, 118, 255, 161));
Expand Down Expand Up @@ -113,4 +117,26 @@ public static void LimeToYellow() {
scheme.getStyle(Token.OPERATOR).foreground = new Color(231, 80, 255);
scheme.getStyle(Token.LITERAL_NUMBER_DECIMAL_INT).foreground = Color.lightGray;
}

public static void NineEight() {
try {
neImg = ImageIO.read(Themes.class.getClassLoader().getResourceAsStream("themes/98.png"));
} catch (IOException e) {
e.printStackTrace();
}

// menu
menuBar.setBackground(new Color(0, 125, 121));
// textarea
textArea.setBackgroundImage(neImg);
textArea.setCurrentLineHighlightColor(new Color(0, 125, 160, 165));
textArea.setForeground(Color.black);
// text
scheme.getStyle(Token.RESERVED_WORD).foreground = Color.blue;
scheme.getStyle(Token.RESERVED_WORD_2).foreground = new Color(255, 0, 0);
scheme.getStyle(Token.COMMENT_KEYWORD).foreground = Color.magenta;
scheme.getStyle(Token.DATA_TYPE).foreground = new Color(31, 140, 255);
scheme.getStyle(Token.OPERATOR).foreground = new Color(231, 80, 255);
scheme.getStyle(Token.LITERAL_NUMBER_DECIMAL_INT).foreground = Color.lightGray;
}
}
Binary file added src/main/resources/themes/98.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/themes/lime-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/themes/metal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/themes/night.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/themes/unused/mc-sunset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified target/classes/pl/andus/skeditor/Main.class
Binary file not shown.
Binary file modified target/classes/pl/andus/skeditor/ShowDialog.class
Binary file not shown.
Binary file modified target/classes/pl/andus/skeditor/Themes.class
Binary file not shown.
Binary file added target/classes/themes/98.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified target/classes/themes/lime-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified target/classes/themes/metal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified target/classes/themes/night.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added target/classes/themes/unused/mc-sunset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cd0b5ff

Please sign in to comment.