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

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

See Also:
Constant Field Values

Player

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


DialogId

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


Effect

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


Type

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


Id

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


Parent

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


Size

protected 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 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 String Background
Applicable for: PANEL, BUTTON. Name of texture, which should be used as background.


BgColor

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


Border

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


Text

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


TextColor

protected 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 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 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 String Checked
Applicable for: OPTION. Name of texture which should be used when the button is checked.


NotChecked

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


Image

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


Origin

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


Scale

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

Constructor Detail

DialogItem

public DialogItem(String Player,
                  String DialogId,
                  String Effect,
                  String Type,
                  String Id,
                  String Parent,
                  Dimension2D Size,
                  Point2D Position,
                  String Background,
                  Color BgColor,
                  Color Border,
                  String Text,
                  Color TextColor,
                  String Action,
                  String Mode,
                  String Checked,
                  String NotChecked,
                  String Image,
                  Point2D Origin,
                  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 String getPlayer()
Name of the player on who's HUD should the dialog show.


setPlayer

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


getDialogId

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


setDialogId

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


getEffect

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


setEffect

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


getType

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


setType

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


getId

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


setId

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


getParent

public 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(String Parent)
Id of parent component. If left empty, the parent is dialog itself. Parent must be specified before the child.


getSize

public 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(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 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(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 String getBackground()
Applicable for: PANEL, BUTTON. Name of texture, which should be used as background.


setBackground

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


getBgColor

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


setBgColor

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


getBorder

public 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(Color Border)
Applicable for: PANEL, BUTTON. Triple of numbers from 0 to 255 separated by commas, specifying the RGB color of border.


getText

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


setText

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


getTextColor

public 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(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 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(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 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(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 String getChecked()
Applicable for: OPTION. Name of texture which should be used when the button is checked.


setChecked

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


getNotChecked

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


setNotChecked

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


getImage

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


setImage

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


getOrigin

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


setOrigin

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


getScale

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


setScale

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


toString

public String toString()
Overrides:
toString in class CommandMessage

toHtmlString

public String toHtmlString()

toMessage

public String toMessage()


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.