JavaView® v2.00.008

vgp.tutor.updatePanel
Class MyClass

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--vgp.tutor.updatePanel.MyClass
All Implemented Interfaces:
java.lang.Cloneable, PsUpdateIf, java.io.Serializable

public class MyClass
extends PsObject

Tutorial class for combined used of JavaView update mechanism and AWT 1.1 events. Any subclass of PsObject may have an associated info panel for inspecting itself in an interactive panel. The info panel may either be supplied by a superclass, or by providing a panel whose class name has appended '_IP' to the name of the class which shall be inspected. In this tutorial, the base class is MyClass and its panel is MyClass_IP. Invoking the method getInfoPanel() returns an instance of the panel, as done in the main(String []), which can be inserted in a frame or in other panels. In JavaView, the panel is usually added to the control window.

The base class and its panel communicate via the methods update(Object) once the base class is registered in the panel as its parent. This registration is done in the super class PsObject after the first call of getInfoPanel().

Base class and its panel separate the data and the widget user interface. The base class contains the data and is usually embedded in a program, while the panel contains the widget representation. The panel is just attached to the base class and only accessible through it.

Version:
15.08.99, 1.00 revised (kp)
15.08.99, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PsObject, PsUpdateIf, Serialized Form

Field Summary
protected  int m_selectedTopic
          Selected entry in list.
protected  boolean m_state
          Boolean flag.
protected  java.lang.String m_text
          Text string.
protected  java.lang.String[] m_topics
          Entries of a list.
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS
 
Constructor Summary
MyClass()
          Constructor.
 
Method Summary
 int getSelectedTopic()
           
 boolean getState()
           
 java.lang.String getText()
           
 java.lang.String[] getTopics()
           
 void init()
          Set values of variables.
static void main(java.lang.String[] args)
          Standalone application support.
 void setSelectedTopic(int ind)
           
 void setState(boolean flag)
           
 void setText(java.lang.String text)
           
 boolean update(java.lang.Object event)
          Update the class whenever a child has changed.
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_state

protected boolean m_state
Boolean flag.

m_topics

protected java.lang.String[] m_topics
Entries of a list.

m_selectedTopic

protected int m_selectedTopic
Selected entry in list.

m_text

protected java.lang.String m_text
Text string.
Constructor Detail

MyClass

public MyClass()
Constructor.
Method Detail

init

public void init()
Set values of variables. Method is also used to reset the class.
Overrides:
init in class PsObject

update

public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.
Overrides:
update in class PsObject
Following copied from class: jv.object.PsObject
See Also:
PsObject.setParent(PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(PsUpdateIf)

getState

public boolean getState()

setState

public void setState(boolean flag)

getTopics

public java.lang.String[] getTopics()

getSelectedTopic

public int getSelectedTopic()

setSelectedTopic

public void setSelectedTopic(int ind)

getText

public java.lang.String getText()

setText

public void setText(java.lang.String text)

main

public static void main(java.lang.String[] args)
Standalone application support.

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.