|
[.hacks.] [.java.] |
||||||||
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 | +--java.awt.Panel | +--Awt | +--MultiColumnList
(#)MultiColumnList.java
Field Summary | |
protected boolean |
adjustable
user adjustable ? |
protected int |
borderw
border width around titles & col separators |
protected int[] |
cpos
column x positions |
protected float[] |
cwidth
proportional column widths (sum = 1.0) |
protected int |
dragcol
column being resized (-1 for none) |
protected java.awt.Image |
image
backing image for flickerfree drawing |
protected java.util.Vector[] |
items
items per column (arraysize = no. of cols) |
protected long |
lastclick
last mouse click time (to enable doubleclick) |
protected int |
minVisibleCols
minimal no. of rows that must be visible |
protected int |
minVisibleRows
to determine minimal space required |
protected int |
moc
mouse over column |
protected java.awt.Scrollbar |
scrollbar
scrollbar at the right side |
protected int |
selrow
selected row (-1 for no selection) |
protected boolean |
showLines
show lines ? |
protected boolean |
showTitle
show title ? |
protected int |
sortcol
column being sorted (-1 for unsorted) |
protected boolean |
sortign
sort ignore case ? |
protected boolean |
sortrev
sort normal or reversed ? |
protected int[] |
spos
sorted positions |
protected java.lang.String[] |
titles
titles per column (arraysize = no. of cols) |
protected int[] |
uniquecols
columns that should be unique |
protected int |
visibleCols
no. of currently visible rows |
Fields inherited from class Awt |
actionListener, Background, bg, big, bim, Black, BlueMask, Bold, Bolditalic, borderDepth, borderType, BOTTOM, Brighter, Bulk, BULK, C, Center, CENTER, ColorMask, componentStates, Darker, E, East, EFFECT_MASK, Esc, FILL, Flat, FontMask, fonts, FontSize0, FontSizeMask, Foreground, GreenMask, Href, HREF, Hrefend, innerInsets, insets, Italic, itemListener, jvendor, jversion, Larger, LEFT, minimumDimension, MISC_MASK, Monospaced, N, NE, None, NONE, North, NorthEast, NorthWest, Null, NW, Plain, POSITION_MASK, Raised, RAISED, RedMask, RIGHT, S, SansSerif, SE, Serif, Smaller, South, SouthEast, SouthWest, Sunken, SUNKEN, SW, Tab0, TabMask, TabSizeMask, TOP, Uline, ULINE, W, West, White |
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 | |
MultiColumnList(java.lang.String[] tls,
int visCols,
int minVisCols,
int minVisRows)
Creates a new scrolling list. |
Method Summary | |
void |
addItem(java.lang.String item)
Add a item row to the list with just one col |
void |
addItem(java.lang.String[] item)
Add a item row to the list |
void |
addItems(java.lang.String[] items)
several rows to the list with just one col |
void |
addItems(java.lang.String[][] items)
Add several rows to the list |
void |
addNotify()
override Awt.addNotify() |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
implement java.awt.event.AdjustmentListener |
void |
clear()
Remove everything from the list |
void |
deleteItem(int row)
Remove one row from the list |
void |
deleteItem(java.lang.String item)
Remove one row from the list (matching only first col) |
void |
deleteItem(java.lang.String item,
int col)
Remove one row from the list matching in col |
boolean |
equalsItem(java.lang.String[] item,
int row,
int[] cols)
See if item[] equals a specific row |
int |
findItem(java.lang.String item)
Find an item in column 0 - return row on succes ot -1 otherwis |
int |
findItem(java.lang.String[] item,
int[] cols)
Find an item in specific columns - return row on succes ot -1 otherwise |
int |
findItem(java.lang.String item,
int col)
Find an item in a specific column - return row on succes ot -1 otherwise |
int |
getColumnCount()
Return the column count |
java.lang.String[] |
getItem(int row)
Returns the contents of a given row (all cols) |
java.lang.String |
getItem(int row,
int col)
Returns the contents of a given cell |
java.lang.String[] |
getItem(int row,
int[] col)
Returns the contents of a given row (selected cols) |
int |
getItemCount()
Return the item count |
java.lang.String[][] |
getItems()
Returns the all content |
java.lang.String[] |
getItems(int col)
gets the contents of one given col as string array |
java.lang.String[][] |
getItems(int[] col)
Gets the contents of given cols as string array |
int |
getSelectedIndex()
Return the selected row |
java.lang.String[] |
getSelectedItem()
Return the selected item |
java.lang.Object[] |
getSelectedObjects()
implement ItemSelectable() |
int |
getSortColumn()
which column to sort ? |
java.lang.String[] |
getTitles()
get all column titles |
int[] |
getUniqueColumns()
which columns are unique ? |
int |
getVisibleCols()
how many columns are currently visible? |
float[] |
getWidths()
get the proportional widths of each column |
boolean |
isAdjustable()
can this lists columns be adjusted by user ? |
boolean |
isShowTitle()
is a title shown ? |
boolean |
isSortReverse()
reverse sort set ? |
boolean |
isValidColumn(int col)
check if a column is valid |
boolean |
isValidRow(int row)
check if a row is valid |
void |
keyPressed(java.awt.event.KeyEvent e)
implement java.awt.event.KeyListener |
void |
keyTyped(java.awt.event.KeyEvent e)
implement java.awt.event.KeyListener |
void |
makeVisible()
Make sure selected item is visble |
java.awt.Dimension |
measure()
calculate required sizes |
void |
mouseDragged(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener actively update screen while mouse drags column separator |
void |
mouseExited(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mouseMoved(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener Check if mouse is over a column separator & change cursor |
void |
mousePressed(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
paint(java.awt.Graphics g)
Overwirte paint to do the actual artwork ;-) |
void |
removeAll()
Remove everything from the list |
void |
setAdjustable(boolean adjustable)
Turns on or off the user's ability to adjust column widths |
void |
setBounds(int x,
int y,
int w,
int h)
Called by the system when this component gets resized - intercept to do some layout |
void |
setItem(int row,
int col,
java.lang.String value)
Sets the contents of a given cell |
void |
setSelectedIndex(int sel)
Set the selected row to index |
void |
setShowTitle(boolean showTitle)
show or hide a title |
void |
setSortColumn(int sc)
set column to sort |
void |
setSortReverse(boolean sortrev)
set sort direction |
void |
setUniqueColumns(int[] uc)
set unique columns |
void |
setVisibleCols(int cols)
set number of visible columns |
void |
setWidths(float[] w)
Set the proportional widths of each column |
Methods inherited from class java.awt.Panel |
getAccessibleContext |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String[] titles
protected java.util.Vector[] items
protected boolean showTitle
protected boolean showLines
protected boolean adjustable
protected boolean sortrev
protected boolean sortign
protected int minVisibleRows
protected int minVisibleCols
protected int visibleCols
protected int selrow
protected int sortcol
protected int dragcol
protected int[] uniquecols
protected int borderw
protected int moc
protected long lastclick
protected float[] cwidth
protected int[] cpos
protected int[] spos
protected java.awt.Scrollbar scrollbar
protected java.awt.Image image
Constructor Detail |
public MultiColumnList(java.lang.String[] tls, int visCols, int minVisCols, int minVisRows)
Method Detail |
public void addItem(java.lang.String[] item)
item
- row to addpublic void addItem(java.lang.String item)
item
- row to addpublic void addItems(java.lang.String[][] items)
public void addItems(java.lang.String[] items)
public void deleteItem(int row)
public void deleteItem(java.lang.String item)
item
- row to removepublic void deleteItem(java.lang.String item, int col)
item
- item to findcol
- col to search inpublic void clear()
public void removeAll()
removeAll
in class java.awt.Container
public java.lang.String[] getItem(int row)
row
- row to returnpublic java.lang.String[] getItem(int row, int[] col)
row
- row to returncol
- cols to returnpublic java.lang.String getItem(int row, int col)
row
- row of item to returncol
- col of item to returnpublic java.lang.String[] getItems(int col)
col
- col to returnpublic java.lang.String[][] getItems(int[] col)
col
- cols to returnpublic java.lang.String[][] getItems()
public void setItem(int row, int col, java.lang.String value)
row
- row of cell to setcol
- col of cell to setvalue
- value to setpublic java.lang.String[] getSelectedItem()
public int getSelectedIndex()
public void setSelectedIndex(int sel)
sel
- row to selectpublic boolean equalsItem(java.lang.String[] item, int row, int[] cols)
item
- each array elem represents one columnrow
- row to compare withcols
- cols of row to compare with itempublic int findItem(java.lang.String item)
item
- item to findpublic int findItem(java.lang.String item, int col)
item
- item to findcol
- col to search inpublic int findItem(java.lang.String[] item, int[] cols)
item
- item to find - each array elem represents one columncols
- cols to search inpublic int getItemCount()
public int getColumnCount()
public boolean isValidRow(int row)
row
- row to checkpublic boolean isValidColumn(int col)
col
- col to checkpublic float[] getWidths()
public void setWidths(float[] w)
public boolean isAdjustable()
public void setAdjustable(boolean adjustable)
adjustable
- Can adjust or not?public boolean isShowTitle()
public void setShowTitle(boolean showTitle)
showTitle
- show or not?public int[] getUniqueColumns()
public void setUniqueColumns(int[] uc)
uc
- array of unique columnspublic boolean isSortReverse()
public void setSortReverse(boolean sortrev)
sortrev
- true=sort reverse false=sort normalpublic int getSortColumn()
public void setSortColumn(int sc)
sc
- sort column; -1 for nonepublic int getVisibleCols()
public void setVisibleCols(int cols)
cols
- how many columns should be visiblepublic java.lang.String[] getTitles()
public void setBounds(int x, int y, int w, int h)
setBounds
in class Awt
x
- x-positiony
- y-positionw
- widthh
- heightpublic void paint(java.awt.Graphics g)
paint
in class Awt
g
- Graphics object to usepublic void makeVisible()
public java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
getSelectedObjects
in class Awt
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class Awt
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class Awt
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class Awt
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class Awt
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
adjustmentValueChanged
in class Awt
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
keyTyped
in class Awt
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
keyPressed
in class Awt
public java.awt.Dimension measure()
measure
in class Awt
public void addNotify()
addNotify
in class Awt
|
[.hacks.] [.java.] |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |