JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table.beans
Class TablePropertyEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.klg.jclass.table.beans.TablePropertyEditor
All Implemented Interfaces:
Accessible, ActionListener, EventListener, FocusListener, ImageObserver, ItemListener, JCSelectListener, MenuContainer, PropertyEditor, Serializable
Direct Known Subclasses:
CellSizeEditor, DataEditor, FrozenCellLayoutEditor, LabelLayoutEditor, SBLayoutEditor, SpannedCellsEditor, StyleEditor

public abstract class TablePropertyEditor
extends JPanel
implements PropertyEditor, ActionListener, ItemListener, JCSelectListener, FocusListener

This editor provides the framework to edit a selection in a table. Sub-class this class to edit specific property.

See Also:
Serialized Form

Nested Class Summary
protected  class TablePropertyEditor.GroupPanel
           
protected static class TablePropertyEditor.RangeValue
          Class internal to TablePropertyEditor that manages a range: start position and end position.
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected static String ALL
           
protected static String ALL_CELLS
           
protected static String ALLCELLS
           
protected  JButton buttonResetAll
           
protected  JComboBox choiceColumn
           
protected  JComboBox choiceRow
           
protected static com.klg.jclass.table.beans.EnumString[] EnumCells
           
protected static com.klg.jclass.table.beans.EnumString[] EnumRange
           
protected  Object initValue
          Init value of the property to be used to reset initial value.
protected static String LABEL
           
protected static String MAXINT
           
protected  String nl
          New line delimiter for displaying a multi-line string in one line.
protected static String NOVALUE
           
protected static String numberDelimiters
           
protected static String RANGE
           
protected static int SELECT_ALL
          All cells and labels can be selected
protected static int SELECT_CELLS
          Only cells, but not labels can be selected
protected static int SELECT_COLUMNS
          Only columns can be selected
protected static int SELECT_NONE
          No selection is allowed
protected  int selectionPolicy
          Supports selection?
protected static int SHOW_COLUMNS
          No selection is allowed, only columns are shown
protected  PropertyChangeSupport support
           
protected  com.klg.jclass.table.beans.PropertyEditorTable tableView
          Tables shows in the custom editor and it is used as a temporary storage of the values for the actual table.beans.
protected  JTextField textColumn
           
protected  JTextField textHeight
           
protected  JTextField textRow
           
protected  JTextField textWidth
           
protected  boolean updateComponents
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TablePropertyEditor()
          Constructs TablePropertyEditor editor.
TablePropertyEditor(int selectionPolicy)
          Constructs TablePropertyEditor editor.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void afterSelect(com.klg.jclass.table.JCSelectEvent e)
          Invoked whenever a select or deselect is completed.
 void beforeSelect(com.klg.jclass.table.JCSelectEvent e)
          Invoked whenever a select or deselect is initiated.
protected  void enable(JTextField field, boolean enabled, int start, int end)
           
protected  void errorMessageBox(String message)
           
 Frame findParent()
           
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
 Component getCustomEditor()
          Returns the custom editor.
protected static int getFirstCell(int startCell)
           
protected static int getInt(String text)
           
protected static TablePropertyEditor.RangeValue getRangeValue(String value)
           
protected static TablePropertyEditor.RangeValue getRangeValue(String value, String delimiters)
           
protected static int getStart(String s, String range)
           
 com.klg.jclass.table.beans.PropertyEditorTable getTableView()
           
 String[] getTags()
          Returns the tag values for this property.
protected  void init()
          Initializes the layout of the custom editor.
protected  void init(boolean editable)
          Initializes the layout of the custom editor.
protected static void initComboBox(JComboBox cb, com.klg.jclass.table.beans.EnumString[] EnumStrings)
           
 boolean isPaintable()
          Always returns True meaning the paintValue method is honored.
 void itemStateChanged(ItemEvent e)
           
protected  JComponent makeControlPanel()
           
protected abstract  JComponent makePropertyPanel()
           
protected  JComponent makeSelectionPanel()
           
