Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update color #24

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/main/java/edu/project/components/TimeForecast.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import edu.project.api.WeatherForecast5Data;

import javax.swing.*;

import com.formdev.flatlaf.FlatClientProperties;

import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import java.time.LocalDateTime;
Expand All @@ -13,9 +16,10 @@
import java.util.Locale;

public class TimeForecast extends JPanel {

private static final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("h a")
.withLocale(Locale.ENGLISH); // Abbreviate the hour
private static final Color PANEL_COLOR = new Color(169, 169, 169); // Light gray color
private static final Color PANEL_COLOR = new Color(224, 224, 224); // Light gray color
private static final int ARC_WIDTH = 20; // Adjust the arc width for rounded corners
private static final int ARC_HEIGHT = 20; // Adjust the arc height for rounded corners
private static final int SPACING = 10; // Horizontal spacing between each hour panel
Expand All @@ -25,8 +29,9 @@ public class TimeForecast extends JPanel {
private final List<HourForecast> hourForecasts = new ArrayList<>();

public TimeForecast(Context context) {
putClientProperty(FlatClientProperties.STYLE,
"border: 16,16,16,16,shade(@background,10%),,16");
setOpaque(false);
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
setLayout(new BorderLayout());

JPanel mainPanel = new JPanel(new BorderLayout());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/project/components/WeatherCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void setValue(String value) {
protected void paintComponent(Graphics graphics) {
Graphics2D graphics2d = (Graphics2D) graphics;
graphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
graphics2d.setColor(Color.LIGHT_GRAY);
graphics2d.setColor(new Color(224, 224, 224));
graphics2d.fillRoundRect(0, 0, getWidth(), getHeight(), 16, 16);
super.paintComponent(graphics);
}
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/edu/project/components/WeatherForecastPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import edu.project.api.WeatherForecast5Data;

import javax.swing.*;

import com.formdev.flatlaf.FlatClientProperties;

import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import java.time.LocalDate;
Expand All @@ -15,17 +18,19 @@
public class WeatherForecastPanel extends JPanel {
private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("EEE")
.withLocale(Locale.ENGLISH);
private static final Color PANEL_COLOR = new Color(169, 169, 169); // Light gray color
private static final int ARC_WIDTH = 20;
private static final int ARC_HEIGHT = 20;
private static final Color PANEL_COLOR = new Color(224, 224, 224); // Light gray color
private static final int ARC_WIDTH = 16;
private static final int ARC_HEIGHT = 16;
private static final int SPACING = 20;

private final JPanel contentPanel;
private final List<DayForecast> dayForecasts = new ArrayList<>();

public WeatherForecastPanel(Context context) {
putClientProperty(FlatClientProperties.STYLE,
"border: 16,16,16,16,shade(@background,10%),,16");

setOpaque(false);
setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 19));
setLayout(new BorderLayout());

JPanel mainPanel = new JPanel(new BorderLayout());
Expand Down
Loading