Skip to content
Snippets Groups Projects
Commit 82d44913 authored by CHEVALIER Noemy's avatar CHEVALIER Noemy
Browse files

Ajout fonctions convertions couleurs

parent 25a0b11d
No related branches found
No related tags found
No related merge requests found
......@@ -70,13 +70,14 @@ public class ShukanView extends JPanel
/** Background color */
private Color BACK_COLOR = new ColorUIResource(226, 226, 226);
/** Background color */
private Color BACK_COLOR2 = Color.LIGHT_GRAY;
/** Grid color */
private final Color GRID_COLOR = Color.BLACK;
/** Free module weeks color */
private final Color HOLLY_COLOR = new Color (1.f, 0.8f, 0.7f);
private Color HOLLY_COLOR = new Color (1.f, 0.8f, 0.7f);
/** Inactive parts of weeks color */
private final Color INACTIVE_COLOR = new Color (0.5f, 0.5f, 0.5f);
private Color INACTIVE_COLOR = new Color (0.5f, 0.5f, 0.5f);
/** Frame borders color */
private final Color ACTIVE_COLOR = new Color (0.6f, 0.6f, 0.9f);
/** Selected activity color */
......@@ -84,7 +85,7 @@ public class ShukanView extends JPanel
/** Frame borders color */
private final Color FRAME_COLOR = Color.BLACK;
/** Text color */
private final Color TEXT_COLOR = Color.BLACK;
private Color TEXT_COLOR = Color.BLACK;
/** Selected text color */
private final Color SELECTED_TEXT_COLOR = Color.WHITE;
/** Unselectable text color */
......@@ -377,6 +378,7 @@ public class ShukanView extends JPanel
private void drawText (Graphics2D g2, float posx, float posy,
float width, float height, String text)
{
g2.setColor(TEXT_COLOR);
g2.drawString (text,
(int) (posx + (width - fontMetrics.stringWidth (text)) / 2),
appliHeight - (int) (posy + (height - fontHeight) / 2));
......@@ -446,9 +448,18 @@ public class ShukanView extends JPanel
}
}
/** change the background color */
public void setBackgroundColor(Color c){
/** Change the background color */
public void setBackgroundColor(Color c, Color c1){
BACK_COLOR = c;
BACK_COLOR2 = c1;
repaint();
}
/** Change the text and the hollydays colors*/
public void setForeground(Color c, Color c1, Color c2){
TEXT_COLOR = c;
HOLLY_COLOR = c1;
INACTIVE_COLOR = c2;
repaint();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment