Class ViewJFrameLightBox
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- gov.nih.mipav.view.ViewJFrameBase
-
- gov.nih.mipav.view.ViewJFrameLightBox
-
- All Implemented Interfaces:
ViewImageUpdateInterface,java.awt.event.ActionListener,java.awt.event.ComponentListener,java.awt.event.ItemListener,java.awt.event.WindowListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.event.ChangeListener,javax.swing.RootPaneContainer,javax.swing.WindowConstants
public class ViewJFrameLightBox extends ViewJFrameBase implements java.awt.event.ItemListener
This class builds a "light box" view of a 3D or 4D dataset. In addition, a 2nd image can be overlayed and an alpha value can be adjusted to control the amount of each image that is displayed. The user can control how the images are tiled by specifing the number of row or cols, border thickness and size, and magnification. The options can changed using the dialog accessed via the options menu.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButtonactiveSliceButtonDOCUMENT ME!private java.awt.ColorborderColorColor for the line border surrounding each image in the light-box.private intborderSizeSpacing for the line border surrounding each image in the light-box.private ViewJComponentEditImage[]componentImageDOCUMENT ME!private ViewControlsImagecontrolsDOCUMENT ME!private intcurrentPagePage information.private intcurrentSelectedSliceDOCUMENT ME!private intcurrentSliceCurrent info -- this slice info refers to the *real* slice number, not the page index for a slice on a page.private intcurrentTSliceDOCUMENT ME!static booleanDEFAULT_DEPENDENT_ROWDefault row is dependent, and column independent.private static intDEFAULT_IMAGE_MAXDOCUMENT ME!private static intDEFAULT_IMAGE_MINDOCUMENT ME!private static intDEFAULT_XSCREEN_SPACEDOCUMENT ME!private static intDEFAULT_YSCREEN_SPACEDOCUMENT ME!private javax.swing.JButtondeleteButtonDOCUMENT ME!private javax.swing.JMenuItemdeleteSelectionDOCUMENT ME!private javax.swing.JButtonextractButtonDOCUMENT ME!private javax.swing.JMenuItemextractSelectionDOCUMENT ME!private javax.swing.JButtonfirstPageButtonDOCUMENT ME!private javax.swing.JMenuItemfirstPageMenuItemDOCUMENT ME!private intframeHeightDOCUMENT ME!private intframeWidthFrame information.private javax.swing.JTextFieldgoToSliceTextDOCUMENT ME!private java.awt.ColorgridColorColor for the region in-between the images in the light-box.private intgridColumnDOCUMENT ME!private intgridRowValue for the number of rows (number of images along the y-axis) and columns (number of images along the x-axis) in the light-box.private intgridSpacingSpacing between images in the light-box.private javax.swing.ButtonGroupgroupDOCUMENT ME!private javax.swing.border.CompoundBorder[]imageBorderDOCUMENT ME!private float[]imageBufferADOCUMENT ME!private float[]imageBufferBDOCUMENT ME!private ViewJFrameImageimageFrameDOCUMENT ME!private intimageHeightDOCUMENT ME!private javax.swing.JPanel[]imagePanelDOCUMENT ME!private intimagePanelSizeXPer num visible images information.private intimagePanelSizeYPer num visible images information.private intimageWidthDOCUMENT ME!private intincrementprivate javax.swing.JButtoninterpolateShapesButtonDOCUMENT ME!private javax.swing.JButtonlastPageButtonDOCUMENT ME!private javax.swing.JMenuItemlastPageMenuItemDOCUMENT ME!private intlastSelectedSliceDOCUMENT ME!private JDialogLightBoxlightBoxOptionsDOCUMENT ME!private ModelLUTLUTaDOCUMENT ME!private ModelLUTLUTbDOCUMENT ME!private floatmagMaxDOCUMENT ME!private floatmagMinDOCUMENT ME!private floatmagnificationMagnification of images in the light-box (mag is a percentage).static intMAX_GRID_BORDERMaximum spacing of the border surrounding images in the light-box.static intMAX_GRID_COLMaximum column value (when it is the independent variable).static intMAX_GRID_ROWMaximum row value (when it is the independent variable).static intMAX_GRID_SIZEMaximum spacing in-between images in the light-box.static floatMAX_MAGNIFICATIONMaximum amount of magnification in the light-box.static intMAX_SELECTED_GRID_BORDERMaximum spacing of the selection border surrounding images in the light-box.private intmaxPagePanelSizeXDOCUMENT ME!private intmaxPagePanelSizeYDOCUMENT ME!private javax.swing.JMenuBarmenuBarVariables for the menubar.static floatMIN_MAGNIFICATIONMinimum amount of magnification in the light-box.private javax.swing.JButtonnextPageButtonelements of paging toolbar.private javax.swing.JMenuItemnextPageMenuItemDOCUMENT ME!private intnumPagesDOCUMENT ME!private intnumTotalSlicesDOCUMENT ME!private intnumTSlicesDOCUMENT ME!private intnumVisibleSlicesDOCUMENT ME!private javax.swing.JPanelpagePanelDOCUMENT ME!private intpagePanelSizeXDOCUMENT ME!private intpagePanelSizeYDOCUMENT ME!private javax.swing.JToolBarpagingTBarDOCUMENT ME!private int[]pixBufferDOCUMENT ME!private int[]pixBufferBDOCUMENT ME!private javax.swing.JButtonprevPageButtonDOCUMENT ME!private javax.swing.JMenuItemprevPageMenuItemDOCUMENT ME!private javax.swing.JButtonrepaintButtonDOCUMENT ME!private floatresolutionXDOCUMENT ME!private floatresolutionYDOCUMENT ME!private booleanrow_dependentIndicates which--row or column--should be dependent on the other.private java.awt.ColorselectedBorderColorColor for the line border surrounding each selected image in the light-box.private intselectedBorderSizeSpacing for the selected line border surrounding each image in the light-box.private java.util.Vector<java.lang.String>selectedImagesThe selectedImages contains the *real* slice numbers -- not the index of a slice on a page.private java.util.Vector<java.lang.String>selectedTimeSlicesThe selected Time Slices vector contains the real slice number and time slice number in the format (slice #).private javax.swing.JCheckBoxMenuItemselectIndividualTSlicesDOCUMENT ME!private static longserialVersionUIDUse serialVersionUID for interoperability.private booleansingleTSliceDOCUMENT ME!private ModelImagesrcImageDOCUMENT ME!private javax.swing.JToolBartBarDOCUMENT ME!private static javax.swing.JToggleButton[]toggleArrayElements of tBar.private javax.swing.JPaneltoolbarPanelVariables for the toolbar.private java.awt.ColorunselectedBorderColorDOCUMENT ME!private javax.swing.JCheckBoxMenuItemupdatePaintDOCUMENT ME!protected VOIManagerInterfacevoiManagerprivate intxScreenDOCUMENT ME!private intyScreenDOCUMENT ME!-
Fields inherited from class gov.nih.mipav.view.ViewJFrameBase
absoluteGoToButton, absoluteGoToPanel, absoluteLabel, absoluteLabelVals, absolutePanel, absoluteXLabel, absoluteXTextField, absoluteYLabel, absoluteYTextField, absoluteZLabel, absoluteZTextField, alphaBlend, defaultLUTa, defaultLUTb, displayMode, IMAGE_A, IMAGE_A_B, IMAGE_B, imageA, imageB, isClosing, linkedScrolling, linkFrame, linkTriFrame, progressBar, scannerLPS_APLabel, scannerLPS_APTextField, scannerLPS_GoToButton, scannerLPS_GoToPanel, scannerLPS_ISLabel, scannerLPS_ISTextField, scannerLPS_RLLabel, scannerLPS_RLTextField, scannerLPSLabel, scannerLPSLabelVals, scannerLPSPanel, scannerRAS_APLabel, scannerRAS_APTextField, scannerRAS_GoToButton, scannerRAS_GoToPanel, scannerRAS_ISLabel, scannerRAS_ISTextField, scannerRAS_RLLabel, scannerRAS_RLTextField, scannerRASLabel, scannerRASLabelVals, scannerRASPanel, scannerTabbedPane, tabbedPane, talGoToButton, talGoToPanel, talXLabel, talXTextField, talYLabel, talYTextField, talZLabel, talZTextField, userInterface, zoomMode
-
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
-
-
Constructor Summary
Constructors Constructor Description ViewJFrameLightBox(ViewJFrameImage imgFrame, java.lang.String _frameTitle, ModelImage _imageA, ModelLUT _LUTa, ModelImage _imageB, ModelLUT _LUTb, float resX, float resY, java.awt.Dimension loc, ViewControlsImage _controls, VOIManagerInterface voiManager)Builds the initial lightbox view.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)Handler for action events.private voidbuildMenuBar()Builds a simple menubar for this frame (ViewJFrameLightBox).voidbuildPage()Builds the panels for a page and adds them to the page.private voidbuildToolbar()Builds a simple toolbar for this frame (ViewJFrameLightBox).voidcalcImagePanelSize()Calculate the individual image panel size based on the current magnification of the image.voidcalcMaxPagePanelSize()Calculate the maximum page panel size based on the screen size, the size of the menubar and toolbars and whether the columns or rows are independent.intcalcNumPages()Calculate the number of pages.voidcalcPagePanelSize()Calculate the size of the page Panel.voidcalcScreenSize()Calculate the screen size in pixels.private voidcallExtractAlgorithm()call the ExractSlices algorithm, building the dest image based on the type of the src image.private voidcallRemoveAlgorithm()call the RemoveSlices algorithm, building the dest image based on the type of the src image.voidclose()Closes the frame.voidcloseImageA()Closes image A.voidcloseImageB()Closes image B.voidcomponentResized(java.awt.event.ComponentEvent event)Method called when a component resize event is generated.javax.swing.border.CompoundBorder[]createImageBorder(int size)This method creates the compound image border array for each image in the light box.private java.awt.ColorextractColor(java.lang.String preferencesColorString)Makes a series of ints, corresponding to a color string stored in the Mipav.preferences file which looks like a color string defined in web pages ("RRGGBB"). and returns a java.awt.Color based on those values.java.awt.ColorgetBorderColor()Returns the color of the image border.intgetBorderSize()Returns the size of the image border.ViewControlsImagegetControls()Gets control widgets for frame.intgetCurrentTSlice()Returns the current tslice.java.awt.ColorgetGridColor()Returns the color of the background of the grid panel.intgetGridColumn()getLightBoxCol - return the number of columns.intgetGridRow()Returns the number of rows.intgetGridSpacing()Returns the size of the space between image borders.ModelImagegetImageA()Returns the reference to imageA.ModelImagegetImageB()Returns the reference to imageB.intgetIncrement()Returns the increment between displayed slicesfloatgetMagMax()Returns the maximum magnification of the image.floatgetMagMin()Returns the minimum magnificaiton of the image.floatgetMagnification()Returns the present magnification of the image.intgetNumTotalSlices()Returns the number of images in the volume.intgetNumTSlices()Returns the number of time slices.booleangetRowDependent()Returns the row dependent flag.java.awt.ColorgetSelectedBorderColor()Returns the color of the selected image border.voidinitBuffers()Initializes the buffers that hold the image data.voidinitImageLUTs(ModelLUT _LUTa, ModelLUT _LUTb)Initializes the LUTs for the images.protected voidinvertSelections(boolean updateBorders)Method to invert the selection of slices in an image.voiditemStateChanged(java.awt.event.ItemEvent event)itemStateChanged.voidloadPage()Loads the currentPage images see loadPage(int page).voidloadPage(int page)Loads the images for a page into component images and then loads the page.private java.lang.StringmakeColorString(java.awt.Color aColor)Takes a java.awt.Color and forms a string representing its color. the string appears as 6 hex digits and looks like the color coding used in html files, as in: "RRGGBB".voidremoveControls()Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.private voidresize()Method that resizes the frame and adjusts the rows, columns as needed.protected voidselectAll()Method to select all the slices in an image.protected voidselectNone()Method to select none of the slices in an image.voidsetActiveImage(int active)Sets the active image for drawing VOIs.voidsetAlphaBlend(int value)Sets the alpha blending of parameter for two image displaying.voidsetBorderColor(java.awt.Color col)Sets the color of the image borders.voidsetBorderSize(int size)Sets the image border size.protected voidsetButtonStatus()Method to set the status of the delete and extract menuItems and Buttons based on the selectedImages vector.voidsetControls()Sets the menu and controls (i.e. toolbars) of the main frame!voidsetEnabled(boolean flag)Controls whether or not the images/VOIs of the frame can be modified.voidsetGridColor(java.awt.Color col)Sets the background color of the panel that is in the scrollpane.voidsetGridColumn(int col)This method is called when there is a change to the light box column number--in the limiting case.voidsetGridRow(int row)This method is called when there is a change to the light box row number--in the limiting case.voidsetGridSpacing(int width)Sets the distance between adjacent images. verifies that the width value is within bounds.voidsetHighlightColor(java.awt.Color col)Sets the color of all the images highlight to the specified color.voidsetImageA(ModelImage _imageA)Accessor that sets the reference to imageA.voidsetImageB(ModelImage _imageB)Accessor that sets the reference to imageB.voidsetIncrement(int _increment)Sets the increment between displayed slicesprotected voidsetMagMax()Sets the maximum magnification to the image. will ensure that the current magnification is not larger than the maximum.protected voidsetMagMin()Sets the minimum magnification to the image. will ensure that the current magnification is not smaller than the minimum.voidsetMagnification(float num)Sets the magnification of the images will ensure that the current magnification is not smaller than the minimum.voidsetMagnification(int num)Sets the magnification of the images will ensure that the current magnification is not larger than the maximum.voidsetPageToCurrentSlice()Sets the current page so that the current image slice is displayed.voidsetPageToSlice(int slice)Sets the page so that the given image slice is displayed.voidsetPaintBitmapSwitch(boolean paintBitmapSwitch)When switching the active image, copy the paintBitmap of the previous active image into the paintBitmap of the new active image.voidsetRGBTA(ModelRGB RGBT)The following 2 functions set the RGB tables for ARGB images A and B.voidsetRGBTB(ModelRGB RGBT)DOCUMENT ME!voidsetRowDependent(boolean imgMatrixIsRowDependent)setRowDependent -- sets the row dependent flag.voidsetSelectedBorderColor(java.awt.Color col)Sets the color of the selected image borders.voidsetSelectedBorderSize(int size)Sets the selected image border size.voidsetSlice(int slice)Used in ViewImageUpdateInterface.voidsetTimeSlice(int tslice)Sets the time slice if the image has 4 dimensions and updates the image and title.voidsetTitle()Sets the title of the frame with the image name of slice location.private voidsetupLightBox(ModelLUT LUTa, ModelLUT LUTb)Setup the light box view.booleansetZoom(float zX, float zY)Sets the scales that defines the magnification of the image.voidstoreToDefaults()Stores the current light box display properties.voidupdateBorderColor(java.awt.Color col)Sets the color of the image borders.voidupdateBorderSize(int size)Sets the image border size and then updates light box.voidupdateGridColor(java.awt.Color col)Sets the background color of the panel that is in the scrollpane.voidupdateGridColumn(int col)This method is called when there is a change to the light box column number verifies that the width value is within bounds.voidupdateGridRow(int row)This method is called when there is a change to the light box row number and then updates light box.voidupdateGridSpacing(int width)Set the distance between adjacent images and updates light box. verifies that the width value is within bounds.booleanupdateImage(int slice, boolean highlightFlag)This methods calls the componentImage's update method to repaint the screen.voidupdateImageBorder(int i)This methods updates the image border for a single slice.voidupdateImageBorders()This method updates all the image borders for a page.booleanupdateImageExtents()(Part of ViewImageUpdateInterface) This methods calls the componentImage's REPAINT method to redraw the screen.booleanupdateImages()This methods calls the componentImage's update method to repaint the screen.booleanupdateImages(boolean forceShow)This methods calls the componentImage's update method to redraw the screen.booleanupdateImages(ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)This methods calls the componentImage's update method to redraw the screen.voidupdateImageSelection(int plane, boolean applyToRange)Updates the image selection list by toggling the selection of the Z(3rd dimension) plane and the time (4th dimesion) volume.voidupdateImageSlice(int plane, int timeVolume)Updates the Z(3rd dimension) plane and the time (4th dimesion) volume.voidupdateIncrement(int increment)Sets the increment between displayed slices and updates the light box.private voidupdateLayout()Changes the layout of the light box (i.e. row or col) 1. reset the layout 2. reset the size of panel and pane 3.private voidupdateLightBoxLocation(java.lang.String ulCorner)Gets the string from the preferences and verifies the upper-left-hand verifies the upper-left-hand corner is within the screen boundaries.voidupdateMagnification(int num)Sets the magnification of the images and then updates light box.voidupdatePagingToolbar()Enable or disable the buttons on the paging toolbar and the view menu items based on the current page and the number of pages.voidupdateRowsColumns(boolean row_dependent, int row, int col)This method is called when there is a change to the light box setting for rows, columns, or row_dependency.voidupdateToolbarLayout()Updates the toolbar panel's layout based on the row dependcies.voidwindowActivated(java.awt.event.WindowEvent event)Over loaded so that it doesn't do anything.voidwindowClosing(java.awt.event.WindowEvent event)Ask user if really wishes to close the image frame.-
Methods inherited from class gov.nih.mipav.view.ViewJFrameBase
about, buildLabelPanel, canCloseImageBAfterLoad, close, componentHidden, componentMoved, componentShown, finalize, getAlphaBlend, getDefaultLUTa, getDefaultLUTb, getDisplayMode, getImageNameA, getImageNameB, getLastState, getLUTa, getLUTb, getRGBTA, getRGBTB, getTriImg, getUserInterface, handleMaskPopupMenu, handlePaintToMaskPopupMenu, handleZoomPopupMenu, initExtents, initImageBuffer, initLUT, initNumSlices, initPixelBuffer, initResFactor, initResolutions, initRGB, initSlicePositions, initUnits, initZoom, loadAllVOIs, loadAllVOIsFrom, loadImage, loadLUT, loadLUTandTransferFunctionFrom, loadLUTandTransferFunctionFrom, makeString, newFrameBeenCreated, openVOI, openVOI, pickImageFile, save, save, save, saveAllVOIs, saveAllVOIsTo, saveLabels, saveLUT, saveLUTandTransferFunction, saveLUTandTransferFunction, saveLUTAs, saveLUTAs, saveVOI, saveVOIAs, saveVOIAs, saveVOIIntensities, saveVOIIntensitiesTo, setAbsPositionLabels, setEnableCloseImageBAfterLoad, setLastState, setLinkedFrame, setLinkedTriFrame, setLUTa, setLUTb, setLUTs, setMessageText, setOpacityInfo, setpaintBitmap, setScannerPosition, stateChanged, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class javax.swing.JFrame
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
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
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
-
Methods inherited from class java.awt.Container
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, setFont, 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_MAX
private static final int DEFAULT_IMAGE_MAX
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_MIN
private static final int DEFAULT_IMAGE_MIN
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_XSCREEN_SPACE
private static final int DEFAULT_XSCREEN_SPACE
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_YSCREEN_SPACE
private static final int DEFAULT_YSCREEN_SPACE
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_DEPENDENT_ROW
public static final boolean DEFAULT_DEPENDENT_ROW
Default row is dependent, and column independent.the default is the number of rows is the dependent variable, and is dependent apon the total number of images and the number of columns.
- See Also:
- Constant Field Values
-
MIN_MAGNIFICATION
public static final float MIN_MAGNIFICATION
Minimum amount of magnification in the light-box.- See Also:
- Constant Field Values
-
MAX_MAGNIFICATION
public static final float MAX_MAGNIFICATION
Maximum amount of magnification in the light-box.- See Also:
- Constant Field Values
-
MAX_GRID_ROW
public static final int MAX_GRID_ROW
Maximum row value (when it is the independent variable).- See Also:
- Constant Field Values
-
MAX_GRID_COL
public static final int MAX_GRID_COL
Maximum column value (when it is the independent variable).- See Also:
- Constant Field Values
-
MAX_GRID_SIZE
public static final int MAX_GRID_SIZE
Maximum spacing in-between images in the light-box.- See Also:
- Constant Field Values
-
MAX_GRID_BORDER
public static final int MAX_GRID_BORDER
Maximum spacing of the border surrounding images in the light-box.- See Also:
- Constant Field Values
-
MAX_SELECTED_GRID_BORDER
public static final int MAX_SELECTED_GRID_BORDER
Maximum spacing of the selection border surrounding images in the light-box.- See Also:
- Constant Field Values
-
toggleArray
private static javax.swing.JToggleButton[] toggleArray
Elements of tBar.
-
activeSliceButton
private javax.swing.JButton activeSliceButton
DOCUMENT ME!
-
borderColor
private java.awt.Color borderColor
Color for the line border surrounding each image in the light-box.
-
borderSize
private int borderSize
Spacing for the line border surrounding each image in the light-box.
-
componentImage
private ViewJComponentEditImage[] componentImage
DOCUMENT ME!
-
controls
private ViewControlsImage controls
DOCUMENT ME!
-
currentPage
private int currentPage
Page information.
-
currentSelectedSlice
private int currentSelectedSlice
DOCUMENT ME!
-
currentSlice
private int currentSlice
Current info -- this slice info refers to the *real* slice number, not the page index for a slice on a page.
-
currentTSlice
private int currentTSlice
DOCUMENT ME!
-
deleteButton
private javax.swing.JButton deleteButton
DOCUMENT ME!
-
deleteSelection
private javax.swing.JMenuItem deleteSelection
DOCUMENT ME!
-
extractButton
private javax.swing.JButton extractButton
DOCUMENT ME!
-
extractSelection
private javax.swing.JMenuItem extractSelection
DOCUMENT ME!
-
interpolateShapesButton
private javax.swing.JButton interpolateShapesButton
DOCUMENT ME!
-
firstPageButton
private javax.swing.JButton firstPageButton
DOCUMENT ME!
-
firstPageMenuItem
private javax.swing.JMenuItem firstPageMenuItem
DOCUMENT ME!
-
frameHeight
private int frameHeight
DOCUMENT ME!
-
frameWidth
private int frameWidth
Frame information.
-
goToSliceText
private javax.swing.JTextField goToSliceText
DOCUMENT ME!
-
gridColor
private java.awt.Color gridColor
Color for the region in-between the images in the light-box.
-
gridColumn
private int gridColumn
DOCUMENT ME!
-
gridRow
private int gridRow
Value for the number of rows (number of images along the y-axis) and columns (number of images along the x-axis) in the light-box.Note that both row and column set to 1 cannot make sense, but that one or the other will be the 'dependent variable' as defined by the row_dependent boolean var.
A value of 0 means that the dependent variable will automatically be sized to its maximum size that can fit nicely on the screen.
-
gridSpacing
private int gridSpacing
Spacing between images in the light-box.
-
increment
private int increment
-
group
private javax.swing.ButtonGroup group
DOCUMENT ME!
-
imageBorder
private javax.swing.border.CompoundBorder[] imageBorder
DOCUMENT ME!
-
imageBufferA
private float[] imageBufferA
DOCUMENT ME!
-
imageBufferB
private float[] imageBufferB
DOCUMENT ME!
-
imageFrame
private ViewJFrameImage imageFrame
DOCUMENT ME!
-
imageHeight
private int imageHeight
DOCUMENT ME!
-
imagePanel
private javax.swing.JPanel[] imagePanel
DOCUMENT ME!
-
imagePanelSizeX
private int imagePanelSizeX
Per num visible images information.
-
imagePanelSizeY
private int imagePanelSizeY
Per num visible images information.
-
imageWidth
private int imageWidth
DOCUMENT ME!
-
lastPageButton
private javax.swing.JButton lastPageButton
DOCUMENT ME!
-
lastPageMenuItem
private javax.swing.JMenuItem lastPageMenuItem
DOCUMENT ME!
-
lastSelectedSlice
private int lastSelectedSlice
DOCUMENT ME!
-
lightBoxOptions
private JDialogLightBox lightBoxOptions
DOCUMENT ME!
-
LUTa
private ModelLUT LUTa
DOCUMENT ME!
-
LUTb
private ModelLUT LUTb
DOCUMENT ME!
-
magMax
private float magMax
DOCUMENT ME!
-
magMin
private float magMin
DOCUMENT ME!
-
magnification
private float magnification
Magnification of images in the light-box (mag is a percentage).
-
maxPagePanelSizeX
private int maxPagePanelSizeX
DOCUMENT ME!
-
maxPagePanelSizeY
private int maxPagePanelSizeY
DOCUMENT ME!
-
menuBar
private javax.swing.JMenuBar menuBar
Variables for the menubar.
-
nextPageButton
private javax.swing.JButton nextPageButton
elements of paging toolbar.
-
nextPageMenuItem
private javax.swing.JMenuItem nextPageMenuItem
DOCUMENT ME!
-
numPages
private int numPages
DOCUMENT ME!
-
numTotalSlices
private int numTotalSlices
DOCUMENT ME!
-
numTSlices
private int numTSlices
DOCUMENT ME!
-
numVisibleSlices
private int numVisibleSlices
DOCUMENT ME!
-
pagePanel
private javax.swing.JPanel pagePanel
DOCUMENT ME!
-
pagePanelSizeX
private int pagePanelSizeX
DOCUMENT ME!
-
pagePanelSizeY
private int pagePanelSizeY
DOCUMENT ME!
-
pagingTBar
private javax.swing.JToolBar pagingTBar
DOCUMENT ME!
-
pixBuffer
private int[] pixBuffer
DOCUMENT ME!
-
pixBufferB
private int[] pixBufferB
DOCUMENT ME!
-
prevPageButton
private javax.swing.JButton prevPageButton
DOCUMENT ME!
-
prevPageMenuItem
private javax.swing.JMenuItem prevPageMenuItem
DOCUMENT ME!
-
repaintButton
private javax.swing.JButton repaintButton
DOCUMENT ME!
-
resolutionX
private float resolutionX
DOCUMENT ME!
-
resolutionY
private float resolutionY
DOCUMENT ME!
-
row_dependent
private boolean row_dependent
Indicates which--row or column--should be dependent on the other.the default is the number of rows is the dependent variable, and is dependent apon the total number of images and the number of columns. Don't confuse the reading to be "This display is (t/f) dependent on the row." It -could- be read as "The display is a column-independent (t/f) matrix".
-
selectedBorderColor
private java.awt.Color selectedBorderColor
Color for the line border surrounding each selected image in the light-box.
-
selectedBorderSize
private int selectedBorderSize
Spacing for the selected line border surrounding each image in the light-box.
-
selectedImages
private java.util.Vector<java.lang.String> selectedImages
The selectedImages contains the *real* slice numbers -- not the index of a slice on a page. So the maximum number in the vector will be numTotalSlices - 1.
-
selectedTimeSlices
private java.util.Vector<java.lang.String> selectedTimeSlices
The selected Time Slices vector contains the real slice number and time slice number in the format (slice #).(time slice #) the maximum number in the vector will be numTotalSlices * t.
-
selectIndividualTSlices
private javax.swing.JCheckBoxMenuItem selectIndividualTSlices
DOCUMENT ME!
-
singleTSlice
private boolean singleTSlice
DOCUMENT ME!
-
srcImage
private ModelImage srcImage
DOCUMENT ME!
-
tBar
private javax.swing.JToolBar tBar
DOCUMENT ME!
-
toolbarPanel
private javax.swing.JPanel toolbarPanel
Variables for the toolbar.
-
unselectedBorderColor
private java.awt.Color unselectedBorderColor
DOCUMENT ME!
-
updatePaint
private javax.swing.JCheckBoxMenuItem updatePaint
DOCUMENT ME!
-
xScreen
private int xScreen
DOCUMENT ME!
-
yScreen
private int yScreen
DOCUMENT ME!
-
voiManager
protected VOIManagerInterface voiManager
-
-
Constructor Detail
-
ViewJFrameLightBox
public ViewJFrameLightBox(ViewJFrameImage imgFrame, java.lang.String _frameTitle, ModelImage _imageA, ModelLUT _LUTa, ModelImage _imageB, ModelLUT _LUTb, float resX, float resY, java.awt.Dimension loc, ViewControlsImage _controls, VOIManagerInterface voiManager)
Builds the initial lightbox view.- Parameters:
imgFrame- the parent image frame_frameTitle- title of the frame_imageA- model of image A_LUTa- Lookup table used for image A_imageB- model of image B_LUTb- Lookup table used for image BresX- x dimension image resolutionresY- y dimension image resolutionloc- location to display frame of image - NOT USED_controls- controls for the frame
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Handler for action events.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Specified by:
actionPerformedin classViewJFrameBase- Parameters:
event- event which trigger the call to the handler
-
buildPage
public void buildPage() throws java.lang.OutOfMemoryErrorBuilds the panels for a page and adds them to the page.- Throws:
java.lang.OutOfMemoryError- DOCUMENT ME!
-
calcImagePanelSize
public void calcImagePanelSize()
Calculate the individual image panel size based on the current magnification of the image.
-
calcMaxPagePanelSize
public void calcMaxPagePanelSize()
Calculate the maximum page panel size based on the screen size, the size of the menubar and toolbars and whether the columns or rows are independent.
-
calcNumPages
public int calcNumPages()
Calculate the number of pages. This is dependent on the number of visible slices and the number of total slices. It's possible that the last page will not be completely filled with images.- Returns:
- DOCUMENT ME!
-
calcPagePanelSize
public void calcPagePanelSize()
Calculate the size of the page Panel. First the maximum size of the pagePanel must have been determined. Once the maximum page panel size is determined, then the actual size may be reduced to nicely fit the current image panel size. This will also determine how many images will fit into the page panel.
-
calcScreenSize
public void calcScreenSize()
Calculate the screen size in pixels.
-
close
public void close()
Closes the frame.- Overrides:
closein classViewJFrameBase
-
closeImageA
public void closeImageA()
Closes image A.
-
closeImageB
public void closeImageB()
Closes image B.- Overrides:
closeImageBin classViewJFrameBase
-
componentResized
public void componentResized(java.awt.event.ComponentEvent event)
Method called when a component resize event is generated. This method snaps the size of the frame and pagePanel to the nearest row, column sizing (so the gridRow and gridColumn and page layout may change).- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener- Overrides:
componentResizedin classViewJFrameBase- Parameters:
event- DOCUMENT ME!
-
createImageBorder
public javax.swing.border.CompoundBorder[] createImageBorder(int size)
This method creates the compound image border array for each image in the light box. The outer border is a LineBorder that uses the border color defined in the settings. The inner border is also a Line Border, however it's color depends on whether an image is selected or not (see the selectedImages vector).- Parameters:
size- the number of images for which borders are needed- Returns:
- DOCUMENT ME!
-
getBorderColor
public java.awt.Color getBorderColor()
Returns the color of the image border.- Returns:
- the image border color.
-
getBorderSize
public int getBorderSize()
Returns the size of the image border.- Returns:
- the size of the image border.
-
getControls
public ViewControlsImage getControls()
Gets control widgets for frame.- Specified by:
getControlsin classViewJFrameBase- Returns:
- DOCUMENT ME!
-
getCurrentTSlice
public int getCurrentTSlice()
Returns the current tslice.- Returns:
- the current time slice.
-
getGridColor
public java.awt.Color getGridColor()
Returns the color of the background of the grid panel.- Returns:
- the background color of the grid panel.
-
getGridColumn
public int getGridColumn()
getLightBoxCol - return the number of columns.- Returns:
- the number of columns.
-
getGridRow
public int getGridRow()
Returns the number of rows.- Returns:
- the number of rows.
-
getGridSpacing
public int getGridSpacing()
Returns the size of the space between image borders.- Returns:
- the size of space between image borders.
-
getIncrement
public int getIncrement()
Returns the increment between displayed slices- Returns:
- increment between displayed slices
-
getImageA
public ModelImage getImageA()
Returns the reference to imageA.- Specified by:
getImageAin classViewJFrameBase- Returns:
- image
-
getImageB
public ModelImage getImageB()
Returns the reference to imageB.- Specified by:
getImageBin classViewJFrameBase- Returns:
- imageB
-
getMagMax
public float getMagMax()
Returns the maximum magnification of the image.- Returns:
- the maximum magnification of the image.
-
getMagMin
public float getMagMin()
Returns the minimum magnificaiton of the image.- Returns:
- the minimum magnification of the image.
-
getMagnification
public float getMagnification()
Returns the present magnification of the image.- Returns:
- the present magnification of the image.
-
getNumTotalSlices
public int getNumTotalSlices()
Returns the number of images in the volume.- Returns:
- the number of image (slices).
-
getNumTSlices
public int getNumTSlices()
Returns the number of time slices.- Returns:
- the number of time slices.
-
getRowDependent
public boolean getRowDependent()
Returns the row dependent flag.- Returns:
- the boolean indicating if rows are the dependent variable.
-
getSelectedBorderColor
public java.awt.Color getSelectedBorderColor()
Returns the color of the selected image border.- Returns:
- the selected image border color.
-
initBuffers
public void initBuffers()
Initializes the buffers that hold the image data.
-
initImageLUTs
public void initImageLUTs(ModelLUT _LUTa, ModelLUT _LUTb) throws java.lang.OutOfMemoryError
Initializes the LUTs for the images.- Parameters:
_LUTa- DOCUMENT ME!_LUTb- DOCUMENT ME!- Throws:
java.lang.OutOfMemoryError- DOCUMENT ME!
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent event)
itemStateChanged.- Specified by:
itemStateChangedin interfacejava.awt.event.ItemListener- Parameters:
event- DOCUMENT ME!
-
loadPage
public void loadPage() throws java.lang.OutOfMemoryErrorLoads the currentPage images see loadPage(int page).- Throws:
java.lang.OutOfMemoryError- DOCUMENT ME!
-
loadPage
public void loadPage(int page) throws java.lang.OutOfMemoryErrorLoads the images for a page into component images and then loads the page.- Parameters:
page- DOCUMENT ME!- Throws:
java.lang.OutOfMemoryError- DOCUMENT ME!
-
removeControls
public void removeControls()
Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.This function no longer loads its controls into the main control window however, this method is required because this class extends ViewJFrameBase
- Specified by:
removeControlsin classViewJFrameBase
-
setActiveImage
public void setActiveImage(int active)
Sets the active image for drawing VOIs.- Specified by:
setActiveImagein classViewJFrameBase- Parameters:
active- IMAGE_A or IMAGE_B
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.- Specified by:
setAlphaBlendin classViewJFrameBase- Parameters:
value- amount [0,100] that is the percentage of Image A to be displayed
-
setBorderColor
public void setBorderColor(java.awt.Color col)
Sets the color of the image borders.- Parameters:
col- color of the image borders
-
setBorderSize
public void setBorderSize(int size)
Sets the image border size.- Parameters:
size- thichness of the image border.
-
setControls
public void setControls()
Sets the menu and controls (i.e. toolbars) of the main frame! This puts the menus and controls needed to controls the operations of this frame. Different image frames have different menu and controls.This function no longer loads its controls into the main control window however, this method is required because this class extends ViewJFrameBase
- Specified by:
setControlsin classViewJFrameBase
-
setEnabled
public void setEnabled(boolean flag)
Controls whether or not the images/VOIs of the frame can be modified.- Specified by:
setEnabledin classViewJFrameBase- Parameters:
flag- if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
-
setGridColor
public void setGridColor(java.awt.Color col)
Sets the background color of the panel that is in the scrollpane.- Parameters:
col- the color the background of the panel that is in the scrollpane
-
setGridColumn
public void setGridColumn(int col)
This method is called when there is a change to the light box column number--in the limiting case. It ensures that the column value is within bounds.- Parameters:
col- the number of columns to be used to display the images
-
setGridRow
public void setGridRow(int row)
This method is called when there is a change to the light box row number--in the limiting case. It ensures that the row value is within bounds.- Parameters:
row- the number of rows to be used to display the images
-
setGridSpacing
public void setGridSpacing(int width)
Sets the distance between adjacent images. verifies that the width value is within bounds. If width is outside of bounds, method fails quietly.- Parameters:
width- the width of space between images.
-
setIncrement
public void setIncrement(int _increment)
Sets the increment between displayed slices- Parameters:
_increment- increment between displayed slices
-
setHighlightColor
public void setHighlightColor(java.awt.Color col)
Sets the color of all the images highlight to the specified color.- Parameters:
col- color of the image highlight
-
setImageA
public void setImageA(ModelImage _imageA)
Accessor that sets the reference to imageA.- Overrides:
setImageAin classViewJFrameBase- Parameters:
_imageA- image to set the frame to
-
setImageB
public void setImageB(ModelImage _imageB)
Accessor that sets the reference to imageB.- Specified by:
setImageBin classViewJFrameBase- Parameters:
_imageB- image to set the frame to
-
setMagnification
public void setMagnification(int num)
Sets the magnification of the images will ensure that the current magnification is not larger than the maximum.- Parameters:
num- number between magMin and magMax
-
setMagnification
public void setMagnification(float num)
Sets the magnification of the images will ensure that the current magnification is not smaller than the minimum.- Parameters:
num- number between magMin and magMax
-
setPageToCurrentSlice
public void setPageToCurrentSlice()
Sets the current page so that the current image slice is displayed.
-
setPageToSlice
public void setPageToSlice(int slice)
Sets the page so that the given image slice is displayed.- Parameters:
slice- - the image slice to display
-
setPaintBitmapSwitch
public void setPaintBitmapSwitch(boolean paintBitmapSwitch)
When switching the active image, copy the paintBitmap of the previous active image into the paintBitmap of the new active image.- Specified by:
setPaintBitmapSwitchin classViewJFrameBase- Parameters:
paintBitmapSwitch- DOCUMENT ME!
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
The following 2 functions set the RGB tables for ARGB images A and B.- Specified by:
setRGBTAin classViewJFrameBase- Parameters:
RGBT- DOCUMENT ME!
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
DOCUMENT ME!- Specified by:
setRGBTBin classViewJFrameBase- Parameters:
RGBT- DOCUMENT ME!
-
setRowDependent
public void setRowDependent(boolean imgMatrixIsRowDependent)
setRowDependent -- sets the row dependent flag.- Parameters:
imgMatrixIsRowDependent- DOCUMENT ME!
-
setSelectedBorderColor
public void setSelectedBorderColor(java.awt.Color col)
Sets the color of the selected image borders.- Parameters:
col- color of the selected image borders
-
setSelectedBorderSize
public void setSelectedBorderSize(int size)
Sets the selected image border size.- Parameters:
size- thichness of the selected image border.
-
setSlice
public void setSlice(int slice)
Used in ViewImageUpdateInterface. This method sets the- Specified by:
setSlicein interfaceViewImageUpdateInterface- Parameters:
slice- image plane
-
setTimeSlice
public void setTimeSlice(int tslice)
Sets the time slice if the image has 4 dimensions and updates the image and title.- Specified by:
setTimeSlicein interfaceViewImageUpdateInterface- Parameters:
tslice- time slice
-
setTitle
public void setTitle()
Sets the title of the frame with the image name of slice location.- Specified by:
setTitlein classViewJFrameBase
-
setZoom
public boolean setZoom(float zX, float zY)Sets the scales that defines the magnification of the image.- Parameters:
zX- zoom in the x directionzY- zoom in the y direction- Returns:
- DOCUMENT ME!
-
storeToDefaults
public void storeToDefaults()
Stores the current light box display properties.- row dependent
- grid row
- grid column
- grid size
- grid color
- border size
- border color
- magnification
- frame location
into the MipavPreferences file.
-
updateBorderColor
public void updateBorderColor(java.awt.Color col)
Sets the color of the image borders.- Parameters:
col- color of the image borders
-
updateBorderSize
public void updateBorderSize(int size)
Sets the image border size and then updates light box. Verifies that the width value is within bounds. If width is outside of bounds, method fails quietly.- Parameters:
size- thichness of the image border.
-
updateGridColor
public void updateGridColor(java.awt.Color col)
Sets the background color of the panel that is in the scrollpane.- Parameters:
col- the color the background of the panel that is in the scrollpane
-
updateGridColumn
public void updateGridColumn(int col)
This method is called when there is a change to the light box column number verifies that the width value is within bounds. If width is outside of bounds, method fails quietly. 1. recalculate the rows of the light box 2. recalculate the size of the scrollPanel and scrollPane 3. change the layout accordingly- Parameters:
col- the number of columns to be used to display the images
-
updateGridRow
public void updateGridRow(int row)
This method is called when there is a change to the light box row number and then updates light box. Verifies that the width value is within bounds row value. If width is outside of bounds, method fails quietly. 1. recalculate the columns of the light box 2. recalculate the size of the scrollPanel and scrollPane 3. change the layout accordingly- Parameters:
row- the number of rows to be used to display the images
-
updateGridSpacing
public void updateGridSpacing(int width)
Set the distance between adjacent images and updates light box. verifies that the width value is within bounds. If width is outside of bounds, method fails quietly.- Parameters:
width- the width of space between images.
-
updateIncrement
public void updateIncrement(int increment)
Sets the increment between displayed slices and updates the light box.- Parameters:
increment- between displayed slices
-
updateImage
public final boolean updateImage(int slice, boolean highlightFlag)This methods calls the componentImage's update method to repaint the screen. This will set the requested highlight when the repaint is issued. Use setSlice() to update a single frames highlight, as this will not set the current slice.- Parameters:
slice- the slice of the image to update -- NOT the index into the visible slices.highlightFlag- requests to paint the highlight around the component image- Returns:
- boolean confirming successful update see setSlice
- See Also:
ViewJComponentEditImage.useHighlight(boolean)
-
updateImageBorder
public void updateImageBorder(int i)
This methods updates the image border for a single slice.- Parameters:
i- the index of the image to update (NOT the slice number)
-
updateImageBorders
public void updateImageBorders()
This method updates all the image borders for a page. This needs to be called whenever a new page is loaded.
-
updateImageExtents
public boolean updateImageExtents()
(Part of ViewImageUpdateInterface) This methods calls the componentImage's REPAINT method to redraw the screen. The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.- Specified by:
updateImageExtentsin interfaceViewImageUpdateInterface- Specified by:
updateImageExtentsin classViewJFrameBase- Returns:
- DOCUMENT ME!
- See Also:
ViewImageUpdateInterface
-
updateImages
public final boolean updateImages()
This methods calls the componentImage's update method to repaint the screen.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Returns:
- boolean confirming successful update
-
updateImages
public final boolean updateImages(boolean forceShow)
This methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
forceShow- forces show to re import image and calc. java image- Returns:
- boolean confirming successful update
-
updateImages
public final boolean updateImages(ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
_LUTa- LUT used to update imageA_LUTb- LUT used to update imageBforceShow- forces show to re import image and calc. java imageinterpMode- image interpolation method (Nearest or Smooth)- Returns:
- boolean confirming successful update
-
updateImageSelection
public void updateImageSelection(int plane, boolean applyToRange)Updates the image selection list by toggling the selection of the Z(3rd dimension) plane and the time (4th dimesion) volume.- Parameters:
plane- image plane that is to displayedapplyToRange- the volume in which the plane the is to be displayed from
-
updateImageSlice
public void updateImageSlice(int plane, int timeVolume)Updates the Z(3rd dimension) plane and the time (4th dimesion) volume.- Parameters:
plane- image plane that is to displayedtimeVolume- the volume in which the plane the is to be displayed from
-
updateMagnification
public void updateMagnification(int num)
Sets the magnification of the images and then updates light box.- Parameters:
num- number between magMin and magMax
-
updatePagingToolbar
public void updatePagingToolbar()
Enable or disable the buttons on the paging toolbar and the view menu items based on the current page and the number of pages.
-
updateRowsColumns
public void updateRowsColumns(boolean row_dependent, int row, int col)This method is called when there is a change to the light box setting for rows, columns, or row_dependency.- Parameters:
row_dependent- boolean indicating if rows are the dependent variablesrow- int indicating the number of rows to display on a pagecol- int indicating the number of columns to display on a page
-
updateToolbarLayout
public void updateToolbarLayout()
Updates the toolbar panel's layout based on the row dependcies.
-
windowActivated
public void windowActivated(java.awt.event.WindowEvent event)
Over loaded so that it doesn't do anything.- Specified by:
windowActivatedin interfacejava.awt.event.WindowListener- Overrides:
windowActivatedin classViewJFrameBase- Parameters:
event- DOCUMENT ME!
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent event)
Ask user if really wishes to close the image frame.- Specified by:
windowClosingin interfacejava.awt.event.WindowListener- Overrides:
windowClosingin classViewJFrameBase- Parameters:
event- DOCUMENT ME!
-
invertSelections
protected void invertSelections(boolean updateBorders)
Method to invert the selection of slices in an image.- Parameters:
updateBorders- DOCUMENT ME!
-
selectAll
protected void selectAll()
Method to select all the slices in an image.
-
selectNone
protected void selectNone()
Method to select none of the slices in an image.
-
setButtonStatus
protected void setButtonStatus()
Method to set the status of the delete and extract menuItems and Buttons based on the selectedImages vector.
-
setMagMax
protected void setMagMax()
Sets the maximum magnification to the image. will ensure that the current magnification is not larger than the maximum.
-
setMagMin
protected void setMagMin()
Sets the minimum magnification to the image. will ensure that the current magnification is not smaller than the minimum.
-
buildMenuBar
private void buildMenuBar()
Builds a simple menubar for this frame (ViewJFrameLightBox).
-
buildToolbar
private void buildToolbar()
Builds a simple toolbar for this frame (ViewJFrameLightBox).
-
callExtractAlgorithm
private void callExtractAlgorithm()
call the ExractSlices algorithm, building the dest image based on the type of the src image. The ExtractSlices algorithm always extracts slices to a new dest image.
-
callRemoveAlgorithm
private void callRemoveAlgorithm()
call the RemoveSlices algorithm, building the dest image based on the type of the src image. The RemoveSlices algorithm always deletes slices from the src image, replacing the old src image.
-
extractColor
private java.awt.Color extractColor(java.lang.String preferencesColorString)
Makes a series of ints, corresponding to a color string stored in the Mipav.preferences file which looks like a color string defined in web pages ("RRGGBB"). and returns a java.awt.Color based on those values.Call with extractColor(Preferences.getProperty("OneOfThoseColors"));
if preferencesColorString is null, or incomplete, returns black.
- Parameters:
String- preferencesColorString-- this class pre-arranges the colors to be- Returns:
- java.awt.Color
- See Also:
Color
-
makeColorString
private java.lang.String makeColorString(java.awt.Color aColor)
Takes a java.awt.Color and forms a string representing its color. the string appears as 6 hex digits and looks like the color coding used in html files, as in: "RRGGBB".- Parameters:
aColor- the color to be converted to a hexidecimal- Returns:
- hexa-decimal string representing the 8-bit values of an RGB color, in the form of "RRGGBB".
-
resize
private void resize()
Method that resizes the frame and adjusts the rows, columns as needed.
-
setupLightBox
private void setupLightBox(ModelLUT LUTa, ModelLUT LUTb)
Setup the light box view. A scrollpane is added to the frame. A panel with a grid layout is added to the scrollpane. Bordered panels the size of the image are added to each position of the grid. Lastly image slices are added to each bordered panel.- Parameters:
LUTa- Lookup table used to display image A.LUTb- Lookup table used to display image B.
-
updateLayout
private void updateLayout()
Changes the layout of the light box (i.e. row or col) 1. reset the layout 2. reset the size of panel and pane 3. resize accordinglyThis will work for simple layout updates --- where the new page size can fit on the screen. If the number of pages decrease, then the page needs to be rebuilt.
-
updateLightBoxLocation
private void updateLightBoxLocation(java.lang.String ulCorner)
Gets the string from the preferences and verifies the upper-left-hand verifies the upper-left-hand corner is within the screen boundaries. So long as it is within screen boundaries, sets the frame to the given location. String is specified by: "x,y" where x & y are pixel locations (ints in those dimensions).- Parameters:
ulCorner- DOCUMENT ME!
-
-