Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Public Attributes | Package Attributes
rene.lister.Lister Class Reference
Inheritance diagram for rene.lister.Lister:
Inheritance graph
[legend]
Collaboration diagram for rene.lister.Lister:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Lister (boolean vs, boolean hs)
 Initialize the display and the two optional scrollbars.
 Lister ()
void setScrollbars (double vp, double vs, double hp, double hs)
 Calles by the lister to set the vertical scrollbars.
void adjustmentValueChanged (AdjustmentEvent e)
 Called by the scrollbars.
ListerPanel getLister ()
 Return the lister for external use.
void addActionListener (ActionListener al)
void updateDisplay ()
void removeActionListener (ActionListener al)
void clear ()
void addElement (Element el)
int getSelectedIndex ()
 Get the first selected index.
String getSelectedItem ()
int[] getSelectedIndices ()
 Get a vector of all selected indices.
void showLast ()
 Make sure, the lister shows the last element.
void setMode (boolean multiple, boolean easymultiple, boolean singleclick, boolean rightmouse)
 Set the operations mode.
void save (PrintWriter o)
 Print the lines to the printwriter o.
void select (int sel)
void addElement (String name, Color col)
 Shortcut to add a string with a specific color.
void addElement (String name)
void setState (int s)
void setListingBackground (Color c)

Static Public Member Functions

static void main (String args[])

Public Attributes

ListerPanel L

Package Attributes

Scrollbar Vertical
Scrollbar Horizontal

Detailed Description

Definition at line 15 of file Lister.java.


Constructor & Destructor Documentation

rene.lister.Lister.Lister ( boolean  vs,
boolean  hs 
) [inline]

Initialize the display and the two optional scrollbars.

Parameters:
verticalscrollbar
horizontalscrollbar

Definition at line 25 of file Lister.java.

       {      L=new ListerPanel(this);
              setLayout(new BorderLayout());
              add("Center",L);
              if (vs)
              {      add("East",Vertical=new Scrollbar(Scrollbar.VERTICAL,0,100,0,1100));
                     Vertical.addAdjustmentListener(this);
              }
              if (hs)
              {      add("South",Horizontal=new Scrollbar(Scrollbar.HORIZONTAL,0,100,0,1100));
                     Horizontal.addAdjustmentListener(this);
              }
       }

Definition at line 38 of file Lister.java.

       {      this(true,true);
       }

Here is the caller graph for this function:


Member Function Documentation

void rene.lister.Lister.addActionListener ( ActionListener  al) [inline]

Definition at line 104 of file Lister.java.

       {      L.addActionListener(al);
       }

Here is the call graph for this function:

void rene.lister.Lister.addElement ( Element  el) [inline]

Definition at line 120 of file Lister.java.

       {      L.add(el);
       }

Here is the call graph for this function:

void rene.lister.Lister.addElement ( String  name,
Color  col 
) [inline]

Shortcut to add a string with a specific color.

Parameters:
name
col

