HTML Parser Home Page

org.htmlparser.lexerapplications.thumbelina
Class TileSet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.htmlparser.lexerapplications.thumbelina.TileSet
All Implemented Interfaces:
ActionListener, MouseListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class TileSet
extends Canvas
implements ActionListener, MouseListener, WindowListener

Class to track tile regions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  ArrayList<Tile> mRegions
          The list of Tiles.
 
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
TileSet()
          Construct a tile set.
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 void add(Tile tile)
          Add a single tile to the list.
 void bringToTop(Tile tile)
          Move the given tile to the top of the Z order.
 int getTileCount()
          Get the number of tiles in this collection.
 Iterator<Tile> getTiles()
           
 boolean isVerbose()
           
static void main(String[] args)
          Visual unit test for the TileSet class.
 void mouseClicked(MouseEvent event)
           
 void mouseEntered(MouseEvent event)
           
 void mouseExited(MouseEvent event)
           
 void mousePressed(MouseEvent event)
           
 void mouseReleased(MouseEvent event)
           
 void paint(Graphics graphics)
           
 void setStatus(String text)
           
 Tile tileAt(int x, int y)
          Find the Tile at position x,y
 void update(Graphics graphics)
           
 void windowActivated(WindowEvent e)
           
 void windowClosed(WindowEvent e)
           
 void windowClosing(WindowEvent e)
           
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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

mRegions

protected ArrayList<Tile> mRegions
The list of Tiles.

Constructor Detail

TileSet

public TileSet()
Construct a tile set.

Method Detail

getTileCount

public int getTileCount()
Get the number of tiles in this collection.

Returns:
The number of tiles showing. Note that the same tile (as determinded by the identity) may be showing (different pieces) in several locations.

getTiles

public Iterator<Tile> getTiles()

add

public void add(Tile tile)
Add a single tile to the list.

Parameters:
tile - The tile to add.

tileAt

public Tile tileAt(int x,
                   int y)
Find the Tile at position x,y

Parameters:
x - The x coordinate of the point to examine.
y - The y coordinate of the point to examine.
Returns:
The tile at that point, or null if there are none.

bringToTop

public void bringToTop(Tile tile)
Move the given tile to the top of the Z order. The tile is reset to it's original size and all fragments are discarded.

Parameters:
tile - The tile to bring to the top.

setStatus

public void setStatus(String text)

isVerbose

public boolean isVerbose()

update

public void update(Graphics graphics)
Overrides:
update in class Canvas

paint

public void paint(Graphics graphics)
Overrides:
paint in class Canvas

windowOpened

public void windowOpened(WindowEvent e)
Specified by:
windowOpened in interface WindowListener

windowClosing

public void windowClosing(WindowEvent e)
Specified by:
windowClosing in interface WindowListener

windowClosed

public void windowClosed(WindowEvent e)
Specified by:
windowClosed in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Specified by:
windowIconified in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Specified by:
windowDeiconified in interface WindowListener

windowActivated

public void windowActivated(WindowEvent e)
Specified by:
windowActivated in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Specified by:
windowDeactivated in interface WindowListener

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

mouseClicked

public void mouseClicked(MouseEvent event)
Specified by:
mouseClicked in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent event)
Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent event)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent event)
Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent event)
Specified by:
mousePressed in interface MouseListener

main

public static void main(String[] args)
Visual unit test for the TileSet class.

Parameters:
args - Ignored.

© 2006 Derrick Oswald
Sep 17, 2006

HTML Parser is an open source library released under Common Public License. SourceForge.net