public class PlotFrame
extends javax.swing.JFrame
Plot frames that contain two plot panels also contain a split pane with either a horizontal (side by side) or vertical (above and below) orientation. The split pane enables interactive resizing of the plot panels.
A plot frame has a single mode manager
(ModeManager
).
When constructed, a plot frame adds and sets active (1) a tile zoom mode
(TileZoomMode
) and (2) a mouse track mode
(MouseTrackMode
) to that mode manager. Of
course, other modes of interaction can be added as well.
The default font and background and foreground colors for a plot frame
are Arial (plain, 24 point), white, and black, respectively. Any of
these attributes can be changed. For both simplicity and consistency,
when any of these attributes are set for this frame, they are set for
all components in this frame as well. For example, calling the method
setFont(java.awt.Font)
will set the font for all panels and,
in turn, all mosaics, tiles, tile axes, color bars, and titles in this
frame.
Note that a plot frame has methods that enable font sizes to be automatically computed for figures in printed manuscripts and in presentation slides.
Modifier and Type | Class and Description |
---|---|
static class |
PlotFrame.Split
Orientation of the split pane (if any) containing two plot panels.
|
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
PlotFrame(PlotPanel panel)
Constructs a plot frame for the specified plot panel.
|
PlotFrame(PlotPanel panelTL,
PlotPanel panelBR,
PlotFrame.Split split)
Constructs a plot frame with two plot panels in a split pane.
|
Modifier and Type | Method and Description |
---|---|
ModeManager |
getModeManager()
Gets the mode manager for this plot frame.
|
MouseTrackMode |
getMouseTrackMode()
Gets the mouse track mode for this plot frame.
|
PlotPanel |
getPlotPanel()
Gets the plot panel in this frame.
|
PlotPanel |
getPlotPanelBottomRight()
Gets the bottom-right plot panel in this frame.
|
PlotPanel |
getPlotPanelTopLeft()
Gets the top-left plot panel in this frame.
|
javax.swing.JSplitPane |
getSplitPane()
Gets the split pane for this frame if it contains two panels.
|
TileZoomMode |
getTileZoomMode()
Gets the tile zoom mode for this plot frame.
|
void |
paintToPng(double dpi,
double win,
java.lang.String fileName)
Paints this frame's panel(s) to a PNG image with specified parameters.
|
void |
setBackground(java.awt.Color color)
Sets the background color in all components in this frame.
|
void |
setFont(java.awt.Font font)
Sets the font in all components in this frame.
|
void |
setFontSize(float size)
Sets the font size (in points) for all panels in this frame.
|
void |
setFontSizeForPrint(double fontSize,
double plotWidth)
Sets font size to automatically adjust for a printed manuscript.
|
void |
setFontSizeForSlide(double fracWidth,
double fracHeight)
Sets font size automatically for a slide in presentations.
|
void |
setFontSizeForSlide(double fracWidth,
double fracHeight,
double aspectRatio)
Sets font size automatically for a slide in presentations.
|
void |
setForeground(java.awt.Color color)
Sets the foreground color in all components in this frame.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
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, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public PlotFrame(PlotPanel panel)
panel
- the plot panel.public PlotFrame(PlotPanel panelTL, PlotPanel panelBR, PlotFrame.Split split)
panelTL
- the top-left panel.panelBR
- the bottom-right panel.split
- the split pane orientation.public PlotPanel getPlotPanel()
public PlotPanel getPlotPanelTopLeft()
public PlotPanel getPlotPanelBottomRight()
public javax.swing.JSplitPane getSplitPane()
public ModeManager getModeManager()
public TileZoomMode getTileZoomMode()
public MouseTrackMode getMouseTrackMode()
public void paintToPng(double dpi, double win, java.lang.String fileName)
dpi
- the image resolution, in dots per inch.win
- the image width, in inches.fileName
- the name of the file to contain the PNG image.public void setFont(java.awt.Font font)
setFont
in class java.awt.Container
font
- the font.public void setFontSize(float size)
size
- the size.public void setFontSizeForSlide(double fracWidth, double fracHeight)
This method uses a default width/height aspect ratio = 4.0/3.0.
To explicitly specify the aspect ratio, use the method
setFontSizeForSlide(double,double,double)
.
fracWidth
- the fraction of slide width available.fracHeight
- the fraction of slide height available.public void setFontSizeForSlide(double fracWidth, double fracHeight, double aspectRatio)
fracWidth
- the fraction of slide width available.fracHeight
- the fraction of slide height available.aspectRatio
- the width/height ratio for slides; e.g., 16.0/9.0.public void setFontSizeForPrint(double fontSize, double plotWidth)
fontSize
- the printed font size (in points) for this plot.plotWidth
- the printed width (in points) of this plot.public void setForeground(java.awt.Color color)
setForeground
in class java.awt.Component
color
- the foreground color.public void setBackground(java.awt.Color color)
setBackground
in class java.awt.Frame
color
- the background color.