java.lang.Object
com.port80.swt.apps.ImageViewer4x
- public class ImageViewer4x
- extends java.lang.Object
An image viewer using swt.
A GC can be created on an Image and then use it to draw into the Image.
To display very large image, pixel data is loaded into ImageData and then
tiles of the data are used to create Image's for display.
This is an experimental version modified from ImageViewer3. To reduce time lag between
clear and update during scroll, a large Image is drawn to the display, so that it would use
scroll in the offscreen image instead of wait for update from the PaintEvent. The PaintEvent
then fill up the offscreen section that are scrolled away.
Update is much faster. There are no visiable blank region for large scroll or jump scroll.
But the update of the larger offscreen Image make scrolling more jumpy even for small scroll.
So it may be better off simply use the ImageViewer3 approach if really needed to handle
very large image.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
private static final java.lang.String NAME
- See Also:
- Constant Field Values
IMAGE_SUFFICES
private static final java.lang.String[] IMAGE_SUFFICES
IMAGE_FILTER_NAMES
private static final java.lang.String[] IMAGE_FILTER_NAMES
fDisplay
private org.eclipse.swt.widgets.Display fDisplay
fShell
private org.eclipse.swt.widgets.Shell fShell
fFont
private org.eclipse.swt.graphics.Font fFont
fWhiteColor
private org.eclipse.swt.graphics.Color fWhiteColor
fBlackColor
private org.eclipse.swt.graphics.Color fBlackColor
fLightColor
private org.eclipse.swt.graphics.Color fLightColor
fCrossCursor
private org.eclipse.swt.graphics.Cursor fCrossCursor
fImage
private org.eclipse.swt.graphics.Image fImage
fImageDatas
private org.eclipse.swt.graphics.ImageData[] fImageDatas
fImageData
private org.eclipse.swt.graphics.ImageData fImageData
fImageDataIndex
private int fImageDataIndex
fScale
private double fScale
fX
private int fX
fY
private int fY
fImageX
private int fImageX
fImageY
private int fImageY
fImageW
private int fImageW
fImageH
private int fImageH
fClientW
private int fClientW
fClientH
private int fClientH
fLastPath
private java.lang.String fLastPath
fTransparent
private boolean fTransparent
fShowMask
private boolean fShowMask
fIncremental
private boolean fIncremental
fLoadTime
private long fLoadTime
fFilename
private java.lang.String fFilename
fScaleCombo
private org.eclipse.swt.widgets.Combo fScaleCombo
fImageCanvas
private org.eclipse.swt.widgets.Canvas fImageCanvas
fSash
private org.eclipse.swt.widgets.Sash fSash
fDataLabel
private org.eclipse.swt.widgets.Label fDataLabel
fStatusLabel
private org.eclipse.swt.widgets.Label fStatusLabel
fDataText
private org.eclipse.swt.custom.StyledText fDataText
fInfoLabel
private org.eclipse.swt.widgets.Label fInfoLabel
ImageViewer4x
public ImageViewer4x()
main
public static void main(java.lang.String[] args)
open
public org.eclipse.swt.widgets.Shell open(org.eclipse.swt.widgets.Display display)
dispose
void dispose()
getShell
org.eclipse.swt.widgets.Shell getShell()
getDisplay
org.eclipse.swt.widgets.Display getDisplay()
createWidgets
void createWidgets()
createMenuBar
org.eclipse.swt.widgets.Menu createMenuBar()
createFileMenu
void createFileMenu(org.eclipse.swt.widgets.Menu menuBar)
openFile
void openFile()
openURL
void openURL()
displayImage
void displayImage(org.eclipse.swt.graphics.ImageData newImageData)
paintImage
void paintImage(org.eclipse.swt.events.PaintEvent event)
createImage
org.eclipse.swt.graphics.Image createImage(int x,
int y,
int w,
int h)
- Extract an Image from the given area of the original image, fImageData.
showColorAt
void showColorAt(int mx,
int my)
showColorForPixel
void showColorForPixel(int x,
int y)
showColorForData
void showColorForData()
scrollHorizontally
void scrollHorizontally(org.eclipse.swt.widgets.ScrollBar scrollBar)
scrollVertically
void scrollVertically(org.eclipse.swt.widgets.ScrollBar scrollBar)
scaleImage
void scaleImage()
resetScaleCombo
void resetScaleCombo()
resetScrollBars
void resetScrollBars()
resizeScrollBars
void resizeScrollBars()
resizeShell
void resizeShell(org.eclipse.swt.events.ControlEvent event)
reset
void reset()
showErrorDialog
void showErrorDialog(java.lang.String operation,
java.lang.String filename,
java.lang.Exception e)
fileTypeString
static java.lang.String fileTypeString(int filetype)
createMsg
static java.lang.String createMsg(java.lang.String msg,
java.lang.Object arg)
i18n
static java.lang.String i18n(java.lang.String str)