|
|||||||||||
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
org.htmlparser.lexerapplications.thumbelina.Thumbelina
View images behind thumbnails.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected boolean |
mActive
Activity state. |
protected javax.swing.JCheckBox |
mBackgroundToggle
Background thread checkbox in status bar. |
protected java.lang.String |
mCurrentURL
The URL being currently being examined. |
protected boolean |
mDiscardCGI
If true , does not follow links containing cgi calls. |
protected boolean |
mDiscardQueries
If true , does not follow links containing queries (?). |
protected javax.swing.JList |
mHistory
History list. |
protected javax.swing.JScrollPane |
mHistoryScroller
Scroller for the history list. |
protected javax.swing.JSplitPane |
mMainArea
Main panel in central area. |
protected PicturePanel |
mPicturePanel
The central area for pictures. |
protected javax.swing.JScrollPane |
mPicturePanelScroller
Scroller for the picture panel. |
protected javax.swing.JPanel |
mPowerBar
Status bar. |
protected java.beans.PropertyChangeSupport |
mPropertySupport
Bound property support. |
protected javax.swing.JProgressBar |
mQueueProgress
Image request queue monitor in status bar. |
protected javax.swing.JLabel |
mQueueSize
URL queue size display in status bar. |
protected javax.swing.JProgressBar |
mReadyProgress
Image ready queue monitor in status bar. |
protected java.util.HashMap |
mRequested
Images requested. |
protected javax.swing.JCheckBox |
mRunToggle
Sequencer thread toggle in status bar. |
protected Sequencer |
mSequencer
The picture sequencer. |
protected javax.swing.JSlider |
mSpeedSlider
Sequencer speed slider in status bar. |
protected java.lang.Thread |
mThread
Background thread. |
protected java.util.HashMap |
mTracked
Images being tracked currently. |
protected javax.swing.JTextField |
mUrlText
URL report in status bar. |
protected java.util.HashMap |
mVisited
URL's visited. |
protected javax.swing.JLabel |
mVisitedSize
URL visited count display in status bar. |
protected static java.net.URL[][] |
NONE
Value returned when no links are discovered. |
static java.lang.String |
PROP_CURRENT_URL_PROPERTY
Property name for current URL binding. |
static java.lang.String |
PROP_URL_QUEUE_PROPERTY
Property name for queue size binding. |
static java.lang.String |
PROP_URL_VISITED_PROPERTY
Property name for visited URL size binding. |
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 | |
Thumbelina()
Creates a new instance of Thumbelina. |
|
Thumbelina(java.lang.String url)
Creates a new instance of Thumbelina. |
|
Thumbelina(java.net.URL url)
Creates a new instance of Thumbelina. |
Method Summary | |
void |
addHistory(java.lang.String url)
Adds the given url to the history list. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
append(java.util.ArrayList list)
Append the given URLs to the queue. |
void |
append(java.net.URL url)
Append the given URL to the queue. |
protected java.net.URL[][] |
extractImageLinks(Lexer lexer,
java.net.URL docbase)
Get the links of an element of a document. |
protected void |
fetch(java.net.URL[] images)
Fetch images. |
protected java.util.ArrayList |
filter(java.net.URL[] urls)
Filter URLs and add to queue. |
boolean |
getBackgroundThreadActive()
Gets the state of the background thread. |
java.lang.String |
getCurrentURL()
Return the URL currently being examined. |
boolean |
getHistoryListVisible()
Gets the state of history list visibility. |
protected java.net.URL[][] |
getImageLinks(java.net.URL url)
Get the image links from the current URL. |
PicturePanel |
getPicturePanel()
Get the picture panel object encapsulated by this Thumbelina. |
java.util.ArrayList |
getQueue()
Getter for property queue. |
int |
getQueueSize()
Getter for property queue. |
boolean |
getSequencerActive()
Gets the state of the sequencer thread. |
int |
getSpeed()
Get the sequencer delay time. |
boolean |
getStatusBarVisible()
Gets the state of status bar visibility. |
protected static void |
help()
Provide command line help. |
boolean |
isDiscardCGI()
Getter for property discardCGI. |
boolean |
isDiscardQueries()
Getter for property discardQueries. |
protected boolean |
isImage(java.lang.String url)
Check if the url looks like an image. |
void |
itemStateChanged(java.awt.event.ItemEvent event)
Handle checkbox events from the status bar. |
static void |
main(java.lang.String[] args)
Mainline. |
protected void |
memCheck()
Check for low memory situation. |
void |
open(java.lang.String ref)
Open a URL. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
reset()
Reset this Thumbelina. |
void |
run()
The main processing loop. |
void |
setBackgroundThreadActive(boolean active)
Sets the state of the background thread activity. |
protected void |
setCurrentURL(java.lang.String url)
Set the current URL being examined. |
void |
setDiscardCGI(boolean discard)
Setter for property discardCGI. |
void |
setDiscardQueries(boolean discard)
Setter for property discardQueries. |
void |
setHistoryListVisible(boolean visible)
Sets the history list visibility. |
void |
setSequencerActive(boolean active)
Sets the sequencer activity state. |
void |
setSpeed(int speed)
Set the sequencer delay time. |
void |
setStatusBarVisible(boolean visible)
Sets the status bar visibility. |
void |
stateChanged(javax.swing.event.ChangeEvent event)
Handles the speed slider events. |
protected void |
updateQueueSize(int original,
int current)
Apply a change in 'to be examined' URL list size. |
protected void |
updateVisitedSize(int original,
int current)
Apply a change in 'visited' URL list size. |
void |
valueChanged(javax.swing.event.ListSelectionEvent event)
Handles the history list events. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 java.lang.String PROP_CURRENT_URL_PROPERTY
public static final java.lang.String PROP_URL_QUEUE_PROPERTY
public static final java.lang.String PROP_URL_VISITED_PROPERTY
protected java.util.HashMap mVisited
protected java.util.HashMap mRequested
protected java.util.HashMap mTracked
protected java.lang.Thread mThread
protected boolean mActive
true
means processing URLS, false
not.
protected Sequencer mSequencer
protected PicturePanel mPicturePanel
protected static final java.net.URL[][] NONE
protected java.beans.PropertyChangeSupport mPropertySupport
protected java.lang.String mCurrentURL
protected boolean mDiscardCGI
true
, does not follow links containing cgi calls.
protected boolean mDiscardQueries
true
, does not follow links containing queries (?).
protected javax.swing.JCheckBox mBackgroundToggle
protected javax.swing.JList mHistory
protected javax.swing.JScrollPane mPicturePanelScroller
protected javax.swing.JScrollPane mHistoryScroller
protected javax.swing.JSplitPane mMainArea
protected javax.swing.JPanel mPowerBar
protected javax.swing.JProgressBar mQueueProgress
protected javax.swing.JProgressBar mReadyProgress
protected javax.swing.JCheckBox mRunToggle
protected javax.swing.JSlider mSpeedSlider
protected javax.swing.JTextField mUrlText
protected javax.swing.JLabel mQueueSize
protected javax.swing.JLabel mVisitedSize
Constructor Detail |
public Thumbelina()
public Thumbelina(java.lang.String url) throws java.net.MalformedURLException
url
- Single URL to enter into the 'to follow' list.
java.net.MalformedURLException
- If the url is malformed.public Thumbelina(java.net.URL url)
url
- URL to enter into the 'to follow' list.Method Detail |
protected void memCheck()
public void reset()
public void append(java.net.URL url)
url
- The url to add.public void append(java.util.ArrayList list)
list
- The list of URL objects to add.protected java.util.ArrayList filter(java.net.URL[] urls)
urls
- The list of URL's to add to the 'to visit' list.
public boolean getStatusBarVisible()
true
if the status bar is visible.public void setStatusBarVisible(boolean visible)
visible
- The new visibility state.
If true
, the status bar will be unhidden.public boolean getHistoryListVisible()
true
if the history list is visible.public void setHistoryListVisible(boolean visible)
visible
- The new visibility state.
If true
, the history list will be unhidden.public boolean getSequencerActive()
true
if the thread is pumping images.public void setSequencerActive(boolean active)
active
- The new activity state.
If true
, the sequencer will be turned on.
This may alter the speed setting if it is set to zero.public boolean getBackgroundThreadActive()
true
if the thread is examining web pages.public void setBackgroundThreadActive(boolean active)
active
- If true
,
the background thread will be turned on.public int getSpeed()
public void setSpeed(int speed)
speed
- The sequencer delay in milliseconds.public boolean isDiscardCGI()
public void setDiscardCGI(boolean discard)
discard
- New value of property discardCGI.public boolean isDiscardQueries()
public void setDiscardQueries(boolean discard)
discard
- New value of property discardQueries.protected boolean isImage(java.lang.String url)
url
- The usrl to check for image characteristics.
true
if the url ends in a recognized image
extension.protected java.net.URL[][] extractImageLinks(Lexer lexer, java.net.URL docbase) throws java.io.IOException, ParserException
lexer
- The fully conditioned lexer, ready to rock.docbase
- The url to read.
java.io.IOException
- If the underlying infrastructure throws it.
ParserException
- If there is a problem parsing the url.protected java.net.URL[][] getImageLinks(java.net.URL url)
url
- The URL to get the links from
public PicturePanel getPicturePanel()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removed.public java.lang.String getCurrentURL()
protected void setCurrentURL(java.lang.String url)
url
- The url that is being examined.protected void updateQueueSize(int original, int current)
PROP_URL_QUEUE_PROPERTY
property
and updates the status bar.
original
- The original size of the list.current
- The new size of the list.protected void updateVisitedSize(int original, int current)
PROP_URL_VISITED_PROPERTY
property and updates the status bar.
original
- The original size of the list.current
- The new size of the list.protected void fetch(java.net.URL[] images)
images
- The list of images to fetch.public void run()
run
in interface java.lang.Runnable
public void itemStateChanged(java.awt.event.ItemEvent event)
itemStateChanged
in interface java.awt.event.ItemListener
event
- The event describing the checkbox event.public void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged
in interface javax.swing.event.ChangeListener
event
- The event describing the slider activity.public void valueChanged(javax.swing.event.ListSelectionEvent event)
valueChanged
in interface javax.swing.event.ListSelectionListener
event
- The event describing the list activity.public void addHistory(java.lang.String url)
url
- The URL to add to the history list.public void open(java.lang.String ref)
ref
- The URL to add.protected static void help()
public static void main(java.lang.String[] args)
args
- the command line arguments.
Can be one or more forms of -help to get command line help,
or a URL to prime the program with.
Checks for JDK 1.4 and if not found runs in crippled mode
(no ThumbelinaFrame).public java.util.ArrayList getQueue()
public int getQueueSize()
PROP_URL_QUEUE_PROPERTY
property.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |