Ignore:
Timestamp:
01/21/14 11:59:05 (10 years ago)
Author:
jts21
Message:

Move ColorWheels to UserSettings, store them as new ArraySetting type that handles default values (so now ColorWheels have defaults if you unlink their setting)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/settings/UserSettings.java

    r717 r729  
    66import java.io.IOException;
    77import java.util.ArrayList;
     8import java.util.Arrays;
    89import java.util.LinkedList;
    910import java.util.List;
     
    2223import org.expeditee.items.ItemUtils;
    2324import org.expeditee.items.Text;
     25import org.expeditee.setting.ArraySetting;
    2426import org.expeditee.setting.BooleanSetting;
    2527import org.expeditee.setting.FloatSetting;
     
    289291         * Colorwheels
    290292         */
    291         public static final FrameSetting ColorWheel = new FrameSetting("The colours of items in the child frame are used to populate the colour wheel") {
    292                 @Override
    293                 protected void run(Frame frame) {
    294                         Item.COLOR_WHEEL = FrameUtils.getColorWheel(frame);
    295                 }
    296         };
    297        
    298         public static final FrameSetting FillColorWheel = new FrameSetting("The colours of items in the child frame are used to populate the colour wheel") {
    299                 @Override
    300                 protected void run(Frame frame) {
    301                         Item.FILL_COLOR_WHEEL = FrameUtils.getColorWheel(frame);
    302                 }
    303         };
    304        
    305         public static final FrameSetting BackgroundColorWheel = new FrameSetting("The colours of items in the child frame are used to populate the colour wheel") {
    306                 @Override
    307                 protected void run(Frame frame) {
    308                         Frame.COLOR_WHEEL = FrameUtils.getColorWheel(frame);
     293        public static final ArraySetting<Color> ColorWheel = new ArraySetting<Color>("The colours of items in the child frame are used to populate the colour wheel",
     294                        new Color[] { Color.BLACK, Color.RED, Color.BLUE, Item.GREEN, Color.MAGENTA, Color.YELLOW.darker(), Color.WHITE }) {
     295                @Override
     296                public boolean setSetting(Text text) {
     297                        Frame child = text.getChild();
     298                if (child == null) {
     299                        return false;
     300                }
     301                _value = FrameUtils.getColorWheel(child);
     302                return true;
     303                }
     304        };
     305       
     306        public static final ArraySetting<Color> FillColorWheel = new ArraySetting<Color>("The colours of items in the child frame are used to populate the colour wheel",
     307                        new Color[] { new Color(255, 150, 150), new Color(150, 150, 255), new Color(150, 255, 150),
     308                        new Color(255, 150, 255), new Color(255, 255, 100), Color.WHITE, Color.BLACK }) {
     309                @Override
     310                public boolean setSetting(Text text) {
     311                        Frame child = text.getChild();
     312                if (child == null) {
     313                        return false;
     314                }
     315                _value = FrameUtils.getColorWheel(child);
     316                return true;
     317                }
     318        };
     319       
     320        public static final ArraySetting<Color> BackgroundColorWheel = new ArraySetting<Color>("The colours of items in the child frame are used to populate the colour wheel",
     321                        new Color[] { new Color(235, 235, 235), new Color(225, 225, 255), new Color(195, 255, 255),
     322                        new Color(225, 255, 225), new Color(255, 255, 195), new Color(255, 225, 225),
     323                        new Color(255, 195, 255), Color.WHITE, Color.GRAY, Color.DARK_GRAY, Color.BLACK, null }) {
     324                @Override
     325                public boolean setSetting(Text text) {
     326                        Frame child = text.getChild();
     327                if (child == null) {
     328                        return false;
     329                }
     330                _value = FrameUtils.getColorWheel(child);
     331                return true;
    309332                }
    310333        };
Note: See TracChangeset for help on using the changeset viewer.