Changeset 86 for trunk/src/org/expeditee/gui/Frame.java
- Timestamp:
- 06/05/08 10:11:18 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Frame.java
r80 r86 7 7 import java.awt.image.ImageObserver; 8 8 import java.awt.image.VolatileImage; 9 import java.sql.Time; 9 10 import java.util.ArrayList; 10 11 import java.util.Collection; … … 14 15 import java.util.Stack; 15 16 17 import org.expeditee.actions.Simple; 16 18 import org.expeditee.io.Conversion; 17 19 import org.expeditee.io.Logger; … … 105 107 private boolean _validBuffer = true; 106 108 109 private Time _activeTime; 110 111 private Time _darkTime; 112 113 private String _backupFrameName = null; 114 107 115 /** 108 116 * Default constructor, nothing is set. … … 310 318 311 319 // Remove the @ symbol if it is there 312 title = ItemUtils.StripTagSymbol(title);320 // title = ItemUtils.StripTagSymbol(title); 313 321 frameTitle.setText(title); 314 322 // If the @ symbol is followed by numbering or a bullet remove that … … 1507 1515 Text tag = ItemUtils.FindTag(getItems(), "@file:"); 1508 1516 if (tag != null) { 1509 String file = ItemUtils.StripTag(tag.getFirstLine(), "@file :");1517 String file = ItemUtils.StripTag(tag.getFirstLine(), "@file"); 1510 1518 file = file.trim(); 1511 1519 if (file.length() > 0) … … 1560 1568 } 1561 1569 } 1570 1571 public boolean isTestFrame() { 1572 Text title = getTitleItem(); 1573 if (title == null) 1574 return false; 1575 String action = title.getFirstAction(); 1576 if (action == null) 1577 return false; 1578 action = action.toLowerCase(); 1579 return action.startsWith(Simple.RUN_FRAME_ACTION) 1580 || action.startsWith(Simple.DEBUG_FRAME_ACTION); 1581 } 1582 1583 public void setActiveTime(String activeTime) { 1584 try { 1585 _activeTime = new Time(Time.valueOf(activeTime).getTime() + 12*60*60*1000); 1586 } catch (Exception e) { 1587 _activeTime = new Time(0); 1588 } 1589 } 1590 1591 public void setDarkTime(String darkTime) { 1592 try { 1593 _darkTime = new Time(Time.valueOf(darkTime).getTime() + 12*60*60*1000); 1594 } catch (Exception e) { 1595 _darkTime = new Time(0); 1596 } 1597 } 1598 1599 /** 1600 * Sets the frame that was the previous version of this frame. 1601 * 1602 * @param oldFrameName 1603 * the name of the old frame 1604 */ 1605 public void setBackupFrameName(String oldFrameName) { 1606 _backupFrameName = oldFrameName; 1607 } 1608 1609 public Time getCometActiveTime(boolean topFrame) { 1610 Time base; 1611 if (topFrame && _frameName.Permission >= Item.PERMISSION_FULL) 1612 base = SessionStats.getFrameActiveTime(); 1613 else if (_activeTime == null) 1614 base = new Time(0); 1615 else 1616 base = _activeTime; 1617 1618 if (_backupFrameName == null 1619 || getName().equalsIgnoreCase(_backupFrameName)) 1620 return base; 1621 Frame backup = FrameIO.LoadFrame(_backupFrameName); 1622 if (backup == null) 1623 return base; 1624 return new Time(base.getTime() 1625 + backup.getCometActiveTime(false).getTime()); 1626 } 1627 1628 public Time getCometDarkTime(boolean topFrame) { 1629 Time base; 1630 if (topFrame && _frameName.Permission >= Item.PERMISSION_FULL ) 1631 base = SessionStats.getFrameDarkTime(); 1632 else if (_darkTime == null) 1633 base = new Time(0); 1634 else 1635 base = _darkTime; 1636 1637 if (_backupFrameName == null 1638 || getName().equalsIgnoreCase(_backupFrameName)) 1639 return base; 1640 Frame backup = FrameIO.LoadFrame(_backupFrameName); 1641 if (backup == null) 1642 return base; 1643 return new Time(base.getTime() 1644 + backup.getCometDarkTime(false).getTime()); 1645 } 1646 1647 /** 1648 * Gets the number of backed up versions of this frame are saved plus 1 for 1649 * this frame. 1650 * 1651 * @return the number of frames in the backed up comet 1652 */ 1653 public int getCometLength() { 1654 if (_backupFrameName == null 1655 || getName().equalsIgnoreCase(_backupFrameName)) 1656 return 1; 1657 Frame backup = FrameIO.LoadFrame(_backupFrameName); 1658 return 1 + (backup == null ? 0 : backup.getCometLength()); 1659 } 1562 1660 }
Note:
See TracChangeset
for help on using the changeset viewer.