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.
-
backward
-
-
begin
-
-
end
-
-
export
-
-
forward
-
-
nextPosition
-
-
objects
-
-
GraphPanel(TraklaEditor)
-
This is the constructor for GraphPanel invoked by Applet.
-
action(Event, Object)
-
-
add(String, String, String, int)
-
-
add(String, String, String, int, int)
-
This method is invoked when new object is added into the editor by
class TraklaEdit.
-
addObject(EditorObject)
- Adds an new object to the end of the list of editorObjects.
-
append(String, String)
-
-
disableItem(String)
- Disables movement of argument item str.
-
encode(String, String)
- This method is invoked when a new encoding substitution is added to
database.
-
export(GraphPanel)
-
This method is invoked when user wants to export exercise.
-
findObject(String)
-
-
findPanel(String)
-
-
getSize()
-
This method returns the size of this graphPanel.
-
insertObject(EditorObject)
- Inserts an new object to the beginning of the list of editorObjects.
-
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.
-
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.
-
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.
-
paint(Graphics)
- Invokes method update().
-
removeObject(EditorObject)
- Removes the object from the list of editorObjects.
-
rename(String, String)
-
This method is invoked by TraklaEditor when an object is renamed.
-
reset()
- Resets all movable objects to the initial states.
-
reshape(int, int, int, int)
-
-
resize()
-
-
resize(Dimension)
-
-
resize(int)
- This method is invoked when the size of the screen is changed.
-
resize(int, int)
-
-
setFont(String)
-
This method is called when the this component receives the input focus.
-
setInfinite(String, String)
- Set infinite properties for argument panel str.
-
setListArray(String, String)
- Set listArray properties for argument panel str.
-
setOrder(String, String)
- Set order of the output (for trees) to panel str.
-
setOutput(String, String, String)
-
Marks object to be exportable.
-
setTestRound(boolean)
-
This method is invoked when the TraklaEdit wants to determine
wheter this exercise is demo exercise or not;
-
shadowed(String)
- Implement slots of argument panel str as shadowed.
-
showSlot(String)
-
-
update(Graphics)
-
objects
public Vector objects
export
public Button export
begin
public Button begin
end
public Button end
forward
public Button forward
backward
public Button backward
nextPosition
public int nextPosition
GraphPanel
public GraphPanel(TraklaEditor editor)
- This is the constructor for GraphPanel invoked by Applet.
findPanel
public EditorPanel findPanel(String str) throws NoSuchPanelException
findObject
public EditorObject findObject(String str) throws NoSuchObjectException
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.
removeObject
protected void removeObject(EditorObject object)
- Removes the object from the list of editorObjects.
addObject
protected void addObject(EditorObject object)
- Adds an new object to the end of the list of editorObjects.
insertObject
protected void insertObject(EditorObject object)
- Inserts an new object to the beginning of the list of editorObjects.
setListArray
protected void setListArray(String str,
String items)
- Set listArray properties for argument panel str.
setInfinite
protected void setInfinite(String str,
String items)
- Set infinite properties for argument panel str.
append
protected void append(String panel,
String items)
setOrder
protected void setOrder(String str,
String order)
- Set order of the output (for trees) to panel str.
shadowed
protected void shadowed(String str)
- Implement slots of argument panel str as shadowed.
disableItem
protected void disableItem(String str)
- Disables movement of argument item str.
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()
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)
reset
protected void reset()
- Resets all movable objects to the initial states.
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.
add
protected Object add(String obj,
String label,
String items,
int space)
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.
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.
showSlot
protected void showSlot(String str)
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.
reshape
public void reshape(int x,
int y,
int width,
int height)
- Overrides:
- reshape in class Component
resize
public void resize(Dimension d)
- Overrides:
- resize in class Component
resize
public void resize(int width,
int height)
- Overrides:
- resize in class Component
resize
public void resize(int newsize)
- This method is invoked when the size of the screen is changed.
resize
public void resize()
getSize
public Dimension getSize()
- This method returns the size of this graphPanel.
- Returns:
- Class Dimension d
paint
public void paint(Graphics g)
- Invokes method update().
- Overrides:
- paint in class Component
update
public synchronized void update(Graphics g)
- Overrides:
- update in class Component
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
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
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
action
public boolean action(Event e,
Object arg)
- Overrides:
- action in class Component
All Packages Class Hierarchy This Package Previous Next Index