Game Control Plus  1.2.2
 All Classes Namespaces Functions Variables Pages
org.gamecontrolplus.gui.MClip Class Reference
Inheritance diagram for org.gamecontrolplus.gui.MClip:

Public Member Functions

void lostOwnership (Clipboard clipboard, Transferable contents)
 

Static Public Member Functions

static boolean copy (String chars)
 
static String paste ()
 

Private Member Functions

 MClip ()
 
void makeClipboardObject ()
 
boolean copyString (String chars)
 
String pasteString ()
 

Private Attributes

Clipboard clipboard = null
 

Static Private Attributes

static MClip gclip = null
 

Detailed Description

Clipboard functionaliy for plain text

This provides clipboard functionality for text and is currently only used by the GTextField and GTextArea classes.

Author
Peter Lager

Constructor & Destructor Documentation

org.gamecontrolplus.gui.MClip.MClip ( )
private

Ctor is private so clipboard is only created when a copy or paste is attempted and one does not exist already.

Member Function Documentation

static boolean org.gamecontrolplus.gui.MClip.copy ( String  chars)
static

Copy a string to the clipboard

Parameters
chars
boolean org.gamecontrolplus.gui.MClip.copyString ( String  chars)
private

Copy a string to the clipboard. If the Clipboard has not been created then create it.

Returns
true for a successful copy to clipboard
void org.gamecontrolplus.gui.MClip.lostOwnership ( Clipboard  clipboard,
Transferable  contents 
)

Reqd by ClipboardOwner interface

void org.gamecontrolplus.gui.MClip.makeClipboardObject ( )
private

If security permits use the system clipboard otherwise create our own application clipboard.

static String org.gamecontrolplus.gui.MClip.paste ( )
static

Get a string from the clipboard

Returns
the string on the clipboard
String org.gamecontrolplus.gui.MClip.pasteString ( )
private

Gets a string from the clipboard. If there is no Clipboard then create it.

Returns
if possible the string on the clipboard else an empty string

Member Data Documentation

Clipboard org.gamecontrolplus.gui.MClip.clipboard = null
private

Class attribute to reference the programs clipboard

MClip org.gamecontrolplus.gui.MClip.gclip = null
staticprivate

Static reference to enforce singleton pattern