|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.rice.cs.util.swing.SwingFrame
edu.rice.cs.drjava.ui.PreviewFrame
public abstract class PreviewFrame
DrJava's print preview window
| Nested Class Summary | |
|---|---|
private class |
PreviewFrame.JSpinnerChanger
|
private class |
PreviewFrame.JTextFieldChanger
|
private static class |
PreviewFrame.PageChangerUpdater
|
(package private) static class |
PreviewFrame.PagePreview
Static inner class which displays the image on the screen, and holds the Image object. |
(package private) class |
PreviewFrame.PagePreviewContainer
Internal class which holds (and places) the PagePreview object. |
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| 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 Action |
_closeAction
Prints the current document. |
protected MainFrame |
_mainFrame
|
protected SingleDisplayModel |
_model
|
private Action |
_nextPageAction
Displays the next page of the document. |
private PreviewFrame.PageChangerUpdater |
_pageChanger
|
protected int |
_pageNumber
|
private PreviewFrame.PagePreview |
_pagePreview
|
private JScrollPane |
_previewScroll
|
private Action |
_prevPageAction
Displays the previous page of the document. |
protected Pageable |
_print
|
private ActionListener |
_printListener
Prints the current document. |
(package private) Dimension |
_screenSize
|
private JToolBar |
_toolBar
|
private WindowListener |
_windowCloseListener
How Preview Pane responds to window events. |
(package private) JSlider |
_zoomSlider
|
private static String |
ICON_PATH
|
private static int |
PAGE_BORDER
|
private static double |
PAGE_ZOOM
|
private int |
PREVIEW_HEIGHT
|
private int |
PREVIEW_PAGE_HEIGHT
|
private int |
PREVIEW_PAGE_WIDTH
|
private int |
PREVIEW_WIDTH
|
private static int |
TOOLBAR_HEIGHT
|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PreviewFrame(SingleDisplayModel model,
MainFrame mainFrame,
boolean interactions)
Contructs a new PreviewFrame using a parent model and a Pageable object print to show. |
|
| Method Summary | |
|---|---|
private void |
_close()
|
private ImageIcon |
_getIcon(String name)
Mirrored from MainFrame, will later use the same Icon access code. |
private void |
_goToPage(int pi)
|
private void |
_nextPage()
|
private void |
_previousPage()
|
protected abstract void |
_print()
Prints the document being previewed |
private void |
_setUpActions()
Initializes all action objects. |
private void |
_setUpToolBar()
Sets up the toolbar with all of the necessary buttons. |
protected void |
_showError(Exception e,
String title,
String message)
|
private void |
_updateActions()
Updates all of the buttons on the page to reflect the current state of the PreviewWindows. |
private static Object |
callMethod(Object rec,
Class<?> c,
String name,
Class<?>[] ca,
Object[] args)
|
private PreviewFrame.PageChangerUpdater |
createPageChanger()
|
void |
refreshScreen()
|
protected abstract Pageable |
setUpDocument(SingleDisplayModel model,
boolean interactions)
Sets up the document to be displayed and returns the Pageable object that allows display by pages |
void |
setZoom(int percent,
boolean fast)
|
private void |
showPage()
Generates an Image, prints to it, and then displays the image on the page. |
| Methods inherited from class edu.rice.cs.util.swing.SwingFrame |
|---|
duringInit, initDone |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
protected final SingleDisplayModel _model
protected final MainFrame _mainFrame
protected final Pageable _print
protected volatile int _pageNumber
Dimension _screenSize
JSlider _zoomSlider
private JScrollPane _previewScroll
private final PreviewFrame.PageChangerUpdater _pageChanger
private final int PREVIEW_WIDTH
private final int PREVIEW_HEIGHT
private final int PREVIEW_PAGE_WIDTH
private final int PREVIEW_PAGE_HEIGHT
private static final double PAGE_ZOOM
private static final int PAGE_BORDER
private static final int TOOLBAR_HEIGHT
private static final String ICON_PATH
private JToolBar _toolBar
private PreviewFrame.PagePreview _pagePreview
private final ActionListener _printListener
private final Action _closeAction
private final Action _nextPageAction
private final Action _prevPageAction
private final WindowListener _windowCloseListener
| Constructor Detail |
|---|
public PreviewFrame(SingleDisplayModel model,
MainFrame mainFrame,
boolean interactions)
throws IllegalStateException
IllegalStateException| Method Detail |
|---|
public void setZoom(int percent,
boolean fast)
public void refreshScreen()
protected abstract void _print()
protected abstract Pageable setUpDocument(SingleDisplayModel model,
boolean interactions)
model - the current display modelinteractions - whether the document is an interactions document
private void _close()
private void _nextPage()
private void _previousPage()
private void _goToPage(int pi)
protected void _showError(Exception e,
String title,
String message)
private void _updateActions()
private void _setUpActions()
private PreviewFrame.PageChangerUpdater createPageChanger()
private static Object callMethod(Object rec,
Class<?> c,
String name,
Class<?>[] ca,
Object[] args)
throws Exception
Exceptionprivate ImageIcon _getIcon(String name)
private void _setUpToolBar()
private void showPage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||