public abstract class PhantomControl extends Object implements PhantomControlType, PhantomControlFlags, Cloneable
Modifier and Type | Field and Description |
---|---|
PhantomControlBase |
controlBase
Control base data position,size,type and other basic data.
|
protected se.entra.phantom.geditor.NPPColor |
controlColor
Foreground and background color that possibly is set from respectively control.
|
String |
id
The control ID (or null if the control doesn't have an ID).
|
int |
index
The control index in the panel.
|
boolean |
isBackgroundConverted
The host VIO color is background converted.
|
boolean |
isForegroundConverted
The host VIO color is foreground converted.
|
PhantomObject |
object
The object connected to this control (or null for no object).
|
PhantomPanelData |
panelData
The panel data.
|
PhantomPopupMenu |
popupMenu
The possible connection to a pop-up menu (may be null).
|
String |
tooltipText
The tool-tip text connected to the control.
|
CTRLTYPE_BUTTON, CTRLTYPE_CHECK, CTRLTYPE_COMBO, CTRLTYPE_FRAME, CTRLTYPE_GRAPH, CTRLTYPE_GROUP, CTRLTYPE_INOUT, CTRLTYPE_LIST, CTRLTYPE_MLE, CTRLTYPE_NOTE, CTRLTYPE_OUT, CTRLTYPE_RADIO, CTRLTYPE_RECT, CTRLTYPE_SPIN, CTRLTYPE_SUB, CTRLTYPE_TEXT, CTRLTYPE_TREE, CTRLTYPE_UNKNOWN, CTRLTYPE_USER, CTRLTYPES_COUNT, names
CTRLFLAG_MOVEX, CTRLFLAG_MOVEY, CTRLFLAG_NEWGROUP, CTRLFLAG_SIZEX, CTRLFLAG_SIZEY, CTRLFLAG_SUBWIN, CTRLFLAG_TABSTOP, CTRLFLAG_TRANSPARENT
Constructor and Description |
---|
PhantomControl(PhantomPanelData panelData,
int index,
PhantomControlBase controlBase)
Loads the control base definition from the Phantom Panel file.
|
Modifier and Type | Method and Description |
---|---|
void |
addControlID(String id)
Adds a control with a control ID to the panel.
|
void |
addControlReference(ENPObject obj,
String controlID)
Adds a control reference.
|
void |
addHostFieldReference(ENPObject obj,
String hostField)
Helper method to add a reference to a host field.
|
protected abstract void |
addNPObjects(ENPObject obj)
Adds the NPObject references.
|
void |
appendBaseTransaction(Transaction trans)
Appends the basic control data to the create transaction
to the client (flags, x, y, cx, cy).
|
void |
checkTextPromptReferences(ENPObject obj,
String text)
Checks a text prompt for added references to text ID and host fields.
|
void |
checkTextPromptReferences(ENPObject obj,
String text,
int bitmapFlags)
Processes a text string for the push button, check box and radio button for images.
|
protected PhantomControl |
clone()
Makes a clone of a PhantomControl instance.
|
static PhantomControl |
create(PhantomPanelData panelData,
int index,
PhantomFile file,
PhantomControlBase controlBase,
PhantomControlBase lastBase)
Loads the control specific definition from the Phantom Panel file
and creates the control.
|
ENPObject |
createNPObject()
Gets the NPObject for the control.
|
boolean |
equals(Object o)
Checks if two control base's are equal.
|
protected abstract boolean |
equalsControl(PhantomControl c)
Checks for control equality.
|
PhantomApplicationData |
getApplicationData()
Gets the application data.
|
int |
getBackgroundColor()
Get control background color.
|
String |
getControlObjectID()
Needs override by the control if the
object instance if not resolved in this class instance. |
abstract int |
getDataSize(PhantomOutputFile outputFile)
Get the size when saved to file.
|
static IDesignerControl |
getDesignerControl(int type)
Gets the designer control implementor for a type.
|
int |
getForegroundColor()
Get control foreground color.
|
PhantomHostField |
getHostField(String fieldName)
Gets the host field of a specific name.
|
String |
getHostFieldID()
Gets the host field ID for this control.
|
String |
getID()
Gets ID of this control.
|
int |
getIndex()
Gets the index of this control.
|
protected String |
getNPObjectExtra()
Gets the "Extra" String for the NPObject.
|
protected String |
getNPObjectID()
Gets the "ID" for the NPObject.
|
PhantomObject |
getObject()
Gets the object reference of this control.
|
PhantomObject |
getObject(String objectName)
Gets the object associated with the object name, may be null if
the object name is empty.
|
PhantomPanelData |
getPanelData()
Gets the panel data.
|
void |
getReferencedFiles(ArrayList<String> files)
Adds all files that are referenced by this control.
|
String |
getTypeDescription()
Gets the type description of this control in "English", such as "Notebook" or "Push Button".
|
String |
getTypeDescriptionID()
Gets the type description of this control in "English", such as "Notebook ID nn" or "Push Button ID nn",
including the control ID.
|
static void |
initializeDesignerControls()
Editor initializing.
|
boolean |
isActionConnectedEnabled()
Checks if a control is action connected to another.
|
void |
processColorConversion(VirtualControl vCtl,
int vioColor)
Handle color conversion for host update.
|
void |
processColorConversion(VirtualControl vCtl,
int vioColor,
boolean doKeepBackgroundAtNoConversion)
Handle color conversion for host update.
|
void |
processColorConversion(VirtualControl vCtl,
int vioColor,
boolean doForegroundColor,
boolean doKeepBackgroundAtNoConversion)
Handle color conversion for host update.
|
se.entra.phantom.geditor.NPPColor |
processDisabledBackground(VirtualControl vCtl,
boolean isDisable,
boolean backgroundAsPanel,
se.entra.phantom.geditor.NPPColor originalBackground)
Handle background as panel when read only.
|
void |
rebind()
Re-bind the panel data.
|
abstract void |
reloadObject()
Reload object reference.
|
void |
resolveComponentReferences()
Resolves references of this control to other panel components,
after the panel has been loaded.
|
abstract void |
save(PhantomOutputFile file)
The save to file method to be implemented by all subclasses.
|
void |
saveBase(PhantomOutputFile file)
The save the base to file.
|
void |
setBackgroundColor(int colorIndex)
Set background color (from e.g.
|
void |
setForegroundColor(int colorIndex)
Set foreground color (from ex GOF).
|
void |
setIndex(int index)
Sets the index of the control in the panel.
|
void |
updateGuiOnTheFlyValue(CRC32 crc32)
Updates the CRC32 value of a Gui-on-the-fly value with the
control's base data.
|
abstract void |
updateReferences(ApplicationReferences refs)
Updates the Applications References instance.
|
public PhantomControlBase controlBase
public PhantomPanelData panelData
public PhantomPopupMenu popupMenu
public int index
public String id
public PhantomObject object
public boolean isForegroundConverted
public boolean isBackgroundConverted
public String tooltipText
protected se.entra.phantom.geditor.NPPColor controlColor
public PhantomControl(PhantomPanelData panelData, int index, PhantomControlBase controlBase)
Base: + x SHORT + y SHORT + cx SHORT + cy SHORT + typeAndFlags BYTE + flags BYTE + dataLength USHORT + skip data pointer ULONG
public static void initializeDesignerControls()
public static IDesignerControl getDesignerControl(int type)
public int getForegroundColor()
public int getBackgroundColor()
public void setForegroundColor(int colorIndex)
public void setBackgroundColor(int colorIndex)
public static PhantomControl create(PhantomPanelData panelData, int index, PhantomFile file, PhantomControlBase controlBase, PhantomControlBase lastBase) throws IOException
Control specific data: + data - variable BYTE [dataLen]
IOException
- if an I/O error occurs.public String getTypeDescription()
public String getTypeDescriptionID()
public void setIndex(int index)
PhantomPanelData
class when creating Gui-on-the-fly controls.public void resolveComponentReferences()
public void getReferencedFiles(ArrayList<String> files)
files
- The ArrayList of file names that are referenced will
be filled in.public PhantomPanelData getPanelData()
public PhantomApplicationData getApplicationData()
public void addControlID(String id)
When this method is called, the table of connection IDs to pop-up menus is also checked for reference. If such connection exist, the PhantomPopupMenu reference is saved.
public PhantomObject getObject(String objectName) throws IOException
IOException
- if the object is not found in the applicationpublic int getIndex()
public abstract int getDataSize(PhantomOutputFile outputFile)
public PhantomObject getObject()
public abstract void reloadObject() throws IOException
IOException
public void rebind()
public String getID()
public PhantomHostField getHostField(String fieldName)
public void appendBaseTransaction(Transaction trans)
public boolean isActionConnectedEnabled()
public void processColorConversion(VirtualControl vCtl, int vioColor)
public void processColorConversion(VirtualControl vCtl, int vioColor, boolean doKeepBackgroundAtNoConversion)
public void processColorConversion(VirtualControl vCtl, int vioColor, boolean doForegroundColor, boolean doKeepBackgroundAtNoConversion)
public se.entra.phantom.geditor.NPPColor processDisabledBackground(VirtualControl vCtl, boolean isDisable, boolean backgroundAsPanel, se.entra.phantom.geditor.NPPColor originalBackground)
public String getHostFieldID()
VirtualControl
is never defined, it's up the the extending class
to return it by overriding this method.public void updateGuiOnTheFlyValue(CRC32 crc32)
All controls that implements a Gui-on-the-fly constructor
must always override this method and start by calling
super.updateGuiOnTheFlyCRC32(crc32)
before
adding control specific data.
public abstract void save(PhantomOutputFile file) throws IOException
file
- IOException
public void saveBase(PhantomOutputFile file) throws IOException
file
- IOException
protected PhantomControl clone()
public abstract void updateReferences(ApplicationReferences refs)
public ENPObject createNPObject()
protected String getNPObjectID()
protected String getNPObjectExtra()
protected abstract void addNPObjects(ENPObject obj)
public String getControlObjectID()
object
instance if not resolved in this class instance.public void checkTextPromptReferences(ENPObject obj, String text)
public void checkTextPromptReferences(ENPObject obj, String text, int bitmapFlags)
public void addControlReference(ENPObject obj, String controlID)
public void addHostFieldReference(ENPObject obj, String hostField)
public boolean equals(Object o)
protected abstract boolean equalsControl(PhantomControl c)
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.