Main Page Cookbook/Overview ImageMeister the jcprops file Licensing Binary Installation & Configuration [ Win · Mac · Nix ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix ] Distribution Issues

    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

Summary

    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.

Fields

### · copyright | Summary | Top

       private static final String copyright

### · kDCTimeThreshold | Summary | Top

       private static final int kDCTimeThreshold

### · kDCPixelThreshold | Summary | Top

       private static final int kDCPixelThreshold

### · callback | Summary | Top

       private GSPCallback callback

### · scrollBar | Summary | Top

       private Scrollbar scrollBar

### · dcLastTime | Summary | Top

       private long dcLastTime

### · chicW | Summary | Top

       private int chicW

### · chicH | Summary | Top

       private int chicH

### · offsetY | Summary | Top

       private int offsetY

### · numChics | Summary | Top

       private int numChics

### · curChic | Summary | Top

       private int curChic

### · numRows | Summary | Top

       private int numRows

### · numCols | Summary | Top

       private int numCols

### · dcLastX | Summary | Top

       private int dcLastX

### · dcLastY | Summary | Top

       private int dcLastY

### · offscreen | Summary | Top

       private Image offscreen

### · bFirstTime | Summary | Top

       private boolean bFirstTime

Constructors

### · GridScrollerPanel | Summary | Top

       public GridScrollerPanel(GSPCallback cb,
                                int cW,
                                int cH)

Methods

### · getCurChic | Summary | Top

       public int getCurChic()

### · setNumItems | Summary | Top

       public void setNumItems(int n)

### · update | Summary | Top

       public void update(Graphics g)

> Overrides:
>   update in class Container

### · paint | Summary | Top

       public void paint(Graphics g)

> Overrides:
>   paint in class Container

### · computeRC | Summary | Top

       private void computeRC(int width,
                              int height)

### · reshape | Summary | Top

       public synchronized void reshape(int x,
                                        int y,
                                        int width,
                                        int height)

> Overrides:
>   reshape in class Component

### · doKey | Summary | Top

       private boolean doKey(Event e)

### · doClick | Summary | Top

       private void doClick(Event e)

### · isDoubleClick | Summary | Top

       private boolean isDoubleClick(Event e)

### · doOutsideClick | Summary | Top

       public void doOutsideClick()

### · doInsideClick | Summary | Top

       public void doInsideClick(int which)

### · handleEvent | Summary | Top

       public boolean handleEvent(Event e)

> Overrides:
>   handleEvent in class Component

### · preferredSize | Summary | Top

       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