com.jbbres.lib.actions.tools.swing
Class JImageSelection

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jbbres.lib.actions.tools.swing.JImageSelection
All Implemented Interfaces:
com.jbbres.lib.PropertiesOwner, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class JImageSelection
extends javax.swing.JPanel
implements com.jbbres.lib.PropertiesOwner

This panel allow the user to select a file, either by choosing one of the variables of the workflow, either by choosing a file on the hard drive.


Release Notes:

v1.1.0:

  • Use JXFileChooser instead of JXFileChooser
  • Since:
    1.0.0
    Version:
    1.1.0
    Author:
    Jean-Baptiste Bres
    See Also:
    Serialized Form

    Nested Class Summary
     
    Nested classes/interfaces inherited from class javax.swing.JComponent
    javax.swing.JComponent.AccessibleJComponent
     
    Nested classes/interfaces inherited from class java.awt.Component
    java.awt.Component.BaselineResizeBehavior
     
    Field Summary
     
    Fields inherited from class javax.swing.JComponent
    TOOL_TIP_TEXT_KEY, 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
    JImageSelection()
              Create the JFileSelection.
    JImageSelection(java.io.File defaultImage)
              Create the JFileSelection.
    JImageSelection(Workflow workflow)
              Create the JImageSelection.
    JImageSelection(Workflow workflow, java.io.File defaultImage)
              Create the JFileSelection.
     
    Method Summary
     void addActionListener(java.awt.event.ActionListener l)
              Add a listener.
     void addStaticImageFile(java.io.File file)
              Add a static file to the list.
     void fireActionPerformed()
              Reports an action.
     java.util.Properties getProperties()
              Returns an Properties object that can be used by an Element for saving the selected file.
     java.awt.Image getSelectedImage()
              Return the selected image.
     void removeActionListener(java.awt.event.ActionListener l)
              Remove a listener.
     void removeStaticImageFile(java.io.File file)
              Remove a static file.
     boolean setEditable(boolean e)
              Set the panel editable.
     void setEnabled(boolean e)
              Set the panel enabled.
     void setProperties(java.util.Properties properties)
              Restore the selected file based on the properties provided.
     void setWorkflow(Workflow workflow)
              Set the workflow that this panel is working on.
     
    Methods inherited from class javax.swing.JPanel
    getAccessibleContext, getUI, getUIClassID, setUI, updateUI
     
    Methods inherited from class javax.swing.JComponent
    addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
     
    Methods inherited from class java.awt.Container
    add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
     
    Methods inherited from class java.awt.Component
    action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    JImageSelection

    public JImageSelection(Workflow workflow)
    Create the JImageSelection.

    Parameters:
    workflow - Associated workflow.

    JImageSelection

    public JImageSelection()
    Create the JFileSelection.
    In order to access to the variables, you have to set the workflow by calling the setWorkflow method.


    JImageSelection

    public JImageSelection(java.io.File defaultImage)
    Create the JFileSelection.
    In order to access to the variables, you have to set the workflow by calling the setWorkflow method.

    Parameters:
    defaultImage - image

    JImageSelection

    public JImageSelection(Workflow workflow,
                           java.io.File defaultImage)
    Create the JFileSelection.

    Parameters:
    workflow - Associated workflow.
    defaultImage - File
    Method Detail

    addStaticImageFile

    public void addStaticImageFile(java.io.File file)
    Add a static file to the list. Use this function if you want the user to see a file that can be selected directly from the list, without having to select "other..." and then choose a file.

    Parameters:
    file - - file to be added
    See Also:
    removeStaticImageFile(File)

    removeStaticImageFile

    public void removeStaticImageFile(java.io.File file)
    Remove a static file.

    Parameters:
    file - - file to be removed.
    See Also:
    addStaticImageFile(File)

    setWorkflow

    public void setWorkflow(Workflow workflow)
    Set the workflow that this panel is working on. The variables of the workflow will be available in the list.

    Parameters:
    workflow - - Workflow

    getSelectedImage

    public java.awt.Image getSelectedImage()
    Return the selected image.

    Returns:
    the selected Image

    getProperties

    public java.util.Properties getProperties()
    Returns an Properties object that can be used by an Element for saving the selected file.

    Specified by:
    getProperties in interface com.jbbres.lib.PropertiesOwner
    Returns:
    - A Properties object

    setProperties

    public void setProperties(java.util.Properties properties)
    Restore the selected file based on the properties provided.

    Specified by:
    setProperties in interface com.jbbres.lib.PropertiesOwner
    Parameters:
    properties - - properties to applied.

    setEditable

    public boolean setEditable(boolean e)
    Set the panel editable.

    Parameters:
    e - boolean
    Returns:
    true, if sets the editable

    setEnabled

    public void setEnabled(boolean e)
    Set the panel enabled.

    Overrides:
    setEnabled in class javax.swing.JComponent
    Parameters:
    e - boolean

    addActionListener

    public void addActionListener(java.awt.event.ActionListener l)
    Add a listener.

    Parameters:
    l - - ActionListener

    removeActionListener

    public void removeActionListener(java.awt.event.ActionListener l)
    Remove a listener.

    Parameters:
    l - - ActionListener

    fireActionPerformed

    public void fireActionPerformed()
    Reports an action.



    To file bugs or suggest feature enhancements, visit the app.jbbres.com Bug Reporter website.

    Additional documentation available online at http://app.jbbres.com/actions/developers.

    Copyright � 2009-2011 app.jbbres.com. All Rights Reserved.