|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IEditorComponent
This Interface specifies that every panel, text field or combo box used in the EditorGUI will implement the functions update(), save(), discard(), discardRed() and add(Component). By unifying the functionality of the different components we can care less about whether we work with a panel or a single text field.
This is an implementation of the structural design pattern "Composite". As a short reminder what the Composite Pattern is about: "Compose ob jects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual ob jects and compositions of objects uniformly."

The classes shown in the Figure above correspond with the following prototypes:
| IEditorComponent | Component |
| EditorPanel | Composite |
| NodeEditor | Composite |
| EditorTextField | Leaf |
| EditorComboBox | Leaf |
| Configurator | Client |
| Method Summary | |
|---|---|
void |
discard()
Discards any changed input field to what is was before; thus any red or green field is reset to black. |
void |
discardRed()
Discards any invalid input field (i.e. any red field) to the last valid value. |
void |
save()
This is the function which follows if update() has encountered unsaved inputs and has returned true or the "save"-button has been hit. |
boolean |
update()
Determines whether there are unsaved inputs and discards the data of incorrect inputs. |
| Method Detail |
|---|
void discard()
void discardRed()
void save()
boolean update()
NodeEditor.stateChanged(javax.swing.event.ChangeEvent) function which is triggered
when the selection in the drawPanel changes.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||