cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands
Class DialogItem

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.CommandMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.DialogItem

public class DialogItem
extends CommandMessage

Representation of the GameBots2004 command DLGITEM. Specifies properties of a new dialog component.


Field Summary
protected  java.lang.String Action
          Applicable for: BUTTON, IMAGE.
protected  java.lang.String Background
          Applicable for: PANEL, BUTTON.
protected  java.awt.Color BgColor
          Applicable for: PANEL, BUTTON.
protected  java.awt.Color Border
          Applicable for: PANEL, BUTTON.
protected  java.lang.String Checked
          Applicable for: OPTION.
protected  java.lang.String DialogId
          Id of dialog, which should the message alter.
protected  java.lang.String Effect
          What should this message do.
protected  java.lang.String Id
          Identification of this component.
protected  java.lang.String Image
          Applicable for: IMAGE.
protected  java.lang.String Mode
          Applicable for: OPTIONLIST.
protected  java.lang.String NotChecked
          Applicable for: OPTION.
protected  java.awt.geom.Point2D Origin
          Applicable for: IMAGE.
protected  java.lang.String Parent
          Id of parent component.
protected  java.lang.String Player
          Name of the player on who's HUD should the dialog show.
protected  java.awt.geom.Point2D Position
          Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE.
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  java.awt.geom.Dimension2D Scale
          Applicable for: IMAGE.
protected  java.awt.geom.Dimension2D Size
          Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE.
protected  java.lang.String Text
          Applicable for: TEXT, BUTTON, OPTION.
protected  java.awt.Color TextColor
          Applicable for: TEXT, BUTTON, OPTION.
protected  java.lang.String Type
          Type of the new component.
 
Constructor Summary
DialogItem()
          Creates new instance of command DialogItem.
DialogItem(DialogItem original)
          Cloning constructor.
DialogItem(java.lang.String Player, java.lang.String DialogId, java.lang.String Effect, java.lang.String Type, java.lang.String Id, java.lang.String Parent, java.awt.geom.Dimension2D Size, java.awt.geom.Point2D Position, java.lang.String Background, java.awt.Color BgColor, java.awt.Color Border, java.lang.String Text, java.awt.Color TextColor, java.lang.String Action, java.lang.String Mode, java.lang.String Checked, java.lang.String NotChecked, java.lang.String Image, java.awt.geom.Point2D Origin, java.awt.geom.Dimension2D Scale)
          Creates new instance of command DialogItem.
 
Method Summary
 java.lang.String getAction()
          Applicable for: BUTTON, IMAGE.
 java.lang.String getBackground()
          Applicable for: PANEL, BUTTON.
 java.awt.Color getBgColor()
          Applicable for: PANEL, BUTTON.
 java.awt.Color getBorder()
          Applicable for: PANEL, BUTTON.
 java.lang.String getChecked()
          Applicable for: OPTION.
 java.lang.String getDialogId()
          Id of dialog, which should the message alter.
 java.lang.String getEffect()
          What should this message do.
 java.lang.String getId()
          Identification of this component.
 java.lang.String getImage()
          Applicable for: IMAGE.
 java.lang.String getMode()
          Applicable for: OPTIONLIST.
 java.lang.String getNotChecked()
          Applicable for: OPTION.
 java.awt.geom.Point2D getOrigin()
          Applicable for: IMAGE.
 java.lang.String getParent()
          Id of parent component.
 java.lang.String getPlayer()
          Name of the player on who's HUD should the dialog show.
 java.awt.geom.Point2D getPosition()
          Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE.
 java.awt.geom.Dimension2D getScale()
          Applicable for: IMAGE.
 java.awt.geom.Dimension2D getSize()
          Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE.
 java.lang.String getText()
          Applicable for: TEXT, BUTTON, OPTION.
 java.awt.Color getTextColor()
          Applicable for: TEXT, BUTTON, OPTION.
 java.lang.String getType()
          Type of the new component.
 DialogItem setAction(java.lang.String Action)
          Applicable for: BUTTON, IMAGE.
 DialogItem setBackground(java.lang.String Background)
          Applicable for: PANEL, BUTTON.
 DialogItem setBgColor(java.awt.Color BgColor)
          Applicable for: PANEL, BUTTON.
 DialogItem setBorder(java.awt.Color Border)
          Applicable for: PANEL, BUTTON.
 DialogItem setChecked(java.lang.String Checked)
          Applicable for: OPTION.
 DialogItem setDialogId(java.lang.String DialogId)
          Id of dialog, which should the message alter.
 DialogItem setEffect(java.lang.String Effect)
          What should this message do.
 DialogItem setId(java.lang.String Id)
          Identification of this component.
 DialogItem setImage(java.lang.String Image)
          Applicable for: IMAGE.
 DialogItem setMode(java.lang.String Mode)
          Applicable for: OPTIONLIST.
 DialogItem setNotChecked(java.lang.String NotChecked)
          Applicable for: OPTION.
 DialogItem setOrigin(java.awt.geom.Point2D Origin)
          Applicable for: IMAGE.
 DialogItem setParent(java.lang.String Parent)
          Id of parent component.
 DialogItem setPlayer(java.lang.String Player)
          Name of the player on who's HUD should the dialog show.
 DialogItem setPosition(java.awt.geom.Point2D Position)
          Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE.
 DialogItem setScale(java.awt.geom.Dimension2D Scale)
          Applicable for: IMAGE.
 DialogItem setSize(java.awt.geom.Dimension2D Size)
          Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE.
 DialogItem setText(java.lang.String Text)
          Applicable for: TEXT, BUTTON, OPTION.
 DialogItem setTextColor(java.awt.Color TextColor)
          Applicable for: TEXT, BUTTON, OPTION.
 DialogItem setType(java.lang.String Type)
          Type of the new component.
 java.lang.String toHtmlString()
           
 java.lang.String toMessage()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final java.lang.String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Player

