- Timestamp:
- 08/25/08 15:19:25 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r275 r278 28 28 import org.expeditee.items.Item; 29 29 import org.expeditee.items.ItemUtils; 30 import org.expeditee.items.Text; 30 31 31 32 /** … … 304 305 // separate method name and parameter names 305 306 String mname = getName(command); 306 if (command.length() > mname.length()) 307 command = command.substring(mname.length() + 1); 308 else 309 command = ""; 307 command = command.substring(mname.length()).trim(); 308 //If no params are provided get them from a text item on the cursor 309 if(command.length() == 0 && launcher instanceof Text){ 310 command = launcher.getText(); 311 } 310 312 311 313 // Strip off the @ from annotation items -
trunk/src/org/expeditee/actions/Misc.java
r270 r278 16 16 import javax.imageio.ImageIO; 17 17 18 import org.expeditee.importer.FrameDNDTransferHandler;19 18 import org.expeditee.gui.DisplayIO; 20 19 import org.expeditee.gui.Frame; … … 24 23 import org.expeditee.gui.MessageBay; 25 24 import org.expeditee.gui.TimeKeeper; 25 import org.expeditee.importer.FrameDNDTransferHandler; 26 26 import org.expeditee.items.Dot; 27 27 import org.expeditee.items.Item; … … 30 30 import org.expeditee.items.Text; 31 31 import org.expeditee.math.ExpediteeJEP; 32 import org.expeditee.simple.SString; 32 33 import org.expeditee.stats.CometStats; 33 34 import org.expeditee.stats.SessionStats; … … 759 760 } 760 761 762 public static void attachToCursor(Collection<Item> items) { 763 for (Item i : items) { 764 i.setParent(null); 765 } 766 FrameMouseActions.pickup(items); 767 FrameGraphics.Repaint(); 768 } 769 761 770 public static void importFiles(Item item) { 762 771 List<File> files = new LinkedList<File>(); … … 786 795 } 787 796 788 public static void createShape(Item item, int sides) { 797 public static Item createPolygon(Item item, int sides) { 798 if (item instanceof Text) { 799 try { 800 SString s = new SString(item.getText()); 801 sides = s.integerValue().intValue(); 802 } catch (NumberFormatException e) { 803 } 804 } 805 789 806 if (sides < 3) { 790 807 MessageBay.errorMessage("Shapes must have at least 3 sides"); 791 808 } 792 double angle = 180 - ((sides - 2) * 180.0F) / sides;809 double angle = -(180 - ((sides - 2) * 180.0F) / sides); 793 810 double curAngle = 0; 794 811 double size = 50F; … … 824 841 825 842 current.addAllItems(newItems); 826 d[0].setThickness(item.getThickness()); 827 d[0].setFillColor(item.getFillColor()); 828 d[0].setColor(item.getColor()); 843 if(item instanceof Text){ 844 for(Item i: item.getAllConnected()){ 845 if(i instanceof Line){ 846 item = i; 847 break; 848 } 849 } 850 } 851 852 if (!(item instanceof Text)) { 853 d[0].setThickness(item.getThickness()); 854 d[0].setFillColor(item.getFillColor()); 855 d[0].setColor(item.getColor()); 856 } 829 857 830 858 ItemUtils.EnclosedCheck(newItems); 831 859 FrameGraphics.refresh(false); 860 861 return d[0]; 832 862 } 833 863 } -
trunk/src/org/expeditee/gui/DisplayIO.java
r247 r278 500 500 // Set the new frame 501 501 _CurrentFrames[getCurrentSide()] = frame; 502 frame.refreshSize( FrameGraphics.getMaxFrameSize());502 frame.refreshSize(); 503 503 // Notify items on the frame being displayed that they are in view 504 504 // ie. widgets use this method to add themselves to the content pane … … 745 745 _VisitedFrames[opposite].add(hiding.getName()); 746 746 _CurrentFrames[opposite] = null; 747 _CurrentFrames[current].refreshSize( FrameGraphics.getMaxFrameSize());747 _CurrentFrames[current].refreshSize(); 748 748 } 749 749 if (_CurrentFrames[current] != null) 750 _CurrentFrames[current].refreshSize( FrameGraphics.getMaxFrameSize());750 _CurrentFrames[current].refreshSize(); 751 751 if (_CurrentFrames[opposite] != null) 752 752 _CurrentFrames[opposite] 753 .refreshSize( FrameGraphics.getMaxFrameSize());753 .refreshSize(); 754 754 755 755 FrameGraphics.Clear(); -
trunk/src/org/expeditee/gui/Frame.java
r247 r278 709 709 } 710 710 711 public void refreshSize(Dimension size) { 712 assert (size != null); 713 int height = size.height; 714 int width = size.width; 711 public void refreshSize() { 712 //assert (size != null); 715 713 boolean bReparse = false; 716 714 for (Item i : getItems()) { … … 718 716 Float anchorRight = i.getAnchorRight(); 719 717 if (anchorRight != null) { 720 i.set X(width -anchorRight);718 i.setAnchorRight(anchorRight); 721 719 if (i.hasVector()) { 722 720 bReparse = true; … … 724 722 } 725 723 if (anchorBottom != null) { 726 i.set Y(height -anchorBottom);724 i.setAnchorBottom(anchorBottom); 727 725 if (i.hasVector()) { 728 726 bReparse = true; … … 730 728 } 731 729 } 730 731 //Do the anchors on the overlays 732 for(Overlay o: getOverlays()){ 733 o.Frame.refreshSize(); 734 } 735 732 736 if (bReparse) { 733 737 FrameUtils.Parse(this, false); -
trunk/src/org/expeditee/gui/FrameCreator.java
r247 r278 20 20 21 21 // Master copy of next & previous links 22 private Item _Mnext = new Text("@Next");23 24 private Item _Mprev = new Text("@Previous");22 private Item _Mnext; 23 24 private Item _Mprev; 25 25 26 26 // Next and previous links for the current frame … … 36 36 } 37 37 38 /** 39 * Creates a text item that looks like a clickable button. 40 * 41 * @param text 42 * the caption for the button 43 * @param x 44 * the x position for the button. Null if the button is anchored 45 * to the right of the screen. 46 * @param y 47 * the y position for the button. Null if the button is anchored 48 * to the bottom of the scree. 49 * @param right 50 * the distance the button is anchored from the right of this 51 * screen. Null if an absolute position is used. 52 * @param bottom 53 * the distance the button is to be anchored from the bottom of 54 * the screen. Null if the button is given an absolute position. 55 * @return the newly created button. 56 */ 57 public Item createButton(String text, Float x, Float y, Float right, 58 Float bottom) { 59 Item button = new Text(text); 60 button.setBackgroundColor(Color.LIGHT_GRAY); 61 button.setBorderColor(Color.DARK_GRAY); 62 button.setThickness(2.0F); 63 if (bottom != null) 64 button.setAnchorBottom(bottom); 65 if (x != null) 66 button.setX(x); 67 if (right != null) 68 button.setAnchorRight(15F); 69 if (y != null) 70 button.setY(y); 71 72 return button; 73 } 74 38 75 public FrameCreator(String name, String path, String frameTitle, 39 76 boolean recreate) { 77 _Mnext = createButton("@Next", null, null, 15F, 15F); 78 _Mprev = createButton("@Previous", 30F, null, null, 15F); 79 40 80 Frame toUse = null; 41 81 try { … … 50 90 _first = toUse; 51 91 // set positions of next\prev frame links 52 _Mnext.setPosition(FrameGraphics.getMaxSize().width - 100,53 54 _Mprev.setPosition(50, FrameGraphics.getMaxSize().height - 15);92 // _Mnext.setPosition(FrameGraphics.getMaxSize().width - 100, 93 // FrameGraphics.getMaxSize().height - 15); 94 // _Mprev.setPosition(50, FrameGraphics.getMaxSize().height - 15); 55 95 } 56 96 -
trunk/src/org/expeditee/gui/FrameGraphics.java
r242 r278 131 131 if (current != null) { 132 132 current.setBuffer(null); 133 current.refreshSize( getMaxFrameSize());133 current.refreshSize(); 134 134 if (DisplayIO.isTwinFramesOn()) { 135 135 Frame opposite = DisplayIO.getOppositeFrame(); 136 136 //if (opposite != null) { 137 137 opposite.setBuffer(null); 138 opposite.refreshSize( getMaxFrameSize());138 opposite.refreshSize(); 139 139 //} 140 140 } -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r247 r278 1502 1502 float current = Math.abs(line.getThickness()); 1503 1503 current = Math.max(current + diff, Item.MINIMUM_THICKNESS); 1504 line. setThickness(current);1504 line.getStartItem().setThickness(current); 1505 1505 FrameGraphics.Repaint(); 1506 1506 return; … … 1541 1541 } 1542 1542 } 1543 FrameGraphics. Repaint();1543 FrameGraphics.refresh(true); 1544 1544 return; 1545 1545 } … … 1577 1577 toSet.getParent().setChanged(true); 1578 1578 1579 FrameGraphics. Repaint();1579 FrameGraphics.refresh(true); 1580 1580 } 1581 1581 -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r276 r278 1591 1591 MouseX = e.getX(); 1592 1592 MouseY = e.getY(); 1593 //System.out.println(MouseX + "," + MouseY); 1593 1594 1594 1595 // Moving the mouse a certain distance removes the last edited text if -
trunk/src/org/expeditee/items/Dot.java
r188 r278 11 11 import org.expeditee.gui.DisplayIO; 12 12 import org.expeditee.gui.Frame; 13 import org.expeditee.gui.FrameGraphics; 13 14 import org.expeditee.gui.FrameKeyboardActions; 14 15 … … 62 63 } 63 64 64 /**65 * Sets the 'thickness' of this Dot, that is, how many pixels this Dot66 * should be.67 *68 * @param thick69 * The number of pixels to use when displaying this Dot The Dot70 * is displayed as a thick x thick square.71 */72 @Override73 public void setThickness(float thick) {74 super.setThickness(thick);75 76 updatePolygon();77 }78 79 65 @Override 80 66 public void setColor(Color c) { … … 84 70 for (Line line : getLines()) 85 71 line.setColor(c); 72 } 73 74 @Override 75 public void setAnchorBottom(Float anchor) { 76 if(!isLineEnd()){ 77 super.setAnchorBottom(anchor); 78 return; 79 } 80 invalidateFill(); 81 invalidateCommonTrait(ItemAppearence.PreMoved); 82 int oldY = getY(); 83 if (anchor != null) { 84 float deltaY = FrameGraphics.getMaxFrameSize().height - anchor 85 - getBoundsHeight() - oldY; 86 //Check for a more efficient way to do this!! 87 //Invalidate all the items 88 for (Item i : this.getAllConnected()) { 89 i.invalidateAll(); 90 } 91 //Move the items 92 for (Item i : this.getAllConnected()) { 93 if (i.isLineEnd()){ 94 i.setAnchorBottom(null); 95 i.setXY(i.getX(), i.getY() + deltaY); 96 i.updatePolygon(); 97 i.invalidateAll(); 98 } 99 } 100 //Invalidate them again!! 101 for (Item i : this.getAllConnected()) { 102 i.invalidateAll(); 103 } 104 } 105 this._anchorBottom = anchor; 106 invalidateCommonTrait(ItemAppearence.PostMoved); 107 invalidateFill(); 108 } 109 110 @Override 111 public void setAnchorRight(Float anchor) { 112 if(!isLineEnd()){ 113 super.setAnchorRight(anchor); 114 return; 115 } 116 invalidateFill(); 117 invalidateCommonTrait(ItemAppearence.PreMoved); 118 int oldX = getX(); 119 if (anchor != null) { 120 float deltaX = FrameGraphics.getMaxFrameSize().width - anchor 121 - getBoundsWidth() - oldX; 122 //Check for a more efficient way to do this!! 123 //Invalidate all the items 124 for (Item i : this.getAllConnected()) { 125 i.invalidateAll(); 126 } 127 //Move the items 128 for (Item i : this.getAllConnected()) { 129 if (i.isLineEnd()){ 130 i.setAnchorRight(null); 131 i.setXY(i.getX() + deltaX, i.getY()); 132 i.updatePolygon(); 133 i.invalidateAll(); 134 } 135 } 136 //Invalidate them again!! 137 for (Item i : this.getAllConnected()) { 138 i.invalidateAll(); 139 } 140 } 141 this._anchorRight = anchor; 142 invalidateCommonTrait(ItemAppearence.PostMoved); 143 invalidateFill(); 86 144 } 87 145 -
trunk/src/org/expeditee/items/Item.java
r247 r278 182 182 dest.setArrow(source.getArrowheadLength(), source.getArrowheadRatio()); 183 183 184 dest.setAnchorBottom(source.getAnchorBottom()); 185 dest.setAnchorRight(source.getAnchorRight()); 186 184 187 dest.setFormula(source.getFormula()); 185 188 dest.setParent(source.getParent()); … … 215 218 } 216 219 217 pr ivateFloat _anchorRight = null;218 219 pr ivateFloat _anchorBottom = null;220 protected Float _anchorRight = null; 221 222 protected Float _anchorBottom = null; 220 223 221 224 protected HighlightMode _mode = HighlightMode.None; … … 1057 1060 Frame sourceFrame = null; 1058 1061 Item sourceItem = FreeItems.getItemAttachedToCursor(); 1062 1059 1063 if (sourceItem == null) { 1060 1064 sourceItem = this; 1065 }else{ 1066 for(Item i: sourceItem.getAllConnected()){ 1067 if(i instanceof Text){ 1068 sourceItem = i; 1069 break; 1070 } 1071 } 1061 1072 } 1062 1073 … … 1081 1092 FreeItems.getInstance().clear(); 1082 1093 if (returnValue instanceof Item) { 1083 Misc.attachToCursor(( Item) returnValue);1094 Misc.attachToCursor(((Item) returnValue).getAllConnected()); 1084 1095 } else { 1085 1096 Misc.attachStatsToCursor(returnValue.toString()); … … 2530 2541 this._anchorRight = anchor; 2531 2542 if (anchor != null) 2532 setX(FrameGraphics.getMaxFrameSize().width - anchor );2543 setX(FrameGraphics.getMaxFrameSize().width - anchor - getBoundsWidth()); 2533 2544 } 2534 2545 … … 2540 2551 this._anchorBottom = anchor; 2541 2552 if (anchor != null) 2542 setY(FrameGraphics.getMaxFrameSize().height - anchor );2553 setY(FrameGraphics.getMaxFrameSize().height - anchor - getBoundsHeight()); 2543 2554 } 2544 2555 -
trunk/src/org/expeditee/items/Line.java
r247 r278 79 79 if (thick < 0) 80 80 setThickness(DEFAULT_THICKNESS); 81 else{ 82 refreshStroke(thick); 83 } 84 85 } 86 87 private void refreshStroke(float thick) { 88 int[] pattern = _start.getLinePattern(); 89 if (pattern == null) 90 pattern = _end.getLinePattern(); 91 92 if (pattern != null) { 93 float[] dash = new float[pattern.length]; 94 for (int i = 0; i < pattern.length; i++) 95 dash[i] = (float) pattern[i]; 96 _lineStroke = new BasicStroke(Math.max(thick, 97 MINIMUM_PAINT_THICKNESS), CAP, JOIN, 10f, dash, 0.0f); 98 } else { 99 _lineStroke = new BasicStroke(Math.max(thick, 100 MINIMUM_PAINT_THICKNESS), CAP, JOIN); 101 } 102 103 updatePolygon(); 81 104 } 82 105 … … 605 628 } 606 629 607 int[] pattern = _start.getLinePattern(); 608 if (pattern == null) 609 pattern = _end.getLinePattern(); 610 611 if (pattern != null) { 612 float[] dash = new float[pattern.length]; 613 for (int i = 0; i < pattern.length; i++) 614 dash[i] = (float) pattern[i]; 615 _lineStroke = new BasicStroke(Math.max(thick, 616 MINIMUM_PAINT_THICKNESS), CAP, JOIN, 10f, dash, 0.0f); 617 } else { 618 _lineStroke = new BasicStroke(Math.max(thick, 619 MINIMUM_PAINT_THICKNESS), CAP, JOIN); 620 } 621 622 updatePolygon(); 630 refreshStroke(thick); 623 631 624 632 if (bigger) -
trunk/src/org/expeditee/items/Text.java
r247 r278 286 286 */ 287 287 public void prependText(String text) { 288 288 289 289 _text.insert(0, text); 290 290 rebuild(false); … … 300 300 public void removeText(String text) { 301 301 if (_text.length() > 0 && _text.indexOf(text) == 0) { 302 // Need the invalidate all for dateStamp toggling302 // Need the invalidate all for dateStamp toggling 303 303 invalidateAll(); 304 304 _text.delete(0, text.length()); … … 1393 1393 if (getBackgroundColor() != null) { 1394 1394 Color bgc = getBackgroundColor(); 1395 if (_alpha > 0) {1395 if (_alpha > 0) { 1396 1396 bgc = new Color(bgc.getRed(), bgc.getGreen(), bgc.getBlue(), 1397 1397 _alpha); 1398 1398 } 1399 1399 g.setColor(bgc); 1400 1400 1401 1401 Color gradientColor = getGradientColor(); 1402 1402 if (gradientColor != null) { … … 1411 1411 } 1412 1412 } 1413 1413 1414 1414 g.fillPolygon(getPolygon()); 1415 1415 } … … 1862 1862 String lowercaseFormula = formula.toLowerCase(); 1863 1863 ExpediteeJEP myParser = new ExpediteeJEP(); 1864 1864 1865 1865 int nextVarNo = 1; 1866 1866 1867 1867 // Add variables from the containing rectangle if the item being 1868 1868 // calculated is inside the enclosing rectangle 1869 1869 Collection<Item> enclosed = getItemsInSameEnclosure(); 1870 1870 for (Item i : enclosed) { 1871 if (i == this)1871 if (i == this) 1872 1872 continue; 1873 1873 if (i instanceof Text && !i.isAnnotation()) { … … 1875 1875 if (pair.hasPair()) { 1876 1876 try { 1877 double value = pair 1878 .getDoubleValue(); 1877 double value = pair.getDoubleValue(); 1879 1878 myParser.addVariable(pair.getAttribute(), value); 1880 // myParser.addVariable("$" + nextVarNo++, value);1879 // myParser.addVariable("$" + nextVarNo++, value); 1881 1880 } catch (NumberFormatException nfe) { 1882 1881 continue; … … 1884 1883 e.printStackTrace(); 1885 1884 } 1886 } else{1885 } else { 1887 1886 try { 1888 double value = pair 1889 .getDoubleValue(); 1887 double value = pair.getDoubleValue(); 1890 1888 myParser.addVariable("$" + nextVarNo++, value); 1891 1889 } catch (NumberFormatException nfe) { … … 1969 1967 */ 1970 1968 public boolean recalculateWhenChanged() { 1971 if (/*!isAnnotation() 1972 && */(hasFormula() || getText().contains(":") || isLineEnd())) 1969 if (/* 1970 * !isAnnotation() && 1971 */(hasFormula() || getText().contains(":") || isLineEnd())) 1973 1972 return true; 1974 1973 try { … … 1983 1982 return getLineDrop(_textLayouts.get(0)); 1984 1983 } 1984 1985 @Override 1986 public void setAnchorRight(Float anchor) { 1987 if (!isLineEnd()) { 1988 super.setAnchorRight(anchor); 1989 // Subtract off the link width 1990 if (anchor != null) { 1991 setX(FrameGraphics.getMaxFrameSize().width - anchor 1992 - getBoundsWidth() + getLeftMargin()); 1993 } 1994 return; 1995 } 1996 invalidateFill(); 1997 invalidateCommonTrait(ItemAppearence.PreMoved); 1998 int oldX = getX(); 1999 if (anchor != null) { 2000 float deltaX = FrameGraphics.getMaxFrameSize().width - anchor 2001 - getBoundsWidth() + getLeftMargin() - oldX; 2002 // Check for a more efficient way to do this!! 2003 // Invalidate all the items 2004 for (Item i : this.getAllConnected()) { 2005 i.invalidateAll(); 2006 } 2007 // Move the items 2008 for (Item i : this.getAllConnected()) { 2009 if (i.isLineEnd()) { 2010 i.setAnchorRight(null); 2011 i.setXY(i.getX() + deltaX, i.getY()); 2012 } 2013 } 2014 // Invalidate them again!! 2015 for (Item i : this.getAllConnected()) { 2016 i.updatePolygon(); 2017 i.invalidateAll(); 2018 } 2019 } 2020 this._anchorRight = anchor; 2021 invalidateCommonTrait(ItemAppearence.PostMoved); 2022 invalidateFill(); 2023 } 2024 2025 @Override 2026 public void setAnchorBottom(Float anchor) { 2027 if(!isLineEnd()){ 2028 super.setAnchorBottom(anchor); 2029 return; 2030 } 2031 invalidateFill(); 2032 invalidateCommonTrait(ItemAppearence.PreMoved); 2033 int oldY = getY(); 2034 if (anchor != null) { 2035 float deltaY = FrameGraphics.getMaxFrameSize().height - anchor 2036 - getBoundsHeight() - oldY; 2037 //Check for a more efficient way to do this!! 2038 //Invalidate all the items 2039 for (Item i : this.getAllConnected()) { 2040 i.invalidateAll(); 2041 } 2042 //Move the items 2043 for (Item i : this.getAllConnected()) { 2044 if (i.isLineEnd()){ 2045 i.setAnchorBottom(null); 2046 i.setXY(i.getX(), i.getY() + deltaY); 2047 i.updatePolygon(); 2048 i.invalidateAll(); 2049 } 2050 } 2051 //Invalidate them again!! 2052 for (Item i : this.getAllConnected()) { 2053 i.invalidateAll(); 2054 } 2055 } 2056 this._anchorBottom = anchor; 2057 invalidateCommonTrait(ItemAppearence.PostMoved); 2058 invalidateFill(); 2059 } 1985 2060 } -
trunk/src/org/expeditee/items/XRayable.java
r242 r278 202 202 } 203 203 204 @Override 205 public void setAnchorBottom(Float anchor) { 206 _source.setAnchorBottom(anchor); 207 } 208 209 @Override 210 public void setAnchorRight(Float anchor) { 211 _source.setAnchorRight(anchor); 212 } 213 204 214 public boolean refresh(){ 205 215 return true; -
trunk/src/org/expeditee/items/widgets/InteractiveWidget.java
r277 r278 1155 1155 if (_textRepresentation.getLink() != null 1156 1156 || _textRepresentation.hasAction()) { 1157 1157 //System.out.println("Painted link"); 1158 1158 _textRepresentation.paintLinkGraphic(g, getLinkX(), getLinkY()); 1159 1159 … … 1264 1264 * Invalidates the link for this widget - if it has one. 1265 1265 */ 1266 void invalidateLink() {1266 protected void invalidateLink() { 1267 1267 if (_textRepresentation.getLink() != null 1268 1268 || _textRepresentation.hasAction()) { … … 1589 1589 _textRepresentation.setData(data); 1590 1590 } 1591 1592 protected Point getOrigin() { 1593 return _d1.getPosition(); 1594 } 1595 1596 protected Item getFirstCorner() { 1597 return _d1; 1598 } 1591 1599 } -
trunk/src/org/expeditee/items/widgets/WidgetCorner.java
r228 r278 31 31 @Override 32 32 public void setPosition(float x, float y) { 33 34 33 invalidateFill(); 35 34 if (_widgetSource != null) { // _widgetSource == null on construction … … 54 53 } 55 54 56 @Override57 public void translate(Point2D origin, double ratio) {58 //super.translate(origin, ratio);59 }55 // @Override 56 // public void translate(Point2D origin, double ratio) { 57 // super.translate(origin, ratio); 58 // } 60 59 61 60 @Override -
trunk/src/org/expeditee/items/widgets/charts/AbstractChart.java
r228 r278 3 3 import java.awt.BasicStroke; 4 4 import java.awt.Color; 5 import java.awt.Component; 5 6 import java.awt.Font; 6 7 import java.awt.Paint; 8 import java.awt.Point; 7 9 import java.awt.event.KeyEvent; 8 10 import java.awt.event.KeyListener; 11 import java.awt.event.MouseEvent; 12 import java.awt.event.MouseListener; 9 13 import java.util.Collection; 10 14 import java.util.LinkedHashMap; … … 15 19 import org.expeditee.gui.ColorUtils; 16 20 import org.expeditee.gui.Frame; 21 import org.expeditee.gui.FrameGraphics; 17 22 import org.expeditee.gui.FrameIO; 23 import org.expeditee.gui.FrameKeyboardActions; 24 import org.expeditee.gui.FrameMouseActions; 18 25 import org.expeditee.gui.FunctionKey; 19 26 import org.expeditee.items.Item; … … 70 77 int index = e.getKeyCode() - KeyEvent.VK_F1 + 1; 71 78 // Make sure the key is within range 72 if (index < 0 || index >= FunctionKey.values().length) 79 if (index < 0 || index >= FunctionKey.values().length) { 73 80 return; 81 } 74 82 75 83 FunctionKey key = FunctionKey.values()[index]; 76 84 switch (key) { 77 85 case SizeUp: 78 // FrameKeyboardActions.SetSize(firstItem, 1, false, true); 86 invalidateLink(); 87 FrameKeyboardActions.SetSize(getFirstCorner(), 1, false, true); 88 invalidateSelf(); 89 FrameGraphics.refresh(true); 90 //FrameGraphics.requestRefresh(true); 79 91 break; 80 92 case SizeDown: 81 // FrameKeyboardActions.SetSize(firstItem, -1, false, true); 93 invalidateLink(); 94 FrameKeyboardActions.SetSize(getFirstCorner(), -1, false, true); 95 invalidateSelf(); 96 FrameGraphics.refresh(true); 97 //FrameGraphics.ForceRepaint(); 98 //FrameGraphics.refresh(true); 99 //FrameGraphics.requestRefresh(true); 82 100 break; 83 101 case ChangeColor: … … 110 128 111 129 public void keyTyped(KeyEvent e) { 112 } 130 FrameKeyboardActions.processChar(e.getKeyChar(), e 131 .isShiftDown()); 132 } 133 }); 134 cp.addMouseListener(new MouseListener() { 135 136 public void mouseClicked(MouseEvent e) { 137 FrameMouseActions.getInstance().mouseClicked(translateEvent(e)); 138 } 139 140 public void mouseEntered(MouseEvent e) { 141 // FrameMouseActions.getInstance().mouseEntered(translateEvent(e)); 142 } 143 144 public void mouseExited(MouseEvent e) { 145 // FrameMouseActions.getInstance().mouseExited(translateEvent(e)); 146 } 147 148 public void mousePressed(MouseEvent e) { 149 FrameMouseActions.getInstance().mousePressed(translateEvent(e)); 150 } 151 152 private MouseEvent translateEvent(MouseEvent e) { 153 Point origin = getOrigin(); 154 return new MouseEvent((Component) e.getSource(), e.getID(), e 155 .getWhen(), e.getModifiers(), origin.x + e.getX(), 156 origin.y + e.getY(), e.getXOnScreen(), 157 e.getYOnScreen(), e.getClickCount(), false, e 158 .getButton()); 159 } 160 161 public void mouseReleased(MouseEvent e) { 162 FrameMouseActions.getInstance() 163 .mouseReleased(translateEvent(e)); 164 } 165 113 166 }); 114 167 super._swingComponent = cp; … … 316 369 legend.setLegendItemGraphicPadding(new RectangleInsets(pad2, pad2, 317 370 pad2, pad2)); 318 legend.setMargin(newThickness,newThickness,newThickness,newThickness); 371 legend.setMargin(newThickness, newThickness, newThickness, 372 newThickness); 319 373 } 320 374 float pad0 = newThickness - 1;
Note:
See TracChangeset
for help on using the changeset viewer.