edu.rice.cs.drjava.ui
Class MainFrame.OddDisplayManager

java.lang.Object
  extended by edu.rice.cs.drjava.ui.MainFrame.OddDisplayManager
All Implemented Interfaces:
DisplayManager<OpenDefinitionsDocument>
Enclosing class:
MainFrame

private static class MainFrame.OddDisplayManager
extends Object
implements DisplayManager<OpenDefinitionsDocument>

This class wraps the file display managers by superimposing any notification icons on top of the base file icon. Currently, only the modified star is allowed, but everything is set up to add notification icons for whether a document has passed the junit test (for display in the tree). This class is static for now. It may be necessary to make it dynamic when implementing the junit notifications.


Field Summary
private  FileDisplayManager _default
           
private  Icon _star
           
 
Constructor Summary
MainFrame.OddDisplayManager(FileDisplayManager fdm, Icon star, Icon junitPass, Icon junitFail)
          Standard constructor.
 
Method Summary
 Icon getIcon(OpenDefinitionsDocument odd)
          Given a piece of data, decide which icon to use
 String getName(OpenDefinitionsDocument doc)
          Given a data, decide on which name to display for it
private  LayeredIcon makeLayeredIcon(Icon base, Icon star)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_star

private final Icon _star

_default

private final FileDisplayManager _default
Constructor Detail

MainFrame.OddDisplayManager

public MainFrame.OddDisplayManager(FileDisplayManager fdm,
                                   Icon star,
                                   Icon junitPass,
                                   Icon junitFail)
Standard constructor.

Parameters:
star - The star icon will be put flush to the left 1/4 the way down
junitPass - indicator of junit success, placed at bottom right
junitFail - indicator of junit failure, placed at bottom right
Method Detail

getIcon

public Icon getIcon(OpenDefinitionsDocument odd)
Description copied from interface: DisplayManager
Given a piece of data, decide which icon to use

Specified by:
getIcon in interface DisplayManager<OpenDefinitionsDocument>
Parameters:
odd - The data to base the icon decision on
Returns:
The icon to display for the given data

getName

public String getName(OpenDefinitionsDocument doc)
Description copied from interface: DisplayManager
Given a data, decide on which name to display for it

Specified by:
getName in interface DisplayManager<OpenDefinitionsDocument>
Parameters:
doc - The data to base the naming decison on
Returns:
The name to display for the data

makeLayeredIcon

private LayeredIcon makeLayeredIcon(Icon base,
                                    Icon star)