Definition at line 193 of file Lister.java.

       {      addElement(new StringElement(name,col));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.lister.Lister.addElement ( String  name) [inline]

Definition at line 196 of file Lister.java.

       {      addElement(new StringElement(name));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.lister.Lister.adjustmentValueChanged ( AdjustmentEvent  e) [inline]

Called by the scrollbars.

Definition at line 61 of file Lister.java.

       {      if (Vertical!=null && e.getSource()==Vertical)
              {      switch (e.getAdjustmentType())
                     {      case AdjustmentEvent.UNIT_INCREMENT :
                                   L.up(1); break;
                            case AdjustmentEvent.UNIT_DECREMENT :
                                   L.down(1); break;
                            case AdjustmentEvent.BLOCK_INCREMENT :
                                   L.pageUp(); break;
                            case AdjustmentEvent.BLOCK_DECREMENT :
                                   L.pageDown(); break;
                            default :
                                   int size=Vertical.getVisibleAmount();
                                   int max=Vertical.getMaximum();
                                   int pos=Vertical.getValue();
                                   L.setVerticalPos((double)(pos)/(max-size));
                     }
              }
              else if (Horizontal!=null && e.getSource()==Horizontal)
              {      int pos=Horizontal.getValue();
                     switch (e.getAdjustmentType())
                     {      case AdjustmentEvent.UNIT_INCREMENT :
                                   pos+=10; break;
                            case AdjustmentEvent.UNIT_DECREMENT :
                                   pos-=10; break;
                            case AdjustmentEvent.BLOCK_INCREMENT :
                                   pos+=50; break;
                            case AdjustmentEvent.BLOCK_DECREMENT :
                                   pos-=50; break;
                     }
                     L.setHorizontalPos((double)(pos)/1000);
                     Horizontal.setValue(pos);
              }
       }

Here is the call graph for this function:

void rene.lister.Lister.clear ( ) [inline]

Definition at line 116 of file Lister.java.

       {      L.clear();
       }

Here is the call graph for this function:

Return the lister for external use.

Returns:
lister panel

Definition at line 100 of file Lister.java.

       {      return L;
       }

Here is the caller graph for this function:

Get the first selected index.

Returns:
index or -1

Definition at line 128 of file Lister.java.

       {      if (L.Selected.size()>0) 
                     return ((Integer)L.Selected.elementAt(0)).intValue();
              else
                     return -1;
       }

Here is the caller graph for this function:

Get a vector of all selected indices.

Returns:
vector of indices

Definition at line 145 of file Lister.java.

       {      int k[]=new int[L.Selected.size()];
              for (int i=0; i<k.length; i++)
                     k[i]=((Integer)L.Selected.elementAt(i)).intValue();
              return k;
       }

Definition at line 135 of file Lister.java.

       {      int n=getSelectedIndex();
              if (n<0) return null;
              return L.getElementAt(n).getElementString();
       }

Here is the call graph for this function:

static void rene.lister.Lister.main ( String  args[]) [inline, static]

Definition at line 200 of file Lister.java.

       {      CloseFrame F=new CloseFrame("Test");
              F.setSize(300,400);
              F.setLocation(200,200);
              F.setLayout(new BorderLayout());
              Lister L=new Lister(true,true);
              F.add("Center",L);
              for (int i=0; i<1000; i++)
              {      L.getLister().add(
                            new StringElement(
                                          "-------------- This is line number: "+i,
                                          new Color(0,0,i%256)));
              }      
              F.setVisible(true);
       }

Here is the call graph for this function:

void rene.lister.Lister.removeActionListener ( ActionListener  al) [inline]

Definition at line 112 of file Lister.java.

Here is the call graph for this function:

void rene.lister.Lister.save ( PrintWriter  o) [inline]

Print the lines to the printwriter o.

Parameters:
o

Definition at line 180 of file Lister.java.

       {      L.save(o);
       }

Here is the call graph for this function:

void rene.lister.Lister.select ( int  sel) [inline]

Definition at line 184 of file Lister.java.

       {      
       }
void rene.lister.Lister.setListingBackground ( Color  c) [inline]

Definition at line 220 of file Lister.java.

Here is the call graph for this function:

void rene.lister.Lister.setMode ( boolean  multiple,
boolean  easymultiple,
boolean  singleclick,
boolean  rightmouse 
) [inline]

Set the operations mode.

Parameters:
multipleallows multiple clicks
easymultiplemultiple selection without control
singleclickreport single click events
rightmousereport right mouse clicks

Definition at line 166 of file Lister.java.

       {      L.MultipleSelection=multiple;
              L.EasyMultipleSelection=easymultiple;
              L.ReportSingleClick=singleclick;
              L.RightMouseClick=rightmouse;
       }
void rene.lister.Lister.setScrollbars ( double  vp,
double  vs,
double  hp,
double  hs 
) [inline]

Calles by the lister to set the vertical scrollbars.

Parameters:
vpvertical position
vsvertical size
hphorizontal position
hshorizontal size

Definition at line 49 of file Lister.java.

       {      if (Vertical!=null)
              {      int size=(int)(vs*1000);
                     int max=1000+size;
                     int pos=(int)(vp*1000);
                     Vertical.setValues(pos,size,0,max);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.lister.Lister.setState ( int  s) [inline]

Definition at line 216 of file Lister.java.

       {      L.setState(s);
       }

Here is the call graph for this function:

void rene.lister.Lister.showLast ( ) [inline]

Make sure, the lister shows the last element.

Definition at line 155 of file Lister.java.

       {      L.showLast();
       }

Here is the call graph for this function:

Definition at line 108 of file Lister.java.

       {      L.repaint();
       }

Member Data Documentation

Scrollbar rene.lister.Lister.Horizontal [package]

Definition at line 18 of file Lister.java.

Definition at line 17 of file Lister.java.

Scrollbar rene.lister.Lister.Vertical [package]

Definition at line 18 of file Lister.java.


The documentation for this class was generated from the following file: