uk.ac.starlink.splat.iface
Class SplatSelectedProperties

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by uk.ac.starlink.splat.iface.SplatSelectedProperties
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class SplatSelectedProperties
extends JPanel
implements ActionListener

SplatSelectedProperties defines objects for viewing the image symbolic and full names, data type, and display properties of a list of selected spectra. When more than one spectrum is selected the current properties shown are those of the first, but modifications of any properties are applied to all spectra.

Instances of this class also offer the ability to save the current rendering settings as the defaults. These can be used when opening new spectra and will be restored between sessions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JComboBox alphaValue
           
protected static String[] COMPOSITE_NAMES
          Names for the possible composite values.
protected  JComboBox coordColumn
           
protected  JComboBox dataColumn
           
protected  JComboBox errorColumn
           
protected  JComboBox errorFrequency
           
protected  JCheckBox errors
           
protected  JComboBox errorScale
           
protected  JButton errorsColour
           
protected  uk.ac.starlink.ast.gui.ColourIcon errorsColourIcon
           
protected  JLabel format
           
protected  JLabel fullName
           
protected  GlobalSpecPlotList globalList
          Reference to GlobalSpecPlotList object.
protected  boolean inhibitChanges
          Stop updates of properties from propagating to other listeners and controls.
protected  JButton lineColour
           
protected  uk.ac.starlink.ast.gui.ColourIcon linesColourIcon
           
protected  uk.ac.starlink.ast.gui.AstStyleBox lineStyle
          Various components used in the interface.
protected  PlotStyleBox lineType
           
protected  JComboBox pointSize
           
protected  PointTypeBox pointType
           
protected  JButton resetProp
           
protected  JButton saveProp
           
protected  JTextField shortName
           
protected  JList specList
          The JList containing names of all the available spectra.
protected  JComboBox thickness
           
 
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
SplatSelectedProperties(JList specList)
          Creates an instance.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void applyProperty(int[] indices, int what, Number value)
          Apply a "known" property value to a list of spectra.
 void applyRenderingProps(SpecData spectrum)
          Apply the current default rendering properties to a spectrum.
protected  double getAlpha()
          Get the alpha componsite value.
 int getErrorColour()
          Get the error bar colour.
 int getErrorFrequency()
          Get the frequency used for drawing error bars.
 int getErrorScale()
          Get the number of sigma displayed when drawing a spectrum.
 int getLineColour()
          Get the line colour.
 double getLineStyle()
          Get the line style.
 int getPlotStyle()
          Get the plot style.
 double getPointSize()
          Get the point size.
 int getPointType()
          Get point type.
 int getThickness()
          Get the line thickness.
protected  void initUI()
          Add all the components for display the spectrum properties.
 void resetRenderingProps()
          Reset the current rendering properties to the defaults.
 void restoreRenderingProps()
          Restore the saved rendering properties from backing store, or create some defaults.
 void saveRenderingProps()
          Save the current rendering properties, making them the defaults to be applied to new spectra if required and preserving between sessions.
 void update()
          Update all values to reflect those of the selected spectrum.
protected  void update(ListSelectionEvent e)
          Update the value of all components to reflect the values of the first selected spectrum.
protected  void updateAlpha()
          Change the alpha composite value.
protected  void updateCoordColumn()
          Set the column used for the coordinate values.
protected  void updateDataColumn()
          Set the column used for the data values.
protected  void updateErrorColour()
          Change the error bar colour, allow user to select using JColorChooser dialog.
protected  void updateErrorColumn()
          Set the column used for the data errors.
protected  void updateErrorFrequency()
          Change the frequency used for drawing error bars.
protected  void updateErrors()
          Update whether we're displaying data errorbars or not.
protected  void updateErrorScale()
          Change the number of sigma plotted for the selected spectra.
protected  void updateLineColour()
          Change the line colour, allow user to select using JColorChooser dialog.
protected  void updateLineStyle()
          Change the line style (dashed etc.).
protected  void updatePlotStyle()
          Change the plot style (type of connection, polyline, histogram, point).
protected  void updatePointSize()
          Change the point size of all selected spectra.
protected  void updatePointType()
          Change the point type of all selected spectra.
 void updateShortName()
          Set the short name of the selected spectra.
protected  void updateThickness()
          Change the line thickness of all selected spectra.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
 

Field Detail

globalList

protected GlobalSpecPlotList globalList
Reference to GlobalSpecPlotList object.


specList

