org.lyra.Interface.Chart
Class DisplayPanel

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 org.lyra.Interface.Chart.DisplayPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class DisplayPanel
extends javax.swing.JFrame

This is an additional tool which allows to view certain pieces of information captured from the Audit table in chart form. Top artists, albums, genres and so forth.

Since:
1.0.5
Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster
See Also:
Serialized Form

Nested Class Summary
private  class DisplayPanel.Interact
          The code separation from the user interface.
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JButton buttonGenerate
           
private  javax.swing.JButton buttonSave
           
private  java.lang.String[] Charts
           
private  javax.swing.JComboBox comboChart
           
private  javax.swing.JComboBox comboNumber
           
private  javax.swing.JComboBox comboPeriod
           
private  javax.swing.JComboBox comboStat
           
private  java.util.Map<java.lang.String,java.lang.String> Global
           
private  javax.swing.JLabel iconResize
           
private  DisplayPanel.Interact Interface
           
private  javax.swing.JLabel labelChart
           
private  javax.swing.JLabel labelNumber
           
private  javax.swing.JLabel labelPeriod
           
private  javax.swing.JLabel labelStat
           
private  java.util.Map<java.lang.String,java.lang.String> Lang
           
private  Ledger Logger
           
private  Comptroller Manager
           
private static int MAX_PERIODS
           
private static int MAX_SELECT
           
private  java.util.Map<java.lang.String,java.lang.String> MCharts
           
private static int MIN_HEIGHT
           
private static int MIN_SELECT
           
private static int MIN_WIDTH
           
private  java.util.Map<java.lang.String,java.lang.String> MPeriods
           
private  java.util.Map<java.lang.String,java.lang.String> MStats
           
private  java.lang.String[] Numbers
           
private  javax.swing.JPanel panelControl
           
private  javax.swing.JPanel panelStatus
           
(package private)  javax.swing.JFrame Parent
           
private  java.lang.String[] Periods
           
private  javax.swing.JScrollPane scrollViewer
           
private static long serialVersionUID
           
private  java.lang.String[] Stats
           
private  javax.swing.JToggleButton toggleGroup
           
private  javax.swing.JToggleButton toggleLegend
           
 
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 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
DisplayPanel(Ledger logger, Comptroller manager, java.util.Map<java.lang.String,java.lang.String> global, java.util.Map<java.lang.String,java.lang.String> lang)
          Primary constructor for the class, which will establish interactive and functional elements.
 
Method Summary
private  javax.swing.JButton getButtonGenerate()
          This method initialises buttonGenerate
private  javax.swing.JButton getButtonSave()
          This method initialises buttonSave
private  javax.swing.JComboBox getComboChart()
          This method initialises comboChart
private  javax.swing.JComboBox getComboNumber()
          This method initialises comboNumber
private  javax.swing.JComboBox getComboPeriod()
          This method initialises comboPeriod
private  javax.swing.JComboBox getComboStat()
          This method initialises comboStat
private  java.lang.String getDefault(java.util.Map<java.lang.String,java.lang.String> source, java.lang.String compare, java.lang.String base)
          This method will recover the default value based on what is stored in the database.
private  javax.swing.JLabel getIconResize()
          This method initialises iconResize.
private  javax.swing.JLabel getLabelChart()
          This method initialises labelChart
private  javax.swing.JLabel getLabelNumber()
          This method initialises labelNumber
private  javax.swing.JLabel getLabelPeriod()
          This method initialises labelPeriod
private  javax.swing.JLabel getLabelStat()
          This method initialises labelStat
private  javax.swing.JPanel getPanelControl()
          This method initialises panelControl
private  javax.swing.JPanel getPanelStatus()
          This method initialises panelWindow.
private  javax.swing.JScrollPane getScrollViewer()
          This method initialises scrollViewer
private  javax.swing.JToggleButton getToggleGroup()
          This method initialises toggleGroup
private  javax.swing.JToggleButton getToggleLegend()
          This method initialises toggleLegend
private  void initFrame()
          This method initialises this frame.
 
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, setVisible, 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 java.awt.MenuContainer
getFont, postEvent
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

panelControl

private javax.swing.JPanel panelControl

labelStat

private javax.swing.JLabel labelStat

comboStat

private javax.swing.JComboBox comboStat

labelChart

private javax.swing.JLabel labelChart

comboChart

private javax.swing.JComboBox comboChart

labelNumber

private javax.swing.JLabel labelNumber

comboNumber

private javax.swing.JComboBox comboNumber

labelPeriod

private javax.swing.JLabel labelPeriod

comboPeriod

private javax.swing.JComboBox comboPeriod

toggleGroup

private javax.swing.JToggleButton toggleGroup

toggleLegend

private javax.swing.JToggleButton toggleLegend

