All Packages This Package Class Hierarchy Class Search Index
Class com.tolstoy.imagemeister.GridScrollerPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----com.tolstoy.imagemeister.GridScrollerPanel
class GridScrollerPanel
extends java.awt.Panel
{
// Fields 17
private boolean bFirstTime;
private GSPCallback callback;
private int chicH;
private int chicW;
private static final String copyright;
private int curChic;
private long dcLastTime;
private int dcLastX;
private int dcLastY;
private static final int kDCPixelThreshold;
private static final int kDCTimeThreshold;
private int numChics;
private int numCols;
private int numRows;
private Image offscreen;
private int offsetY;
private Scrollbar scrollBar;
// Constructors 1
public GridScrollerPanel(GSPCallback, int, int);
// Methods 13
private void computeRC(int, int);
private void doClick(Event);
public void doInsideClick(int);
private boolean doKey(Event);
public void doOutsideClick();
public int getCurChic();
public boolean handleEvent(Event);
private boolean isDoubleClick(Event);
public void paint(Graphics);
public Dimension preferredSize();
public synchronized void reshape(int, int, int, int);
public void setNumItems(int);
public void update(Graphics);
}
A Panel which contains a scrolling grid of items:
ccccc|
ccccc|
ccccc|
ccccc|
This is used to implement the portion of ImageMeister in which the icons for files and folders is displayed.
Each item in the grid is called a "chic". There are methods to set the current number of chics, and to retrieve
the currently selected chic. 'numChics' holds the number of chics, and 'curChic' holds the index of the currently
selected chic.
When created, this object is passed an object implementing the GSPCallback interface. The methods of this
interface are called when the user double-clicks a chic, or presses a key. The paintItem() method of this
interface is called to draw each item.
Depending on the size of the Panel and the number of chics, a scrollbar is shown. When the size or number of
chics is changed, the scrollbar may be removed or added if necessary.
- Author:
-
Copyright (c) 1997,1998,1999,2000 Samizdat Productions. All Rights Reserved.
private static final String copyright
private static final int kDCTimeThreshold
private static final int kDCPixelThreshold
private GSPCallback callback
private Scrollbar scrollBar
private long dcLastTime
private int chicW
private int chicH
private int offsetY
private int numChics
private int curChic
private int numRows
private int numCols
private int dcLastX
private int dcLastY
private Image offscreen
private boolean bFirstTime
public GridScrollerPanel(GSPCallback cb,
int cW,
int cH)
public int getCurChic()
public void setNumItems(int n)
public void update(Graphics g)
- Overrides:
- update in class Container
public void paint(Graphics g)
- Overrides:
- paint in class Container
private void computeRC(int width,
int height)
public synchronized void reshape(int x,
int y,
int width,
int height)
- Overrides:
- reshape in class Component
private boolean doKey(Event e)
private void doClick(Event e)
private boolean isDoubleClick(Event e)
public void doOutsideClick()
public void doInsideClick(int which)
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component
public Dimension preferredSize()
- Overrides:
- preferredSize in class Container
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7