Class tred.GraphPanel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tred.GraphPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----tred.GraphPanel

public final class GraphPanel
extends Panel
GraphPanel class to control all the EditorObjects and buttons.

Variable Index

 o backward
 o begin
 o end
 o export
 o forward
 o nextPosition
 o objects

Constructor Index

 o GraphPanel(TraklaEditor)
This is the constructor for GraphPanel invoked by Applet.

Method Index

 o action(Event, Object)
 o add(String, String, String, int)
 o add(String, String, String, int, int)
This method is invoked when new object is added into the editor by class TraklaEdit.
 o addObject(EditorObject)
Adds an new object to the end of the list of editorObjects.
 o append(String, String)
 o disableItem(String)
Disables movement of argument item str.
 o encode(String, String)
This method is invoked when a new encoding substitution is added to database.
 o export(GraphPanel)
This method is invoked when user wants to export exercise.
 o findObject(String)
 o findPanel(String)
 o getSize()
This method returns the size of this graphPanel.
 o insertObject(EditorObject)
Inserts an new object to the beginning of the list of editorObjects.
 o mouseDown(Event, int, int)
This method is called when the mouse button is pushed inside this component, in which case the x and y arguments contains the x and y field of the event argument.
 o mouseDrag(Event, int, int)
This method is called when the mouse button is moved inside this component with the button pushed, in which case the x and y arguments contains the x and y field of the event argument.
 o mouseUp(Event, int, int)
This method is called when the mouse button is released inside this component, in which case the x and y arguments contains the x and y field of the event argument.
 o paint(Graphics)
Invokes method update().
 o removeObject(EditorObject)
Removes the object from the list of editorObjects.
 o rename(String, String)
This method is invoked by TraklaEditor when an object is renamed.
 o reset()
Resets all movable objects to the initial states.
 o reshape(int, int, int, int)
 o resize()
 o resize(Dimension)
 o resize(int)
This method is invoked when the size of the screen is changed.
 o resize(int, int)
 o setFont(String)
This method is called when the this component receives the input focus.
 o setInfinite(String, String)
Set infinite properties for argument panel str.
 o setListArray(String, String)
Set listArray properties for argument panel str.
 o setOrder(String, String)
Set order of the output (for trees) to panel str.
 o setOutput(String, String, String)
Marks object to be exportable.
 o setTestRound(boolean)
This method is invoked when the TraklaEdit wants to determine wheter this exercise is demo exercise or not;
 o shadowed(String)
Implement slots of argument panel str as shadowed.
 o showSlot(String)
 o update(Graphics)

Variables

 o objects
  public Vector objects
 o export
  public Button export
 o begin
  public Button begin
 o end
  public Button end
 o forward
  public Button forward
 o backward
  public Button backward
 o nextPosition
  public int nextPosition

Constructors

 o GraphPanel
  public GraphPanel(TraklaEditor editor)
This is the constructor for GraphPanel invoked by Applet.

Methods

 o findPanel
  public EditorPanel findPanel(String str) throws NoSuchPanelException
 o findObject
  public EditorObject findObject(String str) throws NoSuchObjectException
 o setTestRound
  protected void setTestRound(boolean flag)
This method is invoked when the TraklaEdit wants to determine wheter this exercise is demo exercise or not;
Parameters:
flag - is true if this is a demo exercise.
 o removeObject
  protected void removeObject(EditorObject object)
Removes the object from the list of editorObjects.
 o addObject
  protected void addObject(EditorObject object)
Adds an new object to the end of the list of editorObjects.
 o insertObject
  protected void insertObject(EditorObject object)
Inserts an new object to the beginning of the list of editorObjects.
 o setListArray
  protected void setListArray(String str,
                              String items)
Set listArray properties for argument panel str.
 o setInfinite
  protected void setInfinite(String str,
                             String items)
Set infinite properties for argument panel str.
 o append
  protected void append(String panel,
                        String items)
 o setOrder
  protected void setOrder(String str,
                          String order)
Set order of the output (for trees) to panel str.
 o shadowed
  protected void shadowed(String str)
Implement slots of argument panel str as shadowed.
 o disableItem
  protected void disableItem(String str)
Disables movement of argument item str.
 o setOutput
  protected void setOutput(String obj,
                           String dstr,
                           String addStr)
