org.zaval.lw
Class LwColorPanel

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.LwPanel
                    |
                    +--org.zaval.lw.LwColorPanel
All Implemented Interfaces:
Drawable, java.util.EventListener, Layoutable, LayoutContainer, LwActionListener, LwComponent, LwContainer, TextListener, Validationable

public class LwColorPanel
extends LwPanel
implements LwActionListener, TextListener

This panel provides ability to cutomize color using different ways :

Register an action listener to be notified whenever a selected color has been changed.


Fields inherited from class org.zaval.lw.LwPanel
children
 
Fields inherited from class org.zaval.lw.LwCanvas
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y
 
Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwColorPanel()
          Constructs a color panel.
LwColorPanel(java.awt.Color c, java.util.Properties p)
          Constructs a color panel with the given selected color and the givent properties to specify a predefined colors set.
LwColorPanel(java.awt.Color c, java.lang.String props)
          Constructs a color panel with the given selected color and the givent properties file to specify a predefined colors set.
 
Method Summary
 void actionPerformed(LwActionEvent e)
          Invoked when an action event occured.
 void addActionListener(LwActionListener l)
          Adds the specified action listener to receive action events from this component.
protected  LwLayout getDefaultLayout()
          Gets the default layout manager that is set with the container during initialization.
 java.awt.Color getSelectedColor()
          Gets a current selected color.
 void removeActionListener(LwActionListener l)
          Removes the specified action listener so it no longer receives action events from this component.
 void setSelectedColor(java.awt.Color c)
          Sets the specified color as the selected color.
 void textInserted(TextEvent e)
          Invoked when a new text has been inserted in the text.
 void textRemoved(TextEvent e)
          Invoked when a part of the text has been removed.
 void textUpdated(TextEvent e)
          Invoked when the text has been updated.
 
Methods inherited from class org.zaval.lw.LwPanel
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, indexOf, insert, insert, invalidate, paintOnTop, recalc, remove, remove, removeAll, setBackground, setLwLayout, setOpaque, toFront, updateCashedPs
 
Methods inherited from class org.zaval.lw.LwCanvas
canHaveFocus, getBackground, getBounds, getHeight, getInsets, getLocation, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isVisible, paint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, viewManChanged, vrp
 
Methods inherited from class org.zaval.util.ValidationObject
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zaval.lw.LwComponent
canHaveFocus, getLwParent, getViewMan, getVisiblePart, setEnabled, setLwParent, setViewMan, setVisible
 
Methods inherited from interface org.zaval.lw.Drawable
getBackground, getOrigin, isEnabled, isOpaque, paint, repaint, repaint, update
 
Methods inherited from interface org.zaval.util.Validationable
isValid, validate
 
Methods inherited from interface org.zaval.lw.Layoutable
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize
 

Constructor Detail

LwColorPanel

public LwColorPanel()
Constructs a color panel. In this case the predefined colors set is loaded by "colors.properties" properties file.

LwColorPanel

public LwColorPanel(java.awt.Color c,
                    java.lang.String props)
Constructs a color panel with the given selected color and the givent properties file to specify a predefined colors set. The properties file will be fetched relatively "org/zaval/lw" package.
Parameters:
c - the given selected color.
props - the given properties file.

LwColorPanel

public LwColorPanel(java.awt.Color c,
                    java.util.Properties p)
Constructs a color panel with the given selected color and the givent properties to specify a predefined colors set.
Parameters:
c - the given selected color.
props - the given properties.
Method Detail

addActionListener

public void addActionListener(LwActionListener l)
Adds the specified action listener to receive action events from this component. The action event is performed whenever a selected has been changed. The action event stores the new color value in the event data field.
Parameters:
l - the specified action listener.

removeActionListener

public void removeActionListener(LwActionListener l)
Removes the specified action listener so it no longer receives action events from this component.
Parameters:
l - the specified action listener.

actionPerformed

public void actionPerformed(LwActionEvent e)
Description copied from interface: LwActionListener
Invoked when an action event occured. The specified action event is passed to the method.
Specified by:
actionPerformed in interface LwActionListener
Following copied from interface: org.zaval.lw.event.LwActionListener
Parameters:
e - the specified action event.

setSelectedColor

public void setSelectedColor(java.awt.Color c)
Sets the specified color as the selected color.
Parameters:
ñ - the specified color to set as selected.

getSelectedColor

public java.awt.Color getSelectedColor()
Gets a current selected color.
Returns:
the current selected color.

textRemoved

public void textRemoved(TextEvent e)
Description copied from interface: TextListener
Invoked when a part of the text has been removed.
Specified by:
textRemoved in interface TextListener
Following copied from interface: org.zaval.data.event.TextListener
Parameters:
e - the text event.

textInserted

public void textInserted(TextEvent e)
Description copied from interface: TextListener
Invoked when a new text has been inserted in the text.
Specified by:
textInserted in interface TextListener
Following copied from interface: org.zaval.data.event.TextListener
Parameters:
e - the text event.

textUpdated

public void textUpdated(TextEvent e)
Description copied from interface: TextListener
Invoked when the text has been updated.
Specified by:
textUpdated in interface TextListener
Following copied from interface: org.zaval.data.event.TextListener
Parameters:
e - the text event.

getDefaultLayout

protected LwLayout getDefaultLayout()
Description copied from class: LwPanel
Gets the default layout manager that is set with the container during initialization. This implementation of the method returns LwRastLayout as the default layout manager, the layout manager is got as a static object by "layout.raster" key.
Overrides:
getDefaultLayout in class LwPanel
Following copied from class: org.zaval.lw.LwPanel
Returns:
a layout manager.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org