com.cbse.jeasy
Class JEPanel

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.cbse.jeasy.JEPanel
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener

public class JEPanel
extends JEObject
implements java.awt.event.MouseListener, java.awt.event.KeyListener

A class using a JPanel. A JPanel is a generic container. Like a JFrame it is the parent of the components.

Properties
name values comment
id * Id of the object. Let it begin with PA_
x int value The x-coordinate of the new location's top-left corner in the owners's coordinate space.
y int value The y-coordinate of the new location's top-left corner in the owners's coordinate space.
width int value The width of this component in pixels.
height int value The height of this component in pixels.
layout BorderLayout The layout of the panel.
border   Id of a border.
background   Id of a color used as the background
constraints   Constraints when added in GridBagLayout
scrollpane true
false
When set to true, the panel will be scrollable.
tabbedpaneText   The text to be displayed when the panel is added in a tabbedpane.
tabbedpaneIcon   An icon shown in the tabbedpane.
tabbedpaneTooltip   A tooltip for the tabbedpane.
borderedpaneText   A border containing this text is painted arround the panel.
hgap int value Sets the horizontal gap between components in BorderLayout.
vgap int value Sets the vertical gap between components in BorderLayout.
North   Component in the North in Borderlayout.
South   Component in the South in Borderlayout
East   Component in the East in Borderlayout
West   Component in the West in Borderlayout
Center   Component in the Center in Borderlayout
E1
.
En
  Elements to be shown in the dialog.
* = property you have to set; bold = default value

Version:
%I%, %G%
Author:
H.Pfohl

Field Summary
 
Fields inherited from class com.cbse.jeasy.JEObject
DEVELOPPING, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_TIME, INPUT_ERRORS, NO_INPUT_ERROR, RUNNING
 
Constructor Summary
JEPanel(java.lang.String s)
          Reads the properties from a string.
 
Method Summary
 void addElement(java.lang.String el)
           
 void backupEntry()
          Tells all elements to backup their entry
 void clear()
          Clears the components in the component
 void clearElements()
           
 java.awt.Color getBackground()
           
 javax.swing.border.Border getBorder()
          Get the border
 java.lang.String getCatalogName(int column)
          Gets a column's table's catalog name.
 java.lang.String getCenter()
          Gets the Center component when using a BorderLayout
 java.lang.String getColumnClassName(int column)
          JDBC 2.0 Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column.
 int getColumnCount()
          Returns the number of columns in this ResultSet.
 int getColumnDisplaySize(int column)
          Indicates the column's normal max width in chars.
 java.lang.String getColumnLabel(int column)
          Gets the suggested column title for use in printouts and displays.
 java.lang.String getColumnName(int column)
          Gets a column's name.
 int getColumnType(int column)
          Retrieves a column's SQL type.
 java.lang.String getColumnTypeName(int column)
          Retrieves a column's database-specific type name.
 javax.swing.JComponent getComponent()
          Gets the JComponent based on this JEasy Object
 java.lang.String getEast()
          Gets the East component when using a BoprderLayout
 java.lang.String getElementAt(int n)
          Gets the component of element n
 java.util.Vector getElements()
           
 int getElementSize()
          Gets the number of elements
 java.awt.GradientPaint getGradientPaint()
           
 java.awt.LayoutManager getLayout()
           
 java.lang.String getNorth()
          Gets the North component when using a BorderLayout
 javax.swing.JPanel getPanel()
           
 int getPrecision(int column)
          Gets a column's number of decimal digits.
 int getScale(int column)
          Gets a column's number of digits to right of the decimal point.
 java.lang.String getSchemaName(int column)
          Gets a column's table's schema.
 java.lang.String getSouth()
          Gets the South component when using a BorderLayout
 java.lang.String getTabbedPaneText()
           
 java.lang.String getTableName(int column)
          Gets a column's table name.
 java.awt.TexturePaint getTexturePaint()
           
 java.lang.String getWest()
          Gets the West component when using a BorderLayout
 boolean isAutoIncrement(int column)
          Indicates whether the column is automatically numbered, thus read-only.
 boolean isCaseSensitive(int column)
          Indicates whether a column's case matters.
 boolean isCurrency(int column)
          Indicates whether the column is a cash value.
 boolean isDefinitelyWritable(int column)
          Indicates whether a write on the column will definitely succeed.
 int isNullable(int column)
          Indicates the nullability of values in the designated column.
 boolean isReadOnly(int column)
          Indicates whether a column is definitely not writable.
 boolean isSearchable(int column)
          Indicates whether the column can be used in a where clause.
 boolean isSigned(int column)
          Indicates whether values in the column are signed numbers.
 boolean isWritable(int column)
          Indicates whether it is possible for a write on the column to succeed.
 void JEadd(java.awt.Container co)
          Adds the JEObject to the Container
 void JEadd(java.awt.Container co, java.awt.LayoutManager lm)
          Adds the JEObject to the Container and the Containers LayoutManager
 void JEadd(java.lang.String border, java.awt.Container co)
          Adds the JEObject to a Container with a BorderLayout
 void JEaddTab(javax.swing.JTabbedPane co)
           
 void JEaddTab(javax.swing.JTabbedPane co, java.awt.LayoutManager lm)
          Adds the JEObject to a JTabbedPane and its LayoutManager
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void restoreEntry()
          Tells all elements to restore their backuped entry
 void setBackground(java.lang.String jeasyColor)
           
 void setCard(java.lang.String jeobject)
          Shows the JEObject in the CardLayout of the panel
 void setEditable(boolean b)
          Enables or disables all inputfields for editing in the panel
 void setEnabled(boolean b)
          Enables or disables all inputfields in the panel
 boolean setFocus()
          Sets the focus on the first editable component
 void setGradientPaint(java.lang.String jeasyGradientPaint)
           
 void setMarkable(boolean b)
          Enables or disables all inputfields for marking regions for copy
 void start()
          Creates the jfc components using the properties
 boolean wasEntryChanged()
          The components compare the current entry with the data stored by backupEntry()
 
Methods inherited from class com.cbse.jeasy.JEObject
deserializeValue, getApplet, getApplLocale, getId, getJCallBack, getJClass, getLabel, getMode, getName, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getStarted, getTitle, getType, getXMLtag, isEditable, isEnabled, isEnterprise, isProfessional, isStandard, isVisible, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, removeProperties, removeProperty, serializeValue, setApplet, setApplLocale, setEditable, setEnabled, setJCallBack, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEPanel

public JEPanel(java.lang.String s)
Reads the properties from a string.

Parameters:
s - contains properties and values
See Also:
JE#PropertyString
Method Detail

clearElements

public void clearElements()

addElement

public void addElement(java.lang.String el)

getElementSize

public int getElementSize()
Description copied from class: JEObject
Gets the number of elements

Overrides:
getElementSize in class JEObject
Returns:
id of the JEObject or null

getElements

public java.util.Vector getElements()

getPanel

public javax.swing.JPanel getPanel()

getElementAt

public java.lang.String getElementAt(int n)
Description copied from class: JEObject
Gets the component of element n

Overrides:
getElementAt in class JEObject
Returns:
id of the JEObject or null

getNorth

public java.lang.String getNorth()
Description copied from class: JEObject
Gets the North component when using a BorderLayout

Overrides:
getNorth in class JEObject
Returns:
id of the JEObject or null

getSouth

public java.lang.String getSouth()
Description copied from class: JEObject
Gets the South component when using a BorderLayout

Overrides:
getSouth in class JEObject
Returns:
id of the JEObject or null

getEast

public java.lang.String getEast()
Description copied from class: JEObject
Gets the East component when using a BoprderLayout

Overrides:
getEast in class JEObject
Returns:
id of the JEObject or null

getWest

public java.lang.String getWest()
Description copied from class: JEObject
Gets the West component when using a BorderLayout

Overrides:
getWest in class JEObject
Returns:
id of the JEObject or null

getCenter

public java.lang.String getCenter()
Description copied from class: JEObject
Gets the Center component when using a BorderLayout

Overrides:
getCenter in class JEObject
Returns:
id of the JEObject or null

getLayout

public java.awt.LayoutManager getLayout()

getTabbedPaneText

public java.lang.String getTabbedPaneText()

getGradientPaint

public java.awt.GradientPaint getGradientPaint()

setGradientPaint

public void setGradientPaint(java.lang.String jeasyGradientPaint)

getTexturePaint

public java.awt.TexturePaint getTexturePaint()

getBorder

public javax.swing.border.Border getBorder()
Get the border

Returns:
Border

getBackground

public java.awt.Color getBackground()

setBackground

public void setBackground(java.lang.String jeasyColor)

getComponent

public javax.swing.JComponent getComponent()
Gets the JComponent based on this JEasy Object

Overrides:
getComponent in class JEObject
Returns:
JComponent

start

public void start()
Creates the jfc components using the properties

Overrides:
start in class JEObject
See Also:
JE#start

setCard

public void setCard(java.lang.String jeobject)
Shows the JEObject in the CardLayout of the panel


JEadd

public void JEadd(java.awt.Container co,
                  java.awt.LayoutManager lm)
Description copied from class: JEObject
Adds the JEObject to the Container and the Containers LayoutManager

Overrides:
JEadd in class JEObject

JEadd

public void JEadd(java.awt.Container co)
Description copied from class: JEObject
Adds the JEObject to the Container

Overrides:
JEadd in class JEObject

JEadd

public void JEadd(java.lang.String border,
                  java.awt.Container co)
Description copied from class: JEObject
Adds the JEObject to a Container with a BorderLayout

Overrides:
JEadd in class JEObject

JEaddTab

public void JEaddTab(javax.swing.JTabbedPane co)

JEaddTab

public void JEaddTab(javax.swing.JTabbedPane co,
                     java.awt.LayoutManager lm)
Description copied from class: JEObject
Adds the JEObject to a JTabbedPane and its LayoutManager

Overrides:
JEaddTab in class JEObject

setFocus

public boolean setFocus()
Sets the focus on the first editable component

