|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.graphic.LyGraphicalObject
leon.view.win.swing.LySwingObject
leon.view.win.swing.LySwingFieldItem
leon.view.win.swing.LySwingRelation
public class LySwingRelation
This class implements the Relation object (as described in the dtd) for swing viewer.
An input field of Relation type allows to choose one or more values among a list of values. This list offers generally application objects belonging to a same class and is used to establish a relation between an object and one or more objects of this class. It is possible to specify whether the relation is multiple or not.
LyRelation
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static java.lang.String |
DEFAULT_EMPTY_LINK
Empty link. |
static char |
ITEM_SEP
Separator between relation items. |
static int |
RELATION_BORDER
Number of pixels of the border, -1 for auto size (2 pixels by default). |
static char |
VALUE_SEP
Deprecated. |
Constructor Summary | |
---|---|
LySwingRelation(LyRelation relation)
Class constructor of a Relation object for the Swing target. |
Method Summary | |
---|---|
void |
actionPerformed(LyActionEvent actionEvent)
(non-Javadoc). |
void |
addItemToComboAt(java.awt.Component combo,
java.lang.Object item,
int pos)
Adds an item in the specified combo at the specified position. |
void |
addItemToMultiSelectorAt(java.awt.Component multiSelector,
java.lang.Object item,
int pos)
Adds an item in the specified multiselector at the specified position. |
void |
addLink(LyLink link,
int pos)
Adds the specified link at the specified position. |
void |
clearCombo(java.awt.Component combo)
Removes all the items of a combo box. |
java.awt.Component |
createAutoCompletionCombo()
Creates a new editable comboBox for the relations elements. |
java.awt.Component |
createAutoCompletionMultiSelector(LyEnvironment env,
java.awt.Color color)
Creates a new editable multiselector component to represent a multiselection relation. |
java.awt.Component |
createCombo()
Creates a new ComboBox for the relations elements and registers the key listeners. |
java.awt.Component |
createMultiSelector(LyEnvironment env,
java.awt.Color color)
Creates a new multiselector component to represent a multiselection relation. |
void |
fillAutoCompletionMultiSelector(java.awt.Component multiSelector,
LyLink paramLink,
boolean addLink)
Sets the content of the auto-completion multiselector depending on the relation's links. |
void |
fillMultiSelector(java.awt.Component multiSelector,
LyLink paramLink,
boolean addLink)
Sets the content of the multiselector depending on the relation's links. |
java.lang.Object |
getComboItemAt(java.awt.Component combo,
int index)
Gets the combo item at the specified index in the given combo box. |
int |
getComboItemCount(java.awt.Component combo)
Gets the number of combo items in the specified combo box. |
int |
getComboSelectedIndex(java.awt.Component combo)
Gets the index of the specified combo box in the current combo. |
java.awt.Component |
getComponent()
(non-Javadoc). |
java.lang.String |
getMultiSelectorValue(java.awt.Component multiSelector)
Gets the multiselector value of the specified multiselector. |
java.lang.String |
getValue()
(non-Javadoc). |
void |
initialize()
Initializes the relation component. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
Processes changed state event only if relation is not multiple. |
void |
removeItemFromComboAt(java.awt.Component combo,
int pos)
Removes the item from the given combo at the specified position. |
void |
removeLink(LyLink link)
Removes the specified link of the relation. |
void |
setComboSelectedIndex(java.awt.Component combo,
int selectedIndex)
Sets the selected index of the combo. |
void |
setContent()
Refreshes the content of the relation component. |
void |
setEditable(boolean editable)
Sets the editable status of the field item. |
void |
setEnabled(boolean status)
Indicates the parent editable status. |
void |
setIdle(boolean status)
Sets the idle mode on this component. |
void |
setMultiSelectorSelectedObject(java.awt.Component multiSelector,
java.lang.Object selectedObject,
boolean selected)
Selects/unselects an object id in the multiselector. |
void |
setSelected(LyLink link,
boolean selected)
Sets the selected flag for the given link in this component. |
void |
setValue(java.lang.String value)
Sets current value. |
Methods inherited from class leon.view.win.swing.LySwingFieldItem |
---|
getActionTransmitter, getSelectionTransmitter |
Methods inherited from class leon.view.win.swing.LySwingObject |
---|
getBounds, getChildrenBounds, getDefaultFrame |
Methods inherited from class leon.view.graphic.LyGraphicalObject |
---|
expand, free, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface leon.view.graphic.LyGraphicalComponent |
---|
free, getViewComponent |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final char ITEM_SEP
public static final char VALUE_SEP
public static final java.lang.String DEFAULT_EMPTY_LINK
String
is used to pack correctly its container
components.
public static int RELATION_BORDER
Constructor Detail |
---|
public LySwingRelation(LyRelation relation)
relation
- a RELATION component defined for every type of view targets. This relation
is initialized for the swing view and filled with its default values.Method Detail |
---|
public void initialize()
public void setContent()
setContent(LyLink, boolean)
public java.awt.Component createCombo()
public java.awt.Component createAutoCompletionCombo()
public java.awt.Component createMultiSelector(LyEnvironment env, java.awt.Color color)
env
- the environment needed to find mutliselector imagescolor
- the selection color, not used in this implementation
public java.awt.Component createAutoCompletionMultiSelector(LyEnvironment env, java.awt.Color color)
env
- the environment needed to find mutliselector imagescolor
- the selection color, not used in this implementation
public void clearCombo(java.awt.Component combo)
combo
- the combo box to unfillpublic void setComboSelectedIndex(java.awt.Component combo, int selectedIndex)
combo
- select the items of this combo boxselectedIndex
- index of the item to select in the combo boxgetComboSelectedIndex(Component)
public void setMultiSelectorSelectedObject(java.awt.Component multiSelector, java.lang.Object selectedObject, boolean selected)
multiSelector
- the source multiselectorselectedObject
- sets or unsets the selected flag for this given objectselected
- the selected flag for the given objectpublic void fillMultiSelector(java.awt.Component multiSelector, LyLink paramLink, boolean addLink)
multiSelector
- the multiselector to fillparamLink
- a link that may be or may not be in the parent listaddLink
- specifies if we should adds the links or discard thempublic void fillAutoCompletionMultiSelector(java.awt.Component multiSelector, LyLink paramLink, boolean addLink)
multiSelector
- the multiselector to fillparamLink
- a link that may be or may not be in the parent listaddLink
- specifies if we should adds the links or discard thempublic int getComboSelectedIndex(java.awt.Component combo)
combo
- the combo that is searched in the current combo box
setComboSelectedIndex(Component, int)
public java.lang.String getMultiSelectorValue(java.awt.Component multiSelector)
multiSelector
- the multiselector component that is searched for its selection
public void addItemToComboAt(java.awt.Component combo, java.lang.Object item, int pos)
combo
- the combo box componentitem
- the item to addpos
- the position of the item in the combopublic void removeItemFromComboAt(java.awt.Component combo, int pos)
combo
- the combo containing the item to removepos
- the position of the item to removepublic void addItemToMultiSelectorAt(java.awt.Component multiSelector, java.lang.Object item, int pos)
multiSelector
- the multiselector componentitem
- the item to addpos
- the position of the item in the combopublic int getComboItemCount(java.awt.Component combo)
combo
- the combo box
public java.lang.Object getComboItemAt(java.awt.Component combo, int index)
combo
- the combo boxindex
- the index of the item
public void setIdle(boolean status)
setIdle
in interface LySetIdleInterface
status
- new idle status (LySetIdleInterface interface)LySetIdleInterface.setIdle(boolean)
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
ItemListener.itemStateChanged(java.awt.event.ItemEvent)
public void setSelected(LyLink link, boolean selected)
link
- the link to setselected
- the selected flagpublic void actionPerformed(LyActionEvent actionEvent)
actionPerformed
in interface LyActionListener
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)
public java.lang.String getValue()
getValue
in interface LyGetValueInterface
LyGetValueInterface.getValue()
public void setValue(java.lang.String value)
value
- the new valuegetValue()
public void setEditable(boolean editable)
setEditable
in interface LySetEditableInterface
editable
- new statusLySetEditableInterface.setEditable(boolean)
public void setEnabled(boolean status)
setEnabled
in interface LySetEnabledInterface
status
- new enabled statuspublic java.awt.Component getComponent()
getComponent
in interface LySwingComponent
getComponent
in class LySwingObject
LySwingComponent.getComponent()
public void addLink(LyLink link, int pos)
addLink
in interface LyGraphicalRelation
addLink
in interface LySetLinksInterface
link
- the link to add to this relationpos
- the position of the link in this relation componentLySetLinksInterface.addLink(leon.view.LyLink, int)
public void removeLink(LyLink link)
removeLink
in interface LyGraphicalRelation
removeLink
in interface LySetLinksInterface
link
- The links to remove to links list.LySetLinksInterface.removeLink(leon.view.LyLink)
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |