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.BrowserDisplay
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----com.tolstoy.imagemeister.BrowserDisplay

  Summary

class  BrowserDisplay
     extends java.awt.Frame
     implements com.tolstoy.imagemeister.GSPCallback, 
                com.tolstoy.imagemeister.ButtonPanelOwnerI
{
          // Fields 20
     private static final String copyright;
     private static final String kFrameTitle;
     private static final int kGridHeight;
     private static final int kGridWidth;
     private static final int kIconHeight;
     private static final int kIconOffsetX;
     private static final int kIconOffsetY;
     private static final int kIconWidth;
     private int[] lgIconData;
     private int lgIconH;
     private int lgIconW;
     private BrowserDisplayOwnerI owner;
     private boolean[] selectFlags;
     private int[] smIconData;
     private int smIconH;
     private int smIconW;
     private ButtonPanel theButtonPanel;
     private DiskObject[] theDiskObjs;
     private GridScrollerPanel theGSP;
     private Image[] theImages;

          // Constructors 1
     public BrowserDisplay(String, BrowserDisplayOwnerI);

          // Methods 16
     public void buttonClicked(int);
     public boolean getCheckboxValue(int);
     public DiskObject getItem(int);
     public Frame getMainFrame();
     public DiskObject getSelectedItem();
     public int getSelectedItemIndex();
     public boolean handleEvent(Event);
     public boolean handleKeyPress(Event, int);
     public void itemDoubleClicked(int);
     public void paintItem(Graphics, int, int, int, int, int, boolean);
     public void setCheckboxValue(int, boolean);
     public void setItemText(int, String);
     public void setItems(DiskObject[]);
     public void setVisibility(boolean);
     private String shortenStringToFit(String, FontMetrics, int);
     void showLargeIcon(int, Graphics, int, int);
}

The GUI portion of ImageMeister. This object is owned by a BrowserDisplayOwnerI object, which is called when the user clicks the buttons of the GUI or the files/folders being displayed.

This object owns a GridScrollerPanel object which displays the files/folders. It also implements the GSPCallback interface used by the GridScrollerPanel. This last object calls the methods of the GSPCallback interface to display the file/folder icons, and also when the user double-clicks one of the file/folder icons.

This object owns a ButtonPanel, which contains the control buttons (quit, about, etc.)

This object contains an array of Image objects, one Image for each file/folder icon. These Image objects are only created when needed. For instance, if the user navigates to a folder which contains 500 items, and only the first 100 are visible in the GridScrollerPanel, these first 100 Images will be created when the display is updated. However, the remaining 400 will only be created if the user scrolls down.

Author:
Copyright (c) 1997,1998,1999,2000 Samizdat Productions. All Rights Reserved.




  Fields

· copyright

Summary  |  Top

   private static final String copyright


· kFrameTitle

Summary  |  Top
   private static final String kFrameTitle


· kGridWidth

Summary  |  Top
   private static final int kGridWidth


· kGridHeight

Summary  |  Top
   private static final int kGridHeight


· kIconWidth

Summary  |  Top
   private static final int kIconWidth


· kIconHeight

Summary  |  Top
   private static final int kIconHeight


· kIconOffsetX

Summary  |  Top
   private static final int kIconOffsetX


· kIconOffsetY

Summary  |  Top
   private static final int kIconOffsetY


· owner

Summary  |  Top
   private BrowserDisplayOwnerI owner


· theGSP

Summary  |  Top
   private GridScrollerPanel theGSP


· theButtonPanel

Summary  |  Top
   private ButtonPanel theButtonPanel


· theDiskObjs

Summary  |  Top
   private DiskObject[] theDiskObjs


· theImages

Summary  |  Top
   private Image[] theImages


· selectFlags

Summary  |  Top
   private boolean[] selectFlags


· smIconData

Summary  |  Top
   private int[] smIconData


· smIconW

Summary  |  Top
   private int smIconW


· smIconH

Summary  |  Top
   private int smIconH


· lgIconData

Summary  |  Top
   private int[] lgIconData


· lgIconW

Summary  |  Top
   private int lgIconW


· lgIconH

Summary  |  Top
   private int lgIconH


  Constructors

· BrowserDisplay

Summary  |  Top

   public BrowserDisplay(String imageBase, 
                         BrowserDisplayOwnerI onr) 


  Methods

· setVisibility

Summary  |  Top
   public void setVisibility(boolean bState) 


· itemDoubleClicked

Summary  |  Top
   public void itemDoubleClicked(int which) 

From the GSPCallback interface. Tell our owner the user double-clicked a file/folder icon.

Implements:
itemDoubleClicked in interface GSPCallback


· paintItem

Summary  |  Top
   public void paintItem(Graphics g, 
                         int which, 
                         int x, 
                         int y, 
                         int w, 
                         int h, 
                         boolean bSelected) 

From the GSPCallback interface. Draw the file/folder icon and the name of the object.

Implements:
paintItem in interface GSPCallback


· handleKeyPress

Summary  |  Top
   public boolean handleKeyPress(Event e, 
                                 int curChic) 

From the GSPCallback interface. Tell our owner the user pressed a key.

Implements:
handleKeyPress in interface GSPCallback


· getItem

Summary  |  Top
   public DiskObject getItem(int which) 


· getSelectedItemIndex

Summary  |  Top
   public int getSelectedItemIndex() 


· getSelectedItem

Summary  |  Top
   public DiskObject getSelectedItem() 


· setItems

Summary  |  Top
   public void setItems(DiskObject[] dObjs) 

Set the currently displayed files/folders. Flush the Images currently in 'theImages', and cause the GridScrollerPanel the call us back to draw the new files/folders.



· getMainFrame

Summary  |  Top
   public Frame getMainFrame() 


· setItemText

Summary  |  Top
   public void setItemText(int which, 
                           String text) 


· getCheckboxValue

Summary  |  Top
   public boolean getCheckboxValue(int which) 


· setCheckboxValue

Summary  |  Top
   public void setCheckboxValue(int which, 
                                boolean state) 


· buttonClicked

Summary  |  Top
   public void buttonClicked(int which) 

From the ButtonPanelOwnerI interface.

Implements:
buttonClicked in interface ButtonPanelOwnerI


· handleEvent

Summary  |  Top
   public boolean handleEvent(Event ev) 
Overrides:
handleEvent in class Component


· shortenStringToFit

Summary  |  Top
   private String shortenStringToFit(String in, 
                                     FontMetrics metrics, 
                                     int width) 

Adds an ellipsis to long file names.



· showLargeIcon

Summary  |  Top
   void showLargeIcon(int which, 
                      Graphics g, 
                      int x, 
                      int y) 


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7