Package com.ribs.plus

Class RJColorWell

All Implemented Interfaces:
DropTargetListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
RJColorDock

public class RJColorWell extends JPanel implements DropTargetListener
This Swing control class displays a color value and kicks off the ColorPanel when clicked.

Copyright (c) 2004 ReportMill Software, Inc. All Rights Reserved. Contact ReportMill <info@reportmill.com>.

See Also:
  • Constructor Details

    • RJColorWell

      public RJColorWell()
      Creates a new color well for editing a specific color attribute (fill, stroke, text).
  • Method Details

    • getColor

      public Color getColor()
      Returns the color represented by this color well.
    • setColor

      public void setColor(Color aColor)
      Sets the color represented by this color well.
    • isSelected

      public boolean isSelected()
      Returns whether color well is selected.
    • setSelected

      public void setSelected(boolean aValue)
      Sets whether color well is selected.
    • isSelectable

      public boolean isSelectable()
      Returns whether or not the well can be selected.
    • setSelectable

      public void setSelectable(boolean flag)
      Sets whether or not the well can be selected.
    • setEnabled

      public void setEnabled(boolean enableIt)
      This just makes sure that any colorwell that is disabled is also deselected
      Overrides:
      setEnabled in class JComponent
    • resetBorder

      public void resetBorder()
      Set the border given the current selection state.
    • sendAction

      public void sendAction()
      Send action.
    • paintComponent

      public void paintComponent(Graphics g)
      Paints the color well.
      Overrides:
      paintComponent in class JComponent
    • paintSwatch

      public static void paintSwatch(Graphics g, Color c, int x, int y, int w, int h)
      Paints a color swatch in a standard way. Used to paint color wells, drag images, and color docks.
    • getColorTransfer

      public Transferable getColorTransfer()
      Returns a transferable with this well's color.
    • getDragImage

      public Image getDragImage(Dimension d)
      Returns an image with a swatch of this well's color.
    • addActionListener

      public void addActionListener(ActionListener l)
      Adds an action listener to the color well.
    • removeActionListener

      public void removeActionListener(ActionListener l)
      Removes given action listener from the color well.
    • setActionCommand

      public void setActionCommand(String aString)
      Sets the action command.
    • fireActionPerformed

      protected void fireActionPerformed()
      Fires the action command.
    • getColorDataFlavor

      public static DataFlavor getColorDataFlavor()
      Returns a DataFlavor object which represents colors for Drag & Drop.
    • dragEnter

      public void dragEnter(DropTargetDragEvent dtde)
      DropTargetListener method.
      Specified by:
      dragEnter in interface DropTargetListener
    • dragExit

      public void dragExit(DropTargetEvent dte)
      DropTargetListener method.
      Specified by:
      dragExit in interface DropTargetListener
    • dragOver

      public void dragOver(DropTargetDragEvent dtde)
      DropTargetListener method.
      Specified by:
      dragOver in interface DropTargetListener
    • dropActionChanged

      public void dropActionChanged(DropTargetDragEvent dtde)
      DropTargetListener method.
      Specified by:
      dropActionChanged in interface DropTargetListener
    • drop

      public void drop(DropTargetDropEvent dtde)
      DropTargetListener method.
      Specified by:
      drop in interface DropTargetListener
    • dropColor

      public void dropColor(Color aColor, Point aPoint)
      Called when a valid color has been dropped.