Ignore:
Timestamp:
03/18/19 18:38:32 (5 years ago)
Author:
davidb
Message:

Changed how DisplayController width, height and size are retrieved. Now does this top-level, rather than going through the AxisAlignmentBox. In doing so, can now control for when the window size has you yet been correctly mapped to the screen, and fall back to pre-defined MINIMUM defaults

Location:
trunk/src/org/expeditee/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/DisplayController.java

    r1245 r1258  
    7373        public static final int MINIMUM_FRAME_HEIGHT = 512;
    7474       
    75         private static boolean DISPLAYED_ABOVE_MINIMUM_FRAME_WIDTH = false;
     75        public static boolean DISPLAYED_ABOVE_MINIMUM_FRAME_WIDTH = false;
    7676       
    7777        /** Convenience definition of TwinFramesSide.LEFT. */
     
    12451245        }
    12461246       
    1247         public static Dimension getSizeEnforceMinimum() {
    1248                 Dimension actual_dim = getFramePaintArea().getSize();
     1247        public static Dimension getSizeEnforceMinimumXXXX() { // **** DB
     1248                Dimension actual_dim = getFramePaintAreaSize();
    12491249               
    12501250                int enforced_width  = Math.max(actual_dim.width, MINIMUM_FRAME_WIDTH);
     
    13051305        }
    13061306       
     1307        public static int getFramePaintAreaWidth()
     1308        {
     1309                if (!DISPLAYED_ABOVE_MINIMUM_FRAME_WIDTH) {
     1310                        return  MINIMUM_FRAME_WIDTH;
     1311                }
     1312               
     1313                return _framePaintArea.getWidth();
     1314        }
     1315       
     1316        public static int getFramePaintAreaHeight()
     1317        {
     1318                if (!DISPLAYED_ABOVE_MINIMUM_FRAME_WIDTH) {
     1319                        return  MINIMUM_FRAME_HEIGHT;
     1320                }
     1321               
     1322                return _framePaintArea.getHeight();
     1323        }
     1324       
     1325        public static Dimension getFramePaintAreaSize()
     1326        {
     1327                if (!DISPLAYED_ABOVE_MINIMUM_FRAME_WIDTH) {
     1328                        Dimension min_dim = new Dimension(MINIMUM_FRAME_WIDTH,MINIMUM_FRAME_HEIGHT);
     1329                        return min_dim;
     1330                }
     1331               
     1332                return _framePaintArea.getSize();
     1333        }
     1334               
    13071335        public static AxisAlignedBoxBounds getMessageBayPaintArea()
    13081336        {
     
    14071435                        Image image = null;
    14081436                        if (currentFrame != null && (!useInvalidation || !frameClip.isFullyClipped())) {
    1409                                 image = FrameGraphics.getFrameImage(currentFrame, frameClip, getFramePaintArea().getSize());
     1437                                image = FrameGraphics.getFrameImage(currentFrame, frameClip, getFramePaintAreaSize());
    14101438                        }
    14111439
  • trunk/src/org/expeditee/gui/FrameCreator.java

    r1102 r1258  
    220220                                // new frame
    221221                                if (!_multiColumn
    222                                                 || toAdd.getBoundsWidth() + _lastX > DisplayController.getFramePaintArea().getWidth()) {
     222                                                || toAdd.getBoundsWidth() + _lastX > DisplayController.getFramePaintAreaWidth()) {
    223223                                        // Make sure text items that are created on the current
    224224                                        // frame are removed
     
    231231                        toAdd.setOffset(0, 0);
    232232                        toAdd.setID(_current.getNextItemID());
    233                         toAdd.setRightMargin(DisplayController.getFramePaintArea().getWidth(), true);
     233                        toAdd.setRightMargin(DisplayController.getFramePaintAreaWidth(), true);
    234234
    235235                        _current.addItem(toAdd);
  • trunk/src/org/expeditee/gui/MessageBay.java

    r1221 r1258  
    133133        private static void updateLink() {
    134134                if (!isLinkInitialized && DisplayController.getFramePaintArea() != null
    135                                 && DisplayController.getFramePaintArea().getWidth() > 0) {
     135                                && DisplayController.getFramePaintAreaWidth() > 0) {
    136136                        // set up 'Messages' link on the right hand side
    137137                        _messageLink.setPosition(DisplayController.getMessageBayPaintArea().getWidth() - MESSAGE_LINK_Y_OFFSET,
     
    218218                Text t = new Text(getMessagePrefix(true) + message);
    219219                t.setPosition(20, 15 + _messages.size() * 25);
    220                 t.setOffset(0, -DisplayController.getFramePaintArea().getHeight());
     220                t.setOffset(0, -DisplayController.getFramePaintAreaHeight());
    221221                t.setColor(color);
    222222                t.setLink(link);
Note: See TracChangeset for help on using the changeset viewer.