Changeset 1159 for trunk/src/org/expeditee/items/widgets
- Timestamp:
- 09/21/18 13:45:34 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/Widget.java
r1143 r1159 148 148 * "org.expeditee.items." 149 149 */ 150 public static Widget createWidget( Text source) throws InteractiveWidgetNotAvailableException,150 public static Widget createWidget(final Text source) throws InteractiveWidgetNotAvailableException, 151 151 InteractiveWidgetInitialisationFailedException 152 152 { 153 153 154 if (source == null) throw new NullPointerException("source"); 155 156 if (source.getParent() == null) throw new IllegalArgumentException("source's parent is null, InteractiveWidget's must be created from Text items with non-null parents"); 157 158 String TAG = ItemUtils.GetTag(ItemUtils.TAG_IWIDGET); 154 if (source == null) { 155 throw new NullPointerException("source"); 156 } 157 158 if (source.getParent() == null) { 159 throw new IllegalArgumentException("source's parent is null, InteractiveWidget's must be created from Text items with non-null parents"); 160 } 161 162 final String TAG = ItemUtils.GetTag(ItemUtils.TAG_IWIDGET); 159 163 160 164 String text = source.getText(); … … 166 170 167 171 // Check starts with the widget tag and separator 168 if (!text.startsWith(TAG + ":")) throw new IllegalArgumentException("Source text must begin with \"" + TAG + ":\""); 172 if (!text.startsWith(TAG + ":")) { 173 throw new IllegalArgumentException("Source text must begin with \"" + TAG + ":\""); 174 } 169 175 170 176 // skip over the '@iw:' preamble … … 191 197 // 192 198 193 String tokens_str = (index == -1) ? text : text.substring(0, index);199 final String tokens_str = (index == -1) ? text : text.substring(0, index); 194 200 195 201 String[] tokens = Text.parseArgsApache(tokens_str); … … 203 209 204 210 // create the command line parser 205 CommandLineParser parser = new GnuParser();211 final CommandLineParser parser = new GnuParser(); 206 212 207 213 // create the Options 208 Options options = new Options();214 final Options options = new Options(); 209 215 options.addOption( "al", "anchorleft", true, "Anchor the vertical left-hand edge of the interactive widget to the value provided " ); 210 216 options.addOption( "ar", "anchorright", true, "Anchor the vertical right-hand edge of the interactive widget to the value provided " ); … … 259 265 260 266 } 261 catch( ParseException exp ) {267 catch( final ParseException exp ) { 262 268 System.err.println( "Unexpected exception:" + exp.getMessage() ); 263 269 core_line = null; … … 265 271 } 266 272 267 HelpFormatter formatter = new HelpFormatter();268 StringWriter usage_str_writer = new StringWriter();269 PrintWriter printWriter = new PrintWriter(usage_str_writer);273 final HelpFormatter formatter = new HelpFormatter(); 274 final StringWriter usage_str_writer = new StringWriter(); 275 final PrintWriter printWriter = new PrintWriter(usage_str_writer); 270 276 271 277 String widget_name = tokens[0]; … … 296 302 } 297 303 298 } catch ( NumberFormatException nfe) {304 } catch (final NumberFormatException nfe) { 299 305 throw new IllegalArgumentException( 300 306 "Bad width or height given in source text", nfe); 301 307 } 302 308 303 if (tokens.length > 3) 309 if (tokens.length > 3) { 304 310 throw new IllegalArgumentException( 305 311 "to many arguments given before \":\" in source text"); 312 } 306 313 307 314 String classname = tokens[0]; … … 311 318 312 319 // Attempt to locate the class using reflection 313 Class<?> iwclass = findIWidgetClass(classname);314 315 if (iwclass == null) // ensure it exists320 final Class<?> iwclass = findIWidgetClass(classname); 321 322 if (iwclass == null) { 316 323 throw new InteractiveWidgetNotAvailableException(classname 317 324 + " does not exist or is not an InteractiveWidget"); 325 } 318 326 319 327 … … 329 337 if (index > 0) { // index of the first ":" 330 338 if (text.length()>(index+1)) { 331 String args_str = text.substring(index + 1);339 final String args_str = text.substring(index + 1); 332 340 333 341 args = Text.parseArgsApache(args_str); … … 339 347 try { 340 348 // Instantiate the widget - passing the params 341 Class parameterTypes[] = new Class[] { Text.class, String[].class };342 Constructor ct = iwclass.getConstructor(parameterTypes);343 344 Object arglist[] = new Object[] { source, args };349 final Class parameterTypes[] = new Class[] { Text.class, String[].class }; 350 final Constructor ct = iwclass.getConstructor(parameterTypes); 351 352 final Object arglist[] = new Object[] { source, args }; 345 353 346 354 inst = (Widget) ct.newInstance(arglist); 347 } catch ( Exception e) {355 } catch (final Exception e) { 348 356 throw new InteractiveWidgetNotAvailableException( 349 357 "Failed to create instance via reflection: " + e.toString(), … … 352 360 353 361 // Check that the widget is suitable for the current platform 354 Ecosystem systemType = EcosystemManager.getType();362 final Ecosystem systemType = EcosystemManager.getType(); 355 363 if (!inst.isSupportedOnEcosystem(systemType)) { 356 364 // Try create a JavaFXSwingWidget if creating a Swing widget in JavaFX … … 383 391 384 392 if(core_line.hasOption( "anchorleft" ) ) { 385 String al_str = core_line.getOptionValue( "anchorleft" );393 final String al_str = core_line.getOptionValue( "anchorleft" ); 386 394 387 395 anchor_left = (int) Float.parseFloat(al_str); … … 389 397 390 398 if(core_line.hasOption( "anchorright" ) ) { 391 String ar_str = core_line.getOptionValue( "anchorright" );399 final String ar_str = core_line.getOptionValue( "anchorright" ); 392 400 393 401 anchor_right = (int) Float.parseFloat(ar_str); … … 395 403 396 404 if(core_line.hasOption( "anchortop" ) ) { 397 String at_str = core_line.getOptionValue( "anchortop" );405 final String at_str = core_line.getOptionValue( "anchortop" ); 398 406 399 407 anchor_top = (int) Float.parseFloat(at_str); … … 401 409 402 410 if(core_line.hasOption( "anchorbottom" ) ) { 403 String ab_str = core_line.getOptionValue( "anchorbottom" );411 final String ab_str = core_line.getOptionValue( "anchorbottom" ); 404 412 405 413 anchor_bottom = (int) Float.parseFloat(ab_str); … … 420 428 private static Class findIWidgetClass(String classname) 421 429 { 422 if(classname == null) 430 if(classname == null) { 423 431 return null; 432 } 424 433 // try just the classname 425 434 try { 426 Class c = Class.forName(classname); // attempt to find the class435 final Class c = Class.forName(classname); // attempt to find the class 427 436 428 437 // If one is found, ensure that it is a descendant of an … … 431 440 && superclass != Item.class; superclass = superclass 432 441 .getSuperclass()) { 433 if (superclass == Widget.class) 442 if (superclass == Widget.class) { 434 443 return c; 435 } 436 437 } catch (ClassNotFoundException e) { 444 } 445 } 446 447 } catch (final ClassNotFoundException e) { 438 448 } 439 449 // see if the class is a widget with invalid capitalisation, or missing the widget package prefix … … 442 452 } 443 453 try { 444 Class c = Class.forName(Actions.getClassName(classname)); // attempt to find the class454 final Class c = Class.forName(Actions.getClassName(classname)); // attempt to find the class 445 455 446 456 // If one is found, ensure that it is a descendant of an … … 449 459 && superclass != Item.class; superclass = superclass 450 460 .getSuperclass()) { 451 if (superclass == Widget.class) 461 if (superclass == Widget.class) { 452 462 return c; 453 } 454 455 } catch (ClassNotFoundException e) { 463 } 464 } 465 466 } catch (final ClassNotFoundException e) { 456 467 } 457 468 … … 522 533 * 523 534 */ 524 protected Widget(Text source, int minWidth, int maxWidth, int minHeight, int maxHeight) 525 { 526 if (source == null) throw new NullPointerException("source"); 535 protected Widget(final Text source, final int minWidth, final int maxWidth, final int minHeight, final int maxHeight) 536 { 537 if (source == null) { 538 throw new NullPointerException("source"); 539 } 527 540 if (source.getParent() == null) { 528 541 throw new IllegalArgumentException("source's parent is null, InteractiveWidget's must be created from Text items with non-null parents"); … … 533 546 setSizeRestrictions(minWidth, maxWidth, minHeight, maxHeight); // throws IllegalArgumentException's 534 547 535 int x = source.getX();536 int y = source.getY();537 int width = (int) ((_minWidth < 0) ? 10 : _minWidth);538 int height = (int) ((_minHeight < 0) ? 10 : _minHeight);539 540 Frame idAllocator = _textRepresentation.getParent();548 final int x = source.getX(); 549 final int y = source.getY(); 550 final int width = (_minWidth < 0) ? 10 : _minWidth; 551 final int height = (_minHeight < 0) ? 10 : _minHeight; 552 553 final Frame idAllocator = _textRepresentation.getParent(); 541 554 542 555 // create WidgetCorners … … 552 565 _l4 = new WidgetEdge(_d4, _d1, idAllocator.getNextItemID(), this); 553 566 554 Collection<Item> enclist = new ArrayList<Item>(4);567 final Collection<Item> enclist = new ArrayList<Item>(4); 555 568 enclist.add(_d1); 556 569 enclist.add(_d2); … … 601 614 * 602 615 */ 603 private void setSizeRestrictions( int minWidth, int maxWidth, int minHeight,int maxHeight)616 private void setSizeRestrictions(final int minWidth, final int maxWidth, final int minHeight, final int maxHeight) 604 617 { 605 618 _minWidth = minWidth; … … 649 662 public Widget copy() throws InteractiveWidgetNotAvailableException, InteractiveWidgetInitialisationFailedException 650 663 { 651 Text t = _textRepresentation.copy();652 String clonedAnnotation = getAnnotationString();664 final Text t = _textRepresentation.copy(); 665 final String clonedAnnotation = getAnnotationString(); 653 666 t.setText(clonedAnnotation); 654 667 t.setData(getData()); … … 664 677 Frame parent = getParentFrame(); 665 678 666 if (parent == null) parent = DisplayController.getCurrentFrame(); 679 if (parent == null) { 680 parent = DisplayController.getCurrentFrame(); 681 } 667 682 668 683 if (parent != null) { 669 for ( Item i : _expediteeItems) {684 for (final Item i : _expediteeItems) { 670 685 i.setID(parent.getNextItemID()); 671 686 } … … 684 699 // Build the annotation string such that it represents this widgets 685 700 // current state 686 String newAnnotation = getAnnotationString();701 final String newAnnotation = getAnnotationString(); 687 702 688 703 // Set the new text … … 712 727 713 728 // Create tag and append classname 714 StringBuilder sb = new StringBuilder(ItemUtils.GetTag(ItemUtils.TAG_IWIDGET));729 final StringBuilder sb = new StringBuilder(ItemUtils.GetTag(ItemUtils.TAG_IWIDGET)); 715 730 sb.append(':'); 716 731 sb.append(' '); … … 741 756 742 757 // Append arguments if any 743 String stateArgs = Util.formatArgs(getArgs());758 final String stateArgs = Util.formatArgs(getArgs()); 744 759 if (stateArgs != null) { 745 760 sb.append(':'); … … 784 799 * 785 800 */ 786 public void setSize( int minWidth, int maxWidth, int minHeight, int maxHeight, float newWidth,float newHeight)801 public void setSize(final int minWidth, final int maxWidth, final int minHeight, final int maxHeight, final float newWidth, final float newHeight) 787 802 { 788 803 setSizeRestrictions(minWidth, maxWidth, minHeight, maxHeight); … … 817 832 818 833 // Remember current isFloating() values 819 boolean vfloating[] = new boolean[] { _d1.isFloating(), _d2.isFloating(), _d3.isFloating(), _d4.isFloating() };834 final boolean vfloating[] = new boolean[] { _d1.isFloating(), _d2.isFloating(), _d3.isFloating(), _d4.isFloating() }; 820 835 821 836 _d1.setFloating(true); … … 824 839 _d4.setFloating(true); 825 840 826 f loat xr = _d1.getX() + width;827 f loat yb = _d1.getY() + height;841 final float xr = _d1.getX() + width; 842 final float yb = _d1.getY() + height; 828 843 829 844 _d2.setX(xr); … … 841 856 } 842 857 843 public void setAnchorCorners( Integer left, Integer right, Integer top,Integer bottom)858 public void setAnchorCorners(final Integer left, final Integer right, final Integer top, final Integer bottom) 844 859 { 845 860 setAnchorLeft(left); … … 850 865 851 866 852 public void setPosition(int x, int y) 853 { 854 if (x == getX() && y == getY()) return; 867 public void setPosition(final int x, final int y) 868 { 869 if (x == getX() && y == getY()) { 870 return; 871 } 855 872 856 873 // Remember current isFloating() values 857 boolean vfloating[] = new boolean[] { _d1.isFloating(), _d2.isFloating(), _d3.isFloating(), _d4.isFloating() };858 859 int width = getWidth();860 int height = getHeight();874 final boolean vfloating[] = new boolean[] { _d1.isFloating(), _d2.isFloating(), _d3.isFloating(), _d4.isFloating() }; 875 876 final int width = getWidth(); 877 final int height = getHeight(); 861 878 862 879 invalidateLink(); … … 895 912 * @return False if need to call super.setPosition 896 913 */ 897 public boolean setPositions(WidgetCorner src, float x, float y) 898 { 899 if (_settingPositionFlag) return false; 914 public boolean setPositions(final WidgetCorner src, final float x, final float y) 915 { 916 if (_settingPositionFlag) { 917 return false; 918 } 900 919 901 920 _settingPositionFlag = true; … … 904 923 905 924 // Check to see if the widget is fully being picked up 906 boolean isAllPickedUp = (_d1.isFloating() && _d2.isFloating() && _d3.isFloating() && _d4.isFloating());925 final boolean isAllPickedUp = (_d1.isFloating() && _d2.isFloating() && _d3.isFloating() && _d4.isFloating()); 907 926 908 927 // If so, then this will be called one by one .. … … 942 961 } 943 962 944 if (!(src == _d4 && _d1.isFloating() && _d4.isFloating())) 963 if (!(src == _d4 && _d1.isFloating() && _d4.isFloating())) { 945 964 _d1.setX(newX); 946 if (!(src == _d1 && _d4.isFloating() && _d1.isFloating())) 965 } 966 if (!(src == _d1 && _d4.isFloating() && _d1.isFloating())) { 947 967 _d4.setX(newX); 968 } 948 969 949 970 } else if (src == _d2 || src == _d3) { … … 962 983 } 963 984 964 if (!(src == _d3 && _d2.isFloating() && _d3.isFloating())) 985 if (!(src == _d3 && _d2.isFloating() && _d3.isFloating())) { 965 986 _d2.setX(newX); 966 if (!(src == _d2 && _d3.isFloating() && _d2.isFloating())) 987 } 988 if (!(src == _d2 && _d3.isFloating() && _d2.isFloating())) { 967 989 _d3.setX(newX); 990 } 968 991 } 969 992 … … 986 1009 } 987 1010 988 if (!(src == _d2 && _d1.isFloating() && _d2.isFloating())) 1011 if (!(src == _d2 && _d1.isFloating() && _d2.isFloating())) { 989 1012 _d1.setY(newY); 990 if (!(src == _d1 && _d2.isFloating() && _d1.isFloating())) 1013 } 1014 if (!(src == _d1 && _d2.isFloating() && _d1.isFloating())) { 991 1015 _d2.setY(newY); 1016 } 992 1017 993 1018 } else if (src == _d3 || src == _d4) { … … 1006 1031 } 1007 1032 1008 if (!(src == _d4 && _d3.isFloating() && _d4.isFloating())) 1033 if (!(src == _d4 && _d3.isFloating() && _d4.isFloating())) { 1009 1034 _d3.setY(newY); 1010 if (!(src == _d3 && _d4.isFloating() && _d3.isFloating())) 1035 } 1036 if (!(src == _d3 && _d4.isFloating() && _d3.isFloating())) { 1011 1037 _d4.setY(newY); 1038 } 1012 1039 } 1013 1040 } 1014 1041 1015 1042 // Update source text position so position is remembered from loading 1016 f loat newTextX = getX();1017 f loat newTextY = getY();1043 final float newTextX = getX(); 1044 final float newTextY = getY(); 1018 1045 if (_textRepresentation.getX() != newTextX || _textRepresentation.getY() != newTextY) { 1019 1046 _textRepresentation.setPosition(newTextX, newTextY); … … 1072 1099 } 1073 1100 1074 public final void onParentStateChanged( ItemParentStateChangedEvent e)1101 public final void onParentStateChanged(final ItemParentStateChangedEvent e) 1075 1102 { 1076 1103 switch (e.getEventType()) { … … 1104 1131 * 1105 1132 */ 1106 protected void onParentStateChanged( int eventType)1133 protected void onParentStateChanged(final int eventType) 1107 1134 { 1108 1135 } … … 1152 1179 protected void paintInFreeSpace() 1153 1180 { 1154 GraphicsManager g = EcosystemManager.getGraphicsManager();1181 final GraphicsManager g = EcosystemManager.getGraphicsManager(); 1155 1182 g.drawRectangle(new Point(getX(), getY()), new Dimension(getWidth(), getHeight()), 0.0, new Fill(FREESPACE_BACKCOLOR), null, null, null); 1156 1183 } … … 1210 1237 protected boolean removeSelf() 1211 1238 { 1212 Frame parent = getParentFrame();1239 final Frame parent = getParentFrame(); 1213 1240 1214 1241 if (parent != null) { … … 1243 1270 protected void invalidateSelf() 1244 1271 { 1245 AxisAlignedBoxBounds dirty = new AxisAlignedBoxBounds(getX(), getY(), getWidth(), getHeight());1272 final AxisAlignedBoxBounds dirty = new AxisAlignedBoxBounds(getX(), getY(), getWidth(), getHeight()); 1246 1273 DisplayController.invalidateArea(dirty); 1247 1274 invalidateLink(); … … 1254 1281 { 1255 1282 if (_textRepresentation.getLink() != null || _textRepresentation.hasAction()) { 1256 AxisAlignedBoxBounds linkArea = _textRepresentation.getLinkDrawArea(getLinkX(), getLinkY());1283 final AxisAlignedBoxBounds linkArea = _textRepresentation.getLinkDrawArea(getLinkX(), getLinkY()); 1257 1284 DisplayController.invalidateArea(linkArea); 1258 1285 } … … 1316 1343 * If tag is empty. 1317 1344 */ 1318 protected String getStrippedDataString(String tag) 1319 { 1320 if (tag == null) throw new NullPointerException("tag"); 1321 if (tag.length() == 0) throw new IllegalArgumentException("tag is empty"); 1345 protected String getStrippedDataString(final String tag) 1346 { 1347 if (tag == null) { 1348 throw new NullPointerException("tag"); 1349 } 1350 if (tag.length() == 0) { 1351 throw new IllegalArgumentException("tag is empty"); 1352 } 1322 1353 1323 1354 if (getCurrentRepresentation().getData() != null) { 1324 for ( String str : getCurrentRepresentation().getData()) {1355 for (final String str : getCurrentRepresentation().getData()) { 1325 1356 if (str != null && str.startsWith(tag) && str.length() > tag.length()) { 1326 1357 return str.substring(tag.length()); … … 1357 1388 * 1358 1389 */ 1359 protected Integer getStrippedDataInt( String tag,Integer defaultValue)1390 protected Integer getStrippedDataInt(final String tag, final Integer defaultValue) 1360 1391 { 1361 1392 String strippedStr = getStrippedDataString(tag); … … 1366 1397 try { 1367 1398 return Integer.parseInt(strippedStr); 1368 } catch ( NumberFormatException e) { /* Consume */1399 } catch (final NumberFormatException e) { /* Consume */ 1369 1400 } 1370 1401 } … … 1402 1433 * 1403 1434 */ 1404 protected Long getStrippedDataLong( String tag,Long defaultValue)1435 protected Long getStrippedDataLong(final String tag, final Long defaultValue) 1405 1436 { 1406 1437 String strippedStr = getStrippedDataString(tag); … … 1411 1442 try { 1412 1443 return Long.parseLong(strippedStr); 1413 } catch ( NumberFormatException e) { /* Consume */1444 } catch (final NumberFormatException e) { /* Consume */ 1414 1445 } 1415 1446 } … … 1446 1477 * 1447 1478 */ 1448 protected Boolean getStrippedDataBool( String tag,Boolean defaultValue) {1479 protected Boolean getStrippedDataBool(final String tag, final Boolean defaultValue) { 1449 1480 1450 1481 String strippedStr = getStrippedDataString(tag); … … 1475 1506 * 1476 1507 */ 1477 protected void removeData( String tag)1508 protected void removeData(final String tag) 1478 1509 { 1479 1510 updateData(tag, null); … … 1483 1514 protected void addDataIfCaseInsensitiveNotExists(String tag) 1484 1515 { 1485 if (tag == null) throw new NullPointerException("tag"); 1516 if (tag == null) { 1517 throw new NullPointerException("tag"); 1518 } 1486 1519 1487 1520 List<String> data = getCurrentRepresentation().getData(); … … 1491 1524 } 1492 1525 1493 for ( String s : data) {1526 for (final String s : data) { 1494 1527 if (s != null && s.equalsIgnoreCase(tag)) { 1495 1528 return; … … 1525 1558 * 1526 1559 */ 1527 protected void updateData( String tag,String newData)1528 { 1529 if (tag == null) 1560 protected void updateData(final String tag, final String newData) 1561 { 1562 if (tag == null) { 1530 1563 throw new NullPointerException("tag"); 1531 else if (tag.length() == 0)1564 } else if (tag.length() == 0) { 1532 1565 throw new IllegalArgumentException("tag is empty"); 1566 } 1533 1567 1534 1568 // Get current data … … 1537 1571 if (data != null) { 1538 1572 for (int i = 0; i < data.size(); i++) { 1539 String str = data.get(i);1573 final String str = data.get(i); 1540 1574 if (str != null && str.startsWith(tag)) { 1541 1575 data.remove(i); … … 1545 1579 1546 1580 if (newData != null) { 1547 if (data != null) 1581 if (data != null) { 1548 1582 data.add(newData); 1549 else {1583 } else { 1550 1584 data = new LinkedList<String>(); 1551 1585 data.add(newData); … … 1556 1590 } 1557 1591 1558 public boolean containsData(String str) { 1559 assert(str != null); 1560 if (getCurrentRepresentation().getData() != null) 1561 return getCurrentRepresentation().getData().contains(str); 1562 return false; 1563 } 1564 1565 public boolean containsDataTrimmedIgnoreCase(String str) { 1592 public boolean containsData(final String str) { 1566 1593 assert(str != null); 1567 1594 if (getCurrentRepresentation().getData() != null) { 1568 for (String data : getCurrentRepresentation().getData()) { 1595 return getCurrentRepresentation().getData().contains(str); 1596 } 1597 return false; 1598 } 1599 1600 public boolean containsDataTrimmedIgnoreCase(final String str) { 1601 assert(str != null); 1602 if (getCurrentRepresentation().getData() != null) { 1603 for (final String data : getCurrentRepresentation().getData()) { 1569 1604 if (data != null && data.trim().equalsIgnoreCase(str)) { 1570 1605 return true; … … 1586 1621 * a text item. 1587 1622 */ 1588 public void setLink( String link,Text linker)1623 public void setLink(final String link, final Text linker) 1589 1624 { 1590 1625 // Make sure the link is redrawn when a link is added 1591 if (link == null) invalidateLink(); 1626 if (link == null) { 1627 invalidateLink(); 1628 } 1592 1629 getSource().setLink(link); 1593 if (link != null) invalidateLink(); 1594 } 1595 1596 public void setBackgroundColor(Colour c) 1630 if (link != null) { 1631 invalidateLink(); 1632 } 1633 } 1634 1635 public void setBackgroundColor(final Colour c) 1597 1636 { 1598 1637 getSource().setBackgroundColor(c); … … 1622 1661 // a parent ... thus must manually format link 1623 1662 1624 String link = getLink();1625 1626 if (link == null || link.length() == 0) 1663 final String link = getLink(); 1664 1665 if (link == null || link.length() == 0) { 1627 1666 return null; 1667 } 1628 1668 1629 1669 if (FrameIO.isPositiveInteger(link)) { // relative - convert to … … 1632 1672 // Get the frameset of this item 1633 1673 Frame parent = getParentFrame(); 1634 if (parent == null) 1674 if (parent == null) { 1635 1675 parent = DisplayController.getCurrentFrame(); 1636 if (parent == null) 1676 } 1677 if (parent == null) { 1637 1678 return null; 1638 1639 String framesetName = parent.getFramesetName(); 1640 1641 if (framesetName == null) 1679 } 1680 1681 final String framesetName = parent.getFramesetName(); 1682 1683 if (framesetName == null) { 1642 1684 return null; 1685 } 1643 1686 1644 1687 return framesetName + link; … … 1659 1702 * The color to set. 1660 1703 */ 1661 public void setWidgetEdgeColor( Colour c)1704 public void setWidgetEdgeColor(final Colour c) 1662 1705 { 1663 1706 // Indirectly invokes setSourceBorderColor accordingly 1664 for (Item i : _expediteeItems) i.setColor(c); 1707 for (final Item i : _expediteeItems) { 1708 i.setColor(c); 1709 } 1665 1710 } 1666 1711 … … 1673 1718 * The new thickness to set. 1674 1719 */ 1675 public void setWidgetEdgeThickness(f loat thickness) {1720 public void setWidgetEdgeThickness(final float thickness) { 1676 1721 _l1.setThickness(thickness, true); 1677 1722 //for (Item i : _expediteeItems) i.setThickness(thickness); … … 1688 1733 1689 1734 // TODO: Maybe rename setSource* .. to update* ... These should actually be friendly! 1690 public void setSourceColor( Colour c) {1735 public void setSourceColor(final Colour c) { 1691 1736 _textRepresentation.setColor(c); 1692 1737 } 1693 1738 1694 public void setSourceBorderColor( Colour c) {1739 public void setSourceBorderColor(final Colour c) { 1695 1740 _textRepresentation.setBorderColor(c); 1696 1741 } 1697 1742 1698 public void setSourceFillColor( Colour c) {1743 public void setSourceFillColor(final Colour c) { 1699 1744 _textRepresentation.setFillColor(c); 1700 1745 } 1701 1746 1702 public void setSourceThickness(f loat newThickness,boolean setConnected) {1747 public void setSourceThickness(final float newThickness, final boolean setConnected) { 1703 1748 _textRepresentation.setThickness(newThickness, setConnected); 1704 1749 } 1705 1750 1706 public void setSourceData( List<String> data) {1751 public void setSourceData(final List<String> data) { 1707 1752 _textRepresentation.setData(data); 1708 1753 } … … 1716 1761 } 1717 1762 1718 public void setAnchorLeft( Integer anchor)1763 public void setAnchorLeft(final Integer anchor) 1719 1764 { 1720 1765 _anchoring.setLeftAnchor(anchor); … … 1732 1777 } 1733 1778 1734 public void setAnchorRight( Integer anchor) {1779 public void setAnchorRight(final Integer anchor) { 1735 1780 _anchoring.setRightAnchor(anchor); 1736 1781 // Anchor right-edge corners (dots) as well … … 1749 1794 } 1750 1795 1751 public void setAnchorTop( Integer anchor) {1796 public void setAnchorTop(final Integer anchor) { 1752 1797 _anchoring.setTopAnchor(anchor); 1753 1798 // Anchor top-edge corners (dots) as well … … 1764 1809 } 1765 1810 1766 public void setAnchorBottom( Integer anchor) {1811 public void setAnchorBottom(final Integer anchor) { 1767 1812 _anchoring.setBottomAnchor(anchor); 1768 1813 // Anchor bottom-edge corners (dots) as well … … 1837 1882 public Clip getClip() 1838 1883 { 1839 Clip clip = new Clip(getBounds());1884 final Clip clip = new Clip(getBounds()); 1840 1885 return clip; 1841 1886 }
Note:
See TracChangeset
for help on using the changeset viewer.