Changeset 1525
- Timestamp:
- 04/21/20 16:21:20 (4 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/core/Anchoring.java
r1513 r1525 131 131 } 132 132 133 private void setXAnchor(Integer offset, VerticalDirection left) {133 private void setXAnchor(Integer offset, VerticalDirection vertical_direction) { 134 134 _xAnchor = offset; 135 verticalDirection = left;135 verticalDirection = vertical_direction; 136 136 } 137 137 138 private void setYAnchor(Integer offset, HorizontalDirection top) {138 private void setYAnchor(Integer offset, HorizontalDirection horizontal_direction) { 139 139 _yAnchor = offset; 140 horizonalDirection = top;140 horizonalDirection = horizontal_direction; 141 141 } 142 142 -
trunk/src/org/expeditee/items/widgets/Widget.java
r1511 r1525 71 71 public final static float DEFAULT_MINIMUM_BORDER_THICKNESS = 1.0f; 72 72 73 // @formatter:off 73 74 /* GUIDE: 74 75 * d1--l1---d2 … … 78 79 * d4---l3--d3 79 80 */ 80 81 /** The top-left corner of the widget. */ 81 // @formatter:on 82 83 /** The top-left corner of the widget. */ 82 84 private WidgetCorner _d1; 83 85 /** The top-right corner of the widget. */ … … 85 87 /** The bottom-right corner of the widget. */ 86 88 private WidgetCorner _d3; 87 / ** The bottom-left corner of the widget. */89 ///** The bottom-left corner of the widget. */ 88 90 private WidgetCorner _d4; 91 92 /** The Anchoring for the top-left corner of the widget */ 93 private Anchoring _d1Anchoring = new Anchoring(); 94 /** The Anchoring for the bottom-right corner of the widget */ 95 private Anchoring _d3Anchoring = new Anchoring(); 89 96 90 97 /** The top edge of the widget. */ … … 112 119 /** The Expeditee item that is used for saving widget state. */ 113 120 protected Text _textRepresentation; 114 115 /** The anchoring of the widget. */116 protected Anchoring _anchoring = new Anchoring();117 121 118 122 /** … … 735 739 sb.append(getClass().getName()); 736 740 737 if (_ anchoring.getLeftAnchor() != null) {738 sb.append(" --anchorLeft " + Math.round(_ anchoring.getLeftAnchor()));739 } 740 if (_ anchoring.getRightAnchor() != null) {741 sb.append(" --anchorRight " + Math.round(_ anchoring.getRightAnchor()));742 } 743 744 if (_ anchoring.getTopAnchor() != null) {745 sb.append(" --anchorTop " + Math.round(_ anchoring.getTopAnchor()));746 } 747 748 if (_ anchoring.getBottomAnchor() != null) {749 sb.append(" --anchorBottom " + Math.round(_ anchoring.getBottomAnchor()));741 if (_d1Anchoring.getLeftAnchor() != null) { 742 sb.append(" --anchorLeft " + Math.round(_d1Anchoring.getLeftAnchor())); 743 } 744 if (_d3Anchoring.getRightAnchor() != null) { 745 sb.append(" --anchorRight " + Math.round(_d3Anchoring.getRightAnchor())); 746 } 747 748 if (_d1Anchoring.getTopAnchor() != null) { 749 sb.append(" --anchorTop " + Math.round(_d1Anchoring.getTopAnchor())); 750 } 751 752 if (_d3Anchoring.getBottomAnchor() != null) { 753 sb.append(" --anchorBottom " + Math.round(_d3Anchoring.getBottomAnchor())); 750 754 } 751 755 … … 1807 1811 public void setAnchorLeft(final Integer anchor) 1808 1812 { 1809 _ anchoring.setLeftAnchor(anchor);1813 _d1Anchoring.setLeftAnchor(anchor); 1810 1814 // Anchor left-edge corners (dots) as well 1811 1815 _d1.setAnchorCornerX(anchor,null); … … 1822 1826 1823 1827 public void setAnchorRight(final Integer anchor) { 1824 _ anchoring.setRightAnchor(anchor);1828 _d3Anchoring.setRightAnchor(anchor); 1825 1829 // Anchor right-edge corners (dots) as well 1826 1830 _d2.setAnchorCornerX(null,anchor); // right … … 1832 1836 } 1833 1837 1834 if (_ anchoring.getLeftAnchor() == null) {1838 if (_d1Anchoring.getLeftAnchor() == null) { 1835 1839 // Prefer having the X-rayable item at anchorLeft position (if defined) over moving to anchorRight 1836 1840 getCurrentRepresentation().setAnchorRight(anchor); … … 1839 1843 1840 1844 public void setAnchorTop(final Integer anchor) { 1841 _ anchoring.setTopAnchor(anchor);1845 _d1Anchoring.setTopAnchor(anchor); 1842 1846 // Anchor top-edge corners (dots) as well 1843 1847 _d1.setAnchorCornerY(anchor,null); … … 1854 1858 1855 1859 public void setAnchorBottom(final Integer anchor) { 1856 _ anchoring.setBottomAnchor(anchor);1860 _d3Anchoring.setBottomAnchor(anchor); 1857 1861 // Anchor bottom-edge corners (dots) as well 1858 1862 _d3.setAnchorCornerY(null,anchor); … … 1864 1868 } 1865 1869 1866 if (_ anchoring.getTopAnchor() == null) {1870 if (_d1Anchoring.getTopAnchor() == null) { 1867 1871 // Prefer having the X-rayable item at anchorTop position (if defined) over moving to anchorBottom 1868 1872 getCurrentRepresentation().setAnchorBottom(anchor); … … 1876 1880 1877 1881 public boolean isAnchoredX() { 1878 return _ anchoring.isXAnchored();1882 return _d1Anchoring.isXAnchored() || _d3Anchoring.isXAnchored(); 1879 1883 } 1880 1884 1881 1885 public boolean isAnchoredY() { 1882 return _ anchoring.isYAnchored();1886 return _d1Anchoring.isYAnchored() || _d3Anchoring.isYAnchored(); 1883 1887 } 1884 1888
Note:
See TracChangeset
for help on using the changeset viewer.