public class AwtColorDataIOSwing.ColorChooserPanel extends de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDSwingComponent implements ActionListener
Modifier and Type | Field and Description |
---|---|
private Color |
color
Current color selected.
|
private JPanel |
configPanel
Panel containing configuration buttons.
|
private boolean |
ignoreButtonPress
Flag to ignore presses on either button.
|
private de.unihalle.informatik.Alida.operator.ALDParameterDescriptor |
paramDescr
(Operator) parameter descriptor associated with parameter.
|
private JButton |
resetButton
Button to reset color to
null . |
private JButton |
selectButton
Button to open selection window.
|
Constructor and Description |
---|
ColorChooserPanel(Color initialColor,
de.unihalle.informatik.Alida.operator.ALDParameterDescriptor d)
Default constructor for panel without reset button.
|
ColorChooserPanel(Color initialColor,
de.unihalle.informatik.Alida.operator.ALDParameterDescriptor d,
boolean allowReset)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
addActionListenerToButtons(ActionListener l)
Adds external action listeners to buttons.
|
void |
disableComponent() |
void |
dispose() |
void |
enableComponent() |
Color |
getChosenColor()
Read currently selected color.
|
JPanel |
getJComponent() |
void |
ignoreButtonPress(boolean flag)
Enable/disable buttons.
|
void |
setChosenColor(Color c)
Select given color.
|
private void |
updateButtonColor(Color c)
Update the button icon with the given color.
|
private JPanel configPanel
private JButton selectButton
private JButton resetButton
null
.private Color color
private boolean ignoreButtonPress
private de.unihalle.informatik.Alida.operator.ALDParameterDescriptor paramDescr
public ColorChooserPanel(Color initialColor, de.unihalle.informatik.Alida.operator.ALDParameterDescriptor d)
initialColor
- Initial color to set.d
- Descriptor associated with color parameter.public ColorChooserPanel(Color initialColor, de.unihalle.informatik.Alida.operator.ALDParameterDescriptor d, boolean allowReset)
initialColor
- Initial color to set.d
- Descriptor associated with color parameter.allowReset
- Allow for resetting color by reset button.public JPanel getJComponent()
getJComponent
in class de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDSwingComponent
public void addActionListenerToButtons(ActionListener l)
Attention! Only do this if you know what you are doing. Having multiple action listeners reacting on the same events might cause severe problems.
l
- Action listener to add to the buttons.public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public Color getChosenColor()
public void setChosenColor(Color c)
c
- Color to display as selected.private void updateButtonColor(Color c)
c
- Color to be displayed as button icon.public void disableComponent()
disableComponent
in class de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDSwingComponent
public void enableComponent()
enableComponent
in class de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDSwingComponent
public void dispose()
dispose
in class de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDSwingComponent
public void ignoreButtonPress(boolean flag)
flag
- If true, button presses are ignored.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.