public class ImPane
extends javax.swing.JComponent
implements javax.swing.Scrollable, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ImPane(ImFrame parent,
int width,
int height,
GlassPane gp) |
ImPane(ImFrame parent,
java.lang.String imFilename,
GlassPane gp) |
ImPane(ImFrame parent,
java.lang.String imFilename,
int width,
int height,
GlassPane gp) |
ImPane(ImFrame parent,
java.lang.String imageFilePath,
int width,
int height,
GlassPane gp,
Image image)
If the file path or image are not null, width and height are irrelevant.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAssociatedPane()
Set associated pane to null.
|
void |
dispose()
Tidy up, for when the parent ImFrame is closed.
|
GlassPane |
getGlassPane()
Get a reference to the GlassPane object which overlays this ImPane in
the parent ImFrame.
|
Image |
getImage()
Get a reference to the Image object for this ImPane.
|
ImFrame |
getImFrame()
Get a reference to the parent ImFrame in which this ImPane is displayed.
|
int |
getIpHeight()
Get the height of this ImPane, in pixels.
|
int |
getIpWidth()
Get the width of this ImPane, in pixels.
|
java.awt.Point |
getOrigin()
Get the origin of the viewport of the scroll pane of the parent ImFrame.
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
Implementing javax.swing.Scrollable.
|
int |
getScale()
Get the current scale factor for display.
|
java.awt.image.BufferedImage |
getScaledImage()
Get reference to the scaled version of the Image, which is currently
displayed in the parent ImFrame.
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Implementing javax.swing.Scrollable.
|
boolean |
getScrollableTracksViewportHeight()
Implementing javax.swing.Scrollable.
|
boolean |
getScrollableTracksViewportWidth()
Implementing javax.swing.Scrollable.
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Implementing javax.swing.Scrollable.
|
boolean |
isPseudocolour()
Whether the image is currently displayed in pseudocolour.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseListener.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseMotionListener.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseListener.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseListener.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseMotionListener.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseListener.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Implementing java.awt.event.MouseListener.
|
void |
paintComponent(java.awt.Graphics g)
Draw the image in this ImPane.
|
void |
reScale()
Recreate the scaled down version of the Im and reset the caption for
the parent ImFrame.
|
void |
setAssociatedPane(AssociatedPane ap)
Set an associated pane which will be affected and given data when mouse
actions occur in the current pane.
|
void |
setImage(Image image)
Set the Image object for this ImPane.
|
void |
setInitialScale()
Sets the scale so that the image would fit into the screen.
|
void |
setIpHeight(int ht)
Sets the height in pixels and then sets preferred size and revalidates,
which may involve repainting.
|
void |
setIpSize(int wd,
int ht)
Single operation combining setIpWidth and setIpHeight avoids
repainting twice.
|
void |
setIpWidth(int wd)
Sets the width in pixels and then sets preferred size and revalidates,
which may involve repainting.
|
protected void |
setPseudocolour(Pseudocolour ps) |
void |
zoomDown()
Increase the scale factor by 1 (if less than maximum), rescale and
redisplay the image.
|
void |
zoomUp()
Decrease the scale factor by 1 (if greater than minimum), rescale and
redisplay the image.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, transferFocusDownCycle, validate, validateTree
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, getAccessibleContext, 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, 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, transferFocusBackward, transferFocusUpCycle
public ImPane(ImFrame parent, java.lang.String imFilename, int width, int height, GlassPane gp)
public int getScale()
public void setInitialScale()
public Image getImage()
public void setImage(Image image)
public java.awt.image.BufferedImage getScaledImage()
public java.awt.Point getOrigin()
public int getIpWidth()
public void setIpWidth(int wd)
public int getIpHeight()
public void setIpHeight(int ht)
public void setIpSize(int wd, int ht)
public ImFrame getImFrame()
public GlassPane getGlassPane()
public boolean isPseudocolour()
protected void setPseudocolour(Pseudocolour ps)
public void clearAssociatedPane()
public void setAssociatedPane(AssociatedPane ap)
public void dispose()
public void reScale()
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void zoomUp()
public void zoomDown()
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener