add missing settings for various colors. resolves #9

This commit is contained in:
Gered 2016-01-03 16:03:12 -05:00
parent 05983ec78f
commit 016ecd8acd
7 changed files with 41 additions and 35 deletions

View file

@ -34,8 +34,11 @@ public enum Language {
setting_color_foreground,
setting_color_time,
setting_color_timer,
setting_color_timeGained,
setting_color_timeLost,
setting_color_negativeTime,
setting_color_timeGainedWhileAhead,
setting_color_timeLostWhileAhead,
setting_color_timeGainedWhileBehind,
setting_color_timeLostWhileBehind,
setting_color_newRecord,
setting_color_title,
setting_color_subTitle,

View file

@ -44,8 +44,11 @@ public class Settings {
public static final Property<Color> colorForeground = new Property<>( "color.foreground" );
public static final Property<Color> colorTime = new Property<>( "color.time" );
public static final Property<Color> colorTimer = new Property<>( "color.timer" );
public static final Property<Color> colorTimeGained = new Property<>( "color.timeGained" );
public static final Property<Color> colorTimeLost = new Property<>( "color.timeLost" );
public static final Property<Color> colorNegativeTime = new Property<>( "color.negativeTime" );
public static final Property<Color> colorTimeGainedWhileAhead = new Property<>( "color.timeGainedWhileAhead" );
public static final Property<Color> colorTimeLostWhileAhead = new Property<>( "color.timeLostWhileAhead" );
public static final Property<Color> colorTimeGainedWhileBehind = new Property<>( "color.timeGainedWhileBehind" );
public static final Property<Color> colorTimeLostWhileBehind = new Property<>( "color.timeLostWhileBehind" );
public static final Property<Color> colorNewRecord = new Property<>( "color.newRecord" );
public static final Property<Color> colorTitle = new Property<>( "color.title" );
public static final Property<Color> colorSubTitle = new Property<>( "color.subTitle" );
@ -213,8 +216,11 @@ public class Settings {
global.put( colorForeground.key, Color.decode( "0xc0c0c0" ) );
global.put( colorTime.key, Color.decode( "0xffffff" ) );
global.put( colorTimer.key, Color.decode( "0x22cc22" ) );
global.put( colorTimeGained.key, Color.decode( "0x6295fc" ) );
global.put( colorTimeLost.key, Color.decode( "0xe82323" ) );
global.put( colorNegativeTime.key, Color.decode ("0x808080" ) );
global.put( colorTimeGainedWhileAhead.key, Color.decode( "0x6295fc" ) );
global.put( colorTimeLostWhileAhead.key, Color.decode( "0x99ccff" ) );
global.put( colorTimeGainedWhileBehind.key, Color.decode( "0xff8e8e" ) );
global.put( colorTimeLostWhileBehind.key, Color.decode( "0xe82323" ) );
global.put( colorNewRecord.key, Color.decode( "0xf0b012" ) );
global.put( colorTitle.key, Color.decode( "0xf0b012" ) );
global.put( colorSubTitle.key, Color.decode( "0xffffff" ) );

View file

@ -308,7 +308,7 @@ class Core extends JPanel implements ActionListener {
Time segmentElapsed = new Time(now - current.getStartTime());
if (splitElapsed.getMilliseconds() < 0)
splitTimer.setForeground(Color.GRAY);
splitTimer.setForeground(Settings.colorNegativeTime.get());
else
splitTimer.setForeground(Settings.colorTimer.get());
@ -318,7 +318,7 @@ class Core extends JPanel implements ActionListener {
Color bg = Settings.colorBackground.get();
if (splitTimer.getForeground().equals(bg)) {
if (pauseTime.compareTo(splitTime) > 0) {
splitTimer.setForeground(Settings.colorTimeLost.get());
splitTimer.setForeground(Settings.colorTimeGainedWhileBehind.get());
} else {
splitTimer.setForeground(Settings.colorTimer.get());
}
@ -338,11 +338,11 @@ class Core extends JPanel implements ActionListener {
if (!splitLoss && splitElapsed.compareTo(splitTime) > 0) {
splitLoss = true;
splitTimer.setForeground(Settings.colorTimeLost.get());
splitTimer.setForeground(Settings.colorTimeGainedWhileBehind.get());
}
if (!segmentLoss && segmentElapsed.compareTo(segmentTime) > 0) {
segmentLoss = true;
segmentTimer.setForeground(Settings.colorTimeLost.get());
segmentTimer.setForeground(Settings.colorTimeGainedWhileBehind.get());
}
}
}
@ -605,7 +605,7 @@ class Core extends JPanel implements ActionListener {
synchronized (this) {
Color color = Settings.colorTimer.get();
if (isShowingNegativeTime() && run.getState() == State.READY)
splitTimer.setForeground(Color.GRAY);
splitTimer.setForeground(Settings.colorNegativeTime.get());
else
splitTimer.setForeground(color);
segmentTimer.setForeground(color);

View file

@ -179,8 +179,8 @@ class Footer extends JPanel {
updateValues(ALL & ~TEXT);
updateColors(TIME | DELTA);
updateVisibility(ALL);
} else if (Settings.colorTimeLost.equals(property)
|| Settings.colorTimeGained.equals(property)) {
} else if (Settings.colorTimeGainedWhileBehind.equals(property)
|| Settings.colorTimeGainedWhileAhead.equals(property)) {
updateColors(DELTA);
} else if (Settings.colorTime.equals(property)
@ -363,9 +363,9 @@ class Footer extends JPanel {
} else {
int compare = tmDlta.compareTo(Time.ZERO);
if (compare > 0) {
delta.setForeground(Settings.colorTimeLost.get());
delta.setForeground(Settings.colorTimeGainedWhileBehind.get());
} else {
delta.setForeground(Settings.colorTimeGained.get());
delta.setForeground(Settings.colorTimeGainedWhileAhead.get());
}
}
}

View file

@ -148,8 +148,8 @@ class Graph extends JPanel {
// Settings.COLOR_BACKGROUND, COLOR_TIME_LOST, COLOR_TIME_GAINED
// or Run.CURRENT_SEGMENT_PROPERTY
} else if (Settings.colorBackground.equals(property)
|| Settings.colorTimeLost.equals(property)
|| Settings.colorTimeGained.equals(property)
|| Settings.colorTimeGainedWhileBehind.equals(property)
|| Settings.colorTimeGainedWhileAhead.equals(property)
|| Settings.colorNewRecord.equals(property)
|| Run.CURRENT_SEGMENT_PROPERTY.equals(property)) {
canvas.repaint();
@ -310,8 +310,8 @@ class Graph extends JPanel {
g2.fillRect(0, 0, clipW, clipH);
Color colorFG = Settings.colorForeground.get();
Color colorTG = Settings.colorTimeGained.get();
Color colorTL = Settings.colorTimeLost.get();
Color colorTG = Settings.colorTimeGainedWhileAhead.get();
Color colorTL = Settings.colorTimeGainedWhileBehind.get();
Color colorRC = Settings.colorNewRecord.get();
// Draw the axis.

View file

@ -255,8 +255,8 @@ public class History extends JPanel {
} else if (Settings.historyRowCount.equals(property)
|| Settings.historyBlankRows.equals(property)) {
populateRows();
} else if (Settings.colorTimeGained.equals(property)
|| Settings.colorTimeLost.equals(property)
} else if (Settings.colorTimeGainedWhileAhead.equals(property)
|| Settings.colorTimeGainedWhileBehind.equals(property)
|| Settings.colorNewRecord.equals(property)) {
updateColors(LIVE);
} else if (Settings.colorHighlight.equals(property)) {
@ -611,18 +611,12 @@ public class History extends JPanel {
}
}
if ((identifier & LIVE) == LIVE && (index > -1)) {
Color lost = Settings.colorTimeLost.get();
Color gain = Settings.colorTimeGained.get();
Color lost = Settings.colorTimeGainedWhileBehind.get();
Color gain = Settings.colorTimeGainedWhileAhead.get();
Color neut = Settings.colorTime.get();
Color recd = Settings.colorNewRecord.get();
int prev = run.getPrevious();
// TODO: replace with color settings the user can set themselves
Color lostWhileAhead = gain.brighter();
Color gainWhileAhead = gain; //.darker();
Color lostWhileBehind = lost.brighter();
Color gainWhileBehind = lost; //.darker();
Merge merge = Settings.historyMerge.get();
JLabel realDelta = (merge == Merge.DELTA) ? time : delta;
JLabel realLive = (merge == Merge.LIVE ) ? time : live;
@ -643,16 +637,16 @@ public class History extends JPanel {
boolean isGainingTime = run.isBetterSegment(run.getPrevious());
if (compare > 0) {
if (isGainingTime)
realDelta.setForeground(gainWhileBehind);
realDelta.setForeground(Settings.colorTimeGainedWhileBehind.get());
else
realDelta.setForeground(lostWhileBehind);
realDelta.setForeground(Settings.colorTimeLostWhileBehind.get());
realLive.setForeground(lost);
} else {
if (isGainingTime)
realDelta.setForeground(gainWhileAhead);
realDelta.setForeground(Settings.colorTimeGainedWhileAhead.get());
else
realDelta.setForeground(lostWhileAhead);
realDelta.setForeground(Settings.colorTimeLostWhileAhead.get());
realLive.setForeground(gain);
}

View file

@ -15,8 +15,11 @@ setting_color_background = Background
setting_color_foreground = Foreground
setting_color_time = Time
setting_color_timer = Timer
setting_color_timeGained = Time Gained
setting_color_timeLost = Time Lost
setting_color_negativeTime = Negative Time
setting_color_timeGainedWhileAhead = Time Gained (While Ahead)
setting_color_timeLostWhileAhead = Time Lost (While Ahead)
setting_color_timeGainedWhileBehind = Time Gained (While Behind)
setting_color_timeLostWhileBehind = Time Lost (While Behind)
setting_color_newRecord = New Record
setting_color_title = Title
setting_color_subTitle = Sub Title