Overrides:
setFocus in class JEObject
Returns:
true if focus was set on the first editable component false else

clear

public void clear()
Clears the components in the component

Overrides:
clear in class JEObject

backupEntry

public void backupEntry()
Tells all elements to backup their entry

Overrides:
backupEntry in class JEObject

restoreEntry

public void restoreEntry()
Tells all elements to restore their backuped entry

Overrides:
restoreEntry in class JEObject

wasEntryChanged

public boolean wasEntryChanged()
The components compare the current entry with the data stored by backupEntry()

Overrides:
wasEntryChanged in class JEObject
Returns:
true data was changed

setEnabled

public void setEnabled(boolean b)
Enables or disables all inputfields in the panel

Overrides:
setEnabled in class JEObject

setEditable

public void setEditable(boolean b)
Enables or disables all inputfields for editing in the panel

Overrides:
setEditable in class JEObject

setMarkable

public void setMarkable(boolean b)
Enables or disables all inputfields for marking regions for copy

Overrides:
setMarkable in class JEObject

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

getColumnCount

public int getColumnCount()
                   throws java.sql.SQLException
Returns the number of columns in this ResultSet.

Returns:
the number of columns
Throws:
java.sql.SQLException - if a database access error occurs

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws java.sql.SQLException
Indicates whether the column is automatically numbered, thus read-only.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws java.sql.SQLException
Indicates whether a column's case matters.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

isSearchable

public boolean isSearchable(int column)
                     throws java.sql.SQLException
Indicates whether the column can be used in a where clause.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

isCurrency

public boolean isCurrency(int column)
                   throws java.sql.SQLException
Indicates whether the column is a cash value.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

isNullable

public int isNullable(int column)
               throws java.sql.SQLException
Indicates the nullability of values in the designated column.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
the nullability status of the given column; one of columnNoNulls, columnNullable or columnNullableUnknown
Throws:
java.sql.SQLException - if a database access error occurs

isSigned

public boolean isSigned(int column)
                 throws java.sql.SQLException
Indicates whether values in the column are signed numbers.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws java.sql.SQLException
Indicates the column's normal max width in chars.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
the normal maximum number of characters allowed as the width of the designated column
Throws:
java.sql.SQLException - if a database access error occurs

getColumnLabel

public java.lang.String getColumnLabel(int column)
                                throws java.sql.SQLException
Gets the suggested column title for use in printouts and displays.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
the suggested column title
Throws:
java.sql.SQLException - if a database access error occurs

getColumnName

public java.lang.String getColumnName(int column)
                               throws java.sql.SQLException
Gets a column's name.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
column name
Throws:
java.sql.SQLException - if a database access error occurs

getSchemaName

public java.lang.String getSchemaName(int column)
                               throws java.sql.SQLException
Gets a column's table's schema.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
schema name or "" if not applicable
Throws:
java.sql.SQLException - if a database access error occurs

getPrecision

public int getPrecision(int column)
                 throws java.sql.SQLException
Gets a column's number of decimal digits.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
precision
Throws:
java.sql.SQLException - if a database access error occurs

getScale

public int getScale(int column)
             throws java.sql.SQLException
Gets a column's number of digits to right of the decimal point.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
scale
Throws:
java.sql.SQLException - if a database access error occurs

getTableName

public java.lang.String getTableName(int column)
                              throws java.sql.SQLException
Gets a column's table name.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
table name or "" if not applicable
Throws:
java.sql.SQLException - if a database access error occurs

getCatalogName

public java.lang.String getCatalogName(int column)
                                throws java.sql.SQLException
Gets a column's table's catalog name.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
column name or "" if not applicable.
Throws:
java.sql.SQLException - if a database access error occurs

getColumnType

public int getColumnType(int column)
                  throws java.sql.SQLException
Retrieves a column's SQL type.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
SQL type from java.sql.Types
Throws:
java.sql.SQLException - if a database access error occurs
See Also:
Types

getColumnTypeName

public java.lang.String getColumnTypeName(int column)
                                   throws java.sql.SQLException
Retrieves a column's database-specific type name.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
type name used by the database. If the column type is a user-defined type, then a fully-qualified type name is returned.
Throws:
java.sql.SQLException - if a database access error occurs

isReadOnly

public boolean isReadOnly(int column)
                   throws java.sql.SQLException
Indicates whether a column is definitely not writable.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

isWritable

public boolean isWritable(int column)
                   throws java.sql.SQLException
Indicates whether it is possible for a write on the column to succeed.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws java.sql.SQLException
Indicates whether a write on the column will definitely succeed.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
true if so
Throws:
java.sql.SQLException - if a database access error occurs

getColumnClassName

public java.lang.String getColumnClassName(int column)
                                    throws java.sql.SQLException
JDBC 2.0

Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column. ResultSet.getObject may return a subclass of the class returned by this method.

Returns:
the fully-qualified name of the class in the Java programming language that would be used by the method ResultSet.getObject to retrieve the value in the specified column. This is the class name used for custom mapping.
Throws:
java.sql.SQLException - if a database access error occurs