protected java.lang.String Player
Name of the player on who's HUD should the dialog show.


DialogId

protected java.lang.String DialogId
Id of dialog, which should the message alter. If empty, actually constructed dialog is used.


Effect

protected java.lang.String Effect
What should this message do. Available are: ADD, EDIT.


Type

protected java.lang.String Type
Type of the new component. Available are: PANEL, BUTTON, TEXT, IMAGE, OPTIONLIST, OPTION.


Id

protected java.lang.String Id
Identification of this component. It should be an unique alphanumeric string without spaces.


Parent

protected java.lang.String Parent
Id of parent component. If left empty, the parent is dialog itself. Parent must be specified before the child.


Size

protected java.awt.geom.Dimension2D Size
Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Width,Height" where each is in range from 0 to 1 (relative portion of the parent component).


Position

protected java.awt.geom.Point2D Position
Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Left,Top" where each is in range from 0 to 1 (relative portion of the parent component).


Background

protected java.lang.String Background
Applicable for: PANEL, BUTTON. Name of texture, which should be used as background.


BgColor

protected java.awt.Color BgColor
Applicable for: PANEL, BUTTON. RGBA color of background.


Border

protected java.awt.Color Border
Applicable for: PANEL, BUTTON. Triple of numbers from 0 to 255 separated by commas, specifying the RGB color of border.


Text

protected java.lang.String Text
Applicable for: TEXT, BUTTON, OPTION. Text which should be written on the component.


TextColor

protected java.awt.Color TextColor
Applicable for: TEXT, BUTTON, OPTION. Color of text which should be written on the component as RGB triple of numbers from 0 to 255 separated by commas.


Action

protected java.lang.String Action
Applicable for: BUTTON, IMAGE. Action which should be performed when the button is pressed. SUBMIT submits data from the dialog using DLGCMD message with Command SUBMIT, RESET resets the dialog and all other values send DLGCMD message with this value as Command - without closing the dialog.


Mode

protected java.lang.String Mode
Applicable for: OPTIONLIST. Either SINGLE - just one option can be selected at one moment (radio buttons), or MULTI - classic check boxes.


Checked

protected java.lang.String Checked
Applicable for: OPTION. Name of texture which should be used when the button is checked.


NotChecked

protected java.lang.String NotChecked
Applicable for: OPTION. Name of texture which should be used when the button is not checked.


Image

protected java.lang.String Image
Applicable for: IMAGE. Name of texture of the image.


Origin

protected java.awt.geom.Point2D Origin
Applicable for: IMAGE. Left top origin point of the image.


Scale

protected java.awt.geom.Dimension2D Scale
Applicable for: IMAGE. Left top origin point of the image.

Constructor Detail

DialogItem

public DialogItem(java.lang.String Player,
                  java.lang.String DialogId,
                  java.lang.String Effect,
                  java.lang.String Type,
                  java.lang.String Id,
                  java.lang.String Parent,
                  java.awt.geom.Dimension2D Size,
                  java.awt.geom.Point2D Position,
                  java.lang.String Background,
                  java.awt.Color BgColor,
                  java.awt.Color Border,
                  java.lang.String Text,
                  java.awt.Color TextColor,
                  java.lang.String Action,
                  java.lang.String Mode,
                  java.lang.String Checked,
                  java.lang.String NotChecked,
                  java.lang.String Image,
                  java.awt.geom.Point2D Origin,
                  java.awt.geom.Dimension2D Scale)
Creates new instance of command DialogItem. Specifies properties of a new dialog component. Corresponding GameBots message for this command is DLGITEM.

Parameters:
Player - Name of the player on who's HUD should the dialog show.
DialogId - Id of dialog, which should the message alter. If empty, actually constructed dialog is used.
Effect - What should this message do. Available are: ADD, EDIT.
Type - Type of the new component. Available are: PANEL, BUTTON, TEXT, IMAGE, OPTIONLIST, OPTION.
Id - Identification of this component. It should be an unique alphanumeric string without spaces.
Parent - Id of parent component. If left empty, the parent is dialog itself. Parent must be specified before the child.
Size - Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Width,Height" where each is in range from 0 to 1 (relative portion of the parent component).
Position - Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Left,Top" where each is in range from 0 to 1 (relative portion of the parent component).
Background - Applicable for: PANEL, BUTTON. Name of texture, which should be used as background.
BgColor - Applicable for: PANEL, BUTTON. RGBA color of background.
Border - Applicable for: PANEL, BUTTON. Triple of numbers from 0 to 255 separated by commas, specifying the RGB color of border.
Text - Applicable for: TEXT, BUTTON, OPTION. Text which should be written on the component.
TextColor - Applicable for: TEXT, BUTTON, OPTION. Color of text which should be written on the component as RGB triple of numbers from 0 to 255 separated by commas.
Action - Applicable for: BUTTON, IMAGE. Action which should be performed when the button is pressed. SUBMIT submits data from the dialog using DLGCMD message with Command SUBMIT, RESET resets the dialog and all other values send DLGCMD message with this value as Command - without closing the dialog.
Mode - Applicable for: OPTIONLIST. Either SINGLE - just one option can be selected at one moment (radio buttons), or MULTI - classic check boxes.
Checked - Applicable for: OPTION. Name of texture which should be used when the button is checked.
NotChecked - Applicable for: OPTION. Name of texture which should be used when the button is not checked.
Image - Applicable for: IMAGE. Name of texture of the image.
Origin - Applicable for: IMAGE. Left top origin point of the image.
Scale - Applicable for: IMAGE. Left top origin point of the image.

DialogItem

public DialogItem()
Creates new instance of command DialogItem. Specifies properties of a new dialog component. Corresponding GameBots message for this command is DLGITEM.

WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!


DialogItem

public DialogItem(DialogItem original)
Cloning constructor.

Parameters:
original -
Method Detail

getPlayer

public java.lang.String getPlayer()
Name of the player on who's HUD should the dialog show.


setPlayer

public DialogItem setPlayer(java.lang.String Player)
Name of the player on who's HUD should the dialog show.


getDialogId

public java.lang.String getDialogId()
Id of dialog, which should the message alter. If empty, actually constructed dialog is used.


setDialogId

public DialogItem setDialogId(java.lang.String DialogId)
Id of dialog, which should the message alter. If empty, actually constructed dialog is used.


getEffect

public java.lang.String getEffect()
What should this message do. Available are: ADD, EDIT.


setEffect

public DialogItem setEffect(java.lang.String Effect)
What should this message do. Available are: ADD, EDIT.


getType

public java.lang.String getType()
Type of the new component. Available are: PANEL, BUTTON, TEXT, IMAGE, OPTIONLIST, OPTION.


setType

public DialogItem setType(java.lang.String Type)
Type of the new component. Available are: PANEL, BUTTON, TEXT, IMAGE, OPTIONLIST, OPTION.


getId

public java.lang.String getId()
Identification of this component. It should be an unique alphanumeric string without spaces.


setId

public DialogItem setId(java.lang.String Id)
Identification of this component. It should be an unique alphanumeric string without spaces.


getParent

public java.lang.String getParent()
Id of parent component. If left empty, the parent is dialog itself. Parent must be specified before the child.


setParent

public DialogItem setParent(java.lang.String Parent)
Id of parent component. If left empty, the parent is dialog itself. Parent must be specified before the child.


getSize

public java.awt.geom.Dimension2D getSize()
Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Width,Height" where each is in range from 0 to 1 (relative portion of the parent component).


setSize

public DialogItem setSize(java.awt.geom.Dimension2D Size)
Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Width,Height" where each is in range from 0 to 1 (relative portion of the parent component).


getPosition

public java.awt.geom.Point2D getPosition()
Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Left,Top" where each is in range from 0 to 1 (relative portion of the parent component).


setPosition

public DialogItem setPosition(java.awt.geom.Point2D Position)
Applicable for: PANEL, BUTTON, TEXT, OPTIONLIST, IMAGE. A pair of values in form "Left,Top" where each is in range from 0 to 1 (relative portion of the parent component).


getBackground

public java.lang.String getBackground()
Applicable for: PANEL, BUTTON. Name of texture, which should be used as background.


setBackground

public DialogItem setBackground(java.lang.String Background)
Applicable for: PANEL, BUTTON. Name of texture, which should be used as background.


getBgColor

public java.awt.Color getBgColor()
Applicable for: PANEL, BUTTON. RGBA color of background.


setBgColor

public DialogItem setBgColor(java.awt.Color BgColor)
Applicable for: PANEL, BUTTON. RGBA color of background.


getBorder

public java.awt.Color getBorder()
Applicable for: PANEL, BUTTON. Triple of numbers from 0 to 255 separated by commas, specifying the RGB color of border.


setBorder

public DialogItem setBorder(java.awt.Color Border)
Applicable for: PANEL, BUTTON. Triple of numbers from 0 to 255 separated by commas, specifying the RGB color of border.


getText

public java.lang.String getText()
Applicable for: TEXT, BUTTON, OPTION. Text which should be written on the component.


setText

public DialogItem setText(java.lang.String Text)
Applicable for: TEXT, BUTTON, OPTION. Text which should be written on the component.


getTextColor

public java.awt.Color getTextColor()
Applicable for: TEXT, BUTTON, OPTION. Color of text which should be written on the component as RGB triple of numbers from 0 to 255 separated by commas.


setTextColor

public DialogItem setTextColor(java.awt.Color TextColor)
Applicable for: TEXT, BUTTON, OPTION. Color of text which should be written on the component as RGB triple of numbers from 0 to 255 separated by commas.


getAction

public java.lang.String getAction()
Applicable for: BUTTON, IMAGE. Action which should be performed when the button is pressed. SUBMIT submits data from the dialog using DLGCMD message with Command SUBMIT, RESET resets the dialog and all other values send DLGCMD message with this value as Command - without closing the dialog.


setAction

public DialogItem setAction(java.lang.String Action)
Applicable for: BUTTON, IMAGE. Action which should be performed when the button is pressed. SUBMIT submits data from the dialog using DLGCMD message with Command SUBMIT, RESET resets the dialog and all other values send DLGCMD message with this value as Command - without closing the dialog.


getMode

public java.lang.String getMode()
Applicable for: OPTIONLIST. Either SINGLE - just one option can be selected at one moment (radio buttons), or MULTI - classic check boxes.


setMode

public DialogItem setMode(java.lang.String Mode)
Applicable for: OPTIONLIST. Either SINGLE - just one option can be selected at one moment (radio buttons), or MULTI - classic check boxes.


getChecked

public java.lang.String getChecked()
Applicable for: OPTION. Name of texture which should be used when the button is checked.


setChecked

public DialogItem setChecked(java.lang.String Checked)
Applicable for: OPTION. Name of texture which should be used when the button is checked.


getNotChecked

public java.lang.String getNotChecked()
Applicable for: OPTION. Name of texture which should be used when the button is not checked.


setNotChecked

public DialogItem setNotChecked(java.lang.String NotChecked)
Applicable for: OPTION. Name of texture which should be used when the button is not checked.


getImage

public java.lang.String getImage()
Applicable for: IMAGE. Name of texture of the image.


setImage

public DialogItem setImage(java.lang.String Image)
Applicable for: IMAGE. Name of texture of the image.


getOrigin

public java.awt.geom.Point2D getOrigin()
Applicable for: IMAGE. Left top origin point of the image.


setOrigin

public DialogItem setOrigin(java.awt.geom.Point2D Origin)
Applicable for: IMAGE. Left top origin point of the image.


getScale

public java.awt.geom.Dimension2D getScale()
Applicable for: IMAGE. Left top origin point of the image.


setScale

public DialogItem setScale(java.awt.geom.Dimension2D Scale)
Applicable for: IMAGE. Left top origin point of the image.


toString

public java.lang.String toString()
Overrides:
toString in class CommandMessage

toHtmlString

public java.lang.String toHtmlString()

toMessage

public java.lang.String toMessage()