Ignore:
Timestamp:
01/07/14 10:59:52 (10 years ago)
Author:
jts21
Message:

Switch to using specialised objects for settings so they make more a bit more sense (now each setting is a single object instead of multiple, and setter functions and default values are less hackish)
Also added tooltips (help strings) to settings, will need to add a way of displaying these (maybe add the idea of a tooltip which is a text item which only appears when hovering over another item?)
Converted all settings over to new format, everything seems to be working fine

Location:
trunk/src/org/expeditee/items
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Item.java

    r632 r655  
    229229
    230230                if (parent != null && !UserSettings.UserName.equals(parent.getOwner())) {
    231                         dest.setOwner(UserSettings.UserName);
     231                        dest.setOwner(UserSettings.UserName.get());
    232232                }
    233233        }
     
    254254                        return 2;
    255255                }
    256                 return org.expeditee.settings.UserSettings.Gravity;
     256                return UserSettings.Gravity.get();
    257257        }
    258258
    259259        public static boolean showLineHighlight() {
    260                 return org.expeditee.settings.UserSettings.LineHighlight;
     260                return UserSettings.LineHighlight.get();
    261261        }
    262262
     
    16961696                if (_parent != null && UserSettings.UserName != null
    16971697                                && !UserSettings.UserName.equals(_parent.getOwner())) {
    1698                         setOwner(UserSettings.UserName);
     1698                        setOwner(UserSettings.UserName.get());
    16991699                }
    17001700        }
  • trunk/src/org/expeditee/items/ItemUtils.java

    r601 r655  
    371371                        File file = null;
    372372
    373                         for (String dir : org.expeditee.settings.UserSettings.ImageDirs) {
     373                        for (String dir : org.expeditee.settings.UserSettings.ImageDirs.get()) {
    374374                                file = new File(dir + path);
    375375                                if (file.exists() && !file.isDirectory())
  • trunk/src/org/expeditee/items/Text.java

    r635 r655  
    14341434                List<Point[]> lines = null;
    14351435               
    1436                 if(_autoWrap || ExperimentalFeatures.AutoWrap) {
     1436                if(_autoWrap || ExperimentalFeatures.AutoWrap.get()) {
    14371437                lines = new LinkedList<Point[]>();
    14381438                if(DisplayIO.getCurrentFrame() == null) {
     
    14721472                while (_lineBreaker.getPosition() < _text.length()) {
    14731473                       
    1474                         if(_autoWrap || ExperimentalFeatures.AutoWrap) {
     1474                        if(_autoWrap || ExperimentalFeatures.AutoWrap.get()) {
    14751475                                requireNextWord = width < FrameGraphics.getMaxFrameSize().width - getX();
    14761476                        }
     
    15051505                        _textLayouts.add(layout);
    15061506                                               
    1507                         if(_autoWrap || ExperimentalFeatures.AutoWrap) {
     1507                        if(_autoWrap || ExperimentalFeatures.AutoWrap.get()) {
    15081508                               
    15091509                        if(lineHeight != Float.NaN) {
     
    16501650                        return;
    16511651               
    1652                 if(_autoWrap || ExperimentalFeatures.AutoWrap) {
     1652                if(_autoWrap || ExperimentalFeatures.AutoWrap.get()) {
    16531653                        invalidateAll();
    16541654               
     
    21192119               
    21202120                // if autowrap is on, wrapping is done every time we draw
    2121                 if(ExperimentalFeatures.AutoWrap) {
     2121                if(ExperimentalFeatures.AutoWrap.get()) {
    21222122                        return;
    21232123                }
  • trunk/src/org/expeditee/items/widgets/JfxBrowser.java

    r645 r655  
    407407        public JfxBrowser(Text source, String[] args) {
    408408                // Initial page is either the page stored in the arguments (if there is one stored) or the homepage
    409                 super(source, new WebBrowserPanel((args != null && args.length > 0) ? args[0] : NetworkSettings.homePage), -1, 500, -1, -1, 300, -1);
     409                super(source, new WebBrowserPanel((args != null && args.length > 0) ? args[0] : NetworkSettings.HomePage.get()), -1, 500, -1, -1, 300, -1);
    410410                _browser = (WebBrowserPanel) _swingComponent;
    411411                _browser.owner = this;
     
    434434                                (firstSpace != -1 && firstSpace < firstSQ)) {      // no '/' or '?'             -> search
    435435                                // make it a search
    436                                 actualURL = NetworkSettings.searchEngine + url;
     436                                actualURL = NetworkSettings.SearchEngine.get() + url;
    437437                        } else {
    438438                                // add the missing protocol
Note: See TracChangeset for help on using the changeset viewer.