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_UNKNOWN, CTRLTYPE_USER, namesCTRLFLAG_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 |
appendBaseTransaction(Transaction trans)
Appends the basic control data to the create transaction
to the client (flags, x, y, cx, cy).
|
protected Object |
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.
|
PhantomApplicationData |
getApplicationData()
Gets the application data.
|
int |
getBackgroundColor()
Get control background color.
|
int |
getControlSize()
Get the control size when saved to file.
|
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.
|
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.
|
abstract int |
getSaveSize()
Get the size when saved to file.
|
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.
|
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 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 void setIndex(int index)
PhantomPanelData class when creating Gui-on-the-fly controls.public void resolveComponentReferences()
public void getReferencedFiles(ArrayList<String> files)
ArrayList - 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 getSaveSize()
public int getControlSize()
public PhantomObject getObject()
public abstract void reloadObject()
throws IOException
IOExceptionpublic 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 - IOExceptionpublic void saveBase(PhantomOutputFile file) throws IOException
file - IOExceptionprotected Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionPhantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.