jview
Class JExtremaSelect

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by jview.JExitFrame
                          extended by jview.JConfirmExitFrame
                              extended by jview.JBorderFrame
                                  extended by jview.JAnalyserToFit
                                      extended by jview.JExtremaSelect
All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, BorderLabels, DataDisplaying, Displayable, EclecticPropertyListener, BeanSupport, Initializable, LocalizedAware, LocalizedComposed

public class JExtremaSelect
extends JAnalyserToFit

A click selector displays data, normally from an analyser's visualize output, and allows the user to click within the data set to select a local minimum or maximum. Depending on its #KEY_SLIDEMAXIMUM property it either slides up to the maximum or down to the minimum of the displayed data set, starting from the users click point. If a maximum could be found, a property change event is issued.

See Also:
Serialized Form

Nested Class Summary
private  class JExtremaSelect.MouseSlider
          The mouse listener on the power canvas that grabs the position and calculates the period, which is then passed to the expression canvas, that displays the phase plot.
static class JExtremaSelect.Show
          Class to create the frame and display it.
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
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
private  DataCanvasProviding central
          My central display.
private static boolean DEFSEARCHMAXIMUM
          Fourier application have a true here, phase dispersion, false.
private static int DEFSEARCHSMOOTH
          Default we search 10 closest points to min/max.
static String EXTREMASELECT
          The name of the property fired if a data model was changed.
private  PropertyChangeListener handler
          If we have an instance that handles the clicks, vulgo extrmaselect.
static String KEY_DATACANVAS
          The properties of my central canvas.
static String KEY_EXTREMAHANDLE
          The properties of the click handler.
static String KEY_SEARCHMAXIMUM
          If true, we search a maximum, othwerwise a minimum.
static String KEY_SEARCHSMOOTH
          The number of parabolas to fit for maximum estimation.
private  VectorG[] power
          And the visualized data.
 
Fields inherited from class jview.JAnalyserToFit
MODELDATA
 
Fields inherited from class jview.JBorderFrame
DATACLEANSE, KEY_ABOUTURL, KEY_ACTIONCLASS, KEY_AIPLOGO, KEY_BIGGERSTRUT, KEY_DATAANALYSER, KEY_EASTALIGNMENT, KEY_FITTERS, KEY_FITTERTIPS, KEY_HELPSIZE, KEY_LESSERSTRUT, KEY_NOLOGO, KEY_NORTHALIGNMENT, KEY_SOUTHALIGNMENT, KEY_WESTALIGNMENT, MODELFITTER
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface util.BeanSupport
CASTING
 
Fields inherited from interface jview.BorderLabels
KEY_ABOUT, KEY_ABOUTACC, KEY_FILEACCS, KEY_FILEITEMS, KEY_FILEMENU, KEY_FILEMNEMONIC, KEY_HELPMENU, KEY_HELPMNEMONIC, KEY_HELPTITLE, KEY_NOHELP, KEY_NOURLACCESS, KEY_TITLE
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JExtremaSelect(LocalizedSupplying prop)
          Constructs an analyser frame.
 
Method Summary
 boolean displayData(VectorG[] visual)
          We display the data from the analyser.
 Component getRepresentation()
          Returns the representation of the central compoentn, which is my data canvas.
protected  List<Object> getRightItems()
          Returns the list of actions where buttons below the AIP logo should be created.
 void init()
          After super init, we have access to the model fitters.
private  void offerProperties(PropertyChangeListener with)
          We add the provided listener with the properties I provide: MODELFITTER MODELDATA and EXTREMASELECT.
 void setComposedProperties(LocalizedSupplying prop)
          Sets a LocalizedSupplying object as a composite of the canvas.
 
Methods inherited from class jview.JAnalyserToFit
getBottomItems, isInterested, propertyChange
 
Methods inherited from class jview.JBorderFrame
analyserListenTo, createButton, createCheckBox, createDataAnalysers, createFitters, createHelp, createLabel, createLocalizedButton, createLocalizedCheckBox, createLocalizedHelp, createLocalizedLabel, createLocalizedRadioButton, createRadioButton, createStatus, getAboutAction, getActiveFit, getBiggerStrut, getComposedProperties, getDataAnalysers, getFitterButtonGroup, getFitterComboBox, getIcon, getLeftItems, getLesserStrut, getModelFittings, getStatusField, getTopItems, hasFired, printAlignment, setAlignment, setFired
 
Methods inherited from class jview.JConfirmExitFrame
disposeAndExit, disposeImmediately
 
Methods inherited from class jview.JExitFrame
setVisible
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, 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 util.BeanSupport
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

EXTREMASELECT

public static final String EXTREMASELECT
The name of the property fired if a data model was changed.

See Also:
Constant Field Values

KEY_EXTREMAHANDLE

public static final String KEY_EXTREMAHANDLE
The properties of the click handler.

See Also:
Constant Field Values

KEY_DATACANVAS

public static final String KEY_DATACANVAS
The properties of my central canvas.

See Also:
Constant Field Values

KEY_SEARCHMAXIMUM

public static final String KEY_SEARCHMAXIMUM
If true, we search a maximum, othwerwise a minimum.

See Also:
Constant Field Values

KEY_SEARCHSMOOTH

public static final String KEY_SEARCHSMOOTH
The number of parabolas to fit for maximum estimation.

See Also:
Constant Field Values

DEFSEARCHMAXIMUM

private static final boolean DEFSEARCHMAXIMUM
Fourier application have a true here, phase dispersion, false.

See Also:
Constant Field Values

DEFSEARCHSMOOTH

private static final int DEFSEARCHSMOOTH
Default we search 10 closest points to min/max.

See Also:
Constant Field Values

handler

private PropertyChangeListener handler
If we have an instance that handles the clicks, vulgo extrmaselect.


central

private DataCanvasProviding central
My central display.


power

private VectorG[] power
And the visualized data.

Constructor Detail

JExtremaSelect

public JExtremaSelect(LocalizedSupplying prop)
Constructs an analyser frame.

Method Detail

setComposedProperties

public void setComposedProperties(LocalizedSupplying prop)
Sets a LocalizedSupplying object as a composite of the canvas. Defaults the necessary parameter.

Specified by:
setComposedProperties in interface LocalizedAware
Overrides:
setComposedProperties in class JBorderFrame

init

public void init()
After super init, we have access to the model fitters. If the fitters are present, they'll probably listen to ANALYSERINPUT changes. We receive this event, if we are placed within a JVisualizingAnalyser, thus we can forward this to the listeners. This is done in my #propertyChanged method. On the other hand, if the user selects an extremum, there will probably be a listener that wants to act on that. This instance is described with #KEY_EXTREMAHANDLER. This handler is created here. Per definition, it must be a property listener to get the extrema select from the user. If it is also listening to FITTING and/or DATA changes, it is also registered here.

Specified by:
init in interface Initializable
Overrides:
init in class JBorderFrame

offerProperties

private void offerProperties(PropertyChangeListener with)
We add the provided listener with the properties I provide: MODELFITTER MODELDATA and EXTREMASELECT.


getRepresentation

public Component getRepresentation()
Returns the representation of the central compoentn, which is my data canvas.

Specified by:
getRepresentation in interface Displayable
Overrides:
getRepresentation in class JBorderFrame

getRightItems

protected List<Object> getRightItems()
Returns the list of actions where buttons below the AIP logo should be created. Per default we return null, if we have no model fitting instances. Otherwise, the model fitters are packed into a combo box and returned here.

Overrides:
getRightItems in class JBorderFrame

displayData

public boolean displayData(VectorG[] visual)
We display the data from the analyser. This is done in the simple way that the vector array is passed as a list to our data canvas. Additionally, we store the data for the mouse click to retrieve the maximum/minimum later.