com.xj.anylogic.engine.presentation
Class ShapeControlManager

java.lang.Object
  extended by com.xj.anylogic.engine.presentation.ShapeControlManager

public class ShapeControlManager
extends java.lang.Object

This class is responsible for displaying controls, i.e. presentation elements that have JComponents (like slider, button, text field, etc, or charts), both persistent or non-persistent, i.e. existing only while they are visible. A non-persistent control is fully identified by its owner (Presentable object), id and index. Therefore if e.g. a button is a member of a replicated group, only one (fisrt) button will be displayed. However, the control itself may be replicated.
Each control may have an action associated with it. When the user touches the control, the action is executed mutually exclusive with other possible model changers.

Author:
XJ Technologies Company Ltd. www.anylogic.com

Method Summary
 void confirmControl(Presentable p, int id, int index, int x, int y, int width, int height)
          Is called by presentable object to notify that a non-persistent control with the given id and index should be displayed at a given location and have a given size.
 void confirmControl(ShapeControl ctrl, int x, int y, int width, int height)
          Is called by presentable object to tell the panel that a persistent control should be displayed a given location and have a given size.
 ShapeControl findControl(Presentable p, int id, int index)
          Searches for a (non-persistent) control with the specified id and index.
 void setControlValueToDefalt(Presentable p, int id, int index)
          Sets a (non-persistent) coltrol value to what was provided as the default one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setControlValueToDefalt

public void setControlValueToDefalt(Presentable p,
                                    int id,
                                    int index)
Sets a (non-persistent) coltrol value to what was provided as the default one.

Parameters:
p - the owner of the coltrol
id - the id of the coltrol
index - index of the coltrol (for replicated coltrols)

findControl

public ShapeControl findControl(Presentable p,
                                int id,
                                int index)
Searches for a (non-persistent) control with the specified id and index. The associated JComponent can then be retrieved by calling getJComponent().

Parameters:
p - the owner of the control
id - the id of the control
index - the index of the control (for replicated controls)
Returns:
the ShapeControl or null if not found

confirmControl

public void confirmControl(Presentable p,
                           int id,
                           int index,
                           int x,
                           int y,
                           int width,
                           int height)
Is called by presentable object to notify that a non-persistent control with the given id and index should be displayed at a given location and have a given size. If such control is absent, the corresponding ShapeControl will be created and marked as not added to the panel, otherwise the existing control properties will be adjusted if needed.

Parameters:
p - the presentable object owning the control
id - the control id
index - the control index (for replicated controls)
x - the x coordinate of the control
y - the y coordinate of the control
width - the width of the control
height - the height of the control

confirmControl

public void confirmControl(ShapeControl ctrl,
                           int x,
                           int y,
                           int width,
                           int height)
Is called by presentable object to tell the panel that a persistent control should be displayed a given location and have a given size.

Parameters:
ctrl - the control
x - the x coordinate of the control
y - the y coordinate of the control
width - the width of the control
height - the height of the control


Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.