edu.rice.cs.drjava.ui
Class RecentDocFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by javax.swing.JWindow
                  extended by edu.rice.cs.drjava.ui.RecentDocFrame
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class RecentDocFrame
extends JWindow

This class extends a Swing view class. Hence it should only be accessed from the event-handling thread.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JWindow
JWindow.AccessibleJWindow
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  OptionListener<Boolean> _antialiasListener
           
(package private)  boolean _antiAliasText
           
private  OptionListener<Color> _colorListener
           
(package private)  int _current
           
(package private)  DisplayManager<OpenDefinitionsDocument> _displayManager
           
(package private)  LinkedList<OpenDefinitionsDocument> _docs
           
private  OptionListener<Font> _fontListener
           
(package private)  MainFrame _frame
           
(package private)  JLabel _label
           
(package private)  int _padding
           
(package private)  JPanel _panel
           
(package private)  JScrollPane _scroller
           
(package private)  boolean _showSource
           
private  OptionListener<Boolean> _showSourceListener
           
(package private)  JTextPane _textpane
           
 
Fields inherited from class javax.swing.JWindow
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RecentDocFrame(MainFrame f)
           
 
Method Summary
private  void centerH()
          Centers the frame in the screen.
private  void centerV()
          Centers the frame in the screen.
 void closeDocument(OpenDefinitionsDocument d)
          Removes the document from the list.
 void first()
          Resets the frame to point to the first document in the list.
 OpenDefinitionsDocument getDocument()
          Returns null if the list is empty, or the currently prefered OpenDefinitionsDocument.
private  String getTextFor(OpenDefinitionsDocument doc)
           
 void next()
          Sets the current document to be the next document in the list.
 void pokeDocument(OpenDefinitionsDocument d)
          Moves the document d to the beginning of the list if it's already in the list, or it adds it to the beginning if its not already in the list.
 void prev()
          Sets the current document to be the previous document in the list.
 void refreshColor()
           
 void reset()
          Moves the selected document to the front of the list.
 void setVisible(boolean v)
          Sets this frame as visible only if _docs is non empty.
private  void show(int _current)
           
private  void updateFontColor()
           
 
Methods inherited from class javax.swing.JWindow
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update, windowInit
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_frame

MainFrame _frame

_displayManager

DisplayManager<OpenDefinitionsDocument> _displayManager

_label

JLabel _label

_panel

JPanel _panel

_textpane

JTextPane _textpane

_scroller

JScrollPane _scroller

_current

int _current

_padding

int _padding

_docs

LinkedList<OpenDefinitionsDocument> _docs

_colorListener

private OptionListener<Color> _colorListener

_fontListener

private OptionListener<Font> _fontListener

_antialiasListener

private OptionListener<Boolean> _antialiasListener

_showSourceListener

private OptionListener<Boolean> _showSourceListener

_antiAliasText

boolean _antiAliasText

_showSource

boolean _showSource
Constructor Detail

RecentDocFrame

public RecentDocFrame(MainFrame f)
Method Detail

updateFontColor

private void updateFontColor()

pokeDocument

public void pokeDocument(OpenDefinitionsDocument d)
Moves the document d to the beginning of the list if it's already in the list, or it adds it to the beginning if its not already in the list.


closeDocument

public void closeDocument(OpenDefinitionsDocument d)
Removes the document from the list.


show

private void show(int _current)

next

public void next()
Sets the current document to be the next document in the list.


prev

public void prev()
Sets the current document to be the previous document in the list.


getTextFor

private String getTextFor(OpenDefinitionsDocument doc)

first

public void first()
Resets the frame to point to the first document in the list.


refreshColor

public void refreshColor()

setVisible

public void setVisible(boolean v)
Sets this frame as visible only if _docs is non empty. Also resets the frame accordingly

Overrides:
setVisible in class Window

centerH

private void centerH()
Centers the frame in the screen.


centerV

private void centerV()
Centers the frame in the screen.


reset

public void reset()
Moves the selected document to the front of the list.


getDocument

public OpenDefinitionsDocument getDocument()
Returns null if the list is empty, or the currently prefered OpenDefinitionsDocument.