Marks object to be exportable. Object is searched from the GraphPanel's list of objects and method object.setOutput(dstr, addStr, before) is invoked. Parameter before is optional and is determined from the input parameter obj.
Parameters:
String - obj object to be exported.
String - dstr to mark null items.
String - addStr to add before answer.
See Also:
output(), setOutput()
 o encode
  protected void encode(String s1,
                        String s2)
This method is invoked when a new encoding substitution is added to database. The HashTable for the elements is created the first time this method is invoked.
Parameters:
s1 - is the from-string (char)
s2 - is the to-string (string)
 o reset
  protected void reset()
Resets all movable objects to the initial states.
 o export
  protected DataInputStream export(GraphPanel gp) throws MalformedURLException, IOException
This method is invoked when user wants to export exercise. An URL connection is made to server defined in parameter getPostURL. There should be an cgi-script which emails the message to TRAKLA-server. This method sets all the headers needed for email. After that all output methods are invoked to combine the answer.
 o add
  protected Object add(String obj,
                       String label,
                       String items,
                       int space)
 o add
  protected Object add(String obj,
                       String label,
                       String items,
                       int space,
                       int height)
This method is invoked when new object is added into the editor by class TraklaEdit.
 o rename
  protected void rename(String str1,
                        String str2)
This method is invoked by TraklaEditor when an object is renamed. The method looks for an object called str1 and renames it with str2. Only first occurence is renamed.
 o showSlot
  protected void showSlot(String str)
 o setFont
  public void setFont(String fontName)
This method is called when the this component receives the input focus. This method is usually called by handleEvent (II-§1.10.22), in which case the what argument contains the arg field of the event argument. The method returns true to indicate that it has successfully handled the action; or false if the event that triggered the action should be passed up to the component's parent. Most applications should return either true or the value of super.handleEvent(evt). The getFocus method of Component simply returns true. The what argument is currently always null.
Parameters:
evt - - the event that caused the action
what - - the action
Returns:
true if the event has been handled and no further action is necessary; false if the event is to be given to the component's parent.
 o reshape
  public void reshape(int x,
                      int y,
                      int width,
                      int height)
Overrides:
reshape in class Component
 o resize
  public void resize(Dimension d)
Overrides:
resize in class Component
 o resize
  public void resize(int width,
                     int height)
Overrides:
resize in class Component
 o resize
  public void resize(int newsize)
This method is invoked when the size of the screen is changed.
 o resize
  public void resize()
 o getSize
  public Dimension getSize()
This method returns the size of this graphPanel.
Returns:
Class Dimension d
 o paint
  public void paint(Graphics g)
Invokes method update().
Overrides:
paint in class Component
 o update
  public synchronized void update(Graphics g)
Overrides:
update in class Component
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
This method is called when the mouse button is pushed inside this component, in which case the x and y arguments contains the x and y field of the event argument. The coordinate is relative to the top-left corner of this component.
Parameters:
evt - the event that caused the action
x - the x coordinate
y - the y coordinate
Returns:
true if the event has been handled and no further action is necessary; false if the event is to be given to the component's parent.
Overrides:
mouseDown in class Component
 o mouseDrag
  public boolean mouseDrag(Event evt,
                           int x,
                           int y)
This method is called when the mouse button is moved inside this component with the button pushed, in which case the x and y arguments contains the x and y field of the event argument. The coordinate is relative to the top- left corner of this component. Mouse drag events continue to get sent to this component even when the mouse has left the bounds of the component. The drag events continue until a mouse up event occurs.
Parameters:
evt - the event that caused the action
x - the x coordinate
y - the y coordinate
Returns:
true if the event has been handled and no further action is necessary; false if the event is to be given to the component's parent.
Overrides:
mouseDrag in class Component
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
This method is called when the mouse button is released inside this component, in which case the x and y arguments contains the x and y field of the event argument. The coordinate is relative to the top-left corner of the component.
Parameters:
evt - the event that caused the action
x - the x coordinate
y - the y coordinate
Returns:
true if the event has been handled and no further action is necessary; false if the event is to be given to the component's parent.
Overrides:
mouseUp in class Component
 o action
  public boolean action(Event e,
                        Object arg)
Overrides:
action in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index