public class TerminalMouseHandler extends Object implements MouseInterface, EditorDirectInterface
Modifier and Type | Field and Description |
---|---|
static int |
MODE_EDITOR |
Constructor and Description |
---|
TerminalMouseHandler()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
closeProject()
Close the current application.
|
boolean |
closeProjectDirect()
Close the current application without asking for save etc.
|
void |
deleteAllMarks()
Delete all marks defined for the current screen.
|
void |
displayInputFields(boolean create)
Display all input fields in the current host screen.
|
Color |
getBackground(Color background,
int x,
int y)
Gets the background color when drawing a character.
|
HostPopupWindow.Rect |
getConstrainingPopup()
Get the constraining popup.
|
se.entra.phantom.server.phed.FieldDecoratedMark |
getLastField(se.entra.phantom.server.phed.FieldDecoratedMark current)
Get the last host field that is not equal to the indicated one.
|
se.entra.phantom.server.phed.FieldDecoratedMark |
getLastNormalField(se.entra.phantom.server.phed.FieldDecoratedMark current)
Get the last defined host field that is not a continued field and is
different from the indicated one.
|
Rectangle |
getMark()
Get the current mark's rectangle representation.
|
se.entra.phantom.server.phed.DecoratedMarks |
getMarks()
Get the marks container.
|
int |
getMode()
Get the current mode.
|
String |
getNewFieldName()
Get a new field name.
|
PhantomHostScreen |
getPhantomHostScreen()
Get the phantom host screen.
|
void |
handleMouseEvent(MouseEvent event)
Handle the current mouse event.
|
boolean |
inEditingMode()
Checks if the mode is in an editing mode, i.e.
|
void |
initialize()
Perform any necessary initialization.
|
boolean |
isCloseProjectAllowed()
Is close application allowed at this point?
|
boolean |
isEdited()
Is this phantom host screen edited.
|
boolean |
isSaveNeeded()
Is save needed at this point?
|
int |
messageBox(int type,
int icon,
String message,
String title)
Display a message box.
|
void |
paint(Graphics graphics,
TerminalWindow tw,
int leftMargin,
int topMargin,
int cxFont,
int cyFont)
Paint all defined marks.
|
boolean |
performAction()
Perform action.
|
void |
populateMarks(PhantomHostScreen screen)
Read the existing screen definition and populate the mark container.
|
void |
populateMarksDirect(PhantomHostScreen screen)
Read the screen definition and populate the mark container directly
(i.e.
|
void |
rematchScreen(boolean reset)
Performs a re-match of the current screen.
|
void |
removeExcludedPopup()
Perform remove excluded pop-up window action.
|
void |
removeMark()
Removes the current mark.
|
boolean |
saveHostData()
Save the PhantomHostData structure to file.
|
boolean |
saveScreenDefinitionDirect()
Save the screen definition in the PhantomHostData structure.
|
boolean |
setConstrainedDirect(HostPopupWindow.Rect constraint)
Set whether the window should be constrained (i.e.
|
void |
setCurrentMark(se.entra.phantom.server.phed.DecoratedMark newMark)
Sets the current mark.
|
boolean |
setCurrentScreenDirect(PhantomHostScreen newScreen)
Set the current screen programmatically.
|
void |
setDimensions(int cxFont,
int cyFont,
int xOffset,
int yOffset,
int cxScreen,
int cyScreen)
Set the dimensions of the component.
|
void |
setEdited(boolean edited)
Set the phantom host screen as edited.
|
void |
setHostConnected(boolean connected)
Indicate the host session is connected/disconnected.
|
void |
setMainPanel(Object main)
Set main panel reference.
|
void |
setMenuItemEnabled(String id,
boolean enabled)
Set menu item as enabled (or disabled).
|
void |
setMode(int newMode)
Set the mode the terminal is running in.
|
boolean |
setModeDirect(int newMode)
Set the current mode directly (i.e.
|
void |
setSessionManager(VirtualSessionManager vsm)
Set the virtual session manager reference.
|
void |
setTerminalWindow(TerminalWindow owner)
Set the owner of the handler.
|
boolean |
undoAction()
Perform undo action.
|
void |
update(HostScreen hs)
Set the host fields.
|
void |
updateMenus()
Set the mode indicator in the menus.
|
public static final int MODE_EDITOR
public void displayInputFields(boolean create)
displayInputFields
in interface MouseInterface
create
- Flag if the displayed fields should be created or not.public void deleteAllMarks()
deleteAllMarks
in interface MouseInterface
public void rematchScreen(boolean reset)
rematchScreen
in interface MouseInterface
reset
- Flag to perform a re-match of the current screen or not.public Rectangle getMark()
getMark
in interface MouseInterface
public se.entra.phantom.server.phed.DecoratedMarks getMarks()
getMarks
in interface EditorDirectInterface
public void setCurrentMark(se.entra.phantom.server.phed.DecoratedMark newMark)
setCurrentMark
in interface EditorDirectInterface
newMark
- The new DecoratedMark to set.public int getMode()
getMode
in interface MouseInterface
public boolean closeProjectDirect()
closeProjectDirect
in interface EditorDirectInterface
public boolean closeProject()
closeProject
in interface MouseInterface
public int messageBox(int type, int icon, String message, String title)
messageBox
in interface EditorDirectInterface
type
- icon
- message
- title
- public void removeMark()
removeMark
in interface MouseInterface
public se.entra.phantom.server.phed.FieldDecoratedMark getLastNormalField(se.entra.phantom.server.phed.FieldDecoratedMark current)
getLastNormalField
in interface EditorDirectInterface
current
- The current FieldDecoratedMark, null for none.public se.entra.phantom.server.phed.FieldDecoratedMark getLastField(se.entra.phantom.server.phed.FieldDecoratedMark current)
getLastField
in interface EditorDirectInterface
current
- The current FieldDecoratedMark, null for none.public PhantomHostScreen getPhantomHostScreen()
getPhantomHostScreen
in interface EditorDirectInterface
public void populateMarks(PhantomHostScreen screen)
populateMarks
in interface EditorDirectInterface
screen
- The PhantomHostScreen.public void populateMarksDirect(PhantomHostScreen screen)
populateMarksDirect
in interface EditorDirectInterface
screen
- The PhantomHostScreen.public void removeExcludedPopup()
removeExcludedPopup
in interface MouseInterface
public boolean saveScreenDefinitionDirect()
saveScreenDefinitionDirect
in interface EditorDirectInterface
public boolean saveHostData()
saveHostData
in interface MouseInterface
public boolean isSaveNeeded()
isSaveNeeded
in interface MouseInterface
public boolean inEditingMode()
public boolean isCloseProjectAllowed()
isCloseProjectAllowed
in interface MouseInterface
public void handleMouseEvent(MouseEvent event)
MouseInterface
handleMouseEvent
in interface MouseInterface
event
- The MouseEvent.public void setMainPanel(Object main)
MouseInterface
setMainPanel
in interface MouseInterface
main
- The main panel reference.public boolean setConstrainedDirect(HostPopupWindow.Rect constraint)
setConstrainedDirect
in interface EditorDirectInterface
constraint
- The pop-up window constrains rectangle, null for none.public Color getBackground(Color background, int x, int y)
getBackground
in interface MouseInterface
background
- The background color.x
- The X position.y
- The Y position.public HostPopupWindow.Rect getConstrainingPopup()
getConstrainingPopup
in interface EditorDirectInterface
public boolean isEdited()
isEdited
in interface EditorDirectInterface
public void setEdited(boolean edited)
setEdited
in interface EditorDirectInterface
edited
- Flag for PhantomHostScreen edited or not.public void setDimensions(int cxFont, int cyFont, int xOffset, int yOffset, int cxScreen, int cyScreen)
setDimensions
in interface MouseInterface
cxFont
- horizontal font sizecyFont
- vertical font sizexOffset
- horizontal offsetyOffset
- vertical offsetcxScreen
- horizontal screen sizecyScreen
- vertical screen sizepublic void setSessionManager(VirtualSessionManager vsm)
vsm
- The VirtualSessionManager.public void setTerminalWindow(TerminalWindow owner)
setTerminalWindow
in interface MouseInterface
owner
- The owner TerminalWindow.public boolean setCurrentScreenDirect(PhantomHostScreen newScreen)
setCurrentScreenDirect
in interface EditorDirectInterface
newScreen
- The new PhantomHostScreen.public String getNewFieldName()
getNewFieldName
in interface EditorDirectInterface
public void setHostConnected(boolean connected)
setHostConnected
in interface MouseInterface
connected
- The connected-enabled state.public void paint(Graphics graphics, TerminalWindow tw, int leftMargin, int topMargin, int cxFont, int cyFont)
paint
in interface MouseInterface
graphics
- The Graphics.tw
- The TerminalWindow.leftMargin
- Left margin.topMargin
- Top margin.cxFont
- Font width.cyFont
- Font height.public void updateMenus()
updateMenus
in interface MouseInterface
public void setMenuItemEnabled(String id, boolean enabled)
setMenuItemEnabled
in interface MouseInterface
id
- The menu item ID.enabled
- true = enabled, false = disabled.public void setMode(int newMode)
setMode
in interface MouseInterface
newMode
- The new mode.public boolean setModeDirect(int newMode)
setModeDirect
in interface EditorDirectInterface
newMode
- The new mode.public void initialize()
initialize
in interface MouseInterface
public boolean performAction()
performAction
in interface MouseInterface
public boolean undoAction()
undoAction
in interface MouseInterface
public void update(HostScreen hs)
hs
- The host screen.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.