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
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.
private static final String copyright
private static final String kFrameTitle
private static final int kGridWidth
private static final int kGridHeight
private static final int kIconWidth
private static final int kIconHeight
private static final int kIconOffsetX
private static final int kIconOffsetY
private BrowserDisplayOwnerI owner
private GridScrollerPanel theGSP
private ButtonPanel theButtonPanel
private DiskObject[] theDiskObjs
private Image[] theImages
private boolean[] selectFlags
private int[] smIconData
private int smIconW
private int smIconH
private int[] lgIconData
private int lgIconW
private int lgIconH
public BrowserDisplay(String imageBase,
BrowserDisplayOwnerI onr)
public void setVisibility(boolean bState)
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
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
public boolean handleKeyPress(Event e,
int curChic)
From the GSPCallback interface.
Tell our owner the user pressed a key.
- Implements:
- handleKeyPress in interface GSPCallback
public DiskObject getItem(int which)
public int getSelectedItemIndex()
public DiskObject getSelectedItem()
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.
public Frame getMainFrame()
public void setItemText(int which,
String text)
public boolean getCheckboxValue(int which)
public void setCheckboxValue(int which,
boolean state)
public void buttonClicked(int which)
From the ButtonPanelOwnerI interface.
- Implements:
- buttonClicked in interface ButtonPanelOwnerI
public boolean handleEvent(Event ev)
- Overrides:
- handleEvent in class Component
private String shortenStringToFit(String in,
FontMetrics metrics,
int width)
Adds an ellipsis to long file names.
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