Ignore:
Timestamp:
09/18/18 12:00:17 (6 years ago)
Author:
bln4
Message:

Used Eclipse refactoring to encapsulate Point.X and Point.Y

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

Legend:

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

    r1102 r1143  
    273273                // Render shaded window over widget
    274274                g.setColor(SwingConversions.toSwingColor(backgroundColor));
    275                 g.fillRect(getX(), getY(), getWidth(), getHeight());
    276                
     275                final int x = getX();
     276                final int y = getY();
     277                final int width = getWidth();
     278                final int height = getHeight();
     279                g.fillRect(x, y, width, height);
     280                               
    277281                // Center the bar
    278                 int barX = getX() + BAR_HOROZONTIAL_MARGIN;
    279                 int barY = getY() + (getHeight() >> 1) - (BAR_HEIGHT >> 1);
    280                
    281                 int barWidth = getWidth() - (BAR_HOROZONTIAL_MARGIN * 2);
     282                int barX = x + BAR_HOROZONTIAL_MARGIN;
     283                int barY = y + (height >> 1) - (BAR_HEIGHT >> 1);
     284               
     285                int barWidth = width - (BAR_HOROZONTIAL_MARGIN * 2);
    282286                if (barWidth <= 0) barWidth = 10;
    283287               
  • trunk/src/org/expeditee/items/widgets/SwingWidget.java

    r1098 r1143  
    44import java.awt.Container;
    55import java.awt.Graphics2D;
     6import java.awt.Point;
    67
    78import javax.swing.JComponent;
     
    109110                Graphics2D g = SwingMiscManager.getIfUsingSwingGraphicsManager().getCurrentSurface();
    110111
    111                 int x = getX();
    112                 int y = getY();
     112                final Point location = _swingComponent.getLocation();
     113                int x = location.x;
     114                int y = location.y;
    113115               
    114116                g.translate(x, y);
  • trunk/src/org/expeditee/items/widgets/Widget.java

    r1098 r1143  
    900900               
    901901                _settingPositionFlag = true;
    902 
     902               
    903903                invalidateLink();
    904904
  • trunk/src/org/expeditee/items/widgets/charts/AbstractChart.java

    r1102 r1143  
    175175                                Point origin = getOrigin();
    176176                                return new MouseEvent((Component) e.getSource(), e.getID(), e
    177                                                 .getWhen(), e.getModifiers(), origin.x + e.getX(),
    178                                                 origin.y + e.getY(), e.getXOnScreen(),
     177                                                .getWhen(), e.getModifiers(), origin.getX() + e.getX(),
     178                                                origin.getY() + e.getY(), e.getXOnScreen(),
    179179                                                e.getYOnScreen(), e.getClickCount(), false, e
    180180                                                                .getButton());
Note: See TracChangeset for help on using the changeset viewer.