|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.htmlparser.lexerapplications.thumbelina.PicturePanel
public class PicturePanel
Hold and display a group of pictures.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static int |
BLOCK_INCREMENT
Scrolling block increment (both directions). |
protected TileSet |
mMosaic
The display mosaic. |
protected Dimension |
mPreferredSize
The preferred size of this component. |
protected Thumbelina |
mThumbelina
The thumbelina object in use. |
protected static int |
UNIT_INCREMENT
Scrolling unit increment (both directions). |
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 | |
---|---|
PicturePanel(Thumbelina thumbelina)
Creates a new instance of PicturePanel |
Method Summary | |
---|---|
void |
adjustClipForInsets(Graphics graphics)
Adjust the graphics clip region to account for insets. |
void |
bringToTop(Tile tile)
Move the given picture to the top of the Z order. |
protected Dimension |
calculatePreferredSize()
Compute the preferred size of the component. |
void |
componentHidden(ComponentEvent event)
Invoked when the component has been made invisible. |
void |
componentMoved(ComponentEvent event)
Invoked when the component's position changes. |
void |
componentResized(ComponentEvent event)
Invoked when the container's size changes. |
void |
componentShown(ComponentEvent event)
Invoked when the component has been made visible. |
protected void |
draw(Picture picture,
boolean add)
Draw an image on screen. |
Picture |
find(String url)
Find a picture with the given URL in the panel. |
Dimension |
getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for a view component. |
Dimension |
getPreferredSize()
Get the preferred size of the component. |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation. |
boolean |
getScrollableTracksViewportHeight()
Return true if a viewport should always force the height of this Scrollable to match the height of the viewport. |
boolean |
getScrollableTracksViewportWidth()
Return true if a viewport should always force the width of this Scrollable to match the width of the viewport. |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. |
void |
hierarchyChanged(HierarchyEvent event)
Handles this components ancestor being added to a container. |
void |
mouseClicked(MouseEvent event)
Invoked when the mouse button has been clicked (pressed and released) on a component. |
void |
mouseEntered(MouseEvent event)
Invoked when the mouse enters a component. |
void |
mouseExited(MouseEvent event)
Invoked when the mouse exits a component. |
void |
mousePressed(MouseEvent event)
Handle left click on a picture by bringing it to the top. |
void |
mouseReleased(MouseEvent event)
Invoked when a mouse button has been released on a component. |
void |
paint(Graphics graphics)
Paints this component. |
void |
reset()
Clears the panel, discarding any existing images. |
void |
setPreferredSize(Dimension dimension)
Sets the preferred size of this component. |
void |
update(Graphics graphics)
Updates this component. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int UNIT_INCREMENT
protected static final int BLOCK_INCREMENT
protected Thumbelina mThumbelina
protected TileSet mMosaic
protected Dimension mPreferredSize
null
initially, caches the results of
calculatePreferredSize ()
.
Constructor Detail |
---|
public PicturePanel(Thumbelina thumbelina)
thumbelina
- The Thumeblina
this panel is associated
with.Method Detail |
---|
public void reset()
public void bringToTop(Tile tile)
tile
- The tile being brought forward.public Picture find(String url)
URL
and Image
.
url
- The url to locate.
protected void draw(Picture picture, boolean add)
picture
- The picture to draw.add
- If true
, the picture is added to the history.public void update(Graphics graphics)
update
in class JComponent
graphics
- The graphics context in which to update the component.public void adjustClipForInsets(Graphics graphics)
graphics
- The graphics object to set the clip region for.public void paint(Graphics graphics)
drawImage()
.
paint
in class JComponent
graphics
- The graphics context used to paint with.public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void setPreferredSize(Dimension dimension)
setPreferredSize
in class JComponent
dimension
- The new value to use for
getPreferredSize()
until recalculated.protected Dimension calculatePreferredSize()
public void mouseClicked(MouseEvent event)
mouseClicked
in interface MouseListener
event
- The object providing details of the mouse event.public void mouseReleased(MouseEvent event)
mouseReleased
in interface MouseListener
event
- The object providing details of the mouse event.public void mouseEntered(MouseEvent event)
mouseEntered
in interface MouseListener
event
- The object providing details of the mouse event.public void mouseExited(MouseEvent event)
mouseExited
in interface MouseListener
event
- The object providing details of the mouse event.public void mousePressed(MouseEvent event)
mousePressed
in interface MouseListener
event
- The object providing details of the mouse event.public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
JComponent.getPreferredSize()
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.
getScrollableUnitIncrement
in interface Scrollable
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or
SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left,
greater than zero for down/right.
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a block scroll.
getScrollableBlockIncrement
in interface Scrollable
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or
SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left,
greater than zero for down/right.
public boolean getScrollableTracksViewportWidth()
Scrollable
to match the width of the viewport.
For example a normal
text view that supported line wrapping would return true here, since it
would be undesirable for wrapped lines to disappear beyond the right
edge of the viewport. Note that returning true for a Scrollable
whose ancestor is a JScrollPane effectively disables horizontal
scrolling.
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportWidth
in interface Scrollable
true
if a viewport should force the Scrollables
width to match its own.public boolean getScrollableTracksViewportHeight()
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportHeight
in interface Scrollable
true
if a viewport should force the Scrollables
height to match its own.public void componentResized(ComponentEvent event)
componentResized
in interface ComponentListener
event
- The resize event.public void componentMoved(ComponentEvent event)
componentMoved
in interface ComponentListener
event
- The component event.public void componentShown(ComponentEvent event)
componentShown
in interface ComponentListener
event
- The component event.public void componentHidden(ComponentEvent event)
componentHidden
in interface ComponentListener
event
- The component event.public void hierarchyChanged(HierarchyEvent event)
hierarchyChanged
in interface HierarchyListener
event
- The heirarchy event.
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under Common Public License. |