public class ControlJPanel extends JPanel
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ControlJPanel()
Constructs a control panel for interactive SIOX segmentation on given image.
|
Modifier and Type | Method and Description |
---|---|
void |
addImageWindowListener(InternalFrameListener windowListener)
Add an
InternalFrameListener to any internal frame
for displaying an image. |
void |
addImageWindowListener(WindowListener windowListener)
Add a
WindowListener to any image display window (except
internal frames), wether it is now open or opened in the future. |
boolean |
closeImage()
Closes the image display, if there is an open one.
|
Action |
createSetBgAction(Color color,
String name)
Creates an action for setting the background to the image,
ie marking transparent areas.
|
Action |
createSetBgAction(Icon tileIcon,
String name,
Icon smallIcon)
Creates an action for setting the background to the image,
ie marking transparent areas.
|
Action |
createSetRulerAction(int type)
Creates an action for setting the rulers for the currently shown
image display.
|
Action |
createZoomAction(int factor,
boolean zoomIn)
Creates an action to zoom the shown image.
|
void |
enableCheckForUnsavedChanges(boolean on)
Enables or disable checks for unsaved changes in
closeImage() . |
JDesktopPane |
getDesktopPane(JDesktopPane jDesktopPane)
Returns the desktop to open image displays in, whicha are then
contained in internal frames.
|
boolean |
hasUnsavedChanges()
Checks currently shown image for unsaved changes, if there is nay.
|
void |
openImage(String title,
BufferedImage image)
Opens the given image for editing into a dialog with the
given title (
null ) for none) and displays the
dialog. |
boolean |
removeImageWindowListener(InternalFrameListener windowListener)
Removes a
InternalFrameListener for internal image frames. |
boolean |
removeImageWindowListener(WindowListener windowListener)
Removes a
WindowListener for image dialogs. |
void |
reset()
Reset image, its selections, and the other GUI components.
|
void |
setDesktopPane(JDesktopPane jDesktopPane)
Set a desktop to open image displays in, contained by internal frames.
|
boolean |
storeCurrentImageTo(File outfile,
boolean needToConfirmOverwrite)
Stores current image as PNG.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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
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, 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 ControlJPanel()
public void enableCheckForUnsavedChanges(boolean on)
closeImage()
.
By default the check is enabled, but for environments, wherr save is notr possible (ie unsigned Applets) this may be undesirable.
public boolean closeImage()
The user may cancel this, if there are unsaved changes,
unless.
The method returns true
on uncanceled close
or if there is no opened image anyway.
public JDesktopPane getDesktopPane(JDesktopPane jDesktopPane)
If null
(which is the default on creation), the
images will be displayed in dialogs instead.
setDesktopPane(javax.swing.JDesktopPane)
public void setDesktopPane(JDesktopPane jDesktopPane)
If set to null
(which is the default on creation), the
images will be displayed in dialogs instead.
getDesktopPane(javax.swing.JDesktopPane)
public void addImageWindowListener(WindowListener windowListener)
WindowListener
to any image display window (except
internal frames), wether it is now open or opened in the future.
Can be used to track if any image is opened (in dialog, not in an internal frame).
public boolean removeImageWindowListener(WindowListener windowListener)
WindowListener
for image dialogs.public void addImageWindowListener(InternalFrameListener windowListener)
InternalFrameListener
to any internal frame
for displaying an image.
Can be used to track if any image is opened (in an internal frame, not in a dialog).
public boolean removeImageWindowListener(InternalFrameListener windowListener)
InternalFrameListener
for internal image frames.public void openImage(String title, BufferedImage image)
null
) for none) and displays the
dialog.public boolean hasUnsavedChanges()
public boolean storeCurrentImageTo(File outfile, boolean needToConfirmOverwrite)
outfile
- Target to write the file to.needToConfirmOverwrite
- If true, user is queried before an
existing file is overwritten.public void reset()
public Action createZoomAction(int factor, boolean zoomIn)
factor
- the strictly positive zoom factor.zoomIn
- determies if the image should be shown zoomed in
(magnified) or zoomed out (scaled down).public Action createSetBgAction(Icon tileIcon, String name, Icon smallIcon)
tileIcon
- background will be set to given icon as tiles.
A null
will set the background to it default
apperance.name
- description of the background to be used as action
name.smallIcon
- optional small icon for action to be displayed
in toolbars, menue items, etc, usually a scaled down
version of the tileIcon (as 24*24 or 16*16 pixel icon).public Action createSetBgAction(Color color, String name)
color
- the color background will be set to.name
- name of the color to be used as action name.public Action createSetRulerAction(int type)
type
- the type of ruler to be shown, one of
ScrollDisplay.NO_RULER
ScrollDisplay.EMPTY_RULER
,
ScrollDisplay.METRIC_RULER
,
ScrollDisplay.INCH_RULER
, and
ScrollDisplay.PIXEL_RULER
.ScrollDisplay.NO_RULER
,
ScrollDisplay.EMPTY_RULER
,
ScrollDisplay.METRIC_RULER
,
ScrollDisplay.INCH_RULER
,
ScrollDisplay.PIXEL_RULER
Copyright © 2015–2021 Fiji. All rights reserved.