|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.mines.jtk.mosaic.IPanel
edu.mines.jtk.mosaic.Mosaic
public class Mosaic
A mosaic of tiles and tile axes. A mosaic lays out its tiles in a matrix, with a specified number of rows and columns. It manages the world and normalized coordinate systems of those tiles, so that tiles zoom and scroll consistently.
For example, when the the view rectangle (in normalized coordinates) of a tile is set, perhaps while zooming or scrolling, then that tile's mosaic changes the view rectangles of any other tiles in the same row or column accordingly, so that they all zoom and scroll together.
A mosaic can also manage axes at the top, left, bottom, and/or right sides of its matrix of tiles. These axes annotate the adjacent tiles, and mosaic ensures that they too zoom and scroll consistent with any changes to the view rectangles of those tiles.
A mosaic also manages a horizontal scrollbar for each column and a vertical scrollbar for each row. The mosaic shows scrollbars for only those dimensions of view rectangles that are zoomed. In other words, scrollbars are visible and consume space only when they are needed.
| Nested Class Summary | |
|---|---|
static class |
Mosaic.AxesPlacement
Placement of axes. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
Mosaic(int nrow,
int ncol,
java.util.Set<Mosaic.AxesPlacement> axesPlacement)
Constructs a mosaic with the specified number of rows and columns. |
|
| Method Summary | |
|---|---|
int |
countColumns()
Returns the number of columns of tiles in this mosaic. |
int |
countRows()
Returns the number of rows of tiles in this mosaic. |
void |
doLayout()
|
java.awt.Dimension |
getMinimumSize()
|
ModeManager |
getModeManager()
Gets the mode manager for this mosaic. |
java.awt.Dimension |
getPreferredSize()
|
Tile |
getTile(int irow,
int icol)
Gets the tile with specified row and column indices. |
TileAxis |
getTileAxisBottom(int icol)
Gets the bottom tile axis with specified column index. |
TileAxis |
getTileAxisLeft(int irow)
Gets the left tile axis with specified row index. |
TileAxis |
getTileAxisRight(int irow)
Gets the right tile axis with specified row index. |
TileAxis |
getTileAxisTop(int icol)
Gets the top tile axis with specified column index. |
protected void |
paintComponent(java.awt.Graphics g)
|
void |
paintToRect(java.awt.Graphics2D g2d,
int x,
int y,
int w,
int h)
Paints this panel to a specified rectangle of a graphics context. |
void |
setBackground(java.awt.Color color)
|
void |
setFont(java.awt.Font font)
|
void |
setForeground(java.awt.Color color)
|
void |
setHeightElastic(int irow,
int heightElastic)
Sets the height elastic for the specified row. |
void |
setHeightMinimum(int irow,
int heightMinimum)
Sets the height minimum for the specified row. |
void |
setModeManager(ModeManager modeManager)
Sets the mode manager for this mosaic. |
void |
setWidthElastic(int icol,
int widthElastic)
Sets the width elastic for the specified column. |
void |
setWidthMinimum(int icol,
int widthMinimum)
Sets the width minimum for the specified column. |
| Methods inherited from class edu.mines.jtk.mosaic.IPanel |
|---|
computeScale, createGraphics, getLineWidth, paintToImage, paintToImage, paintToPng, scaleLineWidth |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Mosaic(int nrow,
int ncol,
java.util.Set<Mosaic.AxesPlacement> axesPlacement)
nrow - the number of rows.ncol - the number of columns.axesPlacement - the placement of axes.| Method Detail |
|---|
public void setModeManager(ModeManager modeManager)
modeManager - the mode manager.public int countRows()
public int countColumns()
public Tile getTile(int irow,
int icol)
irow - the row index.icol - the column index.
public TileAxis getTileAxisTop(int icol)
icol - the column index.
public TileAxis getTileAxisLeft(int irow)
irow - the row index.
public TileAxis getTileAxisBottom(int icol)
icol - the column index.
public TileAxis getTileAxisRight(int irow)
irow - the row index.
public void setWidthMinimum(int icol,
int widthMinimum)
icol - the column index.widthMinimum - the width minimum.
public void setWidthElastic(int icol,
int widthElastic)
icol - the column index.widthElastic - the width elastic.
public void setHeightMinimum(int irow,
int heightMinimum)
irow - the row index.heightMinimum - the height minimum.
public void setHeightElastic(int irow,
int heightElastic)
irow - the row index.heightElastic - the height elastic.public ModeManager getModeManager()
public void setFont(java.awt.Font font)
setFont in class javax.swing.JComponentpublic void setForeground(java.awt.Color color)
setForeground in class javax.swing.JComponentpublic void setBackground(java.awt.Color color)
setBackground in class javax.swing.JComponentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic void doLayout()
doLayout in class java.awt.Container
public void paintToRect(java.awt.Graphics2D g2d,
int x,
int y,
int w,
int h)
IPanelClasses that extend this base class typically override this method to draw something besides children of this panel. When appropriate, those extensions may also call this method.
paintToRect in class IPanelg2d - the graphics context.x - the x-coordinate of the graphics rectangle.y - the y-coordinate of the graphics rectangle.w - the width of the graphics rectangle.h - the height of the graphics rectangle.protected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||