|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.sciss.gui.SpringPanel
de.sciss.gui.PathField
public class PathField
This class is an updated (slim) version
of FScape's PathField
and provides a GUI object
that displays a file's or folder's path,
optionally with format information, and allows
the user to browse the harddisk to change
to a different file.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.sciss.gui.SpringPanel |
---|
SpringPanel.ComponentHeightRatioSpring, SpringPanel.ComponentWidthRatioSpring, SpringPanel.RatioSpring |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static java.awt.Color |
COLOR_PROPSET
|
protected ColouredTextField |
ggFormat
|
protected de.sciss.gui.PathField.IOTextField |
ggPath
|
protected static int |
myMeta
|
protected java.lang.String |
protoScheme
|
protected java.lang.String |
scheme
|
static int |
TYPE_BASICMASK
type flag : the bitmask for all path types |
static int |
TYPE_FOLDER
type flag : path to be chosen is a folder |
static int |
TYPE_FORMATFIELD
type flag : request an extra gadget to view file information |
static int |
TYPE_INPUTFILE
type flag : file is used for input / reading |
static int |
TYPE_OUTPUTFILE
type flag : file is used for output / writing |
protected static PathList |
userPaths
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 | |
---|---|
PathField()
|
|
PathField(int type)
|
|
PathField(int type,
java.lang.String dlgTxt)
Create a new PathField |
Method Summary | |
---|---|
protected java.lang.String |
abbrScheme(java.lang.String orig)
|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addPathListener(PathListener listener)
Registers a PathListener
which will be informed about changes of
the path (i.e. user selections in the
file chooser or text editing). |
protected PathButton |
createPathButton(int buttonType)
|
void |
deriveFrom(PathField[] sp,
java.lang.String s)
PathField offers a mechanism to automatically derive
a path name from a "mother" PathField . |
protected java.lang.String |
evalScheme(java.lang.String s)
|
protected java.lang.String |
expandScheme(java.lang.String orig)
|
java.lang.String |
getFormat()
Get the string displayed in the format gadget. |
java.io.File |
getPath()
Returns the path displayed in the gadget. |
int |
getType()
Gets the type of the path field. |
void |
pathChanged(PathEvent e)
Notifies the listener that a path changed occured. |
void |
processEvent(BasicEvent e)
Processes the next event in the queue. |
void |
removePathListener(PathListener listener)
Unregisters a PathListener
from receiving path change events. |
boolean |
requestFocusInWindow()
|
void |
selectFileName(boolean extention)
Selects the file name portion of the text contents. |
void |
setErrWhenExistsOn(boolean onOff)
|
void |
setErrWhenWriteProtected(boolean onOff)
|
void |
setFormat(java.lang.String txt,
boolean success)
Change the contents of the format gadget. |
void |
setPath(java.io.File path)
Sets the gadget's path. |
protected void |
setPathAndDispatchEvent(java.io.File path)
Sets a new path and dispatches a PathEvent
to registered listeners |
void |
setWarnWhenExists(boolean onOff)
|
protected java.lang.String |
udirScheme(java.lang.String orig,
int idx)
|
Methods inherited from class de.sciss.gui.SpringPanel |
---|
gridAdd, gridAdd, gridAdd, makeCompactGrid, makeCompactGrid, makeGrid, setInitialX, setInitialY, setPadding, setTitle, setXPad, setYPad |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, 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 |
Methods inherited from class java.awt.Container |
---|
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, transferFocusBackward, 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, 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, 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, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_BASICMASK
public static final int TYPE_INPUTFILE
public static final int TYPE_FORMATFIELD
public static final int TYPE_OUTPUTFILE
public static final int TYPE_FOLDER
protected static PathList userPaths
protected final de.sciss.gui.PathField.IOTextField ggPath
protected ColouredTextField ggFormat
protected static final java.awt.Color COLOR_PROPSET
protected java.lang.String scheme
protected java.lang.String protoScheme
protected static final int myMeta
Constructor Detail |
---|
public PathField()
public PathField(int type)
public PathField(int type, java.lang.String dlgTxt)
PathField
type
- one of the types covered by TYPE_BASICMASK
bitwise-OR optional displays like TYPE_FORMATFIELDdlgTxt
- the text string to display in the filechooser or null
Method Detail |
---|
public void setPath(java.io.File path)
path
- the new path for the buttonpublic void setWarnWhenExists(boolean onOff)
public void setErrWhenExistsOn(boolean onOff)
public void setErrWhenWriteProtected(boolean onOff)
protected void setPathAndDispatchEvent(java.io.File path)
PathEvent
to registered listeners
path
- the new path for the gadget and the eventpublic java.io.File getPath()
File
corresponding to the path string in the gadgetpublic void setFormat(java.lang.String txt, boolean success)
txt
- Text to be displayed in the format gadgetsuccess
- false
indicates file format parse error
and will render the format gadget red.
java.lang.IllegalStateException
- if the path field doesn't have a format gadgetpublic java.lang.String getFormat()
null
if the path field has no format gadget.public int getType()
TYPE_BASICMASK
to query the
file access type.public void selectFileName(boolean extention)
extention
- whether to include the file name suffix or notpublic boolean requestFocusInWindow()
requestFocusInWindow
in class javax.swing.JComponent
public void deriveFrom(PathField[] sp, java.lang.String s)
PathField
offers a mechanism to automatically derive
a path name from a "mother" PathField
. This applies
usually to output files whose names are derived from
PathFields which represent input paths. The provided
'scheme' String can contain the Tags
$Dx = Directory of superPath x; $Fx = Filename; $E = Extension; $Bx = Brief filenamewhere 'x' is the index in the provided array of mother PathFields. Whenever the mother contents changes, the child PathField will recalculate its name. When the user changes the contents of the child PathField, an algorithm tries to find out which components are related to the mother's pathname, parts that cannot be identified will not be automatically changing any more unless the user completely clears the PathField (i.e. restores full automation).
The user can abbreviate or extend filenames by pressing the appropriate key; in this case the $F and $B tags are exchanged in the scheme.
sp
- array of mother path fields to listen tos
- automatic formatting scheme which can incorporate
placeholders for the mother fields' paths.public void addPathListener(PathListener listener)
PathListener
which will be informed about changes of
the path (i.e. user selections in the
file chooser or text editing).
listener
- the PathListener
to registerEventManager.addListener( Object )
public void removePathListener(PathListener listener)
PathListener
from receiving path change events.
listener
- the PathListener
to unregisterEventManager.removeListener( Object )
public void processEvent(BasicEvent e)
EventManager.Processor
processEvent
in interface EventManager.Processor
protected java.lang.String evalScheme(java.lang.String s)
protected java.lang.String abbrScheme(java.lang.String orig)
protected java.lang.String expandScheme(java.lang.String orig)
protected java.lang.String udirScheme(java.lang.String orig, int idx)
protected PathButton createPathButton(int buttonType)
public void pathChanged(PathEvent e)
PathListener
pathChanged
in interface PathListener
e
- the event describing
the path changepublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |