Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Package Attributes
rene.viewer.Viewer Class Reference

This is a read-only TextArea, removing the memory restriction in some OS's. More...

Inheritance diagram for rene.viewer.Viewer:
Inheritance graph
[legend]
Collaboration diagram for rene.viewer.Viewer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Viewer (boolean vs, boolean hs)
 Viewer ()
 Viewer (String dummy)
void setFont (Font f)
void appendLine (String s)
void appendLine (String s, Color c)
void append (String s)
void append (String s, Color c)
void doUpdate (boolean showlast)
void adjustmentValueChanged (AdjustmentEvent e)
void setVerticalScrollbar ()
void setText (String S)
void save (PrintWriter fo)
void appendLine0 (String s)
void appendLine0 (String s, Color c)
void mouseClicked (MouseEvent e)
void mousePressed (MouseEvent e)
Dimension getPreferredSize ()
Dimension getMinimumSize ()
void mouseReleased (MouseEvent e)
void mouseEntered (MouseEvent e)
void mouseExited (MouseEvent e)
void mouseMoved (MouseEvent e)
void mouseDragged (MouseEvent e)
void actionPerformed (ActionEvent e)
void keyPressed (KeyEvent e)
void keyReleased (KeyEvent e)
void keyTyped (KeyEvent e)
void setTabWidth (int t)
void showFirst ()
void showLast ()
boolean hasFocus ()
void setBackground (Color c)
void up (int n)
void down (int n)
void pageUp ()
void pageDown ()
void resized ()

Static Public Member Functions

static void main (String args[])

Package Attributes

TextDisplay TD
Scrollbar Vertical
Scrollbar Horizontal
TextPosition Start
TextPosition End
PopupMenu PM
int X
int Y
Panel P3D
boolean Dragging = false

Detailed Description

This is a read-only TextArea, removing the memory restriction in some OS's.

Component usage is like a Panel. Use appendLine to append a line of text. You can give each line a different color. Moreover, you can save the file to a PrintWriter. You can mark blocks with the right mouse button. Dragging and scrolling is not supported in this version.

Definition at line 34 of file Viewer.java.


Constructor & Destructor Documentation

rene.viewer.Viewer.Viewer ( boolean  vs,
boolean  hs 
) [inline]

Definition at line 44 of file Viewer.java.

       {      TD=new TextDisplay(this);
              setLayout(new BorderLayout());
              add("Center",P3D=new Panel3D(TD));
              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);
              }
              TD.addMouseListener(this);
              TD.addMouseMotionListener(this);
              Start=End=null;
              PM=new PopupMenu();
              MenuItem mi=new MenuItem(Global.name("block.copy","Copy"));
              mi.addActionListener(this);
              PM.add(mi);
              PM.addSeparator();
              mi=new MenuItem(Global.name("block.begin","Begin Block"));
              mi.addActionListener(this);
              PM.add(mi);
              mi=new MenuItem(Global.name("block.end","End Block"));
              mi.addActionListener(this);
              PM.add(mi);
              add(PM);
              Wheel W=new Wheel(this);
              addMouseWheelListener(W);
       }

Here is the call graph for this function:

Definition at line 75 of file Viewer.java.

       {      this(true,true);
       }

Here is the caller graph for this function:

rene.viewer.Viewer.Viewer ( String  dummy) [inline]

Definition at line 79 of file Viewer.java.

       {
       }

Member Function Documentation

void rene.viewer.Viewer.actionPerformed ( ActionEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 203 of file Viewer.java.

       {      String o=e.getActionCommand();
              if (o.equals(Global.name("block.copy","Copy"))) TD.copy(Start,End);
              else if (o.equals(Global.name("block.begin","Begin Block")))
              {      TD.unmark(Start,End);
                     Start=TD.getposition(X,Y);
                     Start.oneleft();
                     if (End==null && TD.L.last()!=null)
                     {      End=TD.lastpos();
                     }
                     TD.mark(Start,End);
              }
              else if (o.equals(Global.name("block.end","End Block")))
              {      TD.unmark(Start,End);
                     End=TD.getposition(X,Y);
                     if (Start==null && TD.L.first()!=null)
                     {      Start=new TextPosition(TD.L.first(),0,0);
                     }
                     TD.mark(Start,End);
              }
       }

Here is the call graph for this function:

void rene.viewer.Viewer.adjustmentValueChanged ( AdjustmentEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 108 of file Viewer.java.

       {      if (e.getSource()==Vertical)
              {      switch (e.getAdjustmentType())
                     {      case AdjustmentEvent.UNIT_INCREMENT :
                                   TD.verticalUp(); break;
                            case AdjustmentEvent.UNIT_DECREMENT :
                                   TD.verticalDown(); break;
                            case AdjustmentEvent.BLOCK_INCREMENT :
                                   TD.verticalPageUp(); break;
                            case AdjustmentEvent.BLOCK_DECREMENT :
                                   TD.verticalPageDown(); break;
                            default :
                                   int v=Vertical.getValue();
                                   Vertical.setValue(v);
                                   TD.setVertical(v);
                                   return;
                     }
                     setVerticalScrollbar();
              }
              else if (e.getSource()==Horizontal)
              {      Horizontal.setValue(TD.setHorizontal(
                            Horizontal.getValue()));
              }
       }

Here is the call graph for this function:

void rene.viewer.Viewer.append ( String  s) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 95 of file Viewer.java.

       {      append(s,Color.black);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.viewer.Viewer.append ( String  s,
Color  c 
) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 99 of file Viewer.java.

       {      TD.append(s,c);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.appendLine ( String  s) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 87 of file Viewer.java.

       {      TD.appendLine0(s);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.viewer.Viewer.appendLine ( String  s,
Color  c 
) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 91 of file Viewer.java.

       {      TD.appendLine0(s,c);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.appendLine0 ( String  s) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 149 of file Viewer.java.

       {      TD.appendLine0(s);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.appendLine0 ( String  s,
Color  c 
) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 153 of file Viewer.java.

       {      TD.appendLine0(s,c);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.doUpdate ( boolean  showlast) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 103 of file Viewer.java.

       {      TD.doUpdate(showlast);
              setVerticalScrollbar();
       }

Here is the call graph for this function:

void rene.viewer.Viewer.down ( int  n) [inline]

Implements rene.viewer.WheelListener.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 265 of file Viewer.java.

       {      for (int i=0; i<n; i++) TD.verticalDown();
              setVerticalScrollbar();
       }

Here is the call graph for this function:

Dimension rene.viewer.Viewer.getMinimumSize ( ) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 178 of file Viewer.java.

       {      return new Dimension(150,200);
       }
Dimension rene.viewer.Viewer.getPreferredSize ( ) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 174 of file Viewer.java.

       {      return new Dimension(150,200);
       }

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 252 of file Viewer.java.

{ return false; }

Here is the caller graph for this function:

void rene.viewer.Viewer.keyPressed ( KeyEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 225 of file Viewer.java.

{}
void rene.viewer.Viewer.keyReleased ( KeyEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 227 of file Viewer.java.

       {      if (e.isControlDown() && e.getKeyCode()==KeyEvent.VK_C
                     && Start!=null && End!=null)
              {      TD.copy(Start,End);
              }
       }

Here is the call graph for this function:

void rene.viewer.Viewer.keyTyped ( KeyEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 234 of file Viewer.java.

{}
static void rene.viewer.Viewer.main ( String  args[]) [inline, static]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 284 of file Viewer.java.

       {      Frame f=new Frame();
              f.setLayout(new BorderLayout());
              Viewer v=new Viewer(true,false);
              f.add("Center",v);
              f.setSize(300,300);
              f.setVisible(true);
              v.append("test test test test test test test");
              v.appendLine("test test test test test test test");
              v.appendLine("test test test test test test test");
              v.appendLine("test test test test test test test");
       }

Here is the call graph for this function:

void rene.viewer.Viewer.mouseClicked ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 159 of file Viewer.java.

{}
void rene.viewer.Viewer.mouseDragged ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 196 of file Viewer.java.

       {      TD.unmark(Start,End);
              TextPosition h=TD.getposition(e.getX(),e.getY());
              if (h!=null) End=h;
              TD.mark(Start,End);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.mouseEntered ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 186 of file Viewer.java.

       {
       }
void rene.viewer.Viewer.mouseExited ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 190 of file Viewer.java.

       {
       }
void rene.viewer.Viewer.mouseMoved ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 194 of file Viewer.java.

{}
void rene.viewer.Viewer.mousePressed ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 161 of file Viewer.java.

       {      if (e.isPopupTrigger() || e.isMetaDown())
              {      PM.show(e.getComponent(),e.getX(),e.getY());
                     X=e.getX(); Y=e.getY();
              }
              else
              {      TD.unmark(Start,End);
                     Start=TD.getposition(e.getX(),e.getY());
                     Start.oneleft();
                     End=null;
              }
       }

Here is the call graph for this function:

void rene.viewer.Viewer.mouseReleased ( MouseEvent  e) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 182 of file Viewer.java.

       {      Dragging=false;
       }
void rene.viewer.Viewer.pageDown ( ) [inline]

Implements rene.viewer.WheelListener.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 275 of file Viewer.java.

Here is the call graph for this function:

void rene.viewer.Viewer.pageUp ( ) [inline]

Implements rene.viewer.WheelListener.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 270 of file Viewer.java.

Here is the call graph for this function:

void rene.viewer.Viewer.resized ( ) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 280 of file Viewer.java.

       {      
       }

Here is the caller graph for this function:

void rene.viewer.Viewer.save ( PrintWriter  fo) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 145 of file Viewer.java.

       {      TD.save(fo);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.setBackground ( Color  c) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 254 of file Viewer.java.

       {      TD.setBackground(c);
              P3D.setBackground(c);
              super.setBackground(c);
       }      

Here is the call graph for this function:

void rene.viewer.Viewer.setFont ( Font  f) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 83 of file Viewer.java.

       {      TD.init(f);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.setTabWidth ( int  t) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 236 of file Viewer.java.

       {      TD.setTabWidth(t);
       }

Here is the call graph for this function:

void rene.viewer.Viewer.setText ( String  S) [inline]

Reimplemented in rene.viewer.ExtendedViewer, and rene.viewer.SystemViewer.

Definition at line 139 of file Viewer.java.

Here is the call graph for this function:

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 133 of file Viewer.java.

       {      if (Vertical==null) return;
              int h=TD.computeVerticalSize();
              Vertical.setValues(TD.computeVertical(),h,0,1000+h);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.viewer.Viewer.showFirst ( ) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 240 of file Viewer.java.

       {      TD.showFirst();
              setVerticalScrollbar();
              TD.repaint();
       }

Here is the call graph for this function:

void rene.viewer.Viewer.showLast ( ) [inline]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 246 of file Viewer.java.

       {      TD.showlast();
              setVerticalScrollbar();
              TD.repaint();
       }

Here is the call graph for this function:

void rene.viewer.Viewer.up ( int  n) [inline]

Implements rene.viewer.WheelListener.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 260 of file Viewer.java.

       {      for (int i=0; i<n; i++) TD.verticalUp();
              setVerticalScrollbar();
       }

Here is the call graph for this function:


Member Data Documentation

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 157 of file Viewer.java.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 39 of file Viewer.java.

Scrollbar rene.viewer.Viewer.Horizontal [package]

Definition at line 38 of file Viewer.java.

Panel rene.viewer.Viewer.P3D [package]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 42 of file Viewer.java.

PopupMenu rene.viewer.Viewer.PM [package]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 40 of file Viewer.java.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 39 of file Viewer.java.

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 37 of file Viewer.java.

Scrollbar rene.viewer.Viewer.Vertical [package]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 38 of file Viewer.java.

int rene.viewer.Viewer.X [package]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 41 of file Viewer.java.

int rene.viewer.Viewer.Y [package]

Reimplemented in rene.viewer.ExtendedViewer.

Definition at line 41 of file Viewer.java.


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