freaklamarsch.awt
Class FLMDirectoryCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--freaklamarsch.awt.FLMDirectoryCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

class FLMDirectoryCanvas
extends java.awt.Canvas
implements java.awt.event.MouseListener, java.awt.ItemSelectable


Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  FLMResizableArray dirs
           
(package private)  FLMResizableArray files
           
(package private)  int gapSize
           
(package private)  int iconWidth
           
(package private)  java.awt.Image image
           
(package private)  FLMResizableArray itemListeners
           
(package private)  int lineHeight
           
(package private)  java.awt.FontMetrics metrics
           
(package private)  java.awt.Dimension preferredSize
           
(package private)  int spacing
           
 
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
(package private) FLMDirectoryCanvas(java.io.File dir)
           
(package private) FLMDirectoryCanvas(java.io.File dir, java.io.FilenameFilter filter)
           
(package private) FLMDirectoryCanvas(java.lang.String dir)
           
(package private) FLMDirectoryCanvas(java.lang.String dir, java.io.FilenameFilter filter)
           
 
Method Summary
 void addItemListener(java.awt.event.ItemListener il)
           
 void createBufferImage()
           
 java.lang.String getDirectory()
          Gets the directory of this file dialog.
 java.lang.String getFile()
          Gets the selected file of this file dialog.
 java.awt.Image getFileIcon()
           
 java.io.FilenameFilter getFilenameFilter()
          Determines this file dialog's filename filter.
 java.awt.Image getFolderIcon()
           
 java.awt.Image getParentIcon()
           
 java.lang.Object[] getSelectedObjects()
           
static void main(java.lang.String[] args)
           
 java.awt.Dimension minimumSize()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void openParent()
           
 void paint(java.awt.Graphics g)
           
 java.awt.Dimension preferredSize()
           
 void reload()
           
 void removeItemListener(java.awt.event.ItemListener il)
           
(package private)  void selectFile(java.io.File f)
          Selects a specific file.
(package private)  void selectFile(int yPos)
           
 void setDirectory(java.lang.String dir)
          Sets the directory of this file dialog window to be the specified directory.
 void setFile(java.io.File file)
          Sets the selected file for this file dialog window to be the specified file.
 void setFilenameFilter(java.io.FilenameFilter filter)
          Sets the filename filter for this file dialog window to the specified filter.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

files

FLMResizableArray files

dirs

FLMResizableArray dirs

itemListeners

FLMResizableArray itemListeners

gapSize

int gapSize

spacing

int spacing

metrics

java.awt.FontMetrics metrics

image

java.awt.Image image

lineHeight

int lineHeight

iconWidth

int iconWidth

preferredSize

java.awt.Dimension preferredSize
Constructor Detail

FLMDirectoryCanvas

FLMDirectoryCanvas(java.lang.String dir)

FLMDirectoryCanvas

FLMDirectoryCanvas(java.lang.String dir,
                   java.io.FilenameFilter filter)

FLMDirectoryCanvas

FLMDirectoryCanvas(java.io.File dir)

FLMDirectoryCanvas

FLMDirectoryCanvas(java.io.File dir,
                   java.io.FilenameFilter filter)
Method Detail

reload

public void reload()

createBufferImage

public void createBufferImage()

openParent

public void openParent()

minimumSize

public java.awt.Dimension minimumSize()
Overrides:
minimumSize in class java.awt.Component

preferredSize

public java.awt.Dimension preferredSize()
Overrides:
preferredSize in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Canvas

selectFile

void selectFile(int yPos)

selectFile

void selectFile(java.io.File f)
Selects a specific file. If the file is not in the current directory, nothing is done If the file is a directory, the file is opened in the canvas


getDirectory

public java.lang.String getDirectory()
Gets the directory of this file dialog.

Returns:
the directory of this file dialog.

setDirectory

public void setDirectory(java.lang.String dir)
Sets the directory of this file dialog window to be the specified directory.

Parameters:
dir - the specific directory.

getFile

public java.lang.String getFile()
Gets the selected file of this file dialog.

Returns:
the currently selected file of this file dialog window, or null if none is selected.

setFile

public void setFile(java.io.File file)
Sets the selected file for this file dialog window to be the specified file. This file becomes the default file if it is set before the file dialog window is first shown.

Parameters:
file - the file being set. public void setFile(String file) { try { this.file = file; stateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, new File(file), ItemEvent.SELECTED)); } catch(NullPointerException npe) { this.file = null; stateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); } System.out.println("FILE = "+this.file); }

getFilenameFilter

public java.io.FilenameFilter getFilenameFilter()
Determines this file dialog's filename filter. A filename filter allows the user to specify which files appear in the file dialog window.

Returns:
this file dialog's filename filter.

setFilenameFilter

public void setFilenameFilter(java.io.FilenameFilter filter)
Sets the filename filter for this file dialog window to the specified filter.

Parameters:
filter - the specified filter.

getFolderIcon

public java.awt.Image getFolderIcon()

getFileIcon

public java.awt.Image getFileIcon()

getParentIcon

public java.awt.Image getParentIcon()

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

addItemListener

public void addItemListener(java.awt.event.ItemListener il)
Specified by:
addItemListener in interface java.awt.ItemSelectable

removeItemListener

public void removeItemListener(java.awt.event.ItemListener il)
Specified by:
removeItemListener in interface java.awt.ItemSelectable

getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Specified by:
getSelectedObjects in interface java.awt.ItemSelectable

main

public static void main(java.lang.String[] args)