Changeset 286
- Timestamp:
- 08/29/08 08:17:54 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 3 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r284 r286 29 29 import org.expeditee.items.ItemUtils; 30 30 import org.expeditee.items.Text; 31 import org.expeditee.simple.SString; 31 32 32 33 /** … … 65 66 private static HashMap<String, String> _JAGs = new HashMap<String, String>(); 66 67 68 // maps lower case IW class names to capitalized IW names 69 private static HashMap<String, String> _IWs = new HashMap<String, String>(); 70 67 71 public static final String ROOT_PACKAGE = "org.expeditee."; 68 72 … … 71 75 72 76 private static final String AGENTS_PACKAGE = ROOT_PACKAGE + "agents."; 77 78 private static final String WIDGET_PACKAGE = ROOT_PACKAGE 79 + "items.widgets."; 80 81 private static final String CHARTS_PACKAGE = ROOT_PACKAGE 82 + "items.widgets.charts."; 73 83 74 84 private static final String NAVIGATIONS_CLASS = ROOT_PACKAGE … … 199 209 _JAGs.put(name.toLowerCase(), name); 200 210 } 211 212 classes = getClasses(WIDGET_PACKAGE); 213 214 for (int i = 0; i < classes.length; i++) { 215 String name = classes[i].getSimpleName(); 216 // maps lower case name to correct capitalised name 217 _IWs.put(name.toLowerCase(), WIDGET_PACKAGE + name); 218 } 219 220 classes = getClasses(CHARTS_PACKAGE); 221 222 for (int i = 0; i < classes.length; i++) { 223 String name = classes[i].getSimpleName(); 224 // maps lower case name to correct capitalised name 225 _IWs.put("charts." + name.toLowerCase(), CHARTS_PACKAGE + name); 226 } 201 227 } catch (Exception e) { 202 228 warnings.add("You must have Java 1.5 or higher to run Expeditee"); 203 229 warnings.add(e.getMessage()); 204 230 } 231 205 232 try { 206 233 classes = getClasses(ACTIONS_PACKAGE); … … 421 448 continue; 422 449 for (int i = 0; i < paramCount; i++) { 423 if (paramTypes[i].equals(int.class) 424 || paramTypes[i].equals(Integer.class)) { 425 try { 426 params[i] = Integer.parseInt(paramStrings[i]); 427 } catch (Exception e) { 450 SString nextParam = new SString(paramStrings[i]); 451 try { 452 params[i] = null; 453 if (paramTypes[i].equals(int.class) 454 || paramTypes[i].equals(Integer.class)) { 455 params[i] = nextParam.integerValue().intValue(); 456 } else if (paramTypes[i].equals(long.class) 457 || paramTypes[i].equals(Long.class)) { 458 params[i] = nextParam.integerValue(); 459 } else if (paramTypes[i].equals(double.class) 460 || paramTypes[i].equals(Double.class)) { 461 params[i] = nextParam.doubleValue(); 462 } else if (paramTypes[i].equals(float.class) 463 || paramTypes[i].equals(Float.class)) { 464 params[i] = nextParam.doubleValue() 465 .floatValue(); 466 } else if (paramTypes[i].equals(boolean.class) 467 || paramTypes[i].equals(Boolean.class)) { 468 params[i] = nextParam.booleanValue(); 469 } else if (paramTypes[i].equals(String.class)) { 470 params[i] = nextParam.stringValue(); 471 } else { 428 472 continue; 429 473 } 430 } else if (paramTypes[i].equals(double.class) 431 || paramTypes[i].equals(Double.class)) { 432 try { 433 params[i] = Double.parseDouble(paramStrings[i]); 434 } catch (Exception e) { 435 continue; 436 } 437 } else if (paramTypes[i].equals(String.class)) { 438 params[i] = paramStrings[i]; 439 } else { 474 } catch (Exception e) { 440 475 continue; 441 476 } … … 736 771 return null; 737 772 } 773 774 /** 775 * Gets the full class path for a widget with a given case insensitive name. 776 * 777 * @param widgetName 778 * @return 779 */ 780 public static String getClassName(String widgetName) { 781 return _IWs.get(widgetName.toLowerCase()); 782 } 738 783 } -
trunk/src/org/expeditee/agents/PdfFrameset.java
r282 r286 6 6 import org.expeditee.gui.MessageBay; 7 7 import org.expeditee.io.PdfFramesetWriter; 8 import org.expeditee.items.widgets.InteractiveWidget; 8 9 9 10 … … 14 15 15 16 private int _maxFrame = Integer.MAX_VALUE; 17 18 private boolean _showFrameNames = false; 16 19 17 public PdfFrameset(int firstFrame, int maxFrame ) {20 public PdfFrameset(int firstFrame, int maxFrame, boolean showFrameNames) { 18 21 super(); 19 22 _firstFrame = firstFrame; 20 23 _maxFrame = maxFrame; 24 _showFrameNames = showFrameNames; 25 } 26 27 public PdfFrameset(int firstFrame, int maxFrame) { 28 this(firstFrame, maxFrame, false); 29 } 30 31 public PdfFrameset( boolean showFrameNames) { 32 this(1,Integer.MAX_VALUE, showFrameNames); 21 33 } 22 34 23 35 public PdfFrameset() { 24 super(); 25 _firstFrame = 1; 26 _maxFrame = Integer.MAX_VALUE; 36 this(false); 27 37 } 28 38 29 39 @Override 30 40 protected Frame process(Frame frame) { 31 _pdfWriter = new PdfFramesetWriter(_firstFrame, _maxFrame );41 _pdfWriter = new PdfFramesetWriter(_firstFrame, _maxFrame, _showFrameNames); 32 42 33 43 try { -
trunk/src/org/expeditee/agents/mail/MailSession.java
r284 r286 76 76 if (item.getText().toLowerCase().trim().equals("autoconnect")) { 77 77 _autoConnect = true; 78 continue; 78 79 } 79 80 AttributeValuePair avp = new AttributeValuePair(item.getText()); … … 156 157 _bConnecting = true; 157 158 _transport.connect(); 158 message.set Text("SMTP server connected");159 message.setAttributeValue("SMTP server connected"); 159 160 message.setColor(Color.green); 160 161 } else { … … 211 212 }.start(); 212 213 213 message.set Text("Connection complete");214 message.setAttributeValue("Connection complete"); 214 215 message.setColor(Color.GREEN); 215 216 -
trunk/src/org/expeditee/gui/AttributeValuePair.java
r247 r286 54 54 if (text.charAt(0) == ANNOTATION_CHAR) { 55 55 _bAnnotation = true; 56 if (text.length() == 1 || !Character.isLetter (text.charAt(1)))56 if (text.length() == 1 || !Character.isLetterOrDigit(text.charAt(1))) 57 57 return; 58 58 // All chars in the attribute must be letters or digits … … 61 61 return; 62 62 } 63 text = text.substring(1); 64 ind--; 63 65 if (ind < 1) { 64 setAttribute(text .substring(1));66 setAttribute(text); 65 67 return; 66 68 } -
trunk/src/org/expeditee/gui/Frame.java
r282 r286 2 2 3 3 import java.awt.Color; 4 import java.awt.Dimension;5 4 import java.awt.Image; 6 5 import java.awt.Polygon; … … 31 30 import org.expeditee.items.Text; 32 31 import org.expeditee.items.XRayable; 32 import org.expeditee.items.Item.HighlightMode; 33 33 import org.expeditee.items.widgets.InteractiveWidget; 34 34 import org.expeditee.items.widgets.WidgetCorner; … … 501 501 for (Overlay o : _overlays.keySet()) 502 502 results.addAll(o.Frame.getItemsWithin(poly)); 503 504 for(Item i: getVectorItems()){ 505 if (i.intersects(poly)) { 506 //This assumes a results is a set 507 results.add(i.getEditTarget()); 508 } 509 } 503 510 504 511 return results; … … 1070 1077 int index = toCheck.indexOf(from); 1071 1078 1079 //If its the title index will be 0 1072 1080 if (index < 0) 1073 return column;1081 index = 0; 1074 1082 1075 1083 for (int i = index; i < toCheck.size(); i++) { … … 1100 1108 // Items must be notified that they have been added or removed from this 1101 1109 // frame via the vector... 1110 int maxX = 0; 1111 int maxY = 0; 1112 HighlightMode mode = toAdd.Source.getHighlightMode(); 1113 if(mode != HighlightMode.None) 1114 mode = HighlightMode.Connected; 1115 Color highlightColor = toAdd.Source.getHighlightColor(); 1102 1116 for (Item i : ItemUtils.CopyItems(toAdd.Frame.getVectorItems(), toAdd)) { 1103 1117 i.onParentStateChanged(new ItemParentStateChangedEvent(this, 1104 1118 ItemParentStateChangedEvent.EVENT_TYPE_ADDED_VIA_OVERLAY, 1105 1119 toAdd.permission)); 1120 i.setEditTarget(toAdd.Source); 1121 i.setHighlightMode(mode, highlightColor); 1106 1122 _vectorItems.add(i); 1107 1123 i.invalidateAll(); 1108 1124 i.invalidateFill(); 1109 } 1125 //Get the right most x and bottom most y pos 1126 int itemRight = i.getX() + i.getBoundsWidth(); 1127 if(itemRight > maxX) 1128 maxX = itemRight; 1129 int itemBottom = i.getY() + i.getBoundsHeight(); 1130 if(itemBottom > maxY) 1131 maxY = itemBottom; 1132 } 1133 toAdd.setSize(maxX, maxY); 1110 1134 return true; 1111 1135 } … … 1916 1940 } 1917 1941 } 1942 1943 for(Vector v: getVectors()){ 1944 toSave.add(v.Source); 1945 } 1946 1918 1947 return toSave; 1919 1948 } … … 2016 2045 _frameName = null; 2017 2046 } 2047 2048 public void parse() { 2049 for(Overlay o: getOverlays()){ 2050 o.Frame.parse(); 2051 } 2052 //Must parse the frame AFTER the overlays 2053 FrameUtils.Parse(this); 2054 } 2018 2055 } -
trunk/src/org/expeditee/gui/FrameGraphics.java
r282 r286 36 36 // the maximum size that can be used to paint on 37 37 private static Dimension _MaxSize = new Dimension(1000, 1000); 38 38 39 39 // Final passes to renderering the current frame 40 40 private static LinkedList<FinalFrameRenderPass> _finalPasses = new LinkedList<FinalFrameRenderPass>(); … … 100 100 return; 101 101 _Mode = mode; 102 if (parse) 103 FrameUtils.Parse(DisplayIO.getCurrentFrame()); 102 if (parse) { 103 Frame current = DisplayIO.getCurrentFrame(); 104 current.parse(); 105 } 104 106 } 105 107 … … 134 136 if (DisplayIO.isTwinFramesOn()) { 135 137 Frame opposite = DisplayIO.getOppositeFrame(); 136 // if (opposite != null) {137 138 139 // }138 // if (opposite != null) { 139 opposite.setBuffer(null); 140 opposite.refreshSize(); 141 // } 140 142 } 141 143 } … … 264 266 * @return 265 267 */ 266 private static Image Paint(Frame toPaint, Area clip, boolean isActualFrame, boolean createVolitile) { 268 private static Image Paint(Frame toPaint, Area clip, boolean isActualFrame, 269 boolean createVolitile) { 267 270 if (toPaint == null) 268 271 return null; … … 276 279 if (createVolitile) { 277 280 buffer = ge.getDefaultScreenDevice() 278 .getDefaultConfiguration()279 .createCompatibleVolatileImage(_MaxSize.width,280 _MaxSize.height);281 .getDefaultConfiguration() 282 .createCompatibleVolatileImage(_MaxSize.width, 283 _MaxSize.height); 281 284 } else { 282 285 buffer = new BufferedImage(_MaxSize.width, _MaxSize.height, … … 302 305 * @param bg 303 306 */ 304 public static void paintFrame(Frame toPaint, Area clip, boolean isActualFrame, boolean createVolitile, Graphics2D bg) { 307 public static void paintFrame(Frame toPaint, Area clip, 308 boolean isActualFrame, boolean createVolitile, Graphics2D bg) { 305 309 bg.setClip(clip); 306 310 … … 318 322 if (createVolitile) { 319 323 backgroundColor = toPaint.getPaintBackgroundColor(); 320 } else{324 } else { 321 325 backgroundColor = toPaint.getBackgroundColor(); 322 326 if (backgroundColor == null) … … 337 341 visibleItems.addAll(toPaint.getAllItems()); 338 342 paintWidgets = new LinkedList<InteractiveWidget>(); 339 AddAllOverlayWidgets(paintWidgets, toPaint, 340 new LinkedList<Frame>()); 343 AddAllOverlayWidgets(paintWidgets, toPaint, new LinkedList<Frame>()); 341 344 } else { 342 345 visibleItems.addAll(toPaint.getVisibleItems()); … … 348 351 // FIRST: Paint widgets swing gui (not expeditee gui) . 349 352 // Note that these are the anchored widgets 350 ListIterator<InteractiveWidget> widgetItor = paintWidgets.listIterator(paintWidgets.size()); 351 while (widgetItor.hasPrevious()) { 352 //Paint first-in-last-serve ordering - like swing 353 //If it is done the other way around then widgets are covered up by the box that is supposed to be underneath 353 ListIterator<InteractiveWidget> widgetItor = paintWidgets 354 .listIterator(paintWidgets.size()); 355 while (widgetItor.hasPrevious()) { 356 // Paint first-in-last-serve ordering - like swing 357 // If it is done the other way around then widgets are covered up by 358 // the box that is supposed to be underneath 354 359 InteractiveWidget iw = widgetItor.previous(); 355 if (clip == null 356 || clip.intersects(iw.getComponant().getBounds())){ 357 iw.paint(bg); 360 if (clip == null || clip.intersects(iw.getComponant().getBounds())) { 361 iw.paint(bg); 358 362 PaintItem(bg, iw.getItems().get(4)); 359 363 paintedFillsAndLines.addAll(iw.getItems()); … … 702 706 } else if (i instanceof Circle) { 703 707 i.setHighlightMode(Item.HighlightMode.Connected); 708 } else if (!i.isVisible()) { 709 changeHighlightMode(i, Item.HighlightMode.Connected, null); 704 710 } else { 705 711 // FrameGraphics.ChangeSelectionMode(i, … … 726 732 if (item == null) 727 733 return; 728 // Mike: TODO comment on why the line below is used!! 729 // I forgot already!!Opps 730 boolean freeItem = FreeItems.getInstance().contains(item); 731 for (Item i : item.getAllConnected()) { 732 if (/* freeItem || */!FreeItems.getInstance().contains(i)) { 733 i.setHighlightMode(connectedNewMode); 734 } 735 } 736 if (!freeItem && newMode != connectedNewMode) 734 735 if (item.hasVector()) { 736 for (Item i : item.getParentOrCurrentFrame().getVectorItems()) { 737 if (i.getEditTarget() == item) { 738 i.setHighlightMode(newMode); 739 } 740 } 737 741 item.setHighlightMode(newMode); 742 } else { 743 // Mike: TODO comment on why the line below is used!! 744 // I forgot already!!Opps 745 boolean freeItem = FreeItems.getInstance().contains(item); 746 for (Item i : item.getAllConnected()) { 747 if (/* freeItem || */!FreeItems.getInstance().contains(i)) { 748 i.setHighlightMode(connectedNewMode); 749 } 750 } 751 if (!freeItem && newMode != connectedNewMode) 752 item.setHighlightMode(newMode); 753 } 738 754 Repaint(); 739 755 } … … 746 762 */ 747 763 748 public static void UpdateBuffer(Frame toUpdate, boolean paintOverlays, boolean useVolitile) { 764 public static void UpdateBuffer(Frame toUpdate, boolean paintOverlays, 765 boolean useVolitile) { 749 766 toUpdate.setBuffer(getBuffer(toUpdate, paintOverlays, useVolitile)); 750 767 } 751 752 public static Image getBuffer(Frame toUpdate, boolean paintOverlays, boolean useVolitile){ 768 769 public static Image getBuffer(Frame toUpdate, boolean paintOverlays, 770 boolean useVolitile) { 753 771 if (toUpdate == null) 754 772 return null; … … 771 789 // Damaged areas pending to render. Accessessed by multiple threads 772 790 private static HashSet<Rectangle> damagedAreas = new HashSet<Rectangle>(); 773 791 774 792 /** The clip used while paiting */ 775 793 private static Area currentClip; 776 794 777 795 /** 778 796 * The current clip that is used for painting at this instant. … … 781 799 * lost in the graphics object for which can be regained via this method. 782 800 * 783 * @return 784 * The current clip. Null if no clip (e.g. full screen render). 801 * @return The current clip. Null if no clip (e.g. full screen render). 785 802 */ 786 803 public static Area getCurrentClip() { 787 return (currentClip != null) ? (Area) currentClip.clone() : null;804 return (currentClip != null) ? (Area) currentClip.clone() : null; 788 805 } 789 806 … … 869 886 MessageBay.refresh(true, dg, Item.DEFAULT_BACKGROUND); 870 887 return; 871 872 } else return; // nothing to render 888 889 } else 890 return; // nothing to render 873 891 } 874 892 … … 936 954 937 955 } 938 956 939 957 /** 940 958 * Adds a FinalFrameRenderPass to the frame-render pipeline... … … 944 962 * 945 963 * @param pass 946 * The pass to add. If already added then nothing results in the call. 964 * The pass to add. If already added then nothing results in the 965 * call. 947 966 * 948 967 * @throws NullPointerException 949 * 968 * If pass is null. 950 969 */ 951 970 public static void addFinalFrameRenderPass(FinalFrameRenderPass pass) { 952 if (pass == null) throw new NullPointerException("pass"); 953 971 if (pass == null) 972 throw new NullPointerException("pass"); 973 954 974 if (!_finalPasses.contains(pass)) 955 975 _finalPasses.add(pass); 956 976 } 957 977 958 978 /** 959 979 * Adds a FinalFrameRenderPass to the frame-render pipeline... … … 963 983 * 964 984 * @param pass 965 * 985 * The pass to remove 966 986 * 967 987 */ … … 969 989 _finalPasses.remove(pass); 970 990 } 971 972 /** 973 * A FinalFrameRenderPass is invoked at the very final stages for rendering a frame: 974 * that is, after the popups are drawn. 975 * 976 * There can be many applications for FinalFrameRenderPass. Such as tool tips, balloons, 977 * or drawing items at the highest Z-order in special situations. 991 992 /** 993 * A FinalFrameRenderPass is invoked at the very final stages for rendering 994 * a frame: that is, after the popups are drawn. 995 * 996 * There can be many applications for FinalFrameRenderPass. Such as tool 997 * tips, balloons, or drawing items at the highest Z-order in special 998 * situations. 978 999 * 979 1000 * Although if there are multiples FinalFrameRenderPasses attatach to the -
trunk/src/org/expeditee/gui/FrameIO.java
r282 r286 44 44 public static void changeParentFolder(String newFolder) { 45 45 PARENT_FOLDER = newFolder; 46 PUBLIC_PATH = PARENT_FOLDER + "public" + File.separator; 46 47 FRAME_PATH = PARENT_FOLDER + "framesets" + File.separator; 47 48 TRASH_PATH = PARENT_FOLDER + "trash" + File.separator; … … 65 66 66 67 public static String FRAME_PATH; 68 69 public static String PUBLIC_PATH; 67 70 68 71 public static String IMAGES_PATH; -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r284 r286 10 10 import java.awt.event.KeyListener; 11 11 import java.awt.geom.Point2D; 12 import java.text.NumberFormat; 12 13 import java.util.ArrayList; 13 14 import java.util.Collection; … … 39 40 40 41 private static Collection<Item> _enclosedItems = null; 41 42 42 43 public static void resetEnclosedItems() { 43 44 _enclosedItems = null; … … 330 331 public void keyPressed(KeyEvent e) { 331 332 int keyCode = e.getKeyCode(); 332 333 if (keyCode != KeyEvent.VK_F1 && keyCode != KeyEvent.VK_F2){333 334 if (keyCode != KeyEvent.VK_F1 && keyCode != KeyEvent.VK_F2) { 334 335 resetEnclosedItems(); 335 336 } 336 337 337 338 SessionStats.AddFrameEvent("k" + KeyEvent.getKeyText(keyCode)); 338 339 … … 526 527 527 528 } 528 529 529 530 530 public void keyReleased(KeyEvent e) { … … 1114 1114 public static final String SHORT_DATE_FORMAT = "ddMMMyyyy"; 1115 1115 1116 public static final String TIME_DATE_FORMAT = "[HH:mm]"; 1117 1116 1118 public static final String LONG_DATE_FORMAT = "ddMMMyyyy[HH:mm]"; 1117 1119 … … 1181 1183 dummyItem.setText(newItemText + dummyItem.getText()); 1182 1184 } 1183 1185 1184 1186 dummyItem = createText(); 1185 1187 if (FreeItems.textOnlyAttachedToCursor()) { … … 1199 1201 if (column.size() == 0) { 1200 1202 Frame current = DisplayIO.getCurrentFrame(); 1201 // Item itemTemplate = current.getItemTemplate();1203 // Item itemTemplate = current.getItemTemplate(); 1202 1204 int xPos = title.getX() + FrameCreator.INDENT_FROM_TITLE; 1203 1205 int yPos = FrameCreator.getYStart(title); … … 1509 1511 // check permissions 1510 1512 if (!item.hasPermission(Permission.full)) { 1511 MessageBay 1512 .displayMessage("Insufficient permission to change the size of that item"); 1513 return; 1513 Item editTarget = item.getEditTarget(); 1514 if (editTarget != item 1515 && editTarget.hasPermission(Permission.full)) { 1516 item = editTarget; 1517 } else { 1518 MessageBay 1519 .displayMessage("Insufficient permission to change the size of that item"); 1520 return; 1521 } 1514 1522 } 1515 1523 toSet = item; … … 1569 1577 i.setThickness((float) (i.getThickness() * ratio)); 1570 1578 } else if (i instanceof XRayable) { 1579 XRayable xRay = (XRayable) i; 1580 Text source = xRay.getSource(); 1581 // Ensure that the source is done before the XRayable 1582 if (!done.contains(source)) { 1583 scaleText(origin, ratio, done, source); 1584 } 1585 1571 1586 i.translate(origin, ratio); 1572 1587 i.setThickness((float) (i.getThickness() * ratio)); 1573 1588 done.add(i); 1589 } else if (i.hasVector()) { 1590 // TODO Improve the effiency of resizing vectors... ie... 1591 // dont want to have to reparse all the time 1592 assert (i instanceof Text); 1593 Text text = (Text) i; 1594 AttributeValuePair avp = new AttributeValuePair(text 1595 .getText()); 1596 double scale = 1F; 1597 try { 1598 scale = avp.getDoubleValue(); 1599 } catch (Exception e) { 1600 } 1601 scale *= ratio; 1602 NumberFormat nf = Vector.getNumberFormatter(); 1603 text.setAttributeValue(nf.format(scale)); 1604 text.translate(origin, ratio); 1605 item.getParent().parse(); 1574 1606 } else if (i instanceof Text) { 1575 i.translate(origin, ratio); 1576 i.setSize((float) (i.getSize() * ratio)); 1577 done.add(i); 1607 scaleText(origin, ratio, done, (Text) i); 1578 1608 } 1579 1609 } … … 1598 1628 current = Math.max(current + diff, Item.MINIMUM_THICKNESS); 1599 1629 dot.setThickness(current); 1630 } else if (i.hasVector()) { 1631 assert (item instanceof Text); 1632 Text text = (Text) item; 1633 AttributeValuePair avp = new AttributeValuePair(text.getText()); 1634 double scale = 1F; 1635 try { 1636 scale = avp.getDoubleValue(); 1637 } catch (Exception e) { 1638 } 1639 scale *= ratio; 1640 NumberFormat nf = Vector.getNumberFormatter(); 1641 text.setAttributeValue(nf.format(scale)); 1642 text.translate(origin, ratio); 1643 item.getParent().parse(); 1600 1644 } else { 1601 1645 float oldSize = Math.abs(i.getSize()); … … 1620 1664 } 1621 1665 1666 /** 1667 * @param origin 1668 * @param ratio 1669 * @param done 1670 * @param source 1671 */ 1672 private static void scaleText(Point2D origin, double ratio, 1673 Collection<Item> done, Text source) { 1674 source.translate(origin, ratio); 1675 source.setSize((float) (source.getSize() * ratio)); 1676 done.add(source); 1677 } 1678 1622 1679 private static void SetFillColor(Item item, boolean setTransparent) { 1623 1680 if (item == null) … … 1716 1773 // check permissions 1717 1774 if (!item.hasPermission(Permission.full)) { 1718 MessageBay 1719 .displayMessage("Insufficient permission to change that item's color"); 1720 return; 1775 Item editTarget = item.getEditTarget(); 1776 if (editTarget != item 1777 && editTarget.hasPermission(Permission.full)) { 1778 item = editTarget; 1779 } else { 1780 MessageBay 1781 .displayMessage("Insufficient permission to change color"); 1782 return; 1783 } 1721 1784 } 1722 1785 // Toggling color of circle center changes the circle fill color -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r284 r286 2 2 3 3 import java.awt.Point; 4 import java.awt.Rectangle; 4 5 import java.awt.event.ActionEvent; 5 6 import java.awt.event.ActionListener; … … 10 11 import java.awt.event.MouseWheelEvent; 11 12 import java.awt.event.MouseWheelListener; 13 import java.text.NumberFormat; 12 14 import java.util.ArrayList; 13 15 import java.util.Collection; … … 683 685 // check item permissions 684 686 if (!clicked.hasPermission(Permission.followLinks)) { 685 MessageBay 686 .displayMessage("Insufficient permissions to perform action on item"); 687 return; 687 Item editTarget = clicked.getEditTarget(); 688 if (editTarget != clicked 689 && editTarget.hasPermission(Permission.followLinks)) { 690 clicked = editTarget; 691 } else { 692 MessageBay 693 .displayMessage("Insufficient permission to perform action on item"); 694 return; 695 } 688 696 } 689 697 … … 869 877 // check permissions 870 878 if (!clicked.hasPermission(Permission.full)) { 871 MessageBay 872 .displayMessage("Insufficient permission to pick up item"); 873 return; 879 Item editTarget = clicked.getEditTarget(); 880 if (editTarget != clicked 881 && editTarget.hasPermission(Permission.full)) { 882 clicked = editTarget; 883 } else { 884 MessageBay 885 .displayMessage("Insufficient permission to pick up item"); 886 return; 887 } 874 888 } 875 889 … … 1250 1264 } 1251 1265 } else if (!clicked.hasPermission(Permission.copy)) { 1252 MessageBay 1253 .displayMessage("Insufficient permission to copy"); 1254 return; 1266 Item editTarget = clicked.getEditTarget(); 1267 if (editTarget != clicked 1268 && editTarget.hasPermission(Permission.copy)) { 1269 clicked = editTarget; 1270 } else { 1271 MessageBay 1272 .displayMessage("Insufficient permission to copy"); 1273 return; 1274 } 1255 1275 } 1256 1276 … … 1548 1568 1549 1569 private static boolean _controlDown; 1550 1570 1551 1571 public static boolean isControlDown() { 1552 1572 return _controlDown; … … 1596 1616 MouseX = e.getX(); 1597 1617 MouseY = e.getY(); 1598 // System.out.println(MouseX + "," + MouseY);1618 // System.out.println(MouseX + "," + MouseY); 1599 1619 1600 1620 // Moving the mouse a certain distance removes the last edited text if … … 1813 1833 // Item.SelectedMode.Connected); 1814 1834 // TODO: The method below is for the most part redundant 1815 on = FrameGraphics.Highlight(on );1835 on = FrameGraphics.Highlight(on.getEditTarget()); 1816 1836 } 1817 1837 // if the last item highlighted is still highlighted, clear it … … 2001 2021 */ 2002 2022 public static boolean tdfc(Item linker) throws RuntimeException { 2003 // if (linker instanceof Line)2004 // return false;2005 2006 2023 // if this is a non-usable item 2007 2024 if (linker.getID() < 0) 2008 2025 return false; 2026 2027 // Check if its an image that can be resized to fit a box 2028 // around it 2029 String text = linker.getText(); 2030 if (text.equals("@v") || text.equals("@f")) { 2031 Collection<Item> enclosure = FrameUtils.getEnclosingLineEnds(linker 2032 .getPosition()); 2033 if (enclosure != null) { 2034 for (Item i : enclosure) { 2035 if (i.isLineEnd() && i.isEnclosed()) { 2036 DisplayIO.getCurrentFrame().removeAllItems(enclosure); 2037 Rectangle rect = i.getEnclosedRectangle(); 2038 long width = Math.round(rect.getWidth()); 2039 if (text.equals("@v")) { 2040 NumberFormat nf = Vector.getNumberFormatter(); 2041 linker.setText("@v: " 2042 + nf.format((width / FrameGraphics 2043 .getMaxFrameSize().getWidth()))); 2044 } else { 2045 linker.setText("@f: " + width); 2046 } 2047 2048 linker.setPosition(new Point(rect.x, rect.y)); 2049 linker.setThickness(i.getThickness()); 2050 linker.setBorderColor(i.getColor()); 2051 break; 2052 } 2053 } 2054 FrameMouseActions.deleteItems(enclosure, false); 2055 } 2056 } 2009 2057 2010 2058 boolean mouseMoved; … … 2178 2226 // check permissions 2179 2227 if (!toDelete.hasPermission(Permission.full)) { 2180 MessageBay 2181 .displayMessage("Insufficient permission to delete item"); 2182 return; 2228 Item editTarget = toDelete.getEditTarget(); 2229 if (editTarget != toDelete 2230 && editTarget.hasPermission(Permission.full)) { 2231 toDelete = editTarget; 2232 } else { 2233 MessageBay 2234 .displayMessage("Insufficient permission to delete item"); 2235 return; 2236 } 2183 2237 } 2184 2238 … … 2532 2586 2533 2587 if (!toGrab.hasPermission(Permission.full)) { 2534 MessageBay 2535 .displayMessage("Insufficient permission pickup the item"); 2588 if (toGrab.getEditTarget() != toGrab) { 2589 pickup(toGrab.getEditTarget()); 2590 } else { 2591 MessageBay 2592 .displayMessage("Insufficient permission pickup the item"); 2593 } 2536 2594 return; 2537 2595 } … … 2539 2597 if (toGrab instanceof Circle) 2540 2598 toGrab.setHighlightMode(HighlightMode.Connected); 2541 else 2599 //Dont set the highlight mode if a vector is being picked up 2600 else if(toGrab.isVisible()){ 2542 2601 toGrab.setHighlightMode(HighlightMode.Normal); 2602 } 2543 2603 2544 2604 // Brook: If the widget corner is being picked up. Instead refer to … … 2559 2619 2560 2620 public static void pickup(Collection<Item> toGrab) { 2561 if (toGrab == null || toGrab.size() == 0)2621 if (toGrab == null || toGrab.size() == 0) 2562 2622 return; 2563 2623 2564 2624 boolean bReparse = false; 2565 2625 Frame frame = DisplayIO.getCurrentFrame(); … … 2594 2654 for (Item copy : copies) { 2595 2655 FreeItems.getInstance().add(copy); 2656 copy.setEditTarget(i); 2596 2657 copy.setFloating(true); 2597 2658 copy.setParent(null); 2659 //copy.setHighlightMode(HighlightMode.Connected); 2598 2660 } 2599 2661 } … … 2636 2698 } else { 2637 2699 MessageBay 2638 .displayMessage("Insufficient permission pickup the items");2700 .displayMessage("Insufficient permission to pickup the items"); 2639 2701 } 2640 2702 if (bReparse) -
trunk/src/org/expeditee/gui/FrameUtils.java
r284 r286 4 4 import java.awt.Point; 5 5 import java.awt.Polygon; 6 import java.awt.Rectangle; 6 7 import java.io.File; 7 8 import java.util.ArrayList; … … 31 32 import org.expeditee.items.widgets.WidgetCorner; 32 33 import org.expeditee.items.widgets.WidgetEdge; 34 import org.expeditee.network.PeerToPeer; 33 35 import org.expeditee.stats.SessionStats; 34 36 … … 580 582 else if (attribute.equals("mailsettings")) 581 583 MailSession.init(item.getChild()); 584 else if (attribute.equals("peertopeersettings")) 585 PeerToPeer.init(item.getChild()); 582 586 else if (attribute.equals("reminders")) 583 587 Reminders.init(item.getChild()); … … 779 783 } else if (i.hasFormula()) { 780 784 i.setText(i.getFormula()); 785 } else if (i.hasOverlay()) { 786 i.setVisible(true); 781 787 } 782 788 } … … 849 855 } 850 856 // check for new OVERLAY items 851 else if (!ignoreAnnotations && ItemUtils.startsWithTag(i, 852 ItemUtils.TAG_OVERLAY) 857 else if (!ignoreAnnotations 858 && ItemUtils.startsWithTag(i, 859 ItemUtils.TAG_OVERLAY) 853 860 && i.getLink() != null) { 854 861 if (i.getAbsoluteLink().equalsIgnoreCase( … … 872 879 } 873 880 // check for ACTIVE_OVERLAY items 874 else if (!ignoreAnnotations && ItemUtils.startsWithTag(i, 875 ItemUtils.TAG_ACTIVE_OVERLAY) 881 else if (!ignoreAnnotations 882 && ItemUtils.startsWithTag(i, 883 ItemUtils.TAG_ACTIVE_OVERLAY) 876 884 && i.getLink() != null) { 877 885 String link = i.getAbsoluteLink(); … … 1028 1036 } catch (Exception e) { 1029 1037 } 1030 Vector newVector = new Vector(vector, vectorPermission, i 1031 .getPosition(), scale, i.getColor(), i.getBackgroundColor()); 1038 Vector newVector = new Vector(vector, vectorPermission, scale, i); 1032 1039 i.setOverlay(newVector); 1040 i.setVisible(false); 1033 1041 vectors.add(newVector); 1034 1042 } … … 1451 1459 if (lastEdited != LastEdited) { 1452 1460 if (LastEdited.startsWith("@i")) { 1461 // Check if its an image that can be resized to fit a box 1462 // around it 1463 String text = LastEdited.getText(); 1464 if (text.startsWith("@i:") 1465 && !Character.isDigit(text 1466 .charAt(text.length() - 1))) { 1467 Collection<Item> enclosure = FrameUtils 1468 .getEnclosingLineEnds(LastEdited.getPosition()); 1469 if (enclosure != null) { 1470 for (Item i : enclosure) { 1471 if (i.isLineEnd() && i.isEnclosed()) { 1472 DisplayIO.getCurrentFrame().removeAllItems( 1473 enclosure); 1474 Rectangle rect = i.getEnclosedRectangle(); 1475 LastEdited 1476 .setText(LastEdited.getText() 1477 + " " 1478 + Math.round(rect 1479 .getWidth())); 1480 LastEdited.setPosition(new Point(rect.x, 1481 rect.y)); 1482 LastEdited.setThickness(i.getThickness()); 1483 LastEdited.setBorderColor(i.getColor()); 1484 break; 1485 } 1486 } 1487 FrameMouseActions.deleteItems(enclosure, false); 1488 } 1489 } 1453 1490 toReparse = LastEdited.getParent(); 1454 1491 } else if (LastEdited.recalculateWhenChanged()) { -
trunk/src/org/expeditee/gui/UserSettings.java
r247 r286 71 71 72 72 UserSettings.FrameDirs.add(FrameIO.FRAME_PATH); 73 UserSettings.FrameDirs.add(FrameIO.PUBLIC_PATH); 73 74 UserSettings.FrameDirs.add(FrameIO.PROFILE_PATH); 74 75 UserSettings.FrameDirs.add(FrameIO.HELP_PATH); -
trunk/src/org/expeditee/gui/Vector.java
r115 r286 2 2 3 3 import java.awt.Color; 4 import java.awt.Dimension; 4 5 import java.awt.Point; 6 import java.text.NumberFormat; 5 7 8 import org.expeditee.items.Item; 6 9 import org.expeditee.items.Permission; 7 10 … … 15 18 16 19 public Color Background; 20 21 public Item Source; 22 23 public Dimension Size; 17 24 18 public Vector(Frame overlay, Permission permission, Point origin,19 Float scale, Color color, Color background) {25 public Vector(Frame overlay, Permission permission, 26 Float scale, Item source) { 20 27 super(overlay, permission); 21 Origin = origin;28 Origin = source.getPosition(); 22 29 Scale = scale; 23 Foreground = color; 24 Background = background; 30 Foreground = source.getColor(); 31 Background = source.getBackgroundColor(); 32 Source = source; 25 33 } 26 34 … … 54 62 return (y - Origin.y) / Scale; 55 63 } 64 65 public void setSize(int maxX, int maxY) { 66 Size = new Dimension(maxX, maxY); 67 } 68 69 public static NumberFormat getNumberFormatter() { 70 NumberFormat nf = NumberFormat.getInstance(); 71 nf.setMaximumFractionDigits(4); 72 return nf; 73 } 56 74 } -
trunk/src/org/expeditee/io/DefaultFrameWriter.java
r284 r286 6 6 import java.lang.reflect.Method; 7 7 import java.util.Collection; 8 import java.util.HashSet; 8 9 import java.util.LinkedHashMap; 9 10 … … 12 13 import org.expeditee.gui.FrameIO; 13 14 import org.expeditee.items.Item; 15 import org.expeditee.items.Line; 14 16 import org.expeditee.items.Text; 15 17 … … 63 65 _ItemTags.put("G", Item.class 64 66 .getMethod("getBackgroundColor", param)); 65 _ItemTags.put("K", Item.class 66 .getMethod("getBorderColor", param)); 67 _ItemTags.put("K", Item.class.getMethod("getBorderColor", param)); 67 68 _ItemTags.put("H", Item.class.getMethod("getAnchorRight", param)); 68 69 _ItemTags.put("I", Item.class.getMethod("getAnchorBottom", param)); … … 83 84 _ItemTags.put("e", Item.class.getMethod("getFillColor", param)); 84 85 _ItemTags.put("E", Item.class.getMethod("getGradientColor", param)); 85 86 86 87 _ItemTags.put("i", Item.class.getMethod("getFillPattern", param)); 87 88 _ItemTags.put("o", Item.class.getMethod("getOwner", param)); … … 96 97 _ItemTags.put("t", Text.class.getMethod("getSpacing", param)); 97 98 98 // TODO set a boolean flag to indicate that the text is a formula99 // Store the formula in the text property NOT the answer99 // TODO set a boolean flag to indicate that the text is a formula 100 // Store the formula in the text property NOT the answer 100 101 _ItemTags.put("J", Item.class.getMethod("getFormula", param)); 101 102 _ItemTags.put("T", Text.class.getMethod("getText", param)); … … 138 139 /** 139 140 * Called before writing out the body items of each frame. 140 * @param starting the name of the frame currently being written out. 141 * 142 * @param starting 143 * the name of the frame currently being written out. 141 144 * @throws IOException 142 145 */ … … 152 155 /** 153 156 * Called after writing out the body items of each frame. 154 * @param ending the name of the frame currently being written out. 157 * 158 * @param ending 159 * the name of the frame currently being written out. 155 160 * @throws IOException 156 161 */ … … 160 165 protected void initialise(Frame start) throws IOException { 161 166 if (_filename == null) 162 _filename = FrameIO.EXPORTS_DIR + getValidFilename(start.getTitle()) + _format; 167 _filename = FrameIO.EXPORTS_DIR 168 + getFileName(start) + _format; 163 169 164 170 if (_filename.equalsIgnoreCase(WriteTree.CLIPBOARD)) { … … 189 195 } 190 196 197 protected String getFileName(Frame start) { 198 return getValidFilename(start.getTitle()); 199 } 200 191 201 public static String getValidFilename(String filename) { 192 202 return filename.replaceAll("[ \\.]", "_"); … … 212 222 writeStartFrame(toWrite); 213 223 224 Collection<Item> done = new HashSet<Item>(); 225 214 226 for (Item i : getItemsToWrite(toWrite)) { 215 if (_stop) {227 if (_stop) { 216 228 return; 217 229 } 230 231 if (i instanceof Line) { 232 if (done.contains(i)) { 233 continue; 234 } 235 done.addAll(i.getAllConnected()); 236 } 218 237 writeItem(i); 219 238 } 220 221 239 writeEndFrame(toWrite); 222 240 } 223 241 224 242 protected Collection<Item> getItemsToWrite(Frame toWrite) { 225 243 return toWrite.getItemsToSave(); -
trunk/src/org/expeditee/io/DefaultFramesetWriter.java
r284 r286 8 8 9 9 public class DefaultFramesetWriter extends DefaultFrameWriter { 10 pr ivatelong _firstFrame = 1;11 pr ivatelong _maxFrame = Long.MAX_VALUE;10 protected long _firstFrame = 1; 11 protected long _maxFrame = Long.MAX_VALUE; 12 12 13 13 protected DefaultFramesetWriter(long firstFrame, long maxFrame){ -
trunk/src/org/expeditee/io/ItemWriter.java
r80 r286 4 4 import java.util.List; 5 5 6 import org.expeditee.items.Circle; 6 7 import org.expeditee.items.Dot; 7 8 import org.expeditee.items.Item; … … 9 10 import org.expeditee.items.Picture; 10 11 import org.expeditee.items.Text; 12 import org.expeditee.items.widgets.InteractiveWidget; 13 import org.expeditee.items.widgets.WidgetEdge; 11 14 12 15 public abstract class ItemWriter { … … 22 25 23 26 /** 24 * Called for each item on each frame to write out the contents of the items. 25 * @param toWrite the item to be written out. 27 * Called for each item on each frame to write out the contents of the 28 * items. 29 * 30 * @param toWrite 31 * the item to be written out. 26 32 * @throws IOException 27 33 */ … … 38 44 writePicture((Picture) toWrite); 39 45 40 if (toWrite instanceof Line) 46 if (toWrite instanceof Line) { 47 if (toWrite instanceof WidgetEdge) { 48 writeWidget(((WidgetEdge) toWrite).getWidgetSource()); 49 } 41 50 writeLine((Line) toWrite); 51 } 42 52 43 53 if (toWrite instanceof Dot) 44 54 writeDot((Item) toWrite); 55 56 if (toWrite instanceof Circle) 57 writeCircle((Circle) toWrite); 45 58 } 46 59 … … 52 65 writeAnnotationPicture((Picture) toWrite); 53 66 54 if (toWrite instanceof Line) 67 if (toWrite instanceof Line) { 55 68 writeAnnotationLine((Line) toWrite); 69 } 56 70 57 71 if (toWrite instanceof Dot) … … 80 94 } 81 95 96 protected void writeCircle(Circle toWrite) throws IOException { 97 } 98 99 protected void writeWidget(InteractiveWidget toWrite) throws IOException { 100 } 101 82 102 protected void writeDot(Item toWrite) throws IOException { 83 103 } -
trunk/src/org/expeditee/io/PdfFramesetWriter.java
r282 r286 1 1 package org.expeditee.io; 2 2 3 import java.awt.Color; 3 4 import java.awt.Dimension; 5 import java.awt.Graphics2D; 4 6 import java.awt.Image; 5 7 import java.io.FileOutputStream; … … 11 13 import org.expeditee.gui.FrameGraphics; 12 14 import org.expeditee.gui.UserSettings; 15 import org.expeditee.items.Circle; 13 16 import org.expeditee.items.Item; 17 import org.expeditee.items.Line; 14 18 import org.expeditee.items.Picture; 15 19 import org.expeditee.items.Text; 20 import org.expeditee.items.widgets.InteractiveWidget; 16 21 17 22 import com.lowagie.text.Document; … … 26 31 * 27 32 * @author root 28 * 33 * 29 34 */ 30 35 public class PdfFramesetWriter extends DefaultFramesetWriter { … … 34 39 private PdfWriter _pdfWriter; 35 40 36 public PdfFramesetWriter(long firstFrame, long maxFrame) { 41 private boolean _showFrameNames; 42 43 public PdfFramesetWriter(long firstFrame, long maxFrame, 44 boolean showFrameNames) { 37 45 super(firstFrame, maxFrame); 38 46 Dimension d = FrameGraphics.getMaxSize(); 39 47 _pdfDocument = new Document(new Rectangle(d.width, d.height)); 48 _showFrameNames = showFrameNames; 40 49 } 41 50 42 51 public PdfFramesetWriter() { 43 this(1, Long.MAX_VALUE); 52 this(1, Long.MAX_VALUE, false); 53 } 54 55 @Override 56 protected String getFileName(Frame start) { 57 String fileName = start.getFramesetName(); 58 if (_maxFrame < Long.MAX_VALUE) { 59 fileName += "_" + _firstFrame + "-" + _maxFrame; 60 } 61 return fileName; 44 62 } 45 63 … … 48 66 _format = ".pdf"; 49 67 super.initialise(start); 68 50 69 try { 51 70 _pdfWriter = PdfWriter.getInstance(_pdfDocument, … … 68 87 } 69 88 89 protected void writeStartFrame(Frame starting) throws IOException { 90 // TODO color in the frame background color 91 92 super.writeStartFrame(starting); 93 } 94 70 95 protected void writeEndFrame(Frame ending) throws IOException { 96 if (_showFrameNames) 97 writeText((Text) ending.getNameItem()); 71 98 super.writeEndFrame(ending); 72 99 // Move to the next page … … 108 135 protected void writePicture(Picture pic) throws IOException { 109 136 Image image = pic.getCroppedImage(); 110 if (image == null)137 if (image == null) 111 138 return; 112 139 try { … … 124 151 125 152 @Override 153 protected void writeLine(Line lineEnd) throws IOException { 154 PdfContentByte cb = _pdfWriter.getDirectContent(); 155 // Color fill = lineEnd.getFillColor(); 156 // if (fill != null) { 157 // cb.setColorFill(fill); 158 // } 159 Graphics2D g = cb.createGraphicsShapes( 160 FrameGraphics.getMaxSize().width, 161 FrameGraphics.getMaxSize().height); 162 lineEnd.paint(g); 163 // if (fill != null) { 164 // g.setPaint(fill); 165 // } 166 // lineEnd.paintFill(g); 167 } 168 169 @Override 126 170 protected Collection<Item> getItemsToWrite(Frame toWrite) { 127 171 return toWrite.getVisibleItems(); 128 172 } 173 174 @Override 175 protected void writeCircle(Circle toWrite) throws IOException { 176 PdfContentByte cb = _pdfWriter.getDirectContent(); 177 Graphics2D g = cb.createGraphicsShapes( 178 FrameGraphics.getMaxSize().width, 179 FrameGraphics.getMaxSize().height); 180 toWrite.paint(g); 181 } 182 183 184 @Override 185 protected void writeWidget(InteractiveWidget toWrite) throws IOException { 186 PdfContentByte cb = _pdfWriter.getDirectContent(); 187 Graphics2D g = cb.createGraphicsShapes( 188 FrameGraphics.getMaxSize().width, 189 FrameGraphics.getMaxSize().height); 190 toWrite.paint(g); 191 } 129 192 } -
trunk/src/org/expeditee/items/Item.java
r284 r286 192 192 dest._overlay = source._overlay; 193 193 dest._mode = source._mode;// SelectedMode.None; 194 //dest._highlightColor = source._highlightColor; 195 //dest.setHighlight(source.getHighlight()); 196 194 197 dest._visible = source._visible; 195 198 Frame parent = source.getParentOrCurrentFrame(); … … 234 237 235 238 private int _id; 239 240 private Item _editTarget = this; 236 241 237 242 private String _creationDate = null; … … 1831 1836 1832 1837 public int setHighlightColor(Color c) { 1838 if (!this.isVisible() && this.hasVector()) { 1839 for (Item i : this.getParentOrCurrentFrame().getVectorItems()) { 1840 if (i.getEditTarget() == this) { 1841 i.setHighlightColor(c); 1842 } 1843 } 1844 } 1833 1845 1834 1846 _highlightThickness = DEFAULT_HIGHLIGHT_THICKNESS; … … 1890 1902 public void setHighlightMode(HighlightMode mode, Color color) { 1891 1903 setHighlightColor(color); 1892 if (hasPermission(Permission.followLinks)) { 1904 if (hasPermission(Permission.followLinks) 1905 || getEditTarget().hasPermission(Permission.followLinks)) { 1893 1906 if (_mode != mode) { 1894 1907 _mode = mode; … … 2666 2679 } 2667 2680 } 2681 2682 /** 2683 * Sets the item to be pickup when the user attempts to pick this item up. 2684 * EditTarget has a value of 'this' by default but may be set to other 2685 * values if this item is on a vector. 2686 * 2687 * @param target 2688 * the item to be copied or picked up when the user attempts to 2689 * edit this item. 2690 */ 2691 public void setEditTarget(Item target) { 2692 _editTarget = target; 2693 } 2694 2695 public Item getEditTarget() { 2696 return _editTarget; 2697 } 2668 2698 } -
trunk/src/org/expeditee/items/ItemUtils.java
r247 r286 457 457 458 458 for (Item i : toCopy) { 459 459 //Dont copy parts of a vector 460 if(!i.hasPermission(Permission.copy)) 461 continue; 462 460 463 // BROOK 461 464 if (i instanceof WidgetCorner) { // dont add these -
trunk/src/org/expeditee/items/Text.java
r282 r286 275 275 276 276 public void setAttributeValue(String value) { 277 277 AttributeValuePair avp = new AttributeValuePair(getText(),false); 278 avp.setValue(value); 279 setText(avp.toString()); 278 280 } 279 281 -
trunk/src/org/expeditee/items/widgets/DataFrameWidget.java
r228 r286 1 1 package org.expeditee.items.widgets; 2 2 3 import java.awt.Color; 4 import java.awt.Graphics; 3 5 import java.util.Collection; 4 6 import java.util.HashSet; 5 7 6 8 import javax.swing.JComponent; 7 import javax.swing.JPanel;8 9 9 10 import org.expeditee.gui.Frame; … … 131 132 } 132 133 } 133 134 //STUFF FROM HEAVY_DUTY_INTERACTIVE_WIDGET CLASS 135 136 // @Override 137 // public int getLoadDelayTime() { 138 // // TODO Auto-generated method stub 139 // return 0; 140 // } 141 // 142 // @Override 143 // protected float loadWidgetData() { 144 // // TODO Auto-generated method stub 145 // return 0; 146 // } 147 // 148 // @Override 149 // protected void saveWidgetData() { 150 // // TODO Auto-generated method stub 151 // 152 // } 153 // 154 // @Override 155 // protected void tempUnloadWidgetData() { 156 // // TODO Auto-generated method stub 157 // 158 // } 159 // 160 // @Override 161 // protected void unloadWidgetData() { 162 // // TODO Auto-generated method stub 163 // 164 // } 165 // 166 // public boolean doesNeedSaving() { 167 // // TODO Auto-generated method stub 168 // return false; 169 // } 170 // 171 // public String getSaveName() { 172 // // TODO Auto-generated method stub 173 // return null; 174 // } 134 135 protected void paintInFreeSpace(Graphics g) { 136 super.paintInFreeSpace(g); 137 g.setFont(((Text)getSource()).getFont()); 138 g.setColor(Color.WHITE); 139 g.drawString(this.getClass().getSimpleName(), getX() + 10, getY() + 20); 140 141 } 175 142 } -
trunk/src/org/expeditee/items/widgets/InteractiveWidget.java
r282 r286 19 19 import javax.swing.SwingUtilities; 20 20 21 import org.expeditee. gui.AttributeUtils;21 import org.expeditee.actions.Actions; 22 22 import org.expeditee.gui.Browser; 23 23 import org.expeditee.gui.DisplayIO; … … 184 184 String classname = tokens[0]; 185 185 if (classname.charAt(0) == '$') 186 classname = "org.expeditee.items.widgets." + classname.substring(1);186 classname = Actions.getClassName(classname.substring(1)); 187 187 // Attempt to locate the class using reflection 188 188 Class<?> iwclass = findIWidgetClass(classname); -
trunk/src/org/expeditee/items/widgets/charts/TimeSeries.java
r284 r286 211 211 .length()) { 212 212 df = new SimpleDateFormat(FrameKeyboardActions.LONG_DATE_FORMAT); 213 } else { 213 } else if (dateString.length() <= FrameKeyboardActions.TIME_DATE_FORMAT.length()) { 214 df = new SimpleDateFormat(FrameKeyboardActions.TIME_DATE_FORMAT); 215 }else { 214 216 df = new SimpleDateFormat(FrameKeyboardActions.SHORT_DATE_FORMAT); 215 217 }
Note:
See TracChangeset
for help on using the changeset viewer.