Changeset 147 for trunk/src/org/expeditee/items/Item.java
- Timestamp:
- 07/18/08 14:28:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Item.java
r145 r147 4 4 import java.awt.Color; 5 5 import java.awt.Cursor; 6 import java.awt.Dimension;7 6 import java.awt.GradientPaint; 8 7 import java.awt.Graphics2D; … … 10 9 import java.awt.Polygon; 11 10 import java.awt.Rectangle; 11 import java.awt.Shape; 12 12 import java.awt.Stroke; 13 13 import java.awt.geom.AffineTransform; … … 167 167 dest.setLinkTemplate(source.getLinkTemplate()); 168 168 169 dest.setMaxSize(source.getMaxSize()); 169 // dest.setMaxWidth(source.getMaxWidth()); 170 170 171 dest.setOffset(source.getOffset()); 171 172 dest.setOwner(source.getOwner()); … … 210 211 } 211 212 213 private Float _anchorRight = null; 214 215 private Float _anchorBottom = null; 216 212 217 protected HighlightMode _mode = HighlightMode.None; 213 218 … … 228 233 private boolean _highlight = true; 229 234 230 private Dimension _maxSize = null;235 // private int _maxWidth = -1; 231 236 232 237 private String _owner = null; … … 719 724 } 720 725 721 public Dimension getMaxSize() {722 return _maxSize;723 }726 // public int getMaxWidth() { 727 // return _maxWidth; 728 // } 724 729 725 730 public Point getOffset() { … … 949 954 Color fillColor = getFillColor(); 950 955 if (fillColor != null && getEnclosingDots() != null) { 951 if (isFloating()) { 952 // TODO experiment with adding alpha when picking up filled 953 // items... Slows things down quite alot!! 954 fillColor = new Color(fillColor.getRed(), fillColor.getGreen(), 955 fillColor.getBlue()); 956 } 957 g.setColor(fillColor); 958 Color gradientColor = getGradientColor(); 959 if (gradientColor != null) { 960 // The painting is not efficient enough for gradients... 961 Polygon s = getEnclosedShape(); 956 setFillPaint(g); 957 g.fillPolygon(getEnclosedShape()); 958 } 959 } 960 961 protected void setFillPaint(Graphics2D g) { 962 Color fillColor = getFillColor(); 963 if (isFloating()) { 964 // TODO experiment with adding alpha when picking up filled 965 // items... Slows things down quite alot!! 966 fillColor = new Color(fillColor.getRed(), fillColor.getGreen(), 967 fillColor.getBlue()); 968 } 969 g.setColor(fillColor); 970 Color gradientColor = getGradientColor(); 971 if (gradientColor != null) { 972 // The painting is not efficient enough for gradients... 973 Shape s = getEnclosedShape(); 974 if (s != null) { 962 975 Rectangle b = s.getBounds(); 963 976 GradientPaint gp = new GradientPaint( … … 965 978 (int) (b.x + b.width * 1.3), b.y, gradientColor); 966 979 g.setPaint(gp); 967 g.fillPolygon(s);968 } else {969 g.fillPolygon(getEnclosedShape());970 980 } 971 981 } … … 1364 1374 } 1365 1375 1366 / **1367 * Sets the maximum coordinates on the screen that this item may occupy.1368 * This is used by Text items to compute word-wrapping lengths.1369 *1370 * @param d1371 *The Maximum size of the Frame containing this Item.1372 */1373 public void setMaxSize(Dimension d) {1374 if (d != null) {1375 _maxSize = d;1376 1377 1378 }1376 // /** 1377 // * Sets the maximum coordinates on the screen that this item may occupy. 1378 // * This is used by Text items to compute word-wrapping lengths. 1379 // * 1380 // * @param d 1381 // * The Maximum size of the Frame containing this Item. 1382 // */ 1383 // public void setMaxWidth(int width) { 1384 // if (width > 0) { 1385 // _maxWidth = width; 1386 // updatePolygon(); 1387 // } 1388 // } 1379 1389 1380 1390 public void setOffset(int x, int y) { … … 2347 2357 return !isVisible() || getID() < 0 || offScreenTopOrLeft(); 2348 2358 } 2359 2360 public void setAnchorRight(Float anchor) { 2361 this._anchorRight = anchor; 2362 if (anchor != null) 2363 setX(FrameGraphics.getMaxFrameSize().width - anchor); 2364 } 2365 2366 public Float getAnchorRight() { 2367 return _anchorRight; 2368 } 2369 2370 public void setAnchorBottom(Float anchor) { 2371 this._anchorBottom = anchor; 2372 if (anchor != null) 2373 setY(FrameGraphics.getMaxFrameSize().height - anchor); 2374 } 2375 2376 public Float getAnchorBottom() { 2377 return _anchorBottom; 2378 } 2349 2379 }
Note:
See TracChangeset
for help on using the changeset viewer.