protected JList specList
The JList containing names of all the available spectra.


lineStyle

protected uk.ac.starlink.ast.gui.AstStyleBox lineStyle
Various components used in the interface.


errorsColourIcon

protected uk.ac.starlink.ast.gui.ColourIcon errorsColourIcon

linesColourIcon

protected uk.ac.starlink.ast.gui.ColourIcon linesColourIcon

errorsColour

protected JButton errorsColour

lineColour

protected JButton lineColour

saveProp

protected JButton saveProp

resetProp

protected JButton resetProp

errors

protected JCheckBox errors

coordColumn

protected JComboBox coordColumn

dataColumn

protected JComboBox dataColumn

errorColumn

protected JComboBox errorColumn

errorFrequency

protected JComboBox errorFrequency

errorScale

protected JComboBox errorScale

pointSize

protected JComboBox pointSize

thickness

protected JComboBox thickness

format

protected JLabel format

fullName

protected JLabel fullName

shortName

protected JTextField shortName

lineType

protected PlotStyleBox lineType

pointType

protected PointTypeBox pointType

inhibitChanges

protected boolean inhibitChanges
Stop updates of properties from propagating to other listeners and controls.


COMPOSITE_NAMES

protected static final String[] COMPOSITE_NAMES
Names for the possible composite values.


alphaValue

protected JComboBox alphaValue
Constructor Detail

SplatSelectedProperties

public SplatSelectedProperties(JList specList)
Creates an instance. Tracking the current spectrum shown in a JList.

Method Detail

initUI

protected void initUI()
Add all the components for display the spectrum properties.


update

protected void update(ListSelectionEvent e)
Update the value of all components to reflect the values of the first selected spectrum. Version invoked when list is selected.


update

public void update()
Update all values to reflect those of the selected spectrum. Used when external events change spectral properties.


updateShortName

public void updateShortName()
Set the short name of the selected spectra.


updateThickness

protected void updateThickness()
Change the line thickness of all selected spectra.


getThickness

public int getThickness()
Get the line thickness.


updatePointType

protected void updatePointType()
Change the point type of all selected spectra.


getPointType

public int getPointType()
Get point type.


updatePointSize

protected void updatePointSize()
Change the point size of all selected spectra.


getPointSize

public double getPointSize()
Get the point size.


updateLineStyle

protected void updateLineStyle()
Change the line style (dashed etc.).


getLineStyle

public double getLineStyle()
Get the line style.


updatePlotStyle

protected void updatePlotStyle()
Change the plot style (type of connection, polyline, histogram, point).


getPlotStyle

public int getPlotStyle()
Get the plot style.


updateLineColour

protected void updateLineColour()
Change the line colour, allow user to select using JColorChooser dialog.


getLineColour

public int getLineColour()
Get the line colour.


updateErrorColour

protected void updateErrorColour()
Change the error bar colour, allow user to select using JColorChooser dialog.


getErrorColour

public int getErrorColour()
Get the error bar colour.


updateAlpha

protected void updateAlpha()
Change the alpha composite value.


getAlpha

protected double getAlpha()
Get the alpha componsite value.


applyProperty

protected void applyProperty(int[] indices,
                             int what,
                             Number value)
Apply a "known" property value to a list of spectra.


updateErrors

protected void updateErrors()
Update whether we're displaying data errorbars or not.


updateErrorScale

protected void updateErrorScale()
Change the number of sigma plotted for the selected spectra.


getErrorScale

public int getErrorScale()
Get the number of sigma displayed when drawing a spectrum.


updateErrorFrequency

protected void updateErrorFrequency()
Change the frequency used for drawing error bars.


getErrorFrequency

public int getErrorFrequency()
Get the frequency used for drawing error bars.


updateCoordColumn

protected void updateCoordColumn()
Set the column used for the coordinate values.


updateDataColumn

protected void updateDataColumn()
Set the column used for the data values.


updateErrorColumn

protected void updateErrorColumn()
Set the column used for the data errors.


saveRenderingProps

public void saveRenderingProps()
Save the current rendering properties, making them the defaults to be applied to new spectra if required and preserving between sessions.


restoreRenderingProps

public void restoreRenderingProps()
Restore the saved rendering properties from backing store, or create some defaults.


resetRenderingProps

public void resetRenderingProps()
Reset the current rendering properties to the defaults.


applyRenderingProps

public void applyRenderingProps(SpecData spectrum)
Apply the current default rendering properties to a spectrum.


actionPerformed

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


Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.