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

File:
1 edited

Legend:

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

    r1245 r1258  
    387387                if (width == null) {
    388388                        setJustification(Justification.left);
    389                         setRightMargin(DisplayController.getFramePaintArea().getWidth(), false);
     389                        setRightMargin(DisplayController.getFramePaintAreaWidth(), false);
    390390                        return;
    391391                }
     
    402402                if (width == null) {
    403403                        setJustification(Justification.left);
    404                         setRightMargin(DisplayController.getFramePaintArea().getWidth(), false);
     404                        setRightMargin(DisplayController.getFramePaintAreaWidth(), false);
    405405                        return;
    406406                }
     
    18011801                if (limitWidth) {
    18021802                        if (_maxWidth == null) {
    1803                                 width = DisplayController.getFramePaintArea().getWidth() - getX();
     1803                                width = DisplayController.getFramePaintAreaWidth() - getX();
    18041804                        } else {
    18051805                                width = getAbsoluteWidth();
     
    22822282                        int model_frame_name_x = modelFrame.getNameItem().getX();
    22832283                        if (model_frame_name_x < DisplayController.MINIMUM_FRAME_WIDTH) {
    2284                                 System.err.println("Text::resetTitlePostion(): value to be used as right margin from position of frameName < 512");
     2284                                System.err.println("**** Text::resetTitlePostion(): value to be used as right margin from position of frameName < 512");
    22852285                                System.err.println("  Overriding to ensure reasonable width for title");
    22862286                                model_frame_name_x = DisplayController.MINIMUM_FRAME_WIDTH;
     
    23952395        private void clipFrameMargin() {
    23962396                if (!hasFixedWidth()) {
    2397                         int frameWidth = DisplayController.getFramePaintArea().getWidth();
     2397                        int frameWidth = DisplayController.getFramePaintAreaWidth();
    23982398                        /*
    23992399                         * Only change width if it is more than 150 pixels from the right of the screen
     
    24172417                }
    24182418
    2419                 Integer width = DisplayController.getFramePaintArea().getWidth();
     2419                Integer width = DisplayController.getFramePaintAreaWidth();
    24202420
    24212421                // Check if that text item is inside an enclosing rectangle...
     
    24572457
    24582458        public void resetFrameNamePosition() {
    2459                 Dimension maxSize = DisplayController.getSizeEnforceMinimum();
    2460                                
     2459                //Dimension maxSize = DisplayController.getSizeEnforceMinimum();
     2460                Dimension maxSize = DisplayController.getFramePaintAreaSize();
     2461               
    24612462                if (maxSize != null) {
    24622463                        // setMaxWidth(maxSize.width);
     
    27172718                        // Subtract off the link width
    27182719                        if (anchor != null) {
    2719                                 setX(DisplayController.getFramePaintArea().getWidth() - anchor - getBoundsWidth() + getLeftMargin());
     2720                                setX(DisplayController.getFramePaintAreaWidth() - anchor - getBoundsWidth() + getLeftMargin());
    27202721                        }
    27212722                        return;
     
    27282729                int oldX = getX();
    27292730                if (anchor != null) {
    2730                         float deltaX = DisplayController.getFramePaintArea().getWidth() - anchor - getBoundsWidth()
     2731                        float deltaX = DisplayController.getFramePaintAreaWidth() - anchor - getBoundsWidth()
    27312732                                        + getLeftMargin() - oldX;
    27322733                        anchorConnected(AnchorEdgeType.Right, deltaX);
     
    27782779                                        final float ascent = getTextLayouts().get(0).getAscent();
    27792780                                        final float descent = getTextLayouts().get(0).getDescent();
    2780                                         setY(DisplayController.getFramePaintArea().getHeight()
     2781                                        setY(DisplayController.getFramePaintAreaHeight()
    27812782                                                        - (anchor + this.getBoundsHeight() - ascent - descent));
    27822783                                } else if (this.getFont() != null) {
     
    27852786                                        final float ascent = fakeLayout.getAscent();
    27862787                                        final float descent = fakeLayout.getDescent();
    2787                                         setY(DisplayController.getFramePaintArea().getHeight()
     2788                                        setY(DisplayController.getFramePaintAreaHeight()
    27882789                                                        - (anchor + this.getBoundsHeight() - ascent - descent));
    27892790                                }
     
    28002801                if (anchor != null) {
    28012802
    2802                         float deltaY = DisplayController.getFramePaintArea().getHeight() - anchor - oldY;
     2803                        float deltaY = DisplayController.getFramePaintAreaHeight() - anchor - oldY;
    28032804                        anchorConnected(AnchorEdgeType.Bottom, deltaY);
    28042805                }
Note: See TracChangeset for help on using the changeset viewer.