java.awt.event.ActionListener
, java.awt.event.ItemListener
, java.awt.event.WindowListener
, java.awt.image.ImageObserver
, java.awt.MenuContainer
, java.beans.PropertyChangeListener
, java.io.Serializable
, java.util.EventListener
, javax.accessibility.Accessible
, javax.swing.RootPaneContainer
, javax.swing.WindowConstants
public class ThumbelinaFrame
extends javax.swing.JFrame
implements java.awt.event.WindowListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
java.awt.Container.AccessibleAWTContainer
Modifier and Type | Field | Description |
---|---|---|
protected javax.swing.JMenuItem |
mAbout |
About menu item.
|
protected javax.swing.JMenuItem |
mClear |
Clear menu item
|
protected javax.swing.JMenu |
mCommand |
Vommand menu.
|
protected javax.swing.JMenuItem |
mExit |
Exit menu item.
|
protected javax.swing.JMenuItem |
mGoogle |
Google menu item.
|
protected javax.swing.JMenu |
mHelp |
Help submenu.
|
protected javax.swing.JCheckBoxMenuItem |
mHistoryVisible |
History list visible menu item.
|
protected javax.swing.JMenuBar |
mMenu |
Main menu.
|
protected javax.swing.JMenuItem |
mOpen |
Open menu item.
|
protected javax.swing.JMenuItem |
mReset |
Reset menu item.
|
protected javax.swing.JSeparator |
mSeparator1 |
MRU list separator #1.
|
protected javax.swing.JSeparator |
mSeparator2 |
MRU list separator #2.
|
protected javax.swing.JCheckBoxMenuItem |
mStatusVisible |
Status bar visible menu item.
|
protected javax.swing.JMenu |
mURL |
URL submenu.
|
protected javax.swing.JMenu |
mView |
View submenu.
|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
Constructor | Description |
---|---|
ThumbelinaFrame() |
Construct a new Thumbelina frame with an idle Thumbelina.
|
ThumbelinaFrame(java.lang.String url) |
Construct a new Thumbelina frame with a Thumbelina primed with one URL.
|
ThumbelinaFrame(java.net.URL url) |
Construct a new Thumbelina frame with a Thumbelina primed with one URL.
|
ThumbelinaFrame(Thumbelina thumbelina) |
Construct a new Thumbelina frame with a given Thumbelina.
|
Modifier and Type | Method | Description |
---|---|---|
void |
about() |
Display information about Thumbelina.
|
void |
actionPerformed(java.awt.event.ActionEvent actionEvent) |
Handles events from the menu.
|
void |
exit() |
Exits the application.
|
protected java.awt.Rectangle |
fromString(java.lang.String value) |
Convert the given string to a valid rectangle.
|
Thumbelina |
getThumbelina() |
Access the Thumbelina object contained in the frame.
|
void |
googlesearch() |
Query google via user specified keywords and queue results.
|
void |
initSize() |
Sets the frame size if no previous preference has been stored.
|
void |
initState() |
Initialize the user preferences.
|
void |
itemStateChanged(java.awt.event.ItemEvent event) |
Handles selections on the view state checkboxes.
|
static void |
main(java.lang.String[] args) |
Alternate mainline for Thumbelina.
|
void |
makeMenu() |
Create the menu.
|
void |
open() |
Opens a user specified URL.
|
void |
propertyChange(java.beans.PropertyChangeEvent event) |
Handle a property change.
|
void |
restoreSize() |
Restores the window size based on stored preferences.
|
void |
saveState() |
Saves the current settings in the user preferences.
|
protected java.lang.String |
toString(java.awt.Rectangle r) |
Converts the rectangle to a string.
|
void |
updateMenu() |
Adjusts the menu, by inserting the current MRU list.
|
void |
updateMRU(java.lang.String url) |
Updates the user preferences based on the most recently used list.
|
void |
windowActivated(java.awt.event.WindowEvent event) |
Invoked when the window is set to be the user's
active window, which means the window (or one of its
subcomponents) will receive keyboard events.
|
void |
windowClosed(java.awt.event.WindowEvent event) |
Invoked when a window has been closed as the result
of calling dispose on the window.
|
void |
windowClosing(java.awt.event.WindowEvent event) |
Handles window closing event.
|
void |
windowDeactivated(java.awt.event.WindowEvent event) |
Invoked when a window is no longer the user's active
window, which means that keyboard events will no longer
be delivered to the window or its subcomponents.
|
void |
windowDeiconified(java.awt.event.WindowEvent event) |
Invoked when a window is changed from a minimized
to a normal state.
|
void |
windowIconified(java.awt.event.WindowEvent event) |
Invoked when a window is changed from a normal to a
minimized state.
|
void |
windowOpened(java.awt.event.WindowEvent event) |
Invoked the first time a window is made visible.
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
protected javax.swing.JMenuBar mMenu
protected javax.swing.JMenu mURL
protected javax.swing.JMenuItem mOpen
protected javax.swing.JMenuItem mGoogle
protected javax.swing.JSeparator mSeparator1
protected javax.swing.JSeparator mSeparator2
protected javax.swing.JMenuItem mExit
protected javax.swing.JMenu mView
protected javax.swing.JCheckBoxMenuItem mStatusVisible
protected javax.swing.JCheckBoxMenuItem mHistoryVisible
protected javax.swing.JMenu mCommand
protected javax.swing.JMenuItem mReset
protected javax.swing.JMenuItem mClear
protected javax.swing.JMenu mHelp
protected javax.swing.JMenuItem mAbout
public ThumbelinaFrame()
public ThumbelinaFrame(java.lang.String url) throws java.net.MalformedURLException
url
- The URL to prime the Thumbelina with.java.net.MalformedURLException
- If the given string doesn't represent
a valid url.public ThumbelinaFrame(java.net.URL url)
url
- The URL to prime the Thumbelina with.public ThumbelinaFrame(Thumbelina thumbelina)
thumbelina
- The Thumbelina to encapsulate.public Thumbelina getThumbelina()
public void initState()
public void saveState()
public void initSize()
BORDERPERCENT
margins.public void restoreSize()
initSize()
.protected java.lang.String toString(java.awt.Rectangle r)
[x,y,width,height].
r
- The rectangle containing the window position and size,
as returned by getBounds()
.protected java.awt.Rectangle fromString(java.lang.String value) throws java.lang.IllegalArgumentException
value
- The value to parse.java.lang.IllegalArgumentException
- if the format does not match the
form "[x,y,width,height]" with all values integers.public void makeMenu()
public void updateMenu()
public void windowOpened(java.awt.event.WindowEvent event)
windowOpened
in interface java.awt.event.WindowListener
event
- The window event.public void windowClosing(java.awt.event.WindowEvent event)
exitApplication()
.windowClosing
in interface java.awt.event.WindowListener
event
- The window event.public void windowClosed(java.awt.event.WindowEvent event)
windowClosed
in interface java.awt.event.WindowListener
event
- The window event.public void windowIconified(java.awt.event.WindowEvent event)
windowIconified
in interface java.awt.event.WindowListener
event
- The window event.public void windowDeiconified(java.awt.event.WindowEvent event)
windowDeiconified
in interface java.awt.event.WindowListener
event
- The window event.public void windowActivated(java.awt.event.WindowEvent event)
windowActivated
in interface java.awt.event.WindowListener
event
- The window event.public void windowDeactivated(java.awt.event.WindowEvent event)
windowDeactivated
in interface java.awt.event.WindowListener
event
- The window event.public void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionPerformed
in interface java.awt.event.ActionListener
actionEvent
- The event describing the user action.public void itemStateChanged(java.awt.event.ItemEvent event)
itemStateChanged
in interface java.awt.event.ItemListener
event
- The event describing the checkbox affected.public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- The property old and new values.public void updateMRU(java.lang.String url)
url
- The URL that is to be placed at the top of the MRU list.public void open()
public void googlesearch()
Creates a query of the form:
http://www.google.ca/search?hl=en&ie=UTF-8&oe=UTF-8&q=thumbs&btnG=Google+Search&meta=
public void about()
public void exit()
public static void main(java.lang.String[] args)
args
- The command line arguments.
Optionally, arg[0] can be the URL to preload the Thumeblina bean with.HTML Parser is an open source library released under LGPL.