Package unifeat.gui.menu
Class DiagramPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
unifeat.gui.menu.DiagramPanel
- All Implemented Interfaces:
ActionListener
,MouseMotionListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
This java class is used to create and show the 2-D diagrams of the input
values
- Author:
- Sina Tabakhi
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
This java class is used to create a data structure for pair(key, val)
in whichkey
andval
are Point data type.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
Modifier and TypeFieldDescriptionprivate ArrayList<DiagramPanel.TupleValues>
private final Color[]
(package private) JFrame
(package private) JMenu
private int
private final int[]
private final double[][]
private int
(package private) JMenuBar
(package private) JMenuItem
(package private) JMenuItem
(package private) JMenuItem
private int
private final String
private final String
private final String
private final String
private final String
private double
private double
(package private) JTextField
private final int
private final int
private final int
private final int
private final int
private final int
private final int
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
The listener method for receiving action events.private void
Finds the maximum value of the input arrayprivate void
Finds the minimum value of the input arrayprivate void
This method sets an action for the mi_close button.private void
This method sets an action for the mi_save button.private void
This method sets an action for the mi_saveAs button.void
The listener method for receiving mouse motion events on a component.void
The listener method for receiving mouse motion events on a component.void
This method is used to show the diagram.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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
f
JFrame f -
fileMenu
JMenu fileMenu -
mi_save
JMenuItem mi_save -
mi_saveAs
JMenuItem mi_saveAs -
mi_close
JMenuItem mi_close -
txt_info
JTextField txt_info -
PATH_PROJECT
-
LIST_ITERATION
private final double[][] LIST_ITERATION -
LIST_CASES
private final int[] LIST_CASES -
axisValues
-
NAME_MAIN_PANEL
-
NAME_DIAGRAM
-
NAME_Y_AXIS
-
NAME_LEGEND_LABEL
-
intervalYDimension
private int intervalYDimension -
maxValue
private int maxValue -
minValue
private int minValue -
tempMaxValue
private double tempMaxValue -
tempMinValue
private double tempMinValue -
X_DIMENSION_START
private final int X_DIMENSION_START- See Also:
-
X_DIMENSION_END
private final int X_DIMENSION_END- See Also:
-
Y_DIMENSION_START
private final int Y_DIMENSION_START- See Also:
-
Y_DIMENSION_END
private final int Y_DIMENSION_END- See Also:
-
WIDTH_LEGEND
private final int WIDTH_LEGEND- See Also:
-
X_D_START_LEGEND
private final int X_D_START_LEGEND- See Also:
-
Y_D_START_LEGEND
private final int Y_D_START_LEGEND- See Also:
-
COLOR_SET
-
-
Constructor Details
-
DiagramPanel
public DiagramPanel(double[][] arrayIteration, int[] arrayCases, String namePanel, String name, String nameY, String nameLegend, String path) Creates new form DiagramPanel. This method is called from within the constructor to initialize the form.- Parameters:
arrayIteration
- the results of all iterationarrayCases
- the all different casesnamePanel
- the name of main panelname
- the name of diagramnameY
- the name of Y-axisnameLegend
- the name of legendpath
- the path of the workspace
-
-
Method Details
-
findMaxValue
private void findMaxValue()Finds the maximum value of the input array -
findMinValue
private void findMinValue()Finds the minimum value of the input array -
paintComponent
This method is used to show the diagram.- Overrides:
paintComponent
in classJComponent
- Parameters:
g
- theGraphics
context in which to paint
-
actionPerformed
The listener method for receiving action events. Invoked when an action occurs.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
e
- an action event
-
mi_saveActionPerformed
This method sets an action for the mi_save button.- Parameters:
e
- an action event
-
mi_saveAsActionPerformed
This method sets an action for the mi_saveAs button.- Parameters:
e
- an action event
-
mi_closeActionPerformed
This method sets an action for the mi_close button.- Parameters:
e
- an action event
-
mouseDragged
The listener method for receiving mouse motion events on a component. Invoked when a mouse button is pressed on a component and then dragged.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Parameters:
e
- an action event
-
mouseMoved
The listener method for receiving mouse motion events on a component. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Parameters:
e
- an action event
-