Changeset 1369 for trunk


Ignore:
Timestamp:
05/23/19 12:20:07 (5 years ago)
Author:
bln4
Message:

MaxWidth on text items is now a thing. Use this on text boxes in authentication frameset.

Location:
trunk/src/org/expeditee
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/assets/resources-public/framesets/authentication/1.exp

    r1368 r1369  
    1 V 826
     1V 828
    22p 40
    33U authadmin
    44D 23Nov2018[12:31]
    5 M authadmin
    6 d 23May2019[10:29]
     5M nobody
     6d 23May2019[12:15]
    77B 100 100 39 100
    88Z
     
    546546Z
    547547
    548 ActiveTime:18992043:12:17
    549 DarkTime:-18982463:-8:-10
    550 29:18:317 516 406 Ld
    551 29:18:605 516 406 Rd
    552 29:18:866 516 406 Ru
    553 29:18:882 516 406 Lu
    554 29:21:389 737 384 Rd
    555 29:21:404 737 384 Md
    556 29:21:562 737 384 Ru
    557 29:21:578 737 384 Mu
    558 29:21:826 828 455 kRIGHT_ARROW
     548ActiveTime:19857915:43:23
     549DarkTime:-19848023:-39:-16
     55015:44:927 669 287 kBACKSPACE
     55115:45:427 655 287 kBACKSPACE
     55215:45:460 641 287 kBACKSPACE
     55315:45:493 627 287 kBACKSPACE
     55415:45:526 613 287 kBACKSPACE
     55515:45:559 599 287 kBACKSPACE
     55615:45:592 585 287 kBACKSPACE
     55715:45:624 571 287 kBACKSPACE
     55815:45:658 557 287 kBACKSPACE
     55915:45:691 543 287 kBACKSPACE
     56015:45:724 529 287 kBACKSPACE
     56115:45:757 515 287 kBACKSPACE
     56215:45:791 501 287 kBACKSPACE
     56315:45:825 487 287 kBACKSPACE
     56415:45:867 473 287 kBACKSPACE
     56515:45:894 459 287 kBACKSPACE
     56615:46:135 445 287 kBACKSPACE
     56715:46:313 431 287 kBACKSPACE
     56815:46:489 417 287 kBACKSPACE
     56915:49:442 762 228 kSHIFT
     57015:49:609 762 228 kT
     57115:50:288 773 228 kO
     57215:50:489 782 228 kG
     57315:50:626 791 228 kG
     57415:50:708 799 228 kL
     57515:50:799 804 228 kE
     57615:50:985 813 228 kSHIFT
     57715:51:040 813 228 kA
     57815:51:181 826 228 kU
     57915:51:328 835 228 kT
     58015:51:408 840 228 kH
     58115:51:688 849 228 kCTRL
     58215:51:912 849 228 kA
     58315:53:555 801 220 Ld
     58415:53:719 801 220 Lu
     58515:55:337 797 218 Md
     58615:55:400 797 218 Rd
     58715:55:494 797 218 Ru
     58815:55:527 797 218 Mu
     58915:57:033 721 219 kSHIFT
     59015:57:111 721 219 kM
     59115:57:329 737 219 kA
     59215:57:569 745 219 kX
     59315:57:760 754 219 kSHIFT
     59415:57:977 754 219 kW
     59515:58:304 771 219 kI
     59615:58:403 776 219 kD
     59715:58:601 785 219 kT
     59815:58:671 790 219 kH
     59915:58:809 798 219 kSHIFT
     60016:02:263 789 216 Md
     60116:02:383 789 216 Mu
     60216:03:697 790 222 kRIGHT_ARROW
  • trunk/src/org/expeditee/assets/resources-public/framesets/authentication/2.exp

    r1368 r1369  
    1 V 288
     1V 292
    22p 40
    33U authadmin
    44D 07Dec2018[12:19]
    55M authadmin
    6 d 23May2019[10:23]
     6d 23May2019[12:16]
    77B 100 100 39 100
    88Z
     
    127127p 44
    128128_ph Password
     129_maxW 300
    129130
    130131S T 130
     
    150151p 44
    151152_ph Password Again
     153_maxW 300
    152154
    153155S T 672
     
    172174p 44
    173175_ph Email Again
     176_maxW 300
    174177
    175178S T 671
     
    194197p 44
    195198_ph Email
     199_maxW 300
    196200
    197201S T 190
     
    496500Z
    497501
    498 ActiveTime:01:20:28
     502ActiveTime:01:21:37
    499503DarkTime:01:32:58
    500 23:46:958 183 338 Ld
    501 23:47:092 183 338 Rd
    502 23:47:242 183 338 Ru
    503 23:47:250 183 338 Lu
    504 23:48:621 136 388 Md
    505 23:48:706 136 388 Rd
    506 23:48:818 136 388 Ru
    507 23:48:841 136 388 Mu
    508 23:49:603 110 475 kRIGHT_ARROW
     50416:45:082 190 331 Ld
     50516:45:153 190 331 Rd
     50616:45:287 190 331 Ru
     50716:45:295 190 331 Lu
     50816:46:234 73 272 Md
     50916:46:298 73 272 Rd
     51016:46:399 73 272 Ru
     51116:46:431 73 272 Mu
     51216:47:249 612 348 kCTRL
     51316:47:401 612 348 kS
     51416:48:151 591 338 Ld
     51516:48:217 591 338 Rd
     51616:48:327 591 338 Lu
     51716:48:335 591 338 Ru
     51816:48:858 640 279 Md
     51916:48:919 640 279 Rd
     52016:49:119 640 279 Ru
     52116:49:143 640 279 Mu
     52216:49:810 571 391 Ld
     52316:49:881 571 391 Rd
     52416:49:991 571 391 Lu
     52516:49:992 571 391 Ru
     52616:50:649 605 290 Md
     52716:50:689 605 290 Rd
     52816:50:823 605 290 Ru
     52916:50:847 605 290 Mu
     53016:51:728 180 393 Ld
     53116:51:775 180 393 Rd
     53216:51:879 180 393 Lu
     53316:51:887 180 393 Ru
     53416:52:448 108 280 Md
     53516:52:495 108 280 Rd
     53616:52:623 108 280 Ru
     53716:52:639 108 280 Mu
     53816:53:456 108 280 kLEFT_ARROW
  • trunk/src/org/expeditee/assets/resources-public/framesets/authentication/3.exp

    r1368 r1369  
    1 V 94
     1V 98
    22p 40
    33U authadmin
    44D 07Jan2019[14:34]
    5 M nobody
    6 d 23May2019[10:36]
     5M authadmin
     6d 23May2019[12:16]
    77B 100 100 39 100
    88Z
     
    123123p 44
    124124_ph New Password
     125_maxW 300
    125126
    126127S T 81
     
    144145p 44
    145146_ph New Password Again
     147_maxW 300
    146148
    147149S T 45
     
    286288Z
    287289
    288 ActiveTime:00:16:10
     290ActiveTime:00:16:15
    289291DarkTime:00:20:25
    290 37:16:179 496 492 Rd
    291 37:16:341 496 492 Ru
    292 37:17:121 496 492 kRIGHT_ARROW
     29216:39:689 115 222 kCTRL
     29316:40:095 115 222 kS
     29416:41:371 537 319 Ld
     29516:41:464 537 319 Rd
     29616:41:631 537 319 Ru
     29716:41:647 537 319 Lu
     29816:42:602 121 249 Md
     29916:42:681 121 249 Rd
     30016:42:775 121 249 Ru
     30116:42:823 121 249 Mu
     30216:43:865 20 240 kLEFT_ARROW
  • trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp

    r1368 r1369  
    1 V 218
     1V 222
    22p 40
    33U authadmin
    44D 07Jan2019[14:34]
    5 M nobody
    6 d 23May2019[10:37]
     5M authadmin
     6d 23May2019[12:16]
    77B 100 100 39 100
    88Z
     
    8383p 44
    8484_ph Username
     85_maxW 300
    8586
    8687S T 333
     
    142143p 44
    143144_ph Identity Number
     145_maxW 300
    144146
    145147S T 515
     
    207209p 44
    208210_ph Password Piece Two
     211_maxW 300
    209212
    210213S T 603
     
    227230p 44
    228231_ph Password Piece One
     232_maxW 300
    229233
    230234S T 417
     
    248252p 44
    249253_ph New Password Again
     254_maxW 300
    250255
    251256S T 418
     
    269274p 44
    270275_ph New Password
     276_maxW 300
    271277
    272278S T 503
     
    561567Z
    562568
    563 ActiveTime:01:36:47
     569ActiveTime:01:37:02
    564570DarkTime:02:33:57
    565 38:34:241 956 28 Ld
    566 38:34:327 956 28 Rd
    567 38:34:437 956 28 Ru
    568 38:34:445 956 28 Lu
    569 38:36:496 846 150 kRIGHT_ARROW
     57116:31:593 895 405 kCTRL
     57216:31:978 895 405 kS
     57316:34:563 219 335 Ld
     57416:34:657 219 335 Rd
     57516:34:783 219 335 Ru
     57616:34:799 219 335 Lu
     57716:37:970 115 222 Md
     57816:38:071 115 222 Rd
     57916:38:231 115 222 Ru
     58016:38:255 115 222 Mu
     58116:39:199 115 222 kLEFT_ARROW
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r1296 r1369  
    289289                        _Attrib.put("MinWidth",                         Item.class.getMethod("getMinWidthToSave"),
    290290                                                                                                Item.class.getMethod("setMinWidth", pIntO));
     291                        _Attrib.put("MaxWidth",                         Item.class.getMethod("getMaxWidthToSave"),
     292                                                                                                Item.class.getMethod("setMaxWidth", pIntO));
    291293                        _Attrib.put("X",                    null,
    292294                                                            Item.class.getMethod("setX", pFloat));
  • trunk/src/org/expeditee/io/DefaultFrameReader.java

    r1322 r1369  
    178178                       
    179179                        _ItemTagsExt.put("_ph", Text.class.getMethod("setPlaceholder", pString));
     180                        _ItemTagsExt.put("_maxW", Text.class.getMethod("setMaxWidth", pIntO));
    180181                } catch (Exception e) {
    181182                        e.printStackTrace();
  • trunk/src/org/expeditee/io/DefaultFrameWriter.java

    r1321 r1369  
    153153                        _ItemTags.put('/', Item.class.getMethod("getMagnetizedItemBottom"));
    154154                       
    155                         //_ItemTags.put('=', Text.class.getMethod("getPlaceholder"));
    156155                        _ItemTagsExt.put("_ph", Text.class.getMethod("getPlaceholder"));
     156                        _ItemTagsExt.put("_maxW", Text.class.getMethod("getMaxWidthToSave"));
    157157                } catch (Exception e) {
    158158                        e.printStackTrace();
  • trunk/src/org/expeditee/items/Item.java

    r1258 r1369  
    11701170                return getMinWidth();
    11711171        }
     1172       
     1173        public Integer getMaxWidthToSave() {
     1174                return getMaxWidth();
     1175        }
    11721176
    11731177        public Integer getWidth()
     
    11771181       
    11781182        public Integer getMinWidth() {
     1183                return null;
     1184        }
     1185       
     1186        public Integer getMaxWidth() {
    11791187                return null;
    11801188        }
     
    22962304                throw new UnsupportedOperationException("Item type does not support minwidth attribute.");
    22972305        }
     2306       
     2307        public void setMaxWidth(Integer width) throws UnsupportedOperationException {
     2308                throw new UnsupportedOperationException("Item type does not support maxwidth attribute");
     2309        }
    22982310
    22992311        public void setRightMargin(int i, boolean fixWidth)
  • trunk/src/org/expeditee/items/Text.java

    r1296 r1369  
    136136         * the user. Initially set to be as wide as possible.
    137137         */
     138        private Integer _width = -Integer.MAX_VALUE;
     139
     140        private Integer _minWidth = -Integer.MAX_VALUE;
     141       
    138142        private Integer _maxWidth = -Integer.MAX_VALUE;
    139 
    140         private Integer _minWidth = -Integer.MAX_VALUE;
    141143
    142144        private Justification _justification = Justification.left;
     
    186188        // The font to display this text in
    187189        private Font _font;
     190        private Font _substituteFont;
     191        private boolean _useSubstituteFont = false;
    188192
    189193        // The optional mask character to us in place of the text's content.
     
    395399                }
    396400
    397                 _maxWidth = width;
     401                _width = width;
    398402                rebuild(true);
    399403                invalidateAll();
     
    414418                invalidateAll();
    415419        }
     420       
     421        public void setMaxWidth(Integer width) {
     422                invalidateAll();
     423
     424                if (width == null) {
     425                        setJustification(Justification.left);
     426                        setRightMargin(DisplayController.getFramePaintAreaWidth(), false);
     427                        return;
     428                }
     429               
     430                _maxWidth = width;
     431                rebuild(true);
     432                invalidateAll();
     433        }
     434       
    416435
    417436        /**
     
    428447        @Override
    429448        public Integer getWidth() {
    430                 if (_maxWidth == null || _maxWidth <= 0) {
     449                if (_width == null || _width <= 0) {
    431450                        return null;
    432451                }
    433452
    434                 return _maxWidth;
     453                return _width;
    435454        }
    436455
    437456        public Integer getAbsoluteWidth() {
    438                 if (_maxWidth == null) {
     457                if (_width == null) {
    439458                        return Integer.MAX_VALUE;
    440459                }
    441460
    442                 return Math.abs(_maxWidth);
     461                return Math.abs(_width);
    443462        }
    444463
     
    449468                return _minWidth;
    450469        }
     470       
     471        public Integer getMaxWidth() {
     472                if (_maxWidth == null || _maxWidth <= 0) {
     473                        return null;
     474                }
     475                return _maxWidth;
     476        }
    451477
    452478        public Integer getAbsoluteMinWidth() {
     
    456482                return Math.abs(_minWidth);
    457483        }
    458 
     484       
     485        public Integer getAbsoluteMaxWidth() {
     486                if (_maxWidth == null) {
     487                        return Integer.MIN_VALUE;
     488                }
     489                return Math.abs(_maxWidth);
     490        }
     491       
    459492        @Override
    460493        public Colour getHighlightColor() {
     
    13001333         */
    13011334        public Font getPaintFont() {
    1302                 final Font f = getFont();
     1335                Font f = getFont();
    13031336                if (f == null) {
    13041337                        _font = EcosystemManager.getFontManager().getDefaultFont().clone();
    1305                         return _font;
     1338                        f = _font;
     1339                       
     1340                        if (_useSubstituteFont) {
     1341                                f = _substituteFont;
     1342                        }
    13061343                }
    13071344                return f;
     
    16931730
    16941731                        int minWidth = getAbsoluteMinWidth();
     1732                        int maxWidth = getAbsoluteMaxWidth();
    16951733
    16961734                        minX = Math.min(minX, bounds.getMinX());
    16971735                        maxX = minWidth < Integer.MAX_VALUE ? Math.max(minX + minWidth, bounds.getMaxX())
    16981736                                        : Math.max(maxX, bounds.getMaxX());
     1737                        if ((maxWidth - minX) < maxX) {
     1738                                this._useSubstituteFont = true;
     1739                                this._substituteFont.setSize(this._substituteFont.getSize() - 1);
     1740                        } else {
     1741                                this._useSubstituteFont = false;
     1742                                this._substituteFont = this._font;
     1743                        }
    16991744                        minY = Math.min(minY, (int) (bounds.getMinY() + y));
    17001745                        maxY = Math.max(maxY, (int) (bounds.getMaxY() + y));
     
    18081853                float width = Float.MAX_VALUE;
    18091854                if (limitWidth) {
    1810                         if (_maxWidth == null) {
     1855                        if (_width == null) {
    18111856                                width = DisplayController.getFramePaintAreaWidth() - getX();
    18121857                        } else {
     
    18891934
    18901935        private boolean hasFixedWidth() {
    1891                 assert (_maxWidth != null);
    1892                 if (_maxWidth == null) {
     1936                assert (_width != null);
     1937                if (_width == null) {
    18931938                        justify(false);
    18941939                }
    1895                 return _maxWidth > 0;
     1940                return _width > 0;
    18961941        }
    18971942
Note: See TracChangeset for help on using the changeset viewer.