buttonGenerate

private javax.swing.JButton buttonGenerate

buttonSave

private javax.swing.JButton buttonSave

scrollViewer

private javax.swing.JScrollPane scrollViewer

panelStatus

private javax.swing.JPanel panelStatus

iconResize

private javax.swing.JLabel iconResize

Manager

private Comptroller Manager

Logger

private Ledger Logger

Lang

private java.util.Map<java.lang.String,java.lang.String> Lang

Global

private java.util.Map<java.lang.String,java.lang.String> Global

MCharts

private java.util.Map<java.lang.String,java.lang.String> MCharts

MStats

private java.util.Map<java.lang.String,java.lang.String> MStats

MPeriods

private java.util.Map<java.lang.String,java.lang.String> MPeriods

Charts

private java.lang.String[] Charts

Stats

private java.lang.String[] Stats

Periods

private java.lang.String[] Periods

Numbers

private java.lang.String[] Numbers

Interface

private DisplayPanel.Interact Interface

Parent

javax.swing.JFrame Parent

MIN_WIDTH

private static final int MIN_WIDTH
See Also:
Constant Field Values

MIN_HEIGHT

private static final int MIN_HEIGHT
See Also:
Constant Field Values

MIN_SELECT

private static final int MIN_SELECT
See Also:
Constant Field Values

MAX_SELECT

private static final int MAX_SELECT
See Also:
Constant Field Values

MAX_PERIODS

private static final int MAX_PERIODS
See Also:
Constant Field Values
Constructor Detail

DisplayPanel

public DisplayPanel(Ledger logger,
                    Comptroller manager,
                    java.util.Map<java.lang.String,java.lang.String> global,
                    java.util.Map<java.lang.String,java.lang.String> lang)
Primary constructor for the class, which will establish interactive and functional elements.

Parameters:
logger - Ledger instance for logging of actions.
manager - Instance of Database Comptroller.
global - Global settings map.
lang - Language independent component.
Method Detail

initFrame

private void initFrame()
This method initialises this frame. Contains setup necessary to fully establish look and feel for both the Visual Editor and application constructors.


getLabelChart

private javax.swing.JLabel getLabelChart()
This method initialises labelChart

Returns:
javax.swing.JLabel

getLabelStat

private javax.swing.JLabel getLabelStat()
This method initialises labelStat

Returns:
javax.swing.JLabel

getLabelNumber

private javax.swing.JLabel getLabelNumber()
This method initialises labelNumber

Returns:
javax.swing.JLabel

getLabelPeriod

private javax.swing.JLabel getLabelPeriod()
This method initialises labelPeriod

Returns:
javax.swing.JLabel

getComboStat

private javax.swing.JComboBox getComboStat()
This method initialises comboStat

Returns:
javax.swing.JComboBox

getComboPeriod

private javax.swing.JComboBox getComboPeriod()
This method initialises comboPeriod

Returns:
javax.swing.JComboBox

getComboChart

private javax.swing.JComboBox getComboChart()
This method initialises comboChart

Returns:
javax.swing.JComboBox

getPanelControl

private javax.swing.JPanel getPanelControl()
This method initialises panelControl

Returns:
javax.swing.JPanel

getButtonGenerate

private javax.swing.JButton getButtonGenerate()
This method initialises buttonGenerate

Returns:
javax.swing.JButton

getButtonSave

private javax.swing.JButton getButtonSave()
This method initialises buttonSave

Returns:
javax.swing.JButton

getToggleGroup

private javax.swing.JToggleButton getToggleGroup()
This method initialises toggleGroup

Returns:
javax.swing.JToggleButton

getToggleLegend

private javax.swing.JToggleButton getToggleLegend()
This method initialises toggleLegend

Returns:
javax.swing.JToggleButton

getComboNumber

private javax.swing.JComboBox getComboNumber()
This method initialises comboNumber

Returns:
javax.swing.JComboBox

getScrollViewer

private javax.swing.JScrollPane getScrollViewer()
This method initialises scrollViewer

Returns:
javax.swing.JScrollPane

getPanelStatus

private javax.swing.JPanel getPanelStatus()
This method initialises panelWindow. Contains nothing more then the resize element for creating a consistent look and feel.

Returns:
javax.swing.JPanel

getIconResize

private javax.swing.JLabel getIconResize()
This method initialises iconResize.

Returns:
javax.swing.JLabel

getDefault

private java.lang.String getDefault(java.util.Map<java.lang.String,java.lang.String> source,
                                    java.lang.String compare,
                                    java.lang.String base)
This method will recover the default value based on what is stored in the database. There is no direct way to extract the information from the HashMap itself, so this will do it for us.

Parameters:
source - Source map containing value conversion.
compare - String to compare.
base - Default value assigned normally.
Returns:
String containing default value.