protected  JComponent makeSizeResetPanel()
           
 void paintValue(Graphics gc, Rectangle box)
          Displays selection value as string
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void select(com.klg.jclass.table.JCSelectEvent e)
          Invoked during the selection process.
 void setAsText(String text)
          Sets the property value as text.
protected  boolean setChoice(JComboBox choice, int value)
           
protected static void setSelected(JCheckBox check, boolean selected)
           
protected static void setSelected(JRadioButton button, boolean selected)
           
protected static void setSelectedItem(JComboBox choice, String select)
           
 void setValue(Object value)
          Sets the series value.
 boolean supportsCustomEditor()
          Always returns true since this class is for custom editors.
protected static int toIntValue(com.klg.jclass.table.beans.EnumString[] EnumStrings, String value)
           
protected static String toString(com.klg.jclass.table.beans.EnumString[] EnumStrings, int v)
           
protected abstract  void updatePropertyPanel(com.klg.jclass.table.JCCellRange c)
           
protected  void updateSelection()
           
protected  void updateSelection(int startRow, int startColumn, int endRow, int endColumn)
           
protected  void updateSize()
           
protected  void updateSizePanel()
          Updates the sizes reflected in the size panel of the editor
protected  boolean updateTableSize()
          Updates the size of the table in the series editor
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyEditor
getAsText, getJavaInitializationString, getValue
 

Field Detail

tableView

protected com.klg.jclass.table.beans.PropertyEditorTable tableView
Tables shows in the custom editor and it is used as a temporary storage of the values for the actual table.beans. After user modifies this temporary table, the modified property is copied back to the actual table.


support

protected PropertyChangeSupport support

initValue

protected Object initValue
Init value of the property to be used to reset initial value.


nl

protected String nl
New line delimiter for displaying a multi-line string in one line.


selectionPolicy

protected int selectionPolicy
Supports selection?


SELECT_NONE

protected static final int SELECT_NONE
No selection is allowed

See Also:
Constant Field Values

SELECT_CELLS

protected static final int SELECT_CELLS
Only cells, but not labels can be selected

See Also:
Constant Field Values

SELECT_ALL

protected static final int SELECT_ALL
All cells and labels can be selected

See Also:
Constant Field Values

SELECT_COLUMNS

protected static final int SELECT_COLUMNS
Only columns can be selected

See Also:
Constant Field Values

SHOW_COLUMNS

protected static final int SHOW_COLUMNS
No selection is allowed, only columns are shown

See Also:
Constant Field Values

choiceRow

protected JComboBox choiceRow

choiceColumn

protected JComboBox choiceColumn

textRow

protected JTextField textRow

textColumn

protected JTextField textColumn

textWidth

protected JTextField textWidth

textHeight

protected JTextField textHeight

buttonResetAll

protected JButton buttonResetAll

numberDelimiters

protected static String numberDelimiters

ALLCELLS

protected static final String ALLCELLS
See Also:
Constant Field Values

ALL_CELLS

protected static final String ALL_CELLS
See Also:
Constant Field Values

ALL

protected static final String ALL
See Also:
Constant Field Values

LABEL

protected static final String LABEL
See Also:
Constant Field Values

MAXINT

protected static final String MAXINT
See Also:
Constant Field Values

NOVALUE

protected static final String NOVALUE
See Also:
Constant Field Values

RANGE

protected static final String RANGE
See Also:
Constant Field Values

EnumCells

protected static com.klg.jclass.table.beans.EnumString[] EnumCells

EnumRange

protected static com.klg.jclass.table.beans.EnumString[] EnumRange

updateComponents

protected boolean updateComponents
Constructor Detail

TablePropertyEditor

public TablePropertyEditor()
Constructs TablePropertyEditor editor.


TablePropertyEditor

public TablePropertyEditor(int selectionPolicy)
Constructs TablePropertyEditor editor.

Method Detail

init

protected void init()
Initializes the layout of the custom editor.


init

protected void init(boolean editable)
Initializes the layout of the custom editor.


getTableView

public com.klg.jclass.table.beans.PropertyEditorTable getTableView()

setValue

public void setValue(Object value)
Sets the series value.

Specified by:
setValue in interface PropertyEditor

getCustomEditor

public Component getCustomEditor()
Returns the custom editor.

Specified by:
getCustomEditor in interface PropertyEditor

getTags

public String[] getTags()
Returns the tag values for this property. Tags are supported in this class.

Specified by:
getTags in interface PropertyEditor

isPaintable

public boolean isPaintable()
Always returns True meaning the paintValue method is honored.

Specified by:
isPaintable in interface PropertyEditor

setAsText

public void setAsText(String text)
Sets the property value as text.

Specified by:
setAsText in interface PropertyEditor

supportsCustomEditor

public boolean supportsCustomEditor()
Always returns true since this class is for custom editors.

Specified by:
supportsCustomEditor in interface PropertyEditor

paintValue

public void paintValue(Graphics gc,
                       Rectangle box)
Displays selection value as string

Specified by:
paintValue in interface PropertyEditor

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface PropertyEditor
Overrides:
addPropertyChangeListener in class JComponent

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface PropertyEditor
Overrides:
removePropertyChangeListener in class JComponent

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

focusGained

public void focusGained(FocusEvent e)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent e)
Specified by:
focusLost in interface FocusListener

itemStateChanged

public void itemStateChanged(ItemEvent e)
Specified by:
itemStateChanged in interface ItemListener

beforeSelect

public void beforeSelect(com.klg.jclass.table.JCSelectEvent e)
Invoked whenever a select or deselect is initiated.

Specified by:
beforeSelect in interface JCSelectListener

select

public void select(com.klg.jclass.table.JCSelectEvent e)
Invoked during the selection process.

Specified by:
select in interface JCSelectListener

afterSelect

public void afterSelect(com.klg.jclass.table.JCSelectEvent e)
Invoked whenever a select or deselect is completed.

Specified by:
afterSelect in interface JCSelectListener

toIntValue

protected static int toIntValue(com.klg.jclass.table.beans.EnumString[] EnumStrings,
                                String value)

toString

protected static String toString(com.klg.jclass.table.beans.EnumString[] EnumStrings,
                                 int v)

initComboBox

protected static void initComboBox(JComboBox cb,
                                   com.klg.jclass.table.beans.EnumString[] EnumStrings)

getFirstCell

protected static int getFirstCell(int startCell)

findParent

public Frame findParent()

makePropertyPanel

protected abstract JComponent makePropertyPanel()

updatePropertyPanel

protected abstract void updatePropertyPanel(com.klg.jclass.table.JCCellRange c)

makeSelectionPanel

protected JComponent makeSelectionPanel()

makeSizeResetPanel

protected JComponent makeSizeResetPanel()

makeControlPanel

protected JComponent makeControlPanel()

updateSize

protected void updateSize()

updateSizePanel

protected void updateSizePanel()
Updates the sizes reflected in the size panel of the editor


updateTableSize

protected boolean updateTableSize()
Updates the size of the table in the series editor


errorMessageBox

protected void errorMessageBox(String message)

updateSelection

protected void updateSelection()

updateSelection

protected void updateSelection(int startRow,
                               int startColumn,
                               int endRow,
                               int endColumn)

getInt

protected static int getInt(String text)

enable

protected void enable(JTextField field,
                      boolean enabled,
                      int start,
                      int end)

setChoice

protected boolean setChoice(JComboBox choice,
                            int value)

setSelectedItem

protected static void setSelectedItem(JComboBox choice,
                                      String select)

setSelected

protected static void setSelected(JRadioButton button,
                                  boolean selected)

setSelected

protected static void setSelected(JCheckBox check,
                                  boolean selected)

getStart

protected static int getStart(String s,
                              String range)

getRangeValue

protected static TablePropertyEditor.RangeValue getRangeValue(String value)

getRangeValue

protected static TablePropertyEditor.RangeValue getRangeValue(String value,
                                                              String delimiters)

Copyright © 2004 Quest Software Inc..
